Posts

c# - Give commands to multiple RDP and wait for result -

i have repetitive task @ end of month give commands multiple remote desktop connections (win7, win server 2008, win server 2012, win 8 ...) , need open of them 1 one task. want somekind of tool log on each , every 1 of them , give commands. here tried : public form1() { initializecomponent(); rdp.server = "1.2.3.4"; rdp.username = "rmlabuser2"; imstscnonscriptable secured = (imstscnonscriptable)rdp.getocx(); secured.cleartextpassword = "rmlabuser2"; rdp.connect(); // open cmd.exe , give commands ver , return output message text box // rdp.securedsettings.startprogram = @"c:\windows\system32\cmd.exe"; } full code : http://www.codeproject.com/articles/43705/remote-desktop-using-c-net any ideeas? thanks. you can use psexec run commands on remote computer. if need run commands within active session, can create scheduled task on computer needed stuff. scheduled tasks can configured run unde...

reactjs - jQuery Animate works after first click -

i'm trying hook jquery's animate ability bookmark id on site. when click on link, went bookmark id without animation when clicked same link again, animation works. var titlenav = react.createclass({ handlesubmitclick:function() { $('a').click(function() { $('html, body').animate( { scrolltop: $( $.attr(this, 'href') ).offset().top }, 500); return false; }); }, render: function() { return( <div> <ul classname = "nav"> <li classname = "navworkspace" onclick ={this.handlesubmitclick}><a href="#work">work</a></li> </ul> </div> ); } }); i assume way components called since components not wait on each other. there way fix this? note: using react.js render site. the r...

hdfs - Hadoop HA Namenode goes down with the Error: flush failed for required journal (JournalAndStream(mgr=QJM to [< ip >:8485, < ip >:8485, < ip >:8485])) -

hadoop namenode goes down everyday once. fatal namenode.fseditlog (journalset.java:mapjournalsandreporterrors(398)) - **error: flush failed required journal** (journalandstream(mgr=qjm [< ip >:8485, < ip >:8485, < ip >:8485], stream=quorumoutputstream starting @ txid <>)) java.io.ioexception: timed out waiting 20000ms quorum of nodes respond. @ org.apache.hadoop.hdfs.qjournal.client.asyncloggerset.waitforwritequorum(asyncloggerset.java:137) @ org.apache.hadoop.hdfs.qjournal.client.quorumoutputstream.flushandsync(quorumoutputstream.java:107) @ org.apache.hadoop.hdfs.server.namenode.editlogoutputstream.flush(editlogoutputstream.java:113) @ can suggest things need resolving issue? i using vms journal nodes , master nodes. cause issue? from error pasted. appears journal nodes not talk nn in timely manner. going on @ time of event? since mention nodes vms guess overloaded hypervisor or had troubling talking nn jn , zk quorum. ...

c# - Return data from another view Xamarin.iOS -

what i'm trying sounds simple haven't seen example or been able find one. i'm adding view navigation controller following way: viewcontrollers.companiesviewcontroller companiesviewctrl = this.storyboard.instantiateviewcontroller ("companyselectview") viewcontrollers.companiesviewcontroller; this.navigationcontroller.pushviewcontroller(companiesviewctrl, true); it bring view list of companies , need user selects company, i'll store information (i this) return previous view , , maybe run event. can point me in right direction how this? thanks :) the simplest solution add event companiesviewcontroller , raise when user selects company. navigation controller pushed companiesviewctrl can subscribe event , notified when company selected. class companiesviewcontroller { public event action<company> companyselected; public override void rowselected (uitableview tableview, nsindexpath indexpath) { //raise companyselec...

excel - vba Row numbers for filtered rows -

i have code capture row number in filtered table, things , go next visible row. works great first row. sub test() dim rn long dim cell range dim rng range set rng = sheets("fabricatedparts").range("a:a").specialcells(xlcelltypevisible) rn = sheets("fabricatedparts").usedrange.offset(1, 0).specialcells(xlcelltypevisible).row each cell in rng activesheet .range("b14").value = [parts].cells(rn, [parts[part.]].column) end 'rn = next visible row #???.row next cell end sub when change offset(1, 0) offset(2, 0) still returns row number first visible row(in case 10). looking vba statement return row number next visible row , pass number rn variable. filtered range testing next row number 11, next 165, next 166 etc. thank time. use row number of cell loop. sub test() dim rn long dim cell range dim rng range set rng = sheets("fabricatedp...

java - JavaFX resizable canvas problems -

i've problem what's partially solved, curious (better) solutions.. want canvas fills entire window , resizes if window resized. option 1 (partial solution): according this: https://dlemmermann.wordpress.com/2014/04/10/javafx-tip-1-resizable-canvas/ , this: how make canvas resizable in javafx? i've created (copied) class: public class resizablecanvas extends canvas { public resizablecanvas() { widthproperty().addlistener(evt -> draw()); heightproperty().addlistener(evt -> draw()); } private void draw() { double width = getwidth(); double height = getheight(); graphicscontext gc = getgraphicscontext2d(); gc.clearrect(0, 0, width, height); gc.setstroke(color.red); gc.strokeline(0, 0, width, height); gc.strokeline(0, height, width, 0); } @override public boolean isresizable() { return true; } @override public double prefwidth(double height)...

Why are Python's arrays slow? -

i expected array.array faster lists, arrays seem unboxed. however, following result: in [1]: import array in [2]: l = list(range(100000000)) in [3]: = array.array('l', range(100000000)) in [4]: %timeit sum(l) 1 loop, best of 3: 667 ms per loop in [5]: %timeit sum(a) 1 loop, best of 3: 1.41 s per loop in [6]: %timeit sum(l) 1 loop, best of 3: 627 ms per loop in [7]: %timeit sum(a) 1 loop, best of 3: 1.39 s per loop what cause of such difference? the storage "unboxed", every time access element python has "box" (embed in regular python object) in order it. example, sum(a) iterates on array, , boxes each integer, 1 @ time, in regular python int object. costs time. in sum(l) , boxing done @ time list created. so, in end, array slower, requires substantially less memory. here's relevant code recent version of python 3, same basic ideas apply cpython implementations since python first released. here's code access lis...