Posts

javascript - Using KineticJS to remove drawn objects -

hopefully simple question here: say i've used kineticjs draw line follows: var redline = new kinetic.line({ points: [73, 70, 340, 23, 450, 60, 500, 20], stroke: "red", strokewidth: 15, linecap: "round", linejoin: "round" }); and it's been added layer has been added stage. but need remove line if never there react user event. how go doing this? let's have layer below: var layer = new kinetic.layer(....); to remove redline layer write: layer.remove(redline);

java - JpcapWriter causes app to crash -

i working on relatively simple packet capture application, , using jpcap library. has been working until added in save feature program. my write function public void write() { try { writer = jpcapwriter.opendumpfile(captor, filename); } catch (ioexception e) {e.printstacktrace();} (packet packet : this.packets) { writer.writepacket(packet); } writer.close(); } it correctly gets captor , filepath, loops through packets successfully, when tries write @ end of code block, jvm crashes. my question is, why application crash when trying close jpcapwriter? update : weird thing discovered, is writing file. crashes after write. added print statement after close, , never reaches it. i found several other people same issue me. i'm not sure why removing call close writer fixed problem. file writes correctly, , has no issues. now, content working, may come issue @ later date. update: turns out the file closes when call made stop capt...

variables - Bash avoid filename interpretation -

i'm looking @ aliases save current directory can opened later. alias cdo='pwd|sed 's/ /\ /g' > ~/.cdo' aiias cdn='cd "$(cat ~/.cdo)"' the sed command deals spaces. however, still have curious problem cannot fix must involve variable interpretation. jk@bt:~# cd hello\ world/ jk@bt:~/hello world# pwd|sed 's/ /\\ /g' > ~/.cdo jk@bt:~/hello world# cat ~/.cdo /home/jk/hello\ world jk@bt:~/hello world# cd .. jk@bt:~# cd "$(cat ~/.cdo)" bash: cd: /home/jk/hello\ world: no such file or directory looks me if you're doubling masking. one way handle spaces mask them individually backslash: cd here\ i\ go or mask of them double quotes: cd "here go" while allowed well: cd here" "go however, mixing them means, want literally backslashes: cd "here\ i\ go" and that's what's happening. note while not common, tabs , newlines can included in files well. m...

c# - Caller ID - Cannot obtain incoming Number -

the label on ui keeps reading "ring ring" , empty "". doesn't display incoming number, want. tried add if function checking if there '0' in data reason still doesn't work. the following code: using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; using system.io.ports; namespace callerid { public partial class callerid : form { public callerid() { initializecomponent(); port.open(); watchmodem(); setmodem(); } protected override void onpaint(painteventargs e) { base.onpaint(e); watchmodem(); } private serialport port = new serialport("com3"); string callname; string callnumber; string readdata; private void setmodem() { ...

Deploying spring app in Tomcat with Mongodb running in Micro cloud foundry -

i getting following exception when trying connect micro cloud foundry mongodb server through spring application running inside localhost tomcat server. exception: jun 05, 2012 4:30:44 pm com.mongodb.dbtcpconnector fetchmaxbsonobjectsize warning: exception determining maxbson size using0 java.io.ioexception: couldn't connect [/192.168.80.128:27017] bc:java.net.connectexception: connection refused: connect @ com.mongodb.dbport._open(dbport.java:228) @ com.mongodb.dbport.go(dbport.java:112) @ com.mongodb.dbport.go(dbport.java:93) @ com.mongodb.dbport.findone(dbport.java:146) scenario: spring app configured cloud foundry works in micro cloud foundry set up. works when deployed live cloudfoundry.com deployed app in vmware vfabric tomcat inside spring tool suite(sts), pointing mongodb running in virtual machine ( 192.168.80.128) root-context.xml: (with change in host configuration) <beans profile="default"> <mongo:db-factory id="m...

asp.net - Configuring federated passive Relying Party for IIS 7 classic mode error (Failed to Execute URL) -

i have asp.net relying party uses microsoft identity model , wif passive federated identity. web application works fine in iis 7 under .net 4 integrated pipeline application pool. when switch .net 4 classic pipeline application pool, fails , gives me following error. how can fixed? exception details: system.web.httpexception: failed execute url. stack trace: [httpexception (0x80004005): failed execute url.] system.web.hosting.isapiworkerrequestinprocforiis6.beginexecuteurl(string url, string method, string childheaders, boolean sendheaders, boolean adduserindo, intptr token, string name, string authtype, byte[] entity, asynccallback cb, object state) +4040320 system.web.httpresponse.beginexecuteurlforentireresponse(string pathoverride, namevaluecollection requestheaders, asynccallback cb, object state) +590 system.web.defaulthttphandler.beginprocessrequest(httpcontext context, asynccallback callback, object state) +286 system.web.callhandlerexecutionstep.system....

Grails - remoteField with additional parameters (3 parameters, no id work around) -

in work around i've used in past, i've used id field pass additional parameter needed. need pass 3 parameters through remotefield , presented fact need find way pass these parameters: <g:remotefield action="updatefields" update="thediv" id-"${personinstance.id}" paramname="search" name="updatefields" value="" /> need: search field (search), person id (id), , need company person works (c_id). i can this: <g:remotefield action="updatefields" update="thediv" id-"${personinstance.id}" paramname="search" name="updatefields" value="" params="${[c_id:c_id, search:/'+this.value+/']}"/> if try obtain search value params, search field '+this.value+'. can pass object search field addition param in map (like above) referencing this.value? if so, doing wrong, since gsp doesn't load. edit my current work around tie...