Posts

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

i'm trying implement crud operation using datatableseditor using datatables.but i'm getting error messages: 1)uncaught exception: datatables editor - remote hosting of code not allowed. please see http://editor.datatables.net details on how purchase editor license 2)typeerror: a.editor undefined 3) $.fn.datatable.editor not constructor" what reason? here configuration: <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>insert title here</title> <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.12/css/jquery.datatables.min.css"> <link re...

Regex Matching Words in XML Between Two Other Words (Matlab regexp) -

i'm trying parse xml file using matlab regexp. retrieve array of incidences of word "curvepoint" occuring between "deposits" , "/deposits". xml below should [6x1] array like " <curvepoint> <curvepoint> <curvepoint> <curvepoint> <curvepoint> <curvepoint> " my attempt below doesn't work there lots of other text interspersed between each "curvepoint" word-incidence , look-aheads/backs, don't know how handle this. regexp(xmltext,'(?<=<deposits>)(<curvepoint>)(?=</deposits>)','match')' xmltext is <?xml version="1.0" encoding="utf-8"?> <interestratecurve> <effectiveasof>2016-11-07</effectiveasof> <currency>eur</currency> <baddayconvention>m</baddayconvention> <deposits> <daycountconvention>act/360</daycountconvention> <snapti...

distributed computing - How to run Tensorflow on SLURM cluster with properly configured parameter server? -

i in fortunate position of having access university's slurm powered gpu cluster. have been trying tensorflow run in cluster node, far have failed find documentation. (everyone have spoken @ university has run using cpu nodes before or using single gpu node. i found excellent bit of documentation previous question here . unfortunately, it's rather incomplete. of other distributed examples have found such such this 1 rely on explicitly specifying parameter server. when try run using code question, appears work until either fails connect nonexistent parameter server or hangs when server.join called , no print outs provided sbatch outfile (which understand should happen). so in short, question how 1 go starting tensorflow on slurm cluster? sbatch stage onwards. first time dealing distributed computing framework besides spark on aws , love learn more how configure tensorflow. how specify 1 of items in tf_hostlist example server parameter server? alternatively can use sbat...

python - multiprocessing pool with map -

i try multiprocess code this: param_seq = [] pool = pool(multiprocessing.cpu_count()-1) def work(param_set): (_, v) = experiment_sim(param_set[0], param_set[1]) v_dev = np.subtract(exp_v, v) return - np.sum(np.square(v_dev)) / (2 * noise_sigma ** 2) x in ra.values: y in gpas.values: param_seq.append((x, y)) likelihood = pool.map(work, param_seq) and looks working fine, work, in , stops , nothing , have stop program. following message occurs: process poolworker-8: process poolworker-10: process poolworker-13: process poolworker-14: process poolworker-11: process poolworker-12: traceback (most recent call last): traceback (most recent call last): traceback (most recent call last): traceback (most recent call last): traceback (most recent call last): traceback (most recent call last): file "/usr/local/cellar/python/2.7.11/frameworks/python.framework/versions/2.7/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap file ...

python - Poor performance of db. inserts using django-mssql -

i designed data warehousing application, struggle poor performance when fetching data source , saving them db. - approximately 150 kb/s. because of limitations imposed customer, forced use django on 64bit win machine , save data ms sql express (exact versions below). using django-mssql (1.7) backend. original data stored in .dbf file (visual foxpro), dbfread returns each row file python dict (this not issue, tested running reader discarding data). dictionary checked data quality (function sanitize_value_for_db() below), data copied django data model (attributes of object populated; tables wide, hence each table/object has 100 columns/attributes) , objects saved db. using django objects.bulk_create() (in batches of 50-100). i run code through profiler using cprofile , pstats modules. results below. see of time spent in pywin. have no clue if there can do. hints or opinions appreciated. thanks. configuration: xeon e5-2403 v2 @ 1,8 ghz, 30 gb ram windows server 2012...

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -

i trying convert json java object use of gson in maven, following youtube video guidance - https://www.youtube.com/watch?v=vqgghm9pwe0 , theres error occurs when in main class error - package com.squareup.okhttp3 doesn't exist. code below: java package com.codebeasty.json; import com.squareup.okhttp3.okhttpclient; public class main { private static okhttpclient client = new okhttpclient(); public static void main (string [] args) { } } i put in dependency in pom.xml: <dependencies> <dependency> <groupid>com.squareup.okhttp3</groupid> <artifactid>okhttp</artifactid> <version>3.4.2</version> </dependency> <dependency> <groupid>com.google.code.gson</groupid> <artifactid>gson</artifactid> <version>2.8.0</version> </dependency> </dependencies> i dont understand why doesn't recognize com.squareup. there may need download? have downl...

Generate uuid based on some value and retrive c# -

i need generate uuid based on (userid+time+ip) @ client side, , retrive details uuid (which user passes me through phone). what need in detail user,time , ip should encoded in uuid such way uuid self not reveal details after processing should able details. how encode values in uuid , retrive them ? suggested answer:(by vivek nuna) this code works fine generating uuid , how retrive userid,time , ip uuid ? string input = "userid"+"time"+"ip"; using (md5 sha256 = md5.create()) { byte[] hash = sha256.computehash(encoding.default.getbytes(input)); guid result = new guid(hash); }

Return maximum list of list in Entity Framework C# -

i have these 2 classes : public class result { public string plate { get; set; } public double confidence { get; set; } public int matches_template { get; set; } public int plate_index { get; set; } public string region { get; set; } public int region_confidence { get; set; } public long processing_time_ms { get; set; } public int requested_topn { get; set; } public list<coordinate> coordinates { get; set; } public list<candidate> candidates { get; set; } } public class candidate { public string plate { get; set; } public double confidence { get; set; } public int matches_template { get; set; } } i have query : list<list<candidate>> lstcandidates = deserializedproduct.results.select(i=>i.candidates).tolist(); as can see have list of list<candidate> . every candidate has plate , confidence . need plate number maximum confidence in lstcandidates . how can value? ...

javascript - What does obfuscated code mean? -

this question has answer here: what comma in javascript expressions? 4 answers so on site , peeking source code, , javascript code obfuscated(as usual). don't know obfuscated code normally, think this: var1 > 10 / 2, var1 = 0 is same as if(var1 > 10 / 2){ var1 = 0; } is how is? if not, please tell. you can see happen, when place code inside of parenthesis inside of console.log. need parenthesis, because console.log reads comma separator parameter. comma operator : the comma operator evaluates each of operands (from left right) and returns value of last operand. var var1; console.log(var1); // undefined console.log((var1 > 10 / 2, var1 = 0)); // 0 console.log(var1); // 0

mongodb - Configuring Parseserver hosted on Heroku to use AWS S3 Bucket -

i have app hosted on parse wanted migrate parseserver. so, did following : 1 - migrated data(without files) mongodb on mlab. 2 - deployed app directly on heroku using "connect github" button on heroku site connect parseserver repository wich have forked. 3 - have correctly configured app justed deployed on heroku use, mongodb database , parse app keys. 4 - downloaded latest parse android sdk , updated client use , went fine : new client connects correctly app hosted on heroku , can data mongodb database through app. 5 - created aws account , s3 bucket on , migrated files bucket parse. my problem : how use files s3 bucket in heroku app ? what did : followed tutorial on https://github.com/parseplatform/parse-server/wiki/configuring-file-adapters#configuring-s3adapter configure app use s3-adapter. tutorials devided in 2 parts : set bucket , permissions , configuration options . did first 1 no problem. in second 1 configuration options , configure s3 ada...

reactjs - Children to children components communication -

i have 1 parent component name [parent-1] , 1 child component name [child-1]. now, have few more other components name [other-1] , [other-2]. now passing [other-1] , [other-2] component [child-1] component. jsx rendering correct. how can access [other-1/2] component functions [child-1] ? or how can pass props [child-1] [other-1/2] ? by using refs able call [other-1/2] functions [parent-1] want access [child-1]. tried passing refs [child-1] <child abc={() => this.refs.other1.hello()}/> or <child abc={this.refs.other1.hello()}/> not working. by using global event emitter way able achieve solution above problem. not sure if that's appropriate way in react.js i think you're not using refs properly. when try give arrow function refs sometime causes error due ref returning null . see my question find out why. the example should understand refs hope helps! class others1 extends react.component { log(){ console.log('hello o...

android - Get activity `ViewDataBinding` field inside `Robolectric` unit test after being assigned -

i writing robolectric unit test requires me make use of activity under test view data binding class( viewdatabinding ), unfortunately no luck stuck being null inside of unit test inside of mainactiviy class: ... activitymainbinding binding; // <-- field returns null inside unit test ... @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); binding = databindingutil.setcontentview(this, r.layout.activity_main); } ... if has written test similar requirement please demonstrate example of how got viewdatabinding classed assigned before test completed. thanks! note: using android studio 2.2 i found out testing robolectric version 3.1 issue , after upgrading using robolectric version 3.1.4 activities viewdatabinding field no longer returning null see pr: https://github.com/emartynov/android-architecture/pull/1 thanks @eugenmartynov contribution towards issue. note: used gradle version 3.1 b...

Mixing javascript with jquery -

on click assign class element (svg path) using pure javascript: this.getelement().classlist.add('active'); the new class part of series of other classes has. once new class added clicked element, should give class .active other elements in html have matching classes clicked element itself. html: <button class="1600 1500"></button> <button class="1600 1300 1200"></button> <button class="1300 1200 1700 1800"></button> <button class="1300 1200 1100 1900"></button> <div class="1600 1700 item leaflet"></div> i don't know button has matching class since classes dynamic too. know div have class matching button's class. the thing specific reasons using pure javascript assign new class name on click on div ( works ): this.getelement().classlist.add('active'); so following won't work: this.click(function() { var classes = this.at...

html - "Span" Selector not working -

i trying build border around h1 reason can't select exact "span" in css? have written incorrectly? html h1 span { display: inline-block; padding: 0.5em border: white solid 10px; } <header> <div class="logo"> <img src="octopus.png"> </div> <nav> <a href="">one</a> <a href="">one</a> <a href="">one</a> <a href="">one</a> </nav> <h1><span>elias</span></h1> <p class="kicker">stuff // other stuff // more</p> </header> you missing ; after padding , won't let border work h1 span { display: inline-block; padding: 0.5em; border: white solid 10px; } /*demo*/ body { background: lightblue } <nav> <a href="">one</a> ...

tensorflow - Saving and Restoring a trained LSTM in Tensor Flow -

i trained lstm classifier, using basiclstmcell. how can save model , restore use in later classifications? i wondering myself. other pointed out, usual way save model in tensorflow use tf.train.saver() , believe saves values of tf.variables . i'm not sure if there tf.variables inside basiclstmcell implementation saved automatically when this, or if there perhaps step need taken, if else fails, basiclstmcell can saved , loaded in pickle file.

java - Memory Consumption is always increasing in Humble-Video -

i have been using humble-video in live streaming project convert flv mp4. i've realized java process's(in humble-video codes running) memory usage increasing when looking top command. after changed demo source code of humble-video , put segmentfile function in infinite loop , memory usage of process again increasing when looking top command. on 2.5gib , has been running 30 mins. i expect process's memory consumption stay stable somewhere between 40-50mb not keep increasing always. do have idea that? i've resolved problem. the problem garbage collector not clear weakreferences jnimemorymanager not delete native objects. calling system.gc() after every iteration helping not exact solution. the solution calling delete() @ end of each iteration. objects created may not expect during execution please @ objects created jnimemorymanager.getmgr().dumpmemorylog(); , @ how many objects alive jnimemorymanager.getmgr().getnumpinnedobjects(); the last s...

JSF wrong display of elements when iterating a Map -

i have simplify problem as possible. basically, map not been printed correctly after make modifications on it. i have following xhtml code: <c:foreach items="#{personcontroller.groupedpersons}" var="persong"> <p> <h:commandbutton action="#{personcontroller.removepersongroup(persong.key)}" type="submit" value="remove"> <f:ajax render="@form" /> </h:commandbutton> </p> <p>#{persong.key}</p> <p>#{persong.value.size()}</p> </c:foreach> this iterates on map , prints information. each key, there button allows removing map. with code in personcontroller bean (which @viewscoped , implements serializable ): private hashmap<integer, list<person>> groupedpersons; public void removepersongroup(integer age) { groupedpersons.remove(age); } my testing data has key=20 , 3 values (person) , key=30 ,...

How to display properties of a nested query in semantic media wiki? -

i have category called actors , called film. category film has property 'hasbudget' , 'hasactor'. each actor has property 'hasnationality'. i need display list of australian actors have features in films budget above 40 million. i use following query list actors , corresponding films , budget. {{#ask:[[category:actor]] [[hasnationality::australia]] [[-hasactor::<q> [[category:film]] [[hasbudget::>40000000]]</q>]] |?# |?-hasactor |?hasbudget |format=broadtable |link=all |headers=show |searchlabel=... further results |class=sortable wikitable smwtable }} however not able pick budget subquery. how can extract budget property? any appreciated..thanks that's right - you're querying category:actor result you're receiving actor pages , not film pages. there no "joins" in smw query syntax, way achieve use sub-queries along template result format. the idea encapsulate sub-queries templates, way able quer...

wordpress - Calling manually wp-load.php in conjunction with qtranslate-x I get file not found -

i have custom php code outside of wp-content of wordpress, ie www.xyz.com/test calling code below works fine, if enable qtranslate-x add language literal ie www.xyz.com/fr/test result "404 file not found." require_once($_server['document_root'].'/wp-load.php'); what can resolve problem ? do need plugins when loading wordpress core? core load minimum configuration (without plugins , themes): define('shortinit', true); require_once($_server['document_root'].'/wp-load.php'); if need theme support can trick: define('wp_plugin_dir', ''); require_once($_server['document_root'].'/wp-load.php'); /* start theme */ get_header(); the_content(); get_footer(); all code in functions.php should loaded fine

python - Referencing Tabs in Notebook Tkinter Widget -

i'm fresh python beginner (v3.5) trying work tkinter. i'm having trouble referencing tabs i've created within init class . error issue i'm receiving attributeerror: 'gui' object has no attribute 'tab1' . have feeling answer obvious , haven't been able figure out. i've tried hack away of irrelevant code efficiency. relevant code is: from tkinter import * tkinter.ttk import * class gui: def __init__(self): self.root = tk() self.root.title("title") self.notebook() self.player_selection_and_score() self.process_button() def notebook(self): nb = notebook(self.root) # creates notebook tab1 = frame(nb) # creates tab1 nb.add(tab1, text="score entry") # adds tab1 nb.pack(expand=1, fill="both") # pack tab make visible def player_selection_and_score(self): top = labelframe(self.tab1) ...