Posts

javascript - Getting Youtube view counts for several videos using APIv3 (jquery) -

i'm trying create youtube social feed includes video, title, description, date, , view count. i've got work except last one, view count. i've been able view counts show out of order , i'm lost on how make them match respective videos. used video initial tutorial: [ https://www.youtube.com/watch?v=jdqsifw74jk][1] got me far, i'm lost again. here code via code pen: [ http://codepen.io/thatsmyjams/pen/ejzwex][2] here html: <div id="container"> <h2>results:</h2> <ul id="results"></ul> </div> and here javascript: var yourapikey = 'aizasydpy9fhgp7evndr5mgrxwwkgubtfm8l5pe'; var channelname = 'googledevelopers'; var vidcount = 5; var vidheight = 275; var vidwidth = 400; $(document).ready(function(){ $.get( "https://www.googleapis.com/youtube/v3/channels", { part: 'contentdetails', forusername: ch...

JNI code in Windows works with PATH but not java.library.path -

java 1.6 on windows working java library uses jni. want point @ dll's using java.library.path environment variable, doesn't work. when put same paths in path variable, works fine. successful case: c:>set path=\progra~1\company\compan~1\lib;\progra~1\java\jdk1.6.0_43\bin (setting path without drive or spaces try avoid space issues, though jars , libraries on c drive) java -cp %classpath% com.company.samples.ft.mainclass unsuccessful case 1: set path=\progra~1\java\jdk1.6.0_43\bin c:>java -djava.library.path=\progra~1\company\compan~1\lib -cp %classpath% com.company.samples.ft.mainclass ft\ft.cfg not load base company api library exception in thread "main" java.lang.unsatisfiedlinkerror: c:\program files\company\company client api\lib\companyapi.dll: can't find dependent libraries @ java.lang.classloader$nativelibrary.load(native method) @ java.lang.classloader.loadlibrary0(classloader.java:1807) ...

javascript - Show database records with json -

i building simple app intel xdk , need connect app mysql database. because intel xdk not allow php files needed connect html php via javascrapt , json. here php code found , edited sends php array json object intel xdk app: <?php if(isset($_get["get_rows"])) { //checks format client wants if($_get["get_rows"] == "json") { $link = mysqli_connect("localhost", "xxxx", "xxxx", "xxxx"); /* check connection */ if (mysqli_connect_errno()) { echo mysqli_connect_error(); header("http/1.0 500 internal server error"); exit(); } $query = "select * quotes limit 1"; $jsondata = array(); if ($result = mysqli_query($link, $query)) { /* fetch associative array */ while ($row = mysqli_fetch_row($result)) { $jsondata = $row; } /*...

Code, going through an array in javascript -

'm trying create function continuously loop through array , check if there still elements value. if there no more of these elements, function execute action. i'm checking '0'. if nothing ='0', want display image. here's have, suggestions? function partiewin() // on verifie si il y encore des cases avec pour valeur '0' et si non, on fini la partie { var found=false; (i=1; <= hauteur; i++) { (j=1;j <= largeur; j++) { if( decor[i][j]!=0) { window.alert("you win"); found=1; } } } if(!found) { } } this array var decor = new array(hauteur); (i=0; <= hauteur; i=i+1) { decor[i] = new array(largeur); } the array long list of shape : decor[1][1] = '24'; decor[1][2] = '21'; decor[4][8]='0' ; etc shouldn't work? i'm not getting alerts or answer whatsoever once '0' technically gone map.. var found = false; for(var = 0; ...

Running Java class with JMeter (Bean Shell) -

i have written java class use in jmeter, packaged project .jar file , moved file lib/ext folder in jmeter directory. have seen documentation on how proceed give contradictory answers. the first way use beanshell sampler import package , class, create object of class , run methods way. have used method using example classes more simple file structures of class want run. example classes work following beanshell script. import tools.jmetertools; jmetertools jt = new jmetertools(); jt.foo(); when try use method class want run, states variable declaration error , class cannot found. assume because not understand import exactly, file structure in project little odd. the second uses beanshell preprocessor add jar class path. method have not been able work @ all, have read many accounts of others finding success. works follows: addclasspath("directory path jar\lib\ext\foo.jar"); jmetertest jtm = new jmetertest(); jmt.test(); would have knowledge of way work better or ...

curl - How do I accept POST requests from Go and write output to a file? -

first of all, i'm trying create logging service in go, lightweight server accepting post requests log data service. i'm writing service in go because supposed fast , handle lot of post requests @ once. logic sound there? anyways, issue. i'm sending post requests test: curl -h "content-type: application/json" -x post -d '{"hello":"world"}' http://localhost:8080/log and here go script far: package main import ( "fmt" "log" "net/http" ) func logger(w http.responsewriter, r *http.request) { r.parseform() fmt.println(r.form) fmt.println(r.formvalue("hello")) } func main() { http.handlefunc("/log", logger) log.fatal(http.listenandserve(":8080", nil)) } it outputting: map [] why that? how write post data file on server? thank much! w r.method contains type of received request (get, post, head, put, etc.). you can read data r....

Convert SAS date time value to Java YYYY-MM-DD HH:mm:ss -

i have date time values coming sas ( 10 digits) 1627741415 . want convert them in java code generate java date time yyyy-mm-dd hh:mm:ss.0 i cant find how sas date time works this. 1627741415 corresponds july 31, 2011 2:33:35 p.m. , want be 2011-07-31 14:33:35.0. any appreciated. in advance since sas datetime value represents number of seconds between january 1, 1960, , specified date. think use difference epoch time 1970. i did quick test using code : localdatetime datetime = localdatetime.parse("2011-07-31t14:33:35.0"); system.out.println(datetime.tostring()); system.out.println(datetime.toepochsecond(zoneoffset.utc)); system.out.println(" difference : "+ (1627741415 - datetime.toepochsecond(zoneoffset.utc) )); and use difference of 315618600 calculate dates. so have 1627741415 subtract 315618600 endup epoch date can use in application.