Posts

html - JavaScript error with XML when trying to read empty node -

i trying render catalog xml document , works, although when trying show default image if there no image present in xml node, disables parent node therefore forcing not show of , reads me error in console saying: uncaught typeerror: cannot read property 'getelementsbytagname' of undefined which pointing part of code: if (records[i].getelementsbytagname("image")[0].childnodes.length > 0) { so question in code below error causing not load xml node? ps: if needs more of code please let me know, , happy post it. for (var = fromitem; < nextmaxitem; i++) { if (records[i].getelementsbytagname("image")[0].childnodes.length > 0) { xmlcontent += '<article class="post ' + records[i].getelementsbytagname("category")[0].childnodes[0].nodevalue + '" id="">' + '<div class="col-sm-4 col-lg-4 col-md-4"><div class=...

security - Debug Java SSL Handshake using -Djavax.net.debug=all -

my node.js client connecting java server ssl. seems work until certificateverify cache session, , client prints ssl couldn't authorize. here snippet of java server debug statements logged ssl handshake using -djavax.net.debug=all. problem is, java not explicitly raise red flags couldn't verify signature. tail of log stops. note: added ellipses after cache server session @ end of log. can me decipher log output determine why ssl handshake failing? i'm guessing can't verify signature of certificate, not see being explicitly stated. pool-1-thread-2, read: tlsv1.2 handshake, length = 264 *** certificateverify signature algorithm sha512withrsa [read] md5 , sha1 hashes: len = 264 0000: 0f 00 01 04 06 01 01 00 1e f6 13 87 8c 77 81 2d .............w.- 0010: e3 33 eb e0 8f 80 49 c6 90 f9 b5 4c 9b a0 69 77 .3....i....l..iw 0020: b1 14 6c e3 b2 15 15 1f 26 d5 69 31 64 36 0d d1 ..l.....&.i1d6.. 0030: da ad ba 58 bf 76 6d 25 1d 49 ba 4a c6 80 1c 49 ....

ios - UIView --> UIImage for non-visible view? -

i'm trying go work around inability use custom ui elements in watchkit. app uses custom uibuttons (mroundedbutton) , i'm trying replicate them on watchkit interface creating images of them , using background wkinterfacebutton. problem i'm not able convert uiviews uiimage when view isn't visible. code i'm using, it's giving me index out of bounds error on drawviewhierarchyinrect . - (uiimage *)convertbuttontoimage:(mroundedbutton *)button { uigraphicsbeginimagecontextwithoptions(button.bounds.size, yes, 0); [button drawviewhierarchyinrect:button.bounds afterscreenupdates:yes]; uiimage *image = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); return image; } since there no screen/window in watchkit extension, how go creating images would-be views? rather drawviewhierarchyinrect, try using renderincontext on layer. i ran same problem describe. using drawviewhierarchinrect didn't work - black sc...

import - Issue with Standalone in Processing -

i have sketch running in processing 2.1.2 , , runs fine sketch window. when try export standalone windows application, processing creates application.windows folder, contains 'lib' , 'source' subdirectories. when double-click application, showing me blank window. can guide me on how resolve issue? coding of program given below: import toxi.geom.*; import toxi.geom.mesh.*; import toxi.processing.*; import processing.serial.*; trianglemesh mesh; toxiclibssupport gfx; pimage img; string input; serial port; int x,y,z; void setup() { size(448, 299,p3d); println(serial.list()); port = new serial(this,serial.list()[0], 9600); port.bufferuntil('\n'); mesh=(trianglemesh)new stlreader().loadbinary(sketchpath("check.stl"),stlreader.trianglemesh); gfx=new toxiclibssupport(this); img=loadimage("imagei.jpg"); } void draw() { background(img); translate(width/2,height/2,0); rotatex(radians(x)); // pitch rotatey(radians(y)...

java - Clock and dynamic layout -

how can show hour minutes , seconds of clock in textview continuously using dynamic linear layout`this format works on static layout not on dynamic layout please me thanks? list item public class buttonactivity extends activity { button b; scrollview scrollview; int count = 4;`enter code here` private int mhour,mminute,msecond; int min,hr,sec; private handler mhandler = new handler(); public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_button); runnable mupdate = new runnable() { @override public void run() { calendar c = calendar.getinstance(); mhour = c.get(calendar.hour_of_day); mminute = c.get(calendar.minute); msecond = c.get(calendar.second); min = mminute; hr = mhour; sec = msecond; string timeset = ""; if (hr > 12) { hr -= 12; timeset = "pm"; } else if (hr == 0) { hr +...

kill - Execute method when Android app process is finished -

i'm working on android app , need know when os killed process, can make http request server. i've tried start service , put request in ondestroy() method, service stops when kill manualy (with start_sticky). use start_not_sticky, service ends app, not execute ondestroy() method. my manifest looks this: <service android:name=".checksessionendservice" android:enabled="true" android:exported="false" > </service> when process killed it's gone. can't execute anymore. ondestroy() called after service stopped, either stopservice() or stopself() (and service isn't bound), not mean process has been killed. if you're concerned user swiping app recents try http://developer.android.com/reference/android/app/service.html#ontaskremoved(android.content.intent) or http://developer.android.com/reference/android/content/pm/serviceinfo.html#flag_stop_with_task

How to get multiple text colors for a single NSTextField in Swift? -

textfield.stringvalue = "this part red - here blue" all inside 1 textfield in 2 different colors. could put html code inside textfield? because want provide url link inside textfield, solve 2 problems. look nsmutableattributedstring class achieve this. example: attrstring = nsmutableattributedstring(string: "hello world", attributes: [nsfontattributename:uifont(name: "arial", size: 18.0)!]) attrstring.addattribute(nsforegroundcolorattributename, value: uicolor.redcolor(), range: nsrange(location:0,length:2)) this example creates nsmutableattributedstring , adds attribute sets string have red font color characters @ location 0 2. documentation: https://developer.apple.com/library/ios/documentation/cocoa/reference/foundation/classes/nsmutableattributedstring_class/index.html