Posts

Featured post

filehandler - java open files not cleaned, even when the process is killed -

there java program read files folder, processing , write output files in folder. ran 4 hours , produced few files failed after throwing following error: "too many files" then modified program close (bufferreader , bufferwriter) , started process again. time process failed after starting throwing following error: java.io.filenotfoundexception: <file> (too many open files) then tried running lsof , searched process having no of open files. realized networkmanager. not sure whether should kill process or not. restarted machine. after when ran java program, still got same error. in worst case might possible code still having leaks in terms of not closing everything, still failing after starting process. have feeling lying in system previous run. if start same process in other machine, runs hours before failing. you cannot retain resource between runs of program, if wanted to. leave system without enough resources in theory, though unlikely, restarting

windows - Python - how to run the application and leave until it end? -

how can run application , leave instead of waiting when ended? example : /var/tmp/runme.sh & following code working waits forever when google chrome exit. how can run google chrome let script exit? import subprocess import sys import time line = sys.argv[1] print line def kill_chrome(): subprocess.call(['taskkill', '/im', 'chrome.exe', '/f']) def run_chrome(): subprocess.call(['c:/program files (x86)/google/chrome/application/chrome.exe', '--kiosk']) def run_java(): subprocess.call(['java', '-cp', 'c:/python27/pdfbox-app-2.0.0-rc3.jar;c:/python27/jprint.jar', 'jprint']) try: if line.startswith("myjava:website"): print "google chrome - idle" run_chrome() elif line.startswith("myjava:a4"): print "printing - java" run_java() elif line.startswith("myjava:kill"): print "killer" kill_chrome() except

How to read bytes line by line in Java using NIO or apache commons IO? Whichever is more efficent -

i have bunch of bytes written line line file each line can have varying number of bytes , need read them line line wondering how in efficient way using nio or apache commons io? trying see if there way api can take care of allocation , deallocation of buffers since dont know length of bytes in each line. can read string , .getbytes().length() sounds bit awkward. if file consists of lines, can read millions of lines second bufferedreader.readline(). don't need else. in case nio doesn't support reading lines in way shape or form.

Rails: Pie Charts legend in Chartkicks -

in highcharts show percentage along pie_charts , legend can customized this: legend: {labelformat: '{name} : {y} ({percentage}%)'} but in chartkicks can't find how this? if @ documentation specified on chartkick gem homepage, says: you can pass options directly charting library with: <%= line_chart data, library: {backgroundcolor: "#eee"} %> so in scenario, should try like: <%= pie_chart data, library: {legend: {labelformat: '{name} : {y} ({percentage}%)'}} %>

Spring Cloud Config Server without Spring Boot -

i have looked @ spring-cloud-config client without spring boot , many others , have not found convincing answer. here goes again: question : possible, in spring app, use spring cloud config server/client without automagic configuration of spring boot? using spring boot requirement using these frameworks? if is: is there documentation describes needs done in order enable spring cloud config server/client without spring boot? is there sample project describes needs done in order enable spring cloud config server/client without spring boot?? i'm not aware of documentation or sample project. doing in our projects. you need include configuration server uri property source, assuming using propertysourcesplaceholderconfigurer: <bean class="org.springframework.context.support.propertysourcesplaceholderconfigurer" id="propertyplaceholder"> <property name="locations"> <list> <value>http:/

Jointjs creating link once it is deleted -

i have started working jointjs. have not seen example/tutorial on website mentioning creating of link again once deleted. example on link. http://jointjs.com/demos/org i wonder if possible create link again between 2 members once deleted. i tried code in function function (x, y, rank, background, textcolor) : '.rank': { text: rank, fill: textcolor, 'word-spacing': '-5px', 'letter-spacing': 0, magnet: true, pointerevents:'none' } but not working. i not sure if member type has ports. if yes need add ports recreate links once rendered. if @ source code, links created during render if refresh page or run code again links come back.

php - insert data to mysql using populate dropdown list -

i'm trying insert data database table name dokter , populate dropdown list poliklinik. when i'm trying insert it,the notification keep showing "undifined vaiable : kodep" here form code <select class="form1" name="kodecrot"> <?php $query = mysql_query("select * poliklinik"); if(mysql_num_rows($query) != 0) { while($tampil = mysql_fetch_array($query)){ echo "<option value=".$tampil['namapoli'].">".$tampil['namapoli']."</option>"; } } ?> </select> here process code <?php include'../koneksi.php'; $kodedokter = $_post['kodedokter']; $nmdokter = $_post['nmdokter']; $almdokter = $_post['almdokter']; $telp = $_post['telp']; $kodepoli = $_post['kodecrot']; $kodejadwal = $_post['kodeja