Posts

javascript - jQuery UI autocomplete drop down not displaying -

Image
i trying use jquery ui autocomplete feature search spotify's music library. while passes well, , successful response: there no drop down suggestions. instance searching "time" , wanted see: time hans zimmer <--(this searching for) back in time pitbull elevate big time rush etc. here javascript code: <script>$(function() {$( "#spotify_song_search" ).autocomplete({source: function(request, response) { $.get("http://ws.spotify.com/search/1/track.json", { q: request.term },function( data ) { alert(data); response(data);}); },success: function(data) { // pass data response callback alert(data); response(data); }});});</script> i must doing wrong. checked jquery docs here: http://jqueryui.com/demos/autocomplete/ doesn't give explanation why occur. , added alerts see if @ least response, do, returns [object object] . need display search results? error: uncaught...

How to call a self executing function in JavaScript? -

when have code need execute more once wrap in function don't have repeat myself. in addition there's need execute code on page load. right way: function foo() { alert('hello'); } foo(); i rather way: (function foo() { alert('hello'); })(); problem is, execute on page load if try call subsequent times using foo() won't work. i'm guessing scope issue there way self executing functions work upon getting called later? if function doesn't rely on return value, can this... var foo = (function bar() { alert('hello'); return bar; })(); // hello foo(); // hello this uses local reference bar in named function expression return function outer foo variable. or if does, make return value conditional... var foo = (function bar() { alert('hello'); return foo ? "some other value" : bar; })(); // hello alert( foo() ); // hello --- other value or manually assign variable instea...

gwt - In PlayN, how can I build the HTML version of my project from the command line? -

currently i'm building in eclipse using gwt plugin. i'd automate deployment development webserver using script gwt compilation command line. i've followed directions in running via maven section of getting started page : mvn -phtml integration-test but tries build versions, erring out on android build (which i'd prefer skip @ moment) , throws warning stating html profile doesn't exist: [info] ------------------------------------------------------------------------ [info] reactor summary: [info] [info] myplayngame metaproject .......................... success [0.375s] [info] myplayngame core ................................. success [1.638s] [info] myplayngame java ................................. success [0.319s] [info] myplayngame html ................................. success [4.019s] [info] myplayngame android .............................. failure [0.308s] [info] ------------------------------------------------------------------------ [info] build...

javascript - want to append URL as well as want to submit the form with Get request of HTML -

in jsp page have 1 tag .the url of tag setting in java script calls servlet.so parameters passing request. the above wroks fine generates pdf of current form data in url user can see parameters. now problem have added 1 more parameter sending servlet request quite long.so gives error."too long uri request".the data seding javascript variable. i can not change post want data passed in url.and parameter adding(the large one) can hidden variable or so..??? so can suggest should do?? <div class="pdflink"> <a id="pdflinkforgroup" href="" onclick="getpdf('<%=reportid%>','',reporttitle)"> <img src="/images/pdficon.jpg" class="pdflink"></img></a></div> getpdffunction: atag=document.getelementbyid("pdflinkforsingle"); var querystring = "?"+qry+qstring+"&offset=" + offset + "&limit=1000"+"&img...

wpf - Why is animation starting on mouse down? -

i have stackpanel consists of images: <stackpanel height="115" name="stackpanel1" orientation="horizontal" margin="0"> <!-- *******************stackpanel resources****************************--> <stackpanel.resources> <style targettype="{x:type image}"> <style.resources> <storyboard x:key="storyboard1"> <doubleanimationusingkeyframes storyboard.targetproperty="(frameworkelement.width)"> <easingdoublekeyframe keytime="0:0:0.9" value="100"> <easingdoublekeyframe.easingfunction> <backease easingmode="easeout" /> </easingdoublekeyframe.easingfunction> </easingdoublekeyframe> ...

c - Algorithm to find shortest distance from a point in set A to points in set B -

there set n 3d points (x,y,z) , set b m 3d points (x,y,z). each point (xi,yi,zi) in set have find point in set b has minimum distance (xi,yi,zi). my code running out of given time limit. please help. #include<stdio.h> #include<stdlib.h> #include<math.h> long long np[50000][3],qp[50000][3]; int main() { long long n,q,i,j,d,ans,min; scanf("%lld",&n); for(i=0;i<n;i++) scanf("%lld%lld%lld",&np[i][0],&np[i][0],&np[i][2]); scanf("%lld",&q); for(i=0;i<q;i++) scanf("%lld%lld%lld",&qp[i][0],&qp[i][1],&qp[i][2]); for(i=0;i<q;i++) { ans=0; min=((qp[i][0]-np[0][0])*(qp[i][0]-np[0][0]))+((qp[i][1]-np[0][1])*(qp[i][1]-qp[0][1]))+((qp[i][2]-np[0][2])*(qp[i][2]-np[0][2])); for(j=0;j<n;j++) { d=((qp[i][0]-np[j][0])*(qp[i][0]-np[j][0]))+((qp[i][1]-np[j][1])*(qp[i][1]-qp[j][1]))+((qp[i][2]-np[j][2])*(qp[i][2]-np[j][2])); if(d<min) { ans=j...

wsdl - ServiceMix + broadcasting message -

new servicemix, i'm not sure if can need: i've interface defined wsdl i have several endpoints implement interface defined wsdl i've service can send message 1 endpoint. can service mix following: producer sends endpoint in servicemix (with wsdl). servicemix broadcasts different endpoints message. thanks advice , / or pointers! the simplest use camel recipient list . allow have either static or dynamic destinations broadcast. it sounds if application doesn't require termination of soap message (de/serialize payload to/from object) @ servicemix consumer. therefore can kept simple using camel jetty proxy: there further details on link above on how configure static (the example above) , dynamic routing. if application changes , require termination of soap message @ servicemix consumer in future, change out camel jetty consumer endpoint camel cxf endpoint , se...