Posts

Showing posts from January, 2011

php - Swift Mailer sending only last row of table -

i pulling email addresses database table , iterating through them send email. if comment out line $mailer->send($message); email sent out, last row in table. if leave line in, email sent recipients, sends twice last row in table. doing wrong? <?php // pull data database $query = "select emailaddress, firstname, lastname test_table"; if ($result = mysqli_query($link, $query)) { /* put data array */ while($row = mysqli_fetch_assoc($result)) { $swimmers[] = $row; } /* free result set */ mysqli_free_result($result); } /* close connection */ mysqli_close($link); /* create replacements array */ $replacements = array(); foreach ($swimmers $swimmmer) { $replacements[$swimmer["emailaddress"]] = array ( "{firstname}" => $swimmer["firstname"], "{lastname}" => $swimmer["lastname"],...

UWP Binding to AutoSuggestBox in MVVM -

i invoking querysubmitted command of autosuggestbox control in uwp. command binds icommand in view model. problem requires accept autosuggestboxquerysubmittedeventargs pure ui , it's not acceptable in mvvm. my code looks that: <autosuggestbox name="searchautosuggestbox" placeholdertext="search keywords" queryicon="find" > <interactivity:interaction.behaviors> <core:eventtriggerbehavior eventname="querysubmitted"> <core:invokecommandaction command="{x:bind viewmodel.searchcommand}" /> </core:eventtriggerbehavior> </interactivity:interaction.behaviors> </autosuggestbox> and view model looks that: public delegatecommand<autosuggestboxquerysubmittedeventargs> searchcommand { get; } public mainpageviewmodel() { searchcommand = new delegatecommand<autosuggestboxquerysubmittedeventargs>(...

javascript - Login script using VBS -

i trying write script using vbs having issues getting code work properly. have able run script using google chrome. needing script fill in username , password on website , "log in." have inspected page using developer tools in google chrome , without being specific element id username text box , password text box on page respectively. <input id="user_name_input" type="text" name="username" size="20" value=""> <input id="password_input" type="password" name="password" size="20" value=""> i have been working on while , cannot run without bombing out. have found script online open page correctly can't find me past that. dim iurl dim objshell iurl = "website url" set objshell = createobject("wscript.shell") objshell.run(iurl) i know internet explorer script set id values is ie.document.all.item("user_name_input").v...

ios - AWS Cognito identityId changing for anonymous/guest users -

i happily using cognito sync pre-release app (ios/objective-c), facebook login. however, upon submitting apple app store review, asked remove facebook login. thought straightforward - changed unauth role policies match auth user , bypassed facebook authentication. however, finding identityid changing between sessions. behaving session id. major headache because app uses identityid hash key in dynamodb. so, example, dynamodb search recent activities current user shows current session's history, not history intended. i using sample app's code obtain identityid - seems getting assigned correctly. based on sample's awsidentitymanager.m, following part of appdelegate.m inside didfinishlaunchingwithoptions : awscognitocredentialsprovider *credentialsprovider = [[awscognitocredentialsprovider alloc] initwithregiontype:amazon_cognito_region identitypoolid:amazon_cognito_identit...

Avoid duplicate POSTs with REST -

i have been using post in rest api create objects. every once in while, server create object, client disconnected before receives 201 created response. client sees failed post request, , tries again later, , server happily creates duplicate object... others must have had problem, right? google around, , seems ignore it. i have 2 solutions: a) use put instead, , create (gu)id on client. b) add guid objects created on client, , have server enforce unique -ness. a doesn't match existing frameworks well, , b feels hack. how other people solve this, in real world? edit: with backbone.js, can set guid id when create object on client. when saved, backbone put request. make rest backend handle put non-existing id's, , you're set. i use b -- detection of dups due whatever problem belongs on server side.

ios - How can I access the column of a pointer in another class in Parse using the .whereKey() function? -

i have class called garagesale in parse has pointer column called user . trying access user object's house address column. here trying in code: let radius = pfuser.currentuser()!["radius"] as! double let geopoint = pfuser.currentuser()!["house_address"] as! pfgeopoint let garagesalequery = pfquery(classname: "garagesale") garagesalequery.wherekey("user.house_address", neargeopoint: geopoint, withinmiles: radius) after running code receive error: [error]: dot notation can used on objects (code: 102, version: 1.11.0) is there way access ["user"]["house_address"] column without having call garagesalequery.findobjectsinbackgroundwithblock{()} ? no, can not access information without performing query. info not saved in memory, must retrieve parse database. here do: let garagesalequery = pfquery(classname: "garagesale") garagesale...

mysql - How to make a working SQL query a native query in spring data -

i created sql query: select order_num, stuff2, stuff3 table1 t1 (stuff3 = 'poor') , not exists (select order_num table2 t2 t1.order_num = t2.order_num) the query works correctly , desired result; however, trying use working query in spring data application native query, using @query annotation. @query(value = "select order_num, stuff2, stuff3 table1 t1 (stuff3 = ?0) , not exists (select order_num table2 t2 t1.order_num = t2.order_num)", nativequery = true) list<eorder> findbystuff3(string stuff3); i copied exact same query , placed in repository ( as shown above ) value binding null , no records showing. there step missing make query work spring application? through further research able fix problem having. native query used in repository work, there simple error in code, instead of 0 , replaced 1 , worked great! old version: @query(value = "select order_num, stuff2, stuff3 table1 t1 (stuff3 = ?0) , not exists (select order_num ...

task - VS Code: watch typescript on save file -

in visual studio code, have following code in code in tsconfig.json { "version": "1.6.0", "compileroptions": { "target": "es5", "module": "commonjs", "sourcemap": true, "watch": true, "experimentalasyncfunctions": true, "isolatedmodules": false, "experimentaldecorators": true, "emitdecoratormetadata": true, "declaration": false, "noimplicitany": false, "removecomments": true, "nolib": false, "preserveconstenums": true, "suppressimplicitanyindexerrors": true }, ... } as can see, watch option @ true. well, isn't enough compile .ts file .js atom-typescript does. basically, new compiled .js should in same directory of .ts file when saving .ts. also, i'd avoid...

java - How to custom deserialize from array in Jackson? -

i serialize / deserialize (joda) date array. unfortunately, can't figure out how deserializtion part: import com.fasterxml.jackson.core.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.annotation.jsondeserialize; import com.fasterxml.jackson.databind.annotation.jsonserialize; import org.joda.time.localdate; import org.joda.time.localtime; import java.io.ioexception; public class tryjodatime { public static class localtimeserializer extends jsonserializer<localtime> { @override public void serialize(localtime value, jsongenerator gen, serializerprovider serializers) throws ioexception, jsonprocessingexception { gen.writestartarray(); gen.writenumber(value.gethourofday()); gen.writenumber(value.getminuteofhour()); gen.writenumber(value.getsecondofminute()); gen.writenumber(value.getmillisofsecond()); gen.writeendarray(); } } public static class local...

javascript - Angular Strap tab does not update tab content until browser resize -

i using following code use tabs within modal. <div bs-tabs> <div ng-repeat="tabs in filters" title="{{ tabs.title }}" name="{{ tabs.title }}" bs-pane> <label class="tag-checkboxes col-sm-6" ng-repeat="tag in tabs.filters | orderby: 'name'"> <input type="checkbox" ng-model="tag.checked" ng-change="modifyfilter(tag)"> {{tag.name}} </input> </label> </div> </div> which pulls it's data json source structured this: { "title": "difficulty", "icon": "difficulty-icon", "filters": [{ "name": "easy", "checked": false }] }, { "title": "equipment", "icon": "equipment-icon", "filters": [{ "name": "rope", ...

How are polymorphic fields handled in RethinkDB? -

say have field a values: "some string" 12 ["i'm array"] {"great": "also object"} how work? (if @ all) i.e: in elasticsearch example implicit field mapping created under covers based on first value comes in said field, if explicit mapping doesn't exist. e.g.: if "some string" comes in first value a , a assumed contain strings on. if afterwards can't coerced string persisted, insert fail. since rethinkdb schemaless (no field mappings), same logic apply here? or, alternative, nothing @ assumed on type, , polymorphic values can live happily side side in same field? nothing @ assumed on type, same field can have different type. can live happily side side. when doing query, if needs special decision based on type of field, can use branch , typeof , or pre-processing map . you can try in data exploerer: r.table('user').insert({f: "12"}); r.table('user').insert({f: 12})...

python - Does a side-effect inside a loop affect its generator? -

in python v2.7, have come across for statement on for generator in body of loop item source of for generator side effected: for ssid in (ssid ssid in overlaps if ssid != subseq_id): overlaps = subseq_id_to_overlap_ssids_dict[ssid] my question whether side effect overlaps supposed affect for generator? hope not, if so, mean? if i've processed first matching element , replaced overlaps , for index next location of new value overlaps ? rebinding overlaps inside loop won't have effect on loop (though mutating would). rebinding subseq_iq in side loop affect generator. a for loop evaluates expression iterator once @ beginning of loop: in case expression name overlaps . once has evaluated expression creates iterator iterable , uses iterator work through elements. iterator depends on object returned expression, doesn't depend on name used identify object (if indeed there name). if particular case code equivalent to: for ssid in overlaps: if ssid ...

android - using SQLiteAssetHelper -

mydatabase class import android.content.context; import android.database.cursor; import android.database.sqlite.sqlitedatabase; import android.database.sqlite.sqlitequerybuilder; import com.readystatesoftware.sqliteasset.sqliteassethelper; public class mydatabase extends sqliteassethelper{ private static final string database_name = "databases/mydb.db"; private static final int database_version = 1; public mydatabase(context context) { super(context, database_name, null, database_version); } public cursor getemployees() { sqlitedatabase db = getreadabledatabase(); sqlitequerybuilder qb = new sqlitequerybuilder(); string [] sqlselect = {"_id", "name", "email"}; string sqltables = "contacts"; qb.settables(sqltables); cursor c = qb.query(db, sqlselect, null, null, null, null, null); c.movetofirst(); return c; } ...

c# - How to get media from Twilio incoming MMS that hits Web API -

i have set twilio number post app's api controller. controller hit when send photo message twilio number , response text sent nice. using twilio.mvc , twilio.twiml nuget packages. i'm wondering how can access image photo message in controller. code below, twiliorequest comes in null . null regardless of if send sms or mms twilio number. am using twiliorequest or there other parameter can use information message in controller? messages sending , being responded properly, not know how view , use content/media sent twilio number. // post: api/testresponse public httpresponsemessage post(twiliorequest twiliorequest) { var twilioresponse = new twilioresponse(); twilioresponse.sms("this test response text"); return request.createresponse(httpstatuscode.ok, twilioresponse.element, new xmlmediatypeformatter()); } thank time. please let me know if being unclear or if need additional information me. the mms param...

ios - The background music keep restarting. How to stop it. -

i create sharedinstance of background music , initialize in viewdidload of first view controller. when change screen (via segue) , come first screen, music restart. believe that's happen because viewdidload it's called again, don't want music keep restarting every time comeback screen. how can manage music keep playing without interfering? try starting background music in appdelegate , not having tied particular view controller. although should typically avoid putting code in appdelegate, starting/initializing services start-up task, , makes sense there.

java - When an anonymous class with no references to its enclosing class is returned from an instance method, it has a reference to this. Why? -

when anonymous class no references enclosing class returned instance method, has reference this . why? consider following code: package so; import java.lang.reflect.field; public class soexample { private static object getanonymousclassfromstaticcontext() { return new object() { }; } private object getanonymousclassfrominstancecontext() { return new object() { }; } public static void main(string[] args) throws nosuchfieldexception, securityexception { object anonymousclassfromstaticcontext = getanonymousclassfromstaticcontext(); object anonymousclassfrominstancecontext = new soexample().getanonymousclassfrominstancecontext(); field[] fieldsfromanonymousclassfromstaticcontext = anonymousclassfromstaticcontext.getclass().getdeclaredfields(); field[] fieldsfromanonymousclassfrominstancecontext = anonymousclassfrominstancecontext.getclass().getdeclaredfields(); system.out.println(...

css - Background Color in Yahoo Mail not displayed - shown as white -

in yahoo mail, html of nested table not show selected bg colour, instead seems reset , display white. <table style="display: inline-table;" border="0" cellspacing="0" cellpadding="0" width="369"> <tbody> <tr bgcolor="#203c02"> <td bgcolor="#203c02" style="background-color:#203c02;" height="400"> <p style="font-family: arial; color: #ffffff; font-size: 16px; margin-top: 10px;"><strong>hi $$first_name$$.</strong></p> any ideas?

Java 8 Streams: How to call once the Collection.stream() method and retrieve an array of several aggregate values with different fields -

i'm starting stream api in java 8. here person object use: public class person { private string firstname; private string lastname; private int age; private double height; private double weight; public person(string firstname, string lastname, int age, double height, double weight) { this.firstname = firstname; this.lastname = lastname; this.age = age; this.height = height; this.weight = weight; } public string getfirstname() { return firstname; } public string getlastname() { return lastname; } public int getage() { return age; } public double getheight() { return height; } public double getweight() { return weight; } } here code initializes list of objects person , gets number of objects filtered specific firstname, maximum age , minimum height, weight average, , create array of objects containing these values: list<person> person...

javascript - Webpack css-loader not building -

i having difficulty in getting css loading using css-loader on jsx files. following example from: https://christianalfoni.github.io/react-webpack-cookbook/loading-css.html this jsx import react 'react'; import reactdom 'react-dom'; import styles './styles.css'; class hello extends react.component { render() { return <div>hello world!</div> } } var el = document.getelementbyid('content') var data = json.parse(el.getattribute('data-attr')) reactdom.render(<hello data={data} />, el);` this package.json "devdependencies": { "babel-core": "^6.3.26", "babel-loader": "^6.2.0", "babel-preset-es2015": "^6.3.13", "babel-preset-react": "^6.3.13", "css-loader": "^0.23.1", "exports-loader": "~0.6.2", "expose-loader": ...

scala - Implementing a "live" stream to drive an Akka 2.4 Persistence Query -

i have been investigating experimental akka persistence query module , interested in implementing custom read journal application. documentation describes 2 main flavors of queries, ones return current state of journal (e.g currentpersistenceidsquery ) , ones return subscribe-able stream emit events events committed journal via write side of application (e.g. allpersistenceidsquery ) for contrived application, using postgres , slick 3.1.1 drive guts of these queries. can stream database query results doing like: override def allpersistenceids = { val db = database.forconfig("postgres") val metadata = tablequery[metadata] val query = (m <- metadata) yield m.persistenceid source.frompublisher(db.stream(query.result)) } however, stream signaled complete underlying slick db action completed. doesn't seem fulfill requirement of perpetually open stream capable of emitting new events. my questions are: is there way purely using akka streams dsl? i...

setting up a connection with PyMOL python -

i have created contact map using matplotlib in wxpython, want set 'connection' pymol. want program cm-view when hover on points on contact map, shows 2 contacts on pymol showing line between them. things like, telling pymol select 1 chain. want send data gui pymol make something, hovering on contacts or telling pymol something. if not venkatramanan krishnamani , may want have of code pymol extension cmpymol . hey, extension/plugin visualizing contact map! in plugin, residues not highlighted upon mouse hovering on contact map, rather mouse clicking on contact map. that's close enough want, guess.

Android Scrollview inside a tab not showing all content -

i have 2 tabs , in second tab have content larger viewport, need scrollview. however, can't scrollview show content. cuts view @ last ~10/20dp. here's tabfragment.xml <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <scrollview android:layout_width="match_parent" android:layout_height="wrap_content" android:fillviewport="true"> <relativelayout android:layout_width="match_parent" android:layout_height="wrap_content"> <textview android:id="@+id/textview2" android:l...

python - Try until something works -

is there way following in python? try: thing1() try_this_too: thing2() try_this_too: thing3() except: print "nothing worked :-(" note if thing1() succeeds, don't want else. for thing in (thing1,thing2,thing3): try: thing() break #break out of loop, don't execute else clause except: #bare except bad idea! pass else: print "nothing worked"

javascript - JQUERY slider mad -

the site http://www.quadrifoglio4.it/index.php/quadrifoglio4/gallery.html the slide when slide 12 or 13 pics, not work fine, left value of animate set 0 , position.. code is: ogregallerystart = window.setinterval(function(){ var ogregalleryrailcurrentposition = __jquery__('#ogrerail').position(); __jquery__('.preloadthis').css('display','none'); __jquery__('#ogrerail').animate({ left: eval(ogregalleryrailcurrentposition.left-__jquery__('#ogrerail > .ogredrawer').eq(0).outerwidth(true))+'px' }, 500, function(){ var ogregalleryrailcurrentposition = __jquery__('#ogrerail').position(); if (ogregalleryrailcurrentposition.left <= -eval(__jquery__('#ogrerail').outerwidth(true)-__jquery__('#ogrerail > .ogredrawer').eq(0).outerwidth(true))) { __jquery__(this).css({ ...

vb.net - RDLC reports are not published to after deployed to IIS? -

i have web application written in vb.net. in application have few rdlc reports generated dynamically. works fine during development. reports not working after deployed web application iis. here problems. (1) reports under rdlc folder not deployed, think reason why got error “error occurred during local report processing” question why folder not published, , should set publish folder? (2) if manually copy rdlc reports destination folder, got error “failure: unknown user name or bad password” authentication mode set windows. there else need set in web.config? i using iis 5.1 , web app has been upgraded vs2005 vs2010. your rdlc files marked "embedded resource". right click on rdlc file , change "content" , re-publish. work time.

html - CSS3 Media Queries in web responsive design -

media queries create 2 versions of site? mobile , desktop?! any advice?? usually inline media queries work fine me there variation between site needs compared desktop site, thinking of having 2 totally separate style sheets? use single style sheet following media queries. using single style sheet reduce page loading time. using multiple(more 2 have planned) media queries improve user experience, when multi tasking. (max-width: 640px){your css style} (min-width: 641px) , (max-width: 800px){your css style} (min-width: 801px) , (max-width: 1024px){your css style} (min-width: 1025px){your css style} if not using screen size, make abstract. might need in future.

Flushing successful mock POST request using Jasmine does not execute the AngularJS success function -

this angularjs post.js : angular.module("postpageapp", ["baseapp"]) .controller("mainctrl", ["$http", "$window", "baseservice", function($http, $window, baseservice) { var self = this; self.add = function() { baseservice.add.post(self.post, function() { self.cerrormessages = baseservice.cerrormessages; }); }; }]); this base.js : angular.module("baseapp", []) .config(['$httpprovider', function($httpprovider) { $httpprovider.defaults.xsrfcookiename = 'csrftoken'; $httpprovider.defaults.xsrfheadername = 'x-csrftoken'; }]) .config(['$locationprovider', function($locationprovider){ $locationprovider.html5mode(true); }]) .factory("baseservice", ["$http", "$window", function($http, $window) { var self = this; self.posts...

Replace white background of image with transparent using C++ / OpenCV or Matlab -

using c++ / opencv or matlab i'm trying find method replace white background of image file transparent background , save image further use elsewhere. (the image similar this: http://www.psdgraphics.com/file/monitor-on-white-background.jpg ) i understand task can completed simple image editing software need large batch of images. i've tried methods such make white background transparent png matlab bunch of others no luck. thanks! load image. loading images in opencv convert 4 channel image. opencv: transforming 3 channel image 4 channel determine background adjust alpha channel of pixels accordingly. don't know images like, if there no other white in images, it's simple task. (if pixel white, should transparent.) otherwise, if there other white in images, need contiguous region(s) of white make background. see flood fill algorithm save image (see link 1.)

php - Imagick - no decode delegate for this image format -

i trying convert pngs gif using imagemagick on ubuntu server. used php code generate when ran it, received.. php fatal error: uncaught exception 'imagickexception' message 'no decode delegate image format fatal error: uncaught exception 'imagickexception' message 'no decode delegate image format then used: convert -list configure , on libs, didn't see either gif or png. researched bit more, , found should remove , re-install imagick.. so tried sudo apt-get remove imagemagick , , then.. sudo apt-get install libperl-dev gcc libjpeg-dev libbz2-dev libtiff4-dev libwmf-dev libz-dev libpng12-dev libx11-dev libxt-dev libxext-dev libxml2-dev libfreetype6-dev liblcms1-dev libexif-dev perl libjasper-dev libltdl3-dev graphviz pkg-config after completed installing, used wget http://www.imagemagick.org/download/binaries/imagemagick-x86_64-apple-darwin15.0.0.tar.gz , got latest version. but then, got totally lost. uncompressed using tar -xzf im...

gis - How to find census block groups closest to coordinates? (using python, not ArcGIS) -

i'm decent python new geospatial coding. i have list of coordinates. shapefiles census block groups. i'd know how find census block groups within 1 mile of each coordinate. if small portion of block group within 1 mile, still group show in results. sets of nearby block groups associated coordinates near. please let me know if unclear , try explain more clearly. thanks! p.s. think question getting @ of things i'm struggling ( https://gis.stackexchange.com/questions/11987/polygon-overlay-with-shapely ). implication should use shapely, create buffer each set of coordinates have, , somehow find census areas caught in union.

ember.js - Ember TextField valueBinding with dynamic property -

i'm trying write generic view handles custom fields in app, i'm having hard time getting work. here's scenario - have fielddef object defines custom fields, , valueobject has array, customfields , has values. i'm trying this: {{view ember.textfield valuebinding="valueobject.customfields.[fielddef.name]"}} obviously doesn't work because treats fielddef.name literal. i've tried overriding textfield class, can't seem bind. any suggestions on how accomplish this? thanks, scott ember can't bind array index, you'll have work around it. 1 solution limit one-way binding, textfield updates values hash. if you're planning submit form after user presses button, should trick. define array of field ids in controller , hash values go in. app.applicationcontroller = ember.controller.extend({ fieldids: ['name', 'email', 'whatever'], fieldvalues: {} // {name: 'user', email: 'user@......

javascript - How to remove html code from slider? -

hi markup have image slider. <div role="main"> <div class="slideshow cycle-slideshow home-listings-slider" data-cycle-timeout="10000" data-cycle-auto-height="container" data-cycle-log="false" data-cycle-slides="div.slide" data-cycle-fx="scrollhorz" data-pause-on-hover="true"> <div class="cycle-prev direction"><i class="fa fa-chevron-left"></i></i></div> <div class="cycle-next direction"><i class="fa fa-chevron-right"></i></div> <div id="pager" class="cycle-pager"></div> <?php $images = get_option('homepage_images'); $image_url = get_option('siteurl').'/wp-content/uploads/slideshow/'; foreach($images $image){ ?> <div class="slide"> ...

Identifying related words with the use of Wildcards in c++ -

ok, i've been trying come solution problem. problem is: given list of 3 letter words (size of list irrelevant think), how can identify words in list differ first word in list @ 1 letter. have word pat identify words in list are: pa_ such pay p_t such pot _ot such rot is there way implement wildcards in c++? [this may more complex assignment requires avoids slow string comparisons , regular expressions] given 3-letter word, might consider representing each word 4-byte integer. example, in "pat" letter 'p' 0x70 (ascii), 'a' 0x61 , 't' 0x74 represent "pat" integer 0x706174. likewise 3-letter words in test list. next, combination of tests required 2 of 3 letters match (in same order) is: p?t test 0x70??74 ?at test 0x??6174 pa? test 0x7061?? ps can add stackoverflow 'code sample' button suppose reformat selection code weird in firefox. 1-minute post has taken 20 minutes format! // assume array w...

Javascript If doesn't equal OR doesn't equal -

i'm having issue making work: status_ = 'not contacted' if (!(status_ == "contacted") || (status_ == "not contacted") || (status_ == "not sure")) { console.log('didnt match: '+status_)} else{console.log('matched: '+status_)} it returns - didnt match: not contacted but if change status_ = 'contacted' matched: contacted what doing wrong? the not works first condition, change parentheses if (!(status_ == "contacted" || status_ == "not contacted" || status_ == "not sure")) {...

node.js - Where do the parameters in a javascript callback function come from? -

i understand essence of callback functions in function executed again after being passed parameter function. however, i'm confused variables inside callback function come shown in following node.js example: router.get('/', function(req, res){ res.render('index', {}); }); how variables req , res populated? example explaining how can call res.render(...) without declaring res myself appreciated. they come same place come when normal non callback function invoked, @ invocation time. if have function, function add (a, b) { return + b } you're fine knowing , b come when invoke add, add(1,2) and it's same principle callbacks, don't let brain twisted because it's getting invoked later. at point function pass router.get going invoked, , when does, receive req , res . let's pretend definition router.get looks this router.get = function(endpoint, cb){ //do var request = {} var response = {} cb(request, re...

ios - start something after PFQuery is finished -

is there possibility after query done? have pfquery queries objects, objectids of these objects apendet array. materuserobjects pfuser, matesidsandnames dictionary, rest string `func querynow(){ if mateuserobject.isempty == false{ mateid in mateuserobject{ let date = nsdate() let dateint = date.timeintervalsince1970 let query = pfquery(classname: "calendarevents") query.wherekey("createdby", equalto: mateid) query.wherekey("startdate", lessthan: dateint) query.wherekey("enddate", greaterthan: dateint) query.cachepolicy = .networkonly query.findobjectsinbackgroundwithblock({ (objects:[pfobject]?, error:nserror?) -> void in if error != nil{ print(error) }else{ if objects?.isempty == true{ self.freemateids.append(mateid.objectid!) ...

javascript - Trouble with NVD3 Graph showing x-axis in order of the data in array -

Image
i converting flash graph js nvd3 ( d3 ) based line graph, having difficulty order of x-axis. i x-axis data display ( current month counting 12mths): feb, mar, apr, may, jun, jul, aug, sept, oct, nov, dec, jan but chart library placing jan front , draws line dec on right side jan on left. i have following code: <script> nv.addgraph(function() { var months = ["jan","jan","feb","mar","apr","may","jun","jul","aug","sept","oct","nov","dec"]; var thisyear = [], lastyear = [] thisyear.push( {x: 2, y: 101034} ); thisyear.push( {x: 3, y: 229948} ); thisyear.push( {x: 4, y: 278940} ); thisyear.push( {x: 5, y: 370409} ); thisyear.push( {x: 6, y: 254532} ); thisyear.push( {x: 7, y: 201229} ); thisyear.push( {x: 8, y: 221323} ); thisyear.push( {x: 9, y: 210640} ); thisyear.push( {x: 10, y: 174958} ); th...

javascript - close any open flyout/dropdown when another is opened -

i have these 2 flyout menus toggle in , out , , down respectfully. when out occupy same space overlapping on each other. doesn't bad better if open menu closed when other clicked open. it's possible in future there more 2 menus. need solution when open menu simultaneously closes open menus. suppose need class relates them. i'm unclear on how close other open menus out closing 1 trying open @ moment. hope makes sense. showfoowindow = function() { $('.channels-sessions-tab').click(function(){ var $cspane = $('.current-foo'); var panestate = parseint($cspane.css('left'),10) == 0 ? -$cspane.outerwidth()-11 : 0 $cspane.animate({ left: panestate }, { duration: 700, specialeasing: { width: 'linear', height: 'easeoutbounce' }}); }); }; showbarwindow = function() { $('.channel-session-tab').click(function(){ var $cspane = $('.current-bar'); ...