Posts

channel - libssh 0.7.2 unable to execute command on QNX : UNKNOWN SSH_MSG_GLOBAL_REQUEST -

i'm writing application using libssh 0.7.2 makes ssh connection qnx virtual machine start application. the control flow happens following : ssh_connnect() -> ssh_channel_open_session() -> ssh_channel_request_exec("my_app_name"). i got ssh_ok return value callings. verify command executed list current processes running on qnx , not find "my_app_name". here log ssh activities: log ssh_connect() [2017/07/25 15:45:23.029846, 2] ssh_connect: libssh 0.7.2 (c) 2003-2014 aris adamantiadis, andreas schneider, , libssh contributors. distributed under lgpl, please refer copying file information rights, using threading threads_noop [2017/07/25 15:45:23.030846, 2] ssh_socket_connect: nonblocking connection socket: 740 [2017/07/25 15:45:23.031346, 2] ssh_connect: socket connecting, waiting callbacks work [2017/07/25 15:45:23.031846, 1] socket_callback_connected: socket connection callback: 1 (0) [2017/07/25 15:45:23.037847, 1] ssh_client_connec...

R Shiny GoogleVis missing axis labels from squashed bar charts -

Image
my shiny app not showing vertical axis labels in bar charts. have looked @ other answers show labels on horizontal axis , google chart not showing x-axis labels . test data plot in data.table labels a,b,c,d, etc.. numeric values. please see gist whole app . so 1 gets (chart a) can see barchart labels skipping letters: when want (chart b) showing , b , c , d etc... on y axis: i setting width , height "automatic" in first chart charts scaleable on different size screens. worked fine few months rendering above. chart b done forcing chart width , height numeric values. k.op.width <- "400" k.op.height <- "400" this not wanted wanted make full use of screens possible , viewable on tablets. i setting googlevis vaxis option showtextevery:1 @asgallant suggested in comments answer above, not helping. wide screen crimping plot area, truncating chart. why chart not spread downwards in size showing labels? is there way these charts in...

Cannot read property 'length' of undefined at type in javascript -

i have 2 errors: cannot read property 'length' of undefined @ type , typing. wrong? settimeout(function typing() { var fields = document.queryselectorall('input'); var text = ["text", "text", "text", "text"]; function print (input, num, timeout) { settimeout(function(){ var = 0; function type(){ if (i <= text[num].length) { input.value = text[num].substr(0, i); settimeout(type, 100); } console.log(text[num].length); i++; } type(); console.log(type()); if (num == 3) { settimeout( function() { document.getelementbyid('postlogo_animation').classname +=" postlogo-img" },text[num].length * 120); } }, timeout); } (var b = 0; b < fields.length; b++) { var timeout = 0; var input = fields[b]; if (b > 0) { (var c = 0...

PHP's in_array bevahior surprises me -

this question has answer here: a problem in_array 3 answers php's variable type leniency 3 answers while validating dynamic saving method in controller wanted make sure given case accepts 0 , 1 valid values. when tried manipulate input form, submitting 'aaa' value following still returns true. why that? var_dump(in_array('aaa', [0, 1])); // true, expecting return false you need use "strict" setting, force function check types of elements well: var_dump(in_array('aaa', [0, 1], true)); http://php.net/manual/en/function.in-array.php states if third parameter strict set true in_array() function check types of needle in haystack. the reason returns true because string truthy, , 1 . if( "aaa" ){ echo "yo...

java - get only the website name from domain name of url -

i need convert list of urls host name. tried below mentioned code: url neturl = new url(url); string host = neturl.gethost(); the above mentioned code producing output shown below: a95-101-128-242.deploy.akamaitechnologies.com a23-1-242-192.deploy.static.akamaitechnologies.com edge-video-shv-01-lht6.fbcdn.net i want website name above output shown below: akamaitechnologies akamaitechnologies fbcdn please help. thanks if want parse url, use java.net.uri . java.net.url has bunch of problems -- equals method dns lookup means code using can vulnerable denial of service attacks when used untrusted inputs. public static string getdomainname(string url) throws urisyntaxexception { uri uri = new uri(url); string domain = uri.gethost(); return domain.startswith("www.") ? domain.substring(4) : domain; } this should work.

How can I get all the applications that are currently running on android? -

i want running app on android device. maybe, need use packagemanager ? have tried used packagemanager , did not succeed, maybe, have better decision? using below code can running application list activitymanager = (activitymanager) getsystemservice(context.activity_service); list<activitymanager.runningappprocessinfo> runningappprocessinfo = am.getrunningappprocesses();

How to create a class that prints an array in TypeScript -

i want create array ["name", age] , able print using class: let person: person[] = [["anne", 21], ["coco", 33]]; class person{ person: person[]; printperson(): person{ (let of person) { document.write( + '<br/>'); } } this code allow print general nested arrays (i haven't implemented in class easy do): let persons: (string | number)[][] = [["anne", 21], ["coco", 33]]; const printarray = (array: any[]) => { (const element of array) { if (element instanceof array) { printarray(element); } else { document.write(element.tostring() + '<br/>'); } } } printarray(persons); output: anne 21 coco 33 however, since expecting inner arrays have same shape recommend implementing them typescript class. code below defines person class own write method, creates array of persons , , iterates on each ...