Posts

vert.x - Read large file using vertx -

i new using vertx , using vertx filesystem api read file of large size. vertx.filesystem().readfile("target/classes/readme.txt", result -> { if (result.succeeded()) { system.out.println(result.result()); } else { system.err.println("oh oh ..." + result.cause()); } }); but ram consumed while reading , resource not flushed after use. vertx filesystem api suggest do not use method read large files or risk running out of available ram. is there alternative this? the reason internally .readfile calls files.readallbytes . what should instead create stream out of file, , pass vertx handler: try (inputstream steam = new fileinputstream("target/classes/readme.txt")) { // handling here }

pagination - VueJS: changing number of paginate values? -

my problem is: i'm trying pagination function datatable, works fine when change limit of items in table, total of pages doesn't update. how can proceed? have filter: filters: { paginate: function(list) { this.resultcount = this.movimientos.length; if (this.currentpage >= this.totalpages) { this.currentpage = math.max(0, this.totalpages - 1); } var index = this.currentpage * this.upperlimit; return this.movimientos.slice(index, index + this.upperlimit); } } and here i'm calculating number of pages computed: { totalpages: function() { return math.ceil(this.resultcount / this.itemsperpage); } }, methods: { setpage: function(pagenumber) { this.currentpage = pagenumber; }, <div v-for="pagenumber in totalpages" class="c-paginacao__select"> <a href="#" v-on:click.prevent="setpage(pagenumber)...

android - Analogue of LD_DEBUG for zygote-spawned process -

i'm wondering if android has option user enable ld_debug -style logs zygote-spawned processes. can not start app_process zygote customized environment without being root user. maybe there system property or maybe kind of linker api allow dynamic linker logs debuggable android package may contain native libraries. aiui there isn't way on un-rooted device until o. starting o, can add wrap.sh (debuggable) apk things this. don't think have docs published yet, it's sort of described here: https://github.com/android-ndk/ndk/issues/380#issuecomment-314223774

android - SQLite CursorWindow limit - How to avoid crash -

i have execute query , store result in list, function use follow : list<spoolindb> getspoolinrecords(string label, boolean getlastinserted) { list<spoolindb> spoolinlist = new arraylist<>(); try { if (mdb == null) mdb = mdbhelper.getwritabledatabase(); sqlitequerybuilder qb = new sqlitequerybuilder(); qb.settables(table_spoolin); cursor c = qb.query(mdb, null, " label='" + label + "'", null, null, null, " dateins " + (getlastinserted ? "desc" : "asc")); if (c != null) { c.movetofirst(); if (c.getcount() > 0) { int ndxid = c.getcolumnindex("id"); int ndxserverid = c.getcolumnindex("serverid"); int ndxlabel = c.getcolumnindex("label"); int ndxvalue = c.getcolumnindex("value"); int ndxpriority = c.getco...

javascript - Get Transcrypt to output readable files -

i'm trying translate following test code transcrypt: class a(object): def __init__(self): self.a = 5 the output 2447 line file: $ transcrypt test.py -fb -e 6 $ wc -l __javascript__/test.js 2447 __javascript__/test.js how can transcrypt generate sane output input? thanks file test.js has got whole runtime lib in it. @ module file instead, it's called test.mod.js , has code 1 module. can reduce size further using -xc compiler switch. if e.g. take at: http://www.transcrypt.org/live/turtle_site/turtle_site.html and change program, e.g. change 'red' 'pink' , , press [compile , run] , module file thing that's reloaded. that's why response fast.

amazon web services - AWS Lambda Java how to read properties file -

i try load properties properties class file. expect solution work: how load property file classpath in aws lambda java i have class few static methods , want use config holder. inside there line final inputstream inputstream = config.class.getclass().getresourceasstream("/application-main.properties"); and returns null. downloaded zip package lambda using , file inside in root. not work nevertheless. anyone had similar issue? edit: config file here: project └───src │ └───main │ └───resources │ application-main.properties edit: "temporary" workaround looks that: // load props classpath... try (inputstream = config.class.getresourceasstream(filename)) { props.load(is); } catch (ioexception|nullpointerexception exc) { // ...or filesystem file file = new file(filename); try (inputstream = new fileinputstream(file)) { props.load(is); } catch (ioexception exc2) { thr...

Http get request on kerberos cluster in scala -

i using following code connect livy server running on kerberized cluster using scala. $scala -cp scalaj-http_2.11-2.3.0.jar -djava.security.auth.login.config=jaas.conf scala>import scalaj.http.http scala> system.setproperty("java.security.krb5.conf", "jaas.conf"); res0: string = null scala> http("http://ipaddress:8998/sessions").asstring throws access denied response server. is there way in scala connect kerberized cluster http requests.