Posts

twitter4j - android twitter retrieveRequestToken 401 on request token -

i trying following sample app twitter oauth. http://www.androidsdkforum.com/android-sdk-development/3-oauth-twitter.html private void askoauth() { try { consumer = new commonshttpoauthconsumer(consumer_key, consumer_secret); provider = new defaultoauthprovider("http://twitter.com/oauth/request_token", "http://twitter.com/oauth/access_token", "http://twitter.com/oauth/authorize"); string authurl = provider.retrieverequesttoken(consumer, callback_url); toast.maketext(this, "please authorize app!", toast.length_long).show(); this.startactivity(new intent(intent.action_view, uri.parse(authurl))); } catch (exception e) { log.e(app, e.getmessage()); toast.maketext(this, e.getmessage(), toast.length_long).show(); } } when run following cod...

Distribute a database made with JavaDB with Java program -

i'm creating program in java in have use lot of tables. made decision create tables in javadb file. however, want distribute filled javadb file jar file distribution, since connecting server not option. in past distribute empty database jar using derby package. any ideas? thank much! i'm not sure understood question possible package read-only database inside jar. derby documentation: accessing databases-in-a-jar in class path once archive containing 1 or more derby databases has been created can placed in class path. allows access database within application without application's knowing path of archive. when jar or zip files part of class path, not have specify jar subsubprotocol connect them. to access database in zip or jar file in class path: set class path include jar or zip file before starting derby: classpath="c:\dbs.jar;%classpath%" connect database within jar or zip file 1 of fol...

language agnostic - Graph Algorithm To Find All Connections Between Two Arbitrary Vertices -

i trying determine best time efficient algorithm accomplish task described below. i have set of records. set of records have connection data indicates how pairs of records set connect 1 another. represents undirected graph, records being vertices , connection data edges. all of records in set have connection information (i.e. no orphan records present; each record in set connects 1 or more other records in set). i want choose 2 records set , able show simple paths between chosen records. "simple paths" mean paths not have repeated records in path (i.e. finite paths only). note: 2 chosen records different (i.e. start , end vertex never same; no cycles). for example: if have following records: a, b, c, d, e , following represents connections: (a,b),(a,c),(b,a),(b,d),(b,e),(b,f),(c,a),(c,e), (c,f),(d,b),(e,c),(e,f),(f,b),(f,c),(f,e) [where (a,b) means record connects record b] if chose b starting record , e ending rec...

compilation - Location of generated class files when used in clojure repl -

when enter (use 'some.namespace) in repl, corresponding clojure file compiled , loaded. compiled class files stored on file system, or reside in memory? repl started command line, no editor/ide involved. when use namespace, no class files generated anywhere know of. time class files generated if explicitly aot compile code, , of time, won't need to. you can learn more compilation here: http://clojure.org/compilation

Algorithm for joining e.g. an array of strings -

i have wondered time, nice, clean solution joining array of strings might like. example: have ["alpha", "beta", "gamma"] , want join strings one, separated commas – "alpha, beta, gamma". now know programming languages offer kind of join method this. wonder how these might implemented. when took introductory courses, tried go alone, never found satisfactory algorithm. seemed rather messy, problem being can not loop through array, concatenating strings, add 1 many commas (either before or after last string). don’t want check conditions in loop. don’t want add first or last string before/after loop (i guess maybe best way?). can show me elegant solution? or tell me why there can’t more elegant? the elegant solution found problems (in pseudocode) separator = "" foreach(item in stringcollection) { concatenatedstring += separator + item separator = "," } you run loop , after second time around separator ...

How do I configure Firebug to use Eclipse/Netbeans as editor -

i want use real ide editing javascript files in combination firebug. in 'add editor' dialog firebug i'm allowed specify executable , arguments. question how open file in eclipse/netbeans command line. extra points allowing me choose between opening new eclipse/netbeans instance , reusing running one. not exact answer i'm afraid, information might help. eclipse - running eclipse fireclipse: debug ff straight eclipse

javascript - variable declaration causing page not to load? -

i've got following variable declaration.. var html = "<b>" + name + "</b> <br/>" + message + ' <div align="left"> ' + '<a href="path/to/php? id='+name'&message='+message+'&id='+id+'&lat='+lat+'&lng='+lng+'&type='+type+'" target="_blank">click me!</a>' + ' </div> <form name="myform" action="delete.php" method="post"> <div align="right"> ' + '<br/> <input type="radio" name="id" value= '+id+' > delete entry<br/> <input type="submit" /> </div> </form>'; inside function function createmarker(point, name, message, type, file, id, lat, lng) i can't seem spot why variable declaration appears crashing page. have idea what's wrong declaration? than...