Posts

javascript - Jquery - change the content of a div class to details of clicked video -

i making video playlist youtube hybrid app. populate/display data using each function , append them json data thrown webserver. i have sample json data here: [{"video_id":"1","video_youtube_title":"this latest video", "video_youtube_description":"discription primary video.", "video_youtube_thumbnail":"https://i.ytimg.com/vi/avs4w7gzsq0/hqdefault.jpg", "video_youtube_date_published":"2016-07-15 13:37:00", "video_youtube_duration":"pt16m15s", "video_youtube_link":"avs4w7gzsq0", "video_fb_link":"example/posts/1715658608683485", "video_date_added":"2016-07-14 23:45:58"}] , [{ "video_id":"2", "video_youtube_title":"title 1", "video_youtube_description":"description1", "video_youtube_thumbnail":"https://i.ytimg.com/vi/kpdnw3_1goi/hqd...

java - create table user("user_id int auto_increment"); not working in derby (embedded database) -

i new in derby library. why got error when use auto_increment in query? here java code this.conn.createstatement().execute(create table user("user_id int auto_increment, primary key(user_id))"); i tried in mysql server , works in derby got error java.sql.sqlsyntaxerrorexception: syntax error: encountered "auto_increment" @ line 1 why got error? derby not have auto_increment keyword. in derby need use identity columns implement auto increment behaviour for example create table students ( id integer not null generated identity (start 1, increment 1), name varchar(24) not null, address varchar(1024), constraint primary_key primary key (id) ) ; above statement create student table id auto increment column , primary key well. hope helps

How do I include a JavaScript file in another JavaScript file? -

is there in javascript similar @import in css allows include javascript file inside javascript file? the old versions of javascript had no import, include, or require, many different approaches problem have been developed. but recent versions of javascript have standards es6 modules import modules, although not supported yet browsers. many people using modules browser applications use build and/or transpilation tools make practical use new syntax features modules. es6 modules note currently, browser support es6 modules not particularly great, on it's way. according this stackoverflow answer , supported (but behind flags) in chrome 60, firefox 54 , ms edge 15, safari 10.1 providing support without flags. thus, still need use build and/or transpilation tools valid javascript run in without requirement user use browser versions or enable flags. once es6 modules commonplace, here how go using them: // module.js export function hello() { return "hell...

java - Intellij/Gradle - Can't see Jar in classpath although it exists in module -

Image
when running app in intellij following exception: exception in thread "main" java.lang.noclassdeffounderror: org/slf4j/loggerfactory while when running via gradle run task there no such error. when checking if slf4j jar (which not direct dependency build.gradle ) appears in classpath intellij runs, doesn't, but does appear in external dependencies tree: you need add intellij project classpath. can done clicking on red bulb on editor or adding manually in project settings

c++ - No speedup with OpenMP -

i working openmp in order obtain algorithm near-linear speedup. unfortunately noticed not desired speedup. so, in order understand error in code, wrote code, easy one, double-check speedup in principle obtainable on hardware. this toy example wrote: #include <omp.h> #include <cmath> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <string.h> #include <cstdlib> #include <fstream> #include <sstream> #include <iomanip> #include <iostream> #include <stdexcept> #include <algorithm> #include "mkl.h" int main () { int number_of_threads = 1; int n = 600; int m = 50; int n = n/number_of_threads; int time_limit = 600; double total_clock = omp_get_wtime(); int time_flag = 0; #pragma omp parallel num_threads(number_of_threads) { int thread_id = omp_get_thread_num(); int iteration_number_local = 0; d...

java - Retrofit Dynamic ResponseBody -

i planning make 1 common service class use of retrofit, @get call<responsebody> makegetrequest(@url string url); @post call<responsebody> makepostrequest(@url string url, @body requestbody parameters); in code need pass (responsebody) dynamic json pojo class name , loginres say example , call<loginres> // class dynamic i pass responsebody responsebody not know class wanted prefer. why want because , after result gson.fromjson(response, loginres.class); so, after getting result retrofit again need convert gson.fromjson. so wanted pass dynamic response retrofit response according pojo class, i know working fine when pass loginres instead of responsebody because told response need response in loginres. so if pass call<loginres> // if pass way working fine no need convert response can access properties loginres class directly. this example call web service. call<responsebody> call = apiservice.makepostrequest("/buyer/log...

python - Issue creating a Numpy NDArray from PyArray_SimpleNewFromData -

i try python wrapper bind c++ functions , types python. issue when try convert custom matrix type numpy ndarray. convincing solution use pyarray_simplenewfromdata . to test behaviour, didn't manage wanted tried implement simple test: pyobject* converttopython(...) { uint8_t test[10] = {12, 15, 82, 254, 10, 32, 0, 8, 127, 54}; int32_t ndims = 1; npy_intp dims[1]; dims[0] = 10; int32_t typenum = (int32_t)npy_ubyte; pyobject* python_object = pyarray_simplenewfromdata(ndims, dims, typenum, (void*)test); py_xincref(python_object); return python_object; } and got in python these results: type(test) = <type 'numpy.ndarray'> test.ndim = 1 test.dtype = uint8 test.shape = (10,) but values inside array are: test.values = [ 1 0 0 0 0 0 0 0 80 8] i cannot figure out, doing wrong ? , not experienced doing python wrapper appreciable ! i try array has been allocated malloc, , perhaps settings flag named owndata in or...