Posts

automation - Error : cannot find module 'sprint.js' on starting appium server -

installed appium on numerous machines unable start appium server on particular machine, using version 1.4.0. facing following error : starting node server module.js:340 throw err; ^ error: cannot find module 'sprintf-js' @ function.module._resolvefilename (module.js:338:15) @ function.module._load (module.js:280:25) @ module.require (module.js:364:17) @ require (module.js:380:17) @ object. (c:\program files (x86)\appium\node_modules\appium\node_modules\argparse\lib\argument_parser.js:15:15) @ module._compile (module.js:456:26) @ object.module._extensions..js (module.js:474:10) @ module.load (module.js:356:32) @ function.module._load (module.js:312:12) @ module.require (module.js:364:17) node server process ended

java - Repository layer as webservice consumer -

i'm designing application architecutre @ company. backend i'm planing use spring boot. backend has call wbeservices tibco amx , expose them other services (rest maybe) our model. i want use popular layer stack in case: +-------------------+ +-------------------+ +-------------------+ | | | | | | | controller | | service | | repository | | dto model <----> domain model <----> entity | | | | | | soap/rest client | | | | | | | +-------------------+ +-------------------+ +---------+---------+ | | +---------v---------+ | ...

java - JNCryptor not working, Cannot Resolve Symbol AES256JNCryptor -

Image
im using jncryptor library, got error "cannot resolve symbol aes256jncryptor" jncryptor cryptor = new aes256jncryptor(); byte[] plaintext = "hello, world!".getbytes(); string password = "secretsquirrel"; try { byte[] ciphertext = cryptor.encryptdata(plaintext, password.tochararray()); } catch (cryptorexception e) { // went wrong e.printstacktrace(); } my android studio version 2.1.2 can tell me wrong ? thanks

Using canvas and bitmap in Android , how to get this image? -

Image
i new in android. trying draw image(match statistic) , fill image color 10% 100% . tried , image this code public class drawview extends view { paint paint = new paint(); public drawview(context context) { super(context); } @override public void ondraw(canvas canvas) { paint.setcolor(color.black); paint.setstrokewidth(3); canvas.drawrect(30, 30, 100, 100, paint); paint.setstrokewidth(0); paint.setcolor(color.gray); canvas.drawrect(33, 60, 97, 97, paint); paint.setcolor(color.white); canvas.drawrect(33, 33, 97, 60, paint); } any suggestion helpful me. in advance. i prepare 2 images - filled , not filled (only stroke). having that, load them 2 bitmap objects , draw that: float fillprogress = 0.1f; // let's image 10% filled canvas.drawbitmap(onlystroke, 0f, 0f, null); // draw stroke first canvas.save(); canvas.cliprect( 0f, // left getheight() - fillprogress * getheight(),...

apache spark - How to open a file which is stored in HDFS in pySpark using with open -

how open file stored in hdfs - here input file hdfs - if give file bellow , wont able open , show file not found from pyspark import sparkconf,sparkcontext conf = sparkconf () sc = sparkcontext(conf = conf) def getmoviename(): movienames = {} open ("/user/sachinkerala6174/indata/moviestat") f: line in f: fields = line.split("|") mid = fields[0] mname = fields[1] movienames[int(fields[0])] = fields[1] return movienames namedict = sc.broadcast(getmoviename()) my assumption use with open (sc.textfile("/user/sachinkerala6174/indata/moviestat")) f: but didnt work to read textfile rdd: rdd_name = sc.textfile("/user/sachinkerala6174/indata/moviestat") you can use "collect()" in order use in pure python (not recommended - use on small data), or use spark rdd methods in order manipulate using pyspark methods (the recommended way) for more info:...

graph databases - neo4j match nodes and relationships if exists -

i developing small social network applications , have following nodes , relationships in neo4j graph db: user nodes post nodes. post node connected user node posted_by relationship , post node might connected post node sharing relationship in case post shares post. i retrieve posts posted specific user , each post original post in case share (and publisher of original post). i managed required info using optional match new neo4j , not sure if correct way go: match (p:post)-[r: posted_by]-(publisher:user) publisher.userid = {userid} optional match (p:post)-[r2: shared_post]-(sharedpost:post)-[r3: posted_by]-(sharedpostpublisher: user) return p post,publisher, sharedpost, sharedpostpublisher is correct way retrieve info or should use other methods? aside lack of direction on relationships, looks fine. the lack of direction of course less self-explanatory (even if there's implicit direction, user isn't posted_by post ), changes semantics of query: bec...

javascript - Async function inside loop -

i'm newer in javascript , trying execute async function inside loop. can explain why loop continuous executing after printing "all done" here code function asynchfunc(n, loop) { settimeout(loop, n); } function processitems(items, cb) { (function loop (index) { if (index == items.length) return cb(); console.log(items[index]); asynchfunc(items[index], loop); loop(++index); }(0)); } processitems([1000,2000,3000,4000,5000], function(ret){ console.log('all done'); }); there many problems in code: loop call asynchloop wich call loop after n millisecond (with index == undefined). you're test case if index == items.length. when call loop inside settimeout, pass no parameters when settimeout call loop, test case failed every time (so recursivity never ends). if want code works need pass index in asyncfunc function , stop calling loop @ end of loop function, : function asynchfunc(n, loop, index) { sett...