Posts

java - Unable to set reference variable in recursive call -

Image
i using recursive method find node in binary tree using key. when find node, set reference variable(foundnode) , return. problem when read object value still null. can help. findgivennode(root, key, foundnode, parentstack); private boolean findgivennode(node node, int key, node foundnode, stack<node> parentstack) { if (node == null) { return false; } parentstack.add(node); if (node.getdata() == key) { foundnode = node; return true; } boolean leftreturn = findgivennode(node.getleftchild(), key, foundnode, parentstack); boolean rightreturn = findgivennode(node.getrightchild(), key, foundnode, parentstack); if (leftreturn || rightreturn) { return true; } else { parentstack.pop(); return false; } } java doesn't pass arguments reference, passed value. read more here let's clarify example. make key looking integer value 21 . situation @ beginning of function fol...

c# - Implementing LoadMore pagination for a grouped ListView in Windows Phone 8.1? -

is possible apply listviewbase.loadmoreitemsasync method pagination in grouped listview (collectionviewsource). or maybe know way, please let me know. you can this: on listview add "loaded" event code: private void lvpictures_onloaded(object sender, routedeventargs e) { scrollviewer viewer = getscrollviewer(this.lvpictures); viewer.viewchanged += lvpictures_viewchanged; } public static scrollviewer getscrollviewer(dependencyobject depobj) { if (depobj scrollviewer) return depobj scrollviewer; (int = 0; < visualtreehelper.getchildrencount(depobj); i++) { var child = visualtreehelper.getchild(depobj, i); var result = getscrollviewer(child); if (result != null) return result; } return null; } and in viewchangeevent can specify when want load more items , this: private async void lvpictures_viewchanged(object sender, scrollviewerview...

c# - Gmail sending email timing out -

i trying send email gmail code isn't working, gives connection time out error. if make port '587' gives error: the smtp server requires secure connection or client not authenticated. server response was: 5.5.1 authentication required. learn more at string email = // email string password = // password string smtp = // smtp.gmail.com int port = // 465 var = new mailaddress(email, ""); var = new mailaddress(message.destination); var client = new smtpclient() { host = smtp, port = port, enablessl = true, deliverymethod = smtpdeliverymethod.network, usedefaultcredentials = false, credentials = new networkcredential(email, password) }; var mail = new mailmessage(from, to) { subject = subject, body = body, isbodyhtml = true }; return client.send...

multithreading - Spring Batch: OutOfMemoryError swallowed -

as part of larger application, set spring batch job made chunk oriented tasklet: reader, processor , writer. job not run in main thread. occasionally tasklet code throws outofmemoryerror. so, set thread's uncaughtexceptionhandler able react such errors, terminating application. but outofmemoryerror never reaches thread's uncaughtexceptionhandler. outofmemoryerror "swallowed", abstractstep, if i'm not sure. repeattemplate has sure role. able inform repeatlisteners outofmemoryerror no listeners registered default, , seems not possible register of them through usual tag in taskled definition. anyhow, happens after outofmemoryerror, jvm keeps on running, because oome swallowed. not nice because not make explicit application has crashed. so, have advice on how can prevent spring batch swallow such kind of errors , have possibility handle them ? obviously we're working on fixing oome, think safe if jvm crashes in case of errors. i'm using spri...

unity3d - UnityEngine.Social not working with IOS 8. Unsure how to resolve the issue -

when running our game on device uses game center error related authentication/connection game game center. works on ios 7 versions, not ios 8. we return authentication attempt, failed authenticate local user requested operation not completed because application not recognized game centre. has encountered issue/problem? unity related issue, or xcode and/or apple , game centre? built xcode v6.0.1, ios 8.

java - Consume web service providing updating JSON object -

i need school project, need connect web service providing json document updating every 3 or 4 second, consume , use of information contained. json looks this: { "firstname": "john", "lastname": "smith", "isalive": true, "age": 25, "height_cm": 167.6, "address": { "streetaddress": "21 2nd street", "city": "new york", "state": "ny", "postalcode": "10021-3100" }, "phonecalls": [ { "type": "home", "number": "212 555-1234", "duration": "32" }, { "type": "office", "number": "646 555-4567", "duration": "79" } ] } every x second json file updated random calls added document, need use informatio...

angularjs - Is this an acceptable process in Angular-JS -

ng-model="$parent.$parent.$parent.something" is there better way write this? inside serval ng-repeats. unless have isolated scopes, should able reference something property directly. scopes inherit parent properties. ng-model="something" edit: there gotchas around this. take @ https://github.com/angular/angular.js/wiki/understanding-scopes