Posts

osx - shc on Mac showing 'Killed: 9' error -

i'm using shc on mac os, generate stripped binary of bash scripts, distribution. issue is, when execute stripped binary (with .x ext) shows error killed: 9 . even when make , make test (as shown here ), strips dummy match script , generates match.x, when executed, gives same killed: 9 error. any appreciated. got working. had do shc -t -f test.sh i trying without -t

Python XML parsing from website -

i trying parse website. stuck. provide xml below. coming webiste. have 2 questions. best way read xml website, , having trouble digging xml rate need. the figure need base:obs_value 0.12 what have far: from xml.dom import minidom import urllib document = ('http://www.newyorkfed.org/markets/omo/dmm/fftoxml.cfm?type=daily''r') web = urllib.urlopen(document) get_web = web.read() xmldoc = minidom.parsestring(document) ff_dataset = xmldoc.getelementsbytagname('ff:dataset')[0] ff_series = ff_dataset.getelementsbytagname('ff:series')[0] line in ff_series: price = line.getelementsbytagname('base:obs_value')[0].firstchild.data print(price) xml code webiste: -<header> <id>ffd</id> <test>false</test> <name xml:lang="en">federal funds daily averages</name> <prepared>2013-05-08</prepared> <sender id="frbny"> <name xml:lang="en">federa...

mbeans - EJB Lookup inside SAR -

my ear contains ejb file , sar file. cannot lookup on deployed ejb bean inside of mbean contained in sar file. i getting namenotfoundexception. how can lookup in ejb2x home interface inside mbean service (deployed via sar file on ear)???? i have solved issue below: 1) mbean not locate que ejb in jndi tree because not referenced in mbean declaration dependency. so, did this: <mbean code="app.schedulermanager" name="company:service=schedulermanager"> <depends>jboss.j2ee:module=my-ejb-jar.jar,service=ejbmodule</depends> </mbean> 2) declared in meta-inf/jboss.xml of ejb jar dependency can found: <jmx-name>jboss.j2ee:module=my-ejb-jar.jar,service=ejbmodule</jmx-name>

javascript - IE generates spurious mouse click event for absolute-positioned div when dragging child element -

in jsfiddle below, click link 'click show menu' display absolute-positioned div jscrollpane attached. start dragging scrollbar thumb allow mouse wander little right of scrollbar, , release mouse. in ie (versions 8,9,10) click event generated on document, triggers our code hide menu. in other browsers i've tested (firefox, chrome, safari) no such click event generated on document , menu remains displayed (as desired). in our web app, want clicks outside menu (i.e., reach document) hide menu. however, don't want menu hidden side-effect of drag initiated within scrollpane itself. is there simple workaround avoid issue? can jscrollpane updated somehow avoid problem? $(document).ready(function () { $('.scroll-pane').jscrollpane(); $('#menu').click(function () { console.info('menu clicked'); var api = $('.scroll-pane').show().data('jsp'); api.reinitialise(); return false; }); ...

php - MySQL search multiple words in loop -

$keywords=array("test","tset"); $matches = implode(',', $keywords); $sql = "select * `reg` title in '%$matches%' group p_title"; $data = mysql_query($sql); while($info=mysql_fetch_array($data)) { print " {$info['title']}<br /> "; } i want write query $sql = "select * `reg` title in '%test%' group p_title"; $sql = "select * `reg` title in '%tset%' group p_title"; ........ how can search each keyword in 1 query ? "select * reg title in '%test%' or title in '%tset%' group p_title"

Coldfusion FileUpload function from cfc file not working -

i trying upload file using function cfc file. can code work when call <cffile action="upload"> on same page. however, wanted learn how call function in cfc file. believe there problem arguments i'm passing attributes of <cffile> tag, i'm not sure. here html form: <form action="confirm.cfm" method="post" enctype="multipart/form-data"> first name: <input type="text" name="fname" size="25" /> <br /> last name: <input type="text" name="lname" size="30" /> <br /> upload attachment file here: <input type="file" name="fileupload" id="fileupload" size="30" onchange="passfilename()" /> <br /> <input type="hidden" name="filename" id="filename" /> <b...

java - Force an IllegalArgumentException -

one of past exam paper questions requires me modify method in such way illegalargumentexception occurs. the method involves withdrawing money bank account balance here method this. public void withdraw( double ammount ) { this.balance -= ammount; } how can modify method make exception occur? i've never seen exception before. an exception can thrown throw : throw new illegalargumentexception("amount must positive."); you should write rest of method yourself.