Posts

how to see the logs of added module in android project in android studio -

this first time have added module in project. have added android vitamio inside project. things working except play/pause touch listener. code seems written right . have tried putting listener inline no luck. when debug code , execute line line can see code running expected. have put log.d() command inside mediacontroller class track execution none of log command written in class if vitamio module gets printed. wondering if log commands of added modules not printed @ same window main project's log commands do. can 1 please suggest on this. those module logs part of full project. can filter , display specific log if module send it

javascript - Abort XHR on timeout event -

i want abort xhr request on timeout event, it's not working. syntax next: var req = new xmlhttprequest(); req.open('post', url , true); req.timeout = 5000; req.ontimeout = function () { req.abort(); }; so if xhr request not finished in 5 seconds code should abort request. if write req.abort(), xhr request perform.

ios - Difference between instantiateViewControllerWithIdentifier and initWithNibName? -

what difference between instantiateviewcontrollerwithidentifier , initwithnibname , other former storyboard , later not? uistoryboard *signupstory = [uistoryboard storyboardwithname:@"signupstory" bundle:[nsbundle mainbundle]]; signuploginviewcontroller *signupvc = [signupstory instantiateviewcontrollerwithidentifier:@"signupvc"]; and signuploginviewcontroller *signupvc = [[signuploginviewcontroller alloc] initwithnibname:@"signuploginviewcontroller" bundle:[nsbundle mainbundle]]; if you've created ui using storyboards, you'll want call instantiateviewcontrollerwithidentifier . here, identifier not part of view controller used storyboard locate view controller. storyboard handle initialization , call initwithcoder , why need override when creating subclassed view controllers. on other hand, if ui resides in pure .xib file - developers use initwithnibname . does, technically, break encapsulation , there other ways it...

java - Understanding Server-sent Events -

i'm trying update html5 table in real-time data database. here code: html page: <script type="text/javascript"> //check browser support if(typeof(eventsource)!=="undefined") { //create object, passing name , location of server side script var esource = new eventsource("[some address]/api/sse"); //detect message receipt esource.onmessage = function(event) { //write received data page document.getelementbyid("placeholder").innerhtml=table; }; } else { [erro message] } </script> and java restful service: @path("/sse") public class sseresource { @context private uriinfo context; public sseresource() { } @get @produces(ssefeature.server_sent_events) public string getserversentevents() throws exception { someobject o = new someobject(); final string mystring = o.somequery().get...

Android: Retaining data, multiple language support and retaining last applied settings when the app reloads -

i have developed an android app takes text input orientation changes the textview becomes empty. want add multiple language support app through settigs button(settings.xml). is there way fix textview issue , retain last language used in next app launch? e.g. if set french new language settings. next time open app language should french not english(the default language). can me fix this? thank you you need use sharedpreference once setting set 1 language store selected in sharedpreference can use next time. everytime app restarts can check language set. for orientation change issue may use different layout landscape portrait. avoid can use onsaveinstancestate , onrestoreinstancestate

hadoop - Spark: Unknown/unsupported param error when setting conf.yarn.jar -

i have little application runs fine on spark cluster based on yarn when commit spark-submit this: ~/spark-1.4.0-bin-hadoop2.4$ bin/spark-submit --class myclass --master yarn-cluster --queue testing myapp.jar hdfs://nameservice1/user/xxx/readme.md_count however, avoid uploading spark-assembly.jar file each time, set spark.yarn.jar configuration parameter: ~/spark-1.4.0-bin-hadoop2.4$ bin/spark-submit --class myclass --master yarn-cluster --queue testing --conf "spark.yarn.jar=hdfs://nameservice1/user/spark/share/lib/spark-assembly.jar" myapp.jar hdfs://nameservice1/user/xxx/readme.md_count this seems fine @ first: 15/07/08 13:57:17 warn util.nativecodeloader: unable load native-hadoop library platform... using builtin-java classes applicable 15/07/08 13:57:18 info yarn.client: requesting new application cluster 24 nodemanagers 15/07/08 13:57:18 info yarn.client: verifying our application has not requested more maximum memory capability of cluster (8192 mb per co...

c# - Acessing currently opened solution in a vsix project -

i want access path open solution in visual studio vsix project. how can that? this thread tells if solution open or not gives nothing path of opened solution i use this: public string getinitialfolder(dte dte) { if (!dte.solution.isopen) return null; return system.io.path.getdirectoryname(dte.solution.fullname); } but expect error, cannot return path!