Posts

How to execute certain part of code (eg sftp download) in php in certain time interval? If time exceeds, exception is to be handled -

i want put time interval sftp connection in php. if time exceeds 60 seconds connect it, should disrupted , exception handled. don't know how it. i tried do: set_time_limit(60) but, not work. i want put time limit in function: private function __connectsftp() { $this->sftp = new net_sftp($this->host, 22); if (!$this->sftp->login($this->user, $this->password)) { return $this->_requesterrormessage('could not connect server'); } else { return $this->__downloadfile(); } } i tried do: $totime = time()+60; while(time() != $totime){ //connection code } but, sadly doesn't work @ all. i grateful if suggest me can do.

bash - Rundeck sharing variables across job steps -

i want share variable across rundeck job steps. initialized job option "target_files" set variable on step 1. rd_option_target_files=some bash command echo $rd_option_target_files value printed here. read variable step 2. echo $rd_option_target_files step 3 doesn't recognize variable set in step 1. what's way of doing on rundeck other using environment variables? after rundeck 2.9, there data capture plugin allow pass data between job steps. the plugin contained in rundeck application default. data capture plugin match regular expression in step’s log output , pass values later steps details see data capture/data passing between steps (published: 03 aug 2017)

java - How to find difference in dates -

Image
i have directory structure having folders date folder names. i want delete folder except last 2 days date.in case except today's folder , last 2 days.i.e., 23,22,21. here can't use joda-time find difference between dates. here code trying towards this. dateformat dateformat=new simpledateformat("yyyy-mm-dd"); calendar cal=calendar.getinstance(); cal.add(calendar.date, -2); //java.util.date date=new java.util.date(); system.out.println("the date "+dateformat.format(cal.gettime())); string direct="d:\\tempm\\sample\\"+dateformat.format(cal.gettime()); file file=new file(direct); /* if(!file.exists()) { file.mkdir(); system.out.println("folder created"); }*/ string path="d:\\tempm\\sample\\"; file file2=new file(path); for(file fi:file2.listfiles()) { if(!fi.getabsolutepath().equals(direct)) { system.out.println(fi.getabsolutepath...

bpmn - Query process instances based on starting message name -

env: camunda 7.4, bpmn 2.0 given process, can started multiple start message events. is possible query process instances started specific messages identified message name? if yes, how? if no, why? if not @ moment, when? some apis incidentmessages? that no out-of-the-box feature should easy build using process variables. the basic steps are: 1. implement execution listener sets message name variable: public class messagestarteventlistener implements executionlistener { public void notify(delegateexecution execution) throws exception { execution.setvariable("startmessage", "messagename"); } } note via delegateexecution#getbpmnmodelelementinstance can access bpmn element listener attached to, determine message name dynamically. 2. declare execution listener @ message start events: <process id="executionlistenersprocess"> <startevent id="thestart"> <extensionelements> <ca...

jquery - JsPlumb with Angular2 -

i trying use jsplumb display connections between 2 components. what end doing using jquery handle ui element , use render connections, jsplumb library. below: jsplumb configuration if( typeof jsplumb !== 'undefined' && jsplumb !== null ) { jsplumb.ready(function() { jsplumb.deleteeveryendpoint(); jsplumb.setcontainer(this._container); jsplumb.defaults.paintstyle = { strokestyle:'#339900', linewidth:2, dashstyle: '3 3'}; jsplumb.defaults.endpointstyle = { radius:7, fillstyle:'#339900' }; jsplumb.importdefaults({ connector : [ 'flowchart', { curviness:0 } ], connectionsdetachable:true, reattachconnections:true }); jsplumb.endpointclass = 'endpointclass'; jsplumb.connectorclass = 'connectorclass'; }); } js-plumb usage jsplumb.connect({ source: $('#'+entityfrom+'panel'), target: $('#'+entityto+'panel'), anchors: ['righ...

openmpi - Open MPI + Scalasca :Can not run mpirun command with option --prefix -

i have installed scalasca(scorep,cube,..) with open mpi peformance measurement . when add option : " --prefix = /my-path" mpirun, "scalasca - analyze" can not executed ( aborted ) . command : scalasca -analyze mpirun -np 1 --host localhost --prefix /home/as/lib/bin /home/as/documents/a.out "/home/as/lib" installed open mpi directory. , error : s=c=a=n: abort: target executable /home/as/lib/bin' directory!` if without "--prefix" , runs .but need "-- prefix" option run on cluster. have installed open mpi on of cluster machines same path (/home/as/lib) . how fix it??? open mpi adds implicit --prefix option if orterun (or of symlinks mpirun , mpiexec , etc.) called full path. in other words: $ /home/as/lib/bin/mpirun ... is equivalent to: $ mpirun --prefix /home/as/lib ... if really need pass --prefix option, e.g. because open mpi installed on cluster nodes in different directory on front-end node, quote...

xaml - Fill width on Windows Phone 8.1 -

i'm developing application using windows phone 8.1 sdk, write ui descriptions using xaml markup. i can't text box fill width. i see similar questions posted involve listview. i'm confused. there seems no proportional sizing options. tutorials show use of explicit pixel counts in design. is preferred method on windows? how supposed deal unpredictable screen sizes in windows? the items had, failing fill parent, inside contentcontrol . contentcontrol correctly filled width, child, grid , not. i found solution here – https://stackoverflow.com/a/17627257/5476004 – , echo solution here in case post found else searching same problem. the contentcontrol requires 2 special properties in order child element fill parent. horizontalcontentalignment , verticalcontentalignment . so": <contentcontrol name="mycontent" horizontalcontentalignment="stretch" verticalcontentalignment="stretch"> … </contentcontrol...