Posts

Showing posts from July, 2015

text - Splitting a string in C#, why is this not working? -

i have following string: string mystring = " objective test.\vvision\v* deliver test goals\v** comprehensive\v** control\v* alignment cross-equities strategy\vapproach\v*an acceleration " and trying split on "\v" i tried doesn't seem work: char[] delimiters = new char[] { '\v' }; string[] split = mystring.split(delimiters); (int = 0; < split.length; i++) { } split.length shows 1. suggestions? use this string[] separators = {@"\v"}; string value = @"the objective test.\vvision\v* deliver test goals\v** comprehensive\v** control\v* alignment cross-equities strategy\vapproach\v*an acceleration"; string[] words = value.split(separators, stringsplitoptions.removeemptyentries);

javascript - Download external file in background PHP? -

i have 3 weeks looking this: i have page have download file after verifying data given user. validation , execute external script gives me url. , use url download file i'm gonna execute later. i'd tried download file curl, wget, file_put_content, javascript, ajax , jquery no luck, file 150mb+ created nice progress bar tell user how download going , have method read downloaded size. i fact i'm able download file curl, problem "do_form.php" won't load until file downloaded, want load page first, download file - in background -, can show user progress of download. please tell me possible... thanks!! have @ gearman . maybe gearman background job fits needs. job can run on same machine web server. of course response page has disadvantage contains no success information. need poll information using ajax again. if decide so, should have @ gearmanmanager eases things lot.

arduino - esp8266 blink not building to esp-01 -

i trying esp8266 esp-01, , did asked on arduino ide side, having problems compiling , building blink example board using: ft232rl usb-ttl in 3.3v configuration, 2 1.6v (new) batteries power esp, , conections indicated here (not using led though). when hit (go) compiles, transfers both boards blink synchronously , receive following errors: o sketch usa 219.479 bytes (50%) de espaço de armazenamento para programas. o máximo são 434.160 bytes. variáveis globais usam 31.172 bytes (38%) de memória dinâmica, deixando 50.748 bytes para variáveis locais. o máximo são 81.920 bytes. error: failed reading byte warning: espcomm_send_command: cant receive slip payload data error: failed reading byte warning: espcomm_send_command: cant receive slip payload data error: failed reading byte warning: espcomm_send_command: cant receive slip payload data error: failed reading byte warning: espcomm_send_command: cant receive slip payload data error: failed reading byte warning: espcomm_send_com

python - Java code, issue interpreting this piece of code -

i need translate following piece of code python, cannot understand these libraries / way use it. have 0 background in java. public static double modellikelihood(matrix mat) { double likelihood = 0; (int = 0; < mat.numcols(); ++i) { likelihood += math.exp(mat.getquick(mat.numrows() - 1, i)); } return likelihood; } this part mat.getquick(mat.numrows() - 1, i) dont it, mean don't understand he/she trying there.

php - Set header HTTP code in Flightphp -

im developing api flightphp microframework , can't set http response code routes. can set , works perfectly: header('http/1.0 500 error'); but want use native function http_response_code() php. 1 don't anything. want use because don't have manually type error message. to return http response code using flight, can : flight::route('get /', function(){ flight::json($data, $code = 500); }); where "$data" variable leads array want send in json. if "$code" not set, default returned http response code "200". https://github.com/mikecao/flight/blob/master/flight/engine.php#l470

java - unable to match edittext with image name -

learning android making simple guessing game, have set images in arraylist , applied random operation on it, i'm confused how match edit text value image name can set score. public class mainactivity extends appcompatactivity { private edittext edittext; private button button; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); arraylist<integer> list = new arraylist<integer>(); imageview random_image = (imageview) findviewbyid(r.id.imageview); final int[] images = {r.drawable.kung_fu_panda, r.drawable.mr_nobody, r.drawable.toy_story}; list.add(r.drawable.kung_fu_panda); list.add(r.drawable.mr_nobody); list.add(r.drawable.toy_story); int position = new random().nextint(list.size()); random_image.setimageresource((integer) list.get(position)); list.remove(position);

typechecking - How am I supposed to use the package haskell-type-exts? -

i trying typecheck code snippet provided string. i found package haskell-type-exts ( hackage link ) seems provide need: parsemodule ast gets constructed on typecheckmodule can applied. don't know result. of type tc varenv tc monad. the package provides test case used: ea <- runtc testenv $ typecheckexp e but runtc in hidden module cannot use it. here code have far: import language.haskell.exts.parser (parsemodule, parseresult(..)) import language.haskell.typecheck.typecheck -- import language.haskell.typecheck.monad --hidden module main = let m = "mytest = map (+1) [1..10]" let r = parsemodule m case r of parseok res -> printstuff res _ -> print "wtf" printstuff r = let right tc = return $ typecheckmodule r -- print tc? what missing here? maybe module hidden mistake? i think package not yet ready usage. @ source of language.haskell.typecheck . example typecheck = undefined typecheck

javascript - jQuery shows buttons on last box -

Image
i have issue whenever click edit button goes through each box showing edit state before landing on last input box. console.log in code shows correct box every box clicked the result should every box has own edit function. why code walking? normal state: when edit button clicked: jquery: $(function(){ $.fn.editable.defaults.mode = 'inline'; $.fn.editable.defaults.params = function (params) { params._token = $("#_token").data("token"); return params; }; var dataurl = $('.updatefield').data('url'); var inputname = $('.updatefield').attr("name"); $('.updatefield').editable({ type: 'text', url: dataurl, name: inputname, placement: 'top', title: 'enter public name', toggle:'manual', send:'always', ajaxoptions:{ datatype: 'json' } }); $('.edit').click(function(e){ var

java - Yet another 'cannot find symbol' error when creating a new class object -

in short, i'm trying instantiate within main method in order handle computations. wrote main class in eclipse , able compile , run smoothly. main method: public static void main(string[] args) { ... outsideclass class = new outsideclass(); ... } i ran in eclipse, worked smoothly until got error due to insufficient privileges, led me switch on using cmd.exe administrator. i navigated eclipse folder had classes saved , ran javac x.java each file in folder, 1 one. able javac outsideclass.java without errors, though when came javac main.java , received following error: main.java:36: error: cannot find symbol outsideclass outside = new outsideclass(); ^ symbol: class outsideclass location: class main main.java:36: error: cannot find symbol outsideclass outside = new outsideclass(); ^ symbol: class outsideclass location: class main 2 errors the outside

JavaScript: Stop while loop when an event occurs -

i want while loop stop when "load" event occurs. this executes while loop after event occurs: window.addeventlistener("load", function() { while (...) {...} }); i wish in pure javascript (not using jquery or other library). ("load" event: page loaded; document.readystate == "complete" : page not loaded.) window.addeventlistener("load", function() { while (document.readystate !== "complete") { //do whatever } });

c# - Scaling a sprite in unity -

Image
i trying make sprite same proportion screen sizes. there way can scale sprite width , or height compared rest of screen? have tried multiple ways have looked goes on head. there easy way implement this? or way @ in unity? help. here image further trying accomplish. i want detailed image size of black , green rectangle. help! i figured out, needed convert pixels per world unit so: mathf.abs(camera.main.orthographicsize - (getcomponent<spriterenderer>().sprite.texture.height / getcomponent<spriterenderer>().sprite.pixelsperunit));

Writing to a resource in Java? -

this question has answer here: how can app use files inside jar read , write? 5 answers i trying save data file on computer using class.getresource() method. problem returns url. cannot find way write file using url. here code have far: url = getclass().getresource("save.txt"); urlconnection urlconn = url.openconnection(); outputstream os = urlconn.getoutputstream(); outputstreamwriter isr = new outputstreamwriter(os); buffer = new bufferedwriter(isr); when run java.net.unknownserviceexception: protocol doesn't support output error. not sure do. you can't write resource that. it's meant read only. on other hand, can find out path of resource file. 1 of methods be: finding out path of resource public static file findclassoriginfile( class cls ){ // try find class file. try { final url url = cls.getclassl

Angularjs - How to check undefined from select value -

how check or trap undefined select value select tag. prevent user forget select selection box. have been trying below js still show undefined error in console log , not alert show in browser. code <select ng-model="add.partcode" ng-options="x.part_no x in distictpartcode" ng-change="getlocation()"> <option value="">please select partcode</option> </select> js if(!angular.isundefinedornull($scope.add.partcode.part_no )){ var partcode = $scope.add.partcode.part_no; }else { var alertpopup = $ionicpopup.alert({ title: 'error ...', template: 'please choose part code first.' }); } or if(!$scope.add.partcode.part_no){ var partcode = $scope.add.partcode.part_no; }else { var alertpopup = $ionicpopup.alert({ title: 'error ...', template: 'please choose part code first.' }); } error in console. typeerror: cannot read pro

delay - Can we use two wait statements in a single process in VHDL? -

i have create delay of 20 ms in process waiting in input button. i wrote following code , gives error wait until clk'event , clk='1'; wait 20 ms; or, can use construct like: wait 20 ms until clk'event , clk='1'; any highly appreciated. you can wait event, time, or both (or neither--but unique case). now, i'm not quite sure why first example gives error since valid sequential statement. have not provided complete example nor error code. so, answer here pretty basic. first, wait statement can occur sequential statement, meaning in process (or called process ). so, if trying use concurrently, problem. now, if using process , must in process without sensitivity list. is, following illegal: process(clk) begin wait until clk'event , clk='1'; end process; it must bare process, such as: process begin wait until clk'event , clk='1'; end process; a bit more on first example (properly placed in seq

regex - How to combine XML via node attributes Java -

i have following xml example: <template> <text id="1">you don't qualify because</text> <pertinentdatainputnodenamelistinline id="2">applicableconditions</pertinentdatainputnodenamelistinline> <text id="3">.</text> </template> note: example, there more 3 children nodes of template. way know there sentence combined via id attribute. how can combine (using regex or efficient approach) construct sentence perhaps using it's attributes in following manner: id1+id2+id3+...+idn. output should be: you don't qualify becauseapplicableconditions. notice attribute id every child of template node. or assistance appreciate. edit: removed code because it's distracting actual question. instead of using regex, it's better use stripping tag function. dead simple jsoup . public static string html2text(string html) { return jsoup.parse(html).text(); }

c# - DateTime Oveload -

i trying have output in label example:april 20,2016 4/20/2016:1200:00:am instead i tried modified can't figure error out no overload method takes 1 arguments cause code lbldate.text = rdr.getvalue(4).tostring("mmmm d,yyyy"); this entire code. private void getdata() { sqlconnection con = new sqlconnection("data source = localhost\\sqlexpress;initial catalog = mejonlinemanagementdb00;integrated security=true;"); con.open(); sqlcommand cmd = new sqlcommand(@"select orderprodname,orderprodtype,orderquantity,orderstatus,orderdateordered orders2 ordercustomer='"+dropdownlist1.selecteditem.value.tostring()+"'",con); sqldatareader rdr = cmd.executereader(); if (rdr.hasrows) { while (rdr.read()) { lblprodname.text = rdr.getvalue(0).tostring();

java - How to change port number for tomcat server using maven -

i writing rest service using spring mvc framework , maven. using tomcat server now. pom project <?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>org.springframework</groupid> <artifactid>gs-rest-service</artifactid> <version>0.1.0</version> <parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.2.5.release</version> </parent> <dependencies> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-web</artifactid> &

c++ - how to check socket is not receiving for a time period -

in application 2 different sockets receiving , sending periodic data. need close socket if not receive or send particular time period. since using continuously flowing periodic data, not set number of send , receive. please me find out way socket not receiving or sending time period set read timeout on socket so_rcvtimeo. if expires, recv() return -1 errno == eagain/ewouldblock .

playframework - Play Framework New Project in Intellij -

when create new project in intellij, got these error message in dont know how mitigate. im using intellij idea 15 is there knows error? unknown error! not retrieve latest aspose maven artifacts!

ios - How to parse a NSString -

the string myagent(9953593875).amt:rs.594 , want extract 9953593875 it. here tried: nsrange range = [fedetails rangeofstring:@"."]; nsstring *truncatedfedetails = [fedetails substringwithrange:nsmakerange(0, range.location)]; nslog(@"truncatedstring-->%@",truncatedfedetails); this outputs: truncatedstring-->amzagent(9953593875) or this: nsstring *string = @"myagent(9953593875).amt:rs.594."; nsrange rangeone = [string rangeofstring:@"("]; nsrange rangetwo = [string rangeofstring:@")"]; if (rangeone.location != nsnotfound && rangetwo.location != nsnotfound) { nsstring *truncatedfedetails = [string substringwithrange:nsmakerange(rangeone.location + 1, rangetwo.location - rangeone.location - 1)]; nslog(@"%@",truncatedfedetails); }

wso2esb - How to maintain the session timeout in wso2as 5.0.0 and wso2 Esb 4.5.1 version? -

i using wso2as 5.0.0 application server after few seconds automatically redirect logine page same issues happening wso2 esb 4.5.1 version also.. please suggest me how resolve issue. go repository/conf/tomcat/carbon/web-inf change session-timeout value in web.xml file change session-timeout value want

user interface - Drag and drop files in Matlab GUI -

Image
i trying find way use drag , drop in matlab gui. closest i've found this . however, result this: when file has been dropped, need path of file , call load function. all suggestions appreciated! this submission maarten van der seijs on file exchange seems solve it. it creates callback function can coupled java swing gui components, shown in attached demo. it uses java class, thin wrapper around java.awt.dnd.droptarget : import java.awt.dnd.*; import java.awt.datatransfer.*; import java.util.*; import java.io.file; import java.io.ioexception; public class mldroptarget extends droptarget { /** * modified droptarget used drag & drop in matlab ui control. */ private static final long serialversionuid = 1l; private int droptype; private transferable t; private string[] transferdata; public static final int droperror = 0; public static final int droptexttype = 1; public static final int dropfiletype = 2; @sup

excel - Moving the code one coloumn to the left -

i wrote code , excel template has changed (the first column no longer in need), there way move entry code 1 column left instant of correcting step step? for example(this old code): .range("i1:j1") = array("check", "key") now need change to: .range("h1:i1") = array("check", "key") but it's long code , want know if there's way easier. thanks. i'd suggest using built in search & replace function ( ctrl + f ) . put like .range("i1:j1") into "find what" field and .range("h1:i1") into "replace with" field. if you're lazy hit replace button, can dangerous in possibly changing parts didn't want change. however, using replace button , going through entries can fast in longer code, , way can check each entry if it's correct change it.

c# - Exception HRESULT: 0x800455BC in speech recognition in Windows phone 8 -

i developing new app using speech recognition capability windows phone 8. however, getting following exception: exception hresult: 0x800455bc at system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ system.runtime.compilerservices.taskawaiter`1.getresult() @ excercisemod7voice.mainpage.d__4.movenext() and code i'm trying use: private async void btnspeak_click(object sender, routedeventargs e) { var recognizer = new speechrecognizerui(); recognizer.settings.showconfirmation = true; recognizer.settings.readoutenabled = false; try { var result = await recognizer.recognizewithuiasync(); if (result.resultstatus == speechrecognitionuistatus.succeeded) { messagebox.show(result.recognitionresult.text); } }

How can I force bash to expand a variable to pass it as an argument? -

i found weird behavior don't know how workaround. $ var1=* $ echo $var1 audiobooks downloads desktop (etc.) $ ls $var1 audiobooks: downloads: (etc) all seems ok. @ declaration, variable gets expanded , else works. see this: $ var2=~/rpmbuild/{srpms,rpms/*}/enki-*.rpm $ echo $var2 /home/yajo/rpmbuild/{srpms,rpms/*}/enki-*.rpm $ ls $var2 ls: no se puede acceder /home/yajo/rpmbuild/{srpms,rpms/*}/enki-*.rpm: no existe el fichero o el directorio $ ls /home/yajo/rpmbuild/{srpms,rpms/*}/enki-*.rpm /home/yajo/rpmbuild/rpms/noarch/enki-12.10.3-1.fc18.noarch.rpm /home/yajo/rpmbuild/srpms/enki-12.10.3-1.fc18.src.rpm /home/yajo/rpmbuild/rpms/noarch/enki-12.10.3-1.fc19.noarch.rpm /home/yajo/rpmbuild/srpms/enki-12.10.3-1.fc19.src.rpm this time, @ declaration ~ gets expanded, produces cannot pass argument ls . however, passing same string literally produces expected results. questions are: why expand , not? how mimic behavior of $var1 $var2 ? thanks. extra notes:

php - Laravel 5.2 Auth::check() on exception pages (layouts) -

when abort(404) laravel 5.2 returns error page. when call auth::check() of auth::user() through dump() method return null. but want custom error page current logged-in user on screen (for example in layouts/app.blade.php want in menu: goodmorning username ). i tried enable web middleware on app/exceptions/handler.php didn't work. anny suggestions? you add custom error message : abort(404, 'ow noo, error 404'.auth::user()->id); and in error page: {{ $exception->getmessage() }}

spring - @RabbitListener is not working with queue names pattern -

me using spring boot project need listen few queues @ run time pattern enables in rabbitlister. i have tried @rabbitlistener(queues="queue*") . but throws exception constant should used in queue name. any appreciated . and have query json convertor in spring boot rabbitmq: @bean simplemessagelistenercontainer container(connectionfactory connectionfactory, messagelisteneradapter listeneradapter,queue notificationqueue) { simplemessagelistenercontainer container = new simplemessagelistenercontainer(); container.setconnectionfactory(connectionfactory); container.setqueuenames(notificationqueue.getname()); container.setmessagelistener(listeneradapter); return container; } @bean reciver receiver() { return new reciver (); } @bean messagelisteneradapter listeneradapter(reciver receiver) { return new messagelisteneradapter(receiver,"receivemethod"); } and in recieve

r - Why does RStudio show the manually knitted pdf wrong? -

Image
i'm running latest rstudio (0.97.551) , r (3.0.1) version on mac os x mountain lion 10.8.4. i have following 2 files: test.rnw \documentclass{article} <<set-options, echo=false>>= options(replace.assign=true) opts_chunk$set(external=true, cache=true, echo=false, fig=true) read_chunk('chunks.r') @ \begin{document} \section{graphics} <<chart, fig.height=4>>= @ \end{document} and chunks.r ## @knitr chart library(ggplot2, quietly=true) sys.sleep(3) p <- ggplot(mtcars, aes(wt, mpg)) + geom_point(aes(size = qsec)) + labs(title ="title umlauts ä") p sessioninfo() when knitting document in rstudio fine: now clear cache , knit document manually script running commands: export texinputs=$texinputs:/library/frameworks/r.framework/versions/current/resources/share/texmf/tex/latex/ /usr/bin/rscript -e "library(knitr); knit(\"test.rnw\")" pdflatex ./test.tex everything still fine. but don't cl

Cordova Android Push Notification With Action Button -

i have used push plugin , when sending push action button 1)accept 2)ignore. when notification came , clicked on "accept" button . want parameters "accept" button callback. identify notification's "accept" called. code reference //initialization of push object var push = pushnotification.init({ "android": { "alert": "true", "senderid": config.project_number, "icon": "img/ionic.png", "iconcolor": "blue", "badge": "true" }, "ios": { "alert": "true", "badge": "true", "sound": "true" }, "windows": { } }); //listner getting registration detail of

ios - Saving image from a URL asynchronously -

so have gone through questions on so, , have put them create method accepts 2 paramaters, first url of image download , display in uiimageview , second placeholder image uiimageview . want save image won't downloaded every time. have used sdwebimage download image, had confusion when came saving image in documents directory using sdwebimage, decided not use it. used dispatch_sync(dispatch_get_main_queue() , method looks : - (void)saveimagefromurl:(uiimage*)image:(nsurl*)imageurl { nsstring *url = [imageurl absolutestring]; nsarray *parts = [url componentsseparatedbystring:@"/"]; nsstring *filename = [parts lastobject]; nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; nsstring *fullpath = [documentsdirectory stringbyappendingpathcomponent:[nsstring stringwithformat:@"%@.png", filename]]; bool fileexists = [[nsfilemanager defaultmanager] fileexistsa

Laravel 5.1 eloquent Unsupported operand types -

i trying query result array , show them in select element. when hardcode this, works fine: $categories = ['editorial', 'product test', 'news', 'feature']; $categories = ['select_category']+$categories; return view('admin.articles.create', compact('categories')); but when try categories form db, above mentioned error. $categories = category::all(); $categories = ['select_category']+$categories; return view('admin.articles.create', compact('categories')); category::all(); return collection , not array. you should able around using toarray() e.g. $categories = category::all()->toarray(); hope helps!

How to access data of MySql database from javascript -

i developing web application in use javascript, normal servlet classes , jsp page. want javascript file data of database table. please tell me how can achieve this. below code of jsp page. <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>calendar</title> <link type="text/css" rel="stylesheet" href="css/style.css"> </head> <body> <% //logindetails login = new logindetails(); username = logindetails.username; password = logindetails.password; system.out.println(username+" * "+password); %> <input type="hidden" id="hidden-user" value="<%= username%>"></br> <input type="hidden" id="hidden-pass" value="<%= password%>"></br> <div style= "float:right;"> <div id="calendar-container"> <input type="butto

mysql - Php prepare method where should I use While loop -

i new php prepare method, need use while loop in following code. here query function function query($query, $bindings, $conn) { $stmt = $conn->prepare($query); $stmt-> execute($bindings); $result = $stmt->fetchall(); return $result ? $result : false; } and query $home_team = query('select home_team premier_league match_date >= :current_date , pre_selected = :pre_selected order match_date limit 5', array('current_date' => $current_date, 'pre_selected' =>$pre_selected), $conn); if (empty($home_team)){ echo "no match selected today."; } else { print_r($home_team); } how , use while loop query? you don't need no while here function query($query, $bindings, $conn) { $stmt = $conn->prepare($query); $stmt-> execute($bindings); return $stmt->fetchall(

Spring Framework hosting -

i trying java spring framework own web project. i've asked traditional jsp web hosting firms supports tomcat , said not support spring framework. confused situation. different requirements between jsp , spring framework? thinking both of them runs on jvm such tomcat , not need difference things. spring framework need different jar files, or different software on server? building spring application results in jar embedded webserver (most of times tomcat, can change in pom.xml / build.gradle ). i used host spring applications on vps or amazon ec2 instance. that. can install java on , run jar. no installations of webservers needed.

frontend - Sass compiler Phoenix Framework -

i new front-end phoenix framework , trying implement sass, “priv/static/css/app.css” not compiling using “web/static/css/app.scss”. app.css.map file looks this: {"version":3,"sources":"web/static/css/app.scss","names":[],"mappings":"","file":"priv/static/css/app.css"} and brunch.config file looks this: exports.config = { // see http://brunch.io/#documentation docs. files: { scripts: { jointo: "js/app.js" // use separate vendor.js bundle, specify 2 files path // https://github.com/brunch/brunch/blob/stable/docs/config.md#files // jointo: { // "js/app.js": /^(web\/static\/js)/, // "js/vendor.js": /^(web\/static\/vendor)|(deps)/ // } // // change order of concatenation of files, explicitly mention here // https://github.com/brunch/brunch/tree/master/docs#concatenation // order: { // befo

c# - Win10 BLE desktop application IAsyncOperation as collection -

i working on upgrading desktop app run on windows 10 ble support. modified app target corresponding windows version described in this question (how can reference windows 8 runtime in console) . trying step step in this example (using ble gatt services windows 10) . first of need run ble scan follows: var devices = deviceinformation.findallasync(gattdeviceservice.getdeviceselectorfromuuid(gattserviceuuids.heartrate)); if (devices != null) { foreach (deviceinformation device in devices) { // add device ui here } } but on compilation error related foreach loop, here error: error cs1579 foreach statement cannot operate on variables of type 'windows.foundation.iasyncoperation' because 'windows.foundation.iasyncoperation' not contain public definition 'getenumerator'

digital ocean - Deploy node.js app on digitalocean using Codeship -

i trying use codeship automatically deploy simple helloworld node.js app onto digitalocean droplet. this custom script: rsync -avz -e "ssh" ~/clone/ root@ip_address:/var/destination/ npm install npm start my intention whenever there code changes, codeship copy files destination folder, , perform npm install , npm start restart server automatically. when run custom script, npm start cause codeship custom scripts stuck there, not returning, , no longer report successful deployment. what common practise perform npm install/npm start/node server.js automatically?

asp.net - Simple Membership Tables -

i planning use simple membership project. creating web application using mvc option in visual studio 2013. change webconfig point mssql database. run default application , register user. when check database, tables created follows • aspnetroles • aspnetuserclaims • aspnetuserlogins • aspnetuserroles • aspnetusers however, when refer examples available on net, observe names of simple membership tables follows • webpages_membership • webpages_roles • webpages_usersinroles would appreciate how move forward - missing while creating application tables starting webpages not created or tables starting webpages renamed in latest version , starting aspnet. thanks

Accessing elements on the next page in selenium python -

i trying write program in python3.5 using selenium automate downloading process in zbigz.com using firefox webdriver. code follows: import time selenium import webdriver selenium.common.exceptions import timeoutexception #magnet link purpose of testing mag = "magnet:?xt=urn:btih:86259d1c8d9dfbe15b6290268231e68d414fed23&dn=the.big.bang.theory.s09e21.hdtv.x264-lol%5bettv%5d&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80&tr=udp%3a%2f%2fopen.demonii.com%3a1337&tr=udp%3a%2f%2ftracker.coppersurfer.tk%3a6969&tr=udp%3a%2f%2fexodus.desync.com%3a6969" def startdriver(): #starting firefox driver , waiting 100 seconds driver = webdriver.firefox() driver.implicitly_wait(100) return driver def download(driver, url, mg): #opening firefox @ url = www.zbigz.com driver.get(url) try: #accessing required elements on first page opens entry_box = driver.find_element_by_xpath('.//*[@id=\'text-link-input\']')

osx - can't reach vagrant box over private network -

my vagrant box stop working unknown reason , if reinstall box trough ansible script, don't want reached http://192.168.33.10/ . here vagrant file : vagrant.configure(2) |config| config.vm.box = "centos67vm" config.vm.synced_folder "../../pjt" , "/var/www/pjt", owner: "pjt", group: "pjt", mount_options: ["dmode=777,fmode=777"] config.vm.synced_folder "../../library" , "/var/library" config.vm.network :private_network, ip: "192.168.33.10" config.vm.provision :shell, path: "ansible.sh" config.vm.provider :virtualbox |vb| vb.name = "dev-pjt" end end when ping ip got : ping 192.168.33.10 ping 192.168.33.10 (192.168.33.10): 56 data bytes request timeout icmp_seq 0 request timeout icmp_seq 1 request timeout icmp_seq 2 request timeout icmp_seq 3 request timeout icmp_seq 4 ^c --- 192.168.33.10 ping statistics --- 6 packets transmitted, 0 packets rec

java - Tesseract OCR not working in Web Project -

i'm trying use tesseract ocr in web application. code runs fine when run java application. put same code in web application, doesn't work anymore. if put function in servlet, tomcat doesnt start @ all. if call separate class creating object, on debugging find object not created @ all. have included jars necessary. code in servlet ocrfulltrial ot = new ocrfulltrial(); ot.imgocr(); inside other class public void imgocr(){ file imagefile = new file("d:\\ocrtesting\\0.jpg"); try { itesseract instance = new tesseract(); // system.out.println("1"); } catch (exception e) { system.err.println(e.getmessage()); } just pointers think should check, in case if using tess4j in web based project: 1) put jars in web-inf > lib folder. 2) *.dll files provided along tess4j must in system32 folder (windows). don't know other os. 3) set instance path using instance.setdatapath() method. must point folder containing te

java - Dynamic method invocation trace logging in JVM -

i want analysis large open-sourced java framework. in order so, want log method invocation sequences during execution. output should include multiple entries, each entry contains "method name, call time, exit time". it's hard modify source code of original framework enable tracing task. hope find profiliers or approaches. thanks! i have found useful tool myself @ https://code.google.com/archive/p/javashot/ , although haven't tried out yet. more suggestions still welcome!

javascript - Event listener inside a function -

i have select on page: <select id='cat'> <option value='a'>a</option> <option value='b'>b</option> <option value='all'>all</option> </select> with javascript function handles options have displayed: function funcname(alist) { // populates options select tag $("#cat").on("change", function(){ // computation; }); // uses alist update div data } what i'm trying if selected option all , have display in alist , otherwise based on selected option have display related options. usage of onchange event correct? initially thought of making alist global, after reading on globals in js, got know not practice. thanks in advance! update: alist contains string values. $(function () { $("#ddl").change(function () { var selectedtext = $(this).find("option:selected").text(); v

libGdx unable to find files in android application data directory -

Image
i'm trying access data application's data directory. i'm able load default.fnt file, tells me associated default.png cannot found. how can system recognize file? there i've setup incorrectly? exception 07-07 22:22:52.467: e/androidruntime(10785): fatal exception: glthread 240 07-07 22:22:52.467: e/androidruntime(10785): com.badlogic.gdx.utils.gdxruntimeexception: couldn't load file: /data/data/com.iliadonline.client/files/data/gfx/fonts/default.png 07-07 22:22:52.467: e/androidruntime(10785): @ com.badlogic.gdx.graphics.pixmap.<init>(pixmap.java:140) 07-07 22:22:52.467: e/androidruntime(10785): @ com.badlogic.gdx.graphics.glutils.filetexturedata.prepare(filetexturedata.java:64) 07-07 22:22:52.467: e/androidruntime(10785): @ com.badlogic.gdx.graphics.texture.load(texture.java:175) 07-07 22:22:52.467: e/androidruntime(10785): @ com.badlogic.gdx.graphics.texture.create(texture.java:159) 07-07 22:22:52.467: e/androidruntime(10785): @ com.