Posts

Featured post

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -

i'm geting started tensorflow,followed tutorials,but cannot download mnist data. import tensorflow tf tensorflow.examples.tutorials.mnist import input_data mnist=input_data.read_data_sets("mnist_data/",one_hot=true) print("download done!") error information: extracting mnist_data/train-images-idx3-ubyte.gz traceback (most recent call last): file "/home/sj/program/tesorflow_try.py", line 6, in <module> mnist=input_data.read_data_sets("mnist_data/",one_hot=true) file "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py", line 213, in read_data_sets train_images = extract_images(f) file "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py", line 60, in extract_images buf = bytestream.read(rows * cols * num_images) file "/usr/lib/python2.7/gzip.py", line 268, in read self._read(readsize) file

ios - Pass NSDictionary from Javascript to Objective-c in JavascriptCore -

i'm using javascriptcore in app. now, i'm passing variables jscontext can passed objective-c. however, 1 of variables, nsdictionary, not passing through correctly. run code below: var evaluate = function(variables) { app.setdictionary(variables.dictionary); } this simple example has these following methods set in jscontext . this setdictionary() method: - (void)setdicationary:(nsdictionary *)dictionary { self.mutabledictionary = [dictionary mutablecopy]; } this variables.dictionary : - (nsdictionary *)dictionary { return self.values; } and how call evaluate() : jsvalue *jsfunction = self.context[@"evaluate"]; jsvalue *value = [jsfunction callwitharguments:@[self.variables]]; however, in setdictionary method, don't nsdictionary, instead nsstring containing [object object] . any ideas how can solve this? although javascriptcore automatically converts types between objective-c or swift , javascript, suggest implement ex

java - How to handle special characters while unmarshalling xml in JAXB -

my test xml content <p id="033" num="03">geopotent change&#x2 high.</p> and run jaxb unmarshalling, i'm getting exception 09:58:43.748 error [main][net.serviceimpl] parsing error: javax.xml.bind.unmarshalexception- linked exception: [javax.xml.stream.xmlstreamexception: parseerror @ [row,col]: [161,306]message: string "&#] my jaxb unmarshal source jaxbcontext jaxbcontext = jaxbcontext.newinstance(cndocument.class); unmarshaller jaxbunmarshaller = jaxbcontext.createunmarshaller(); document = (cndocument) jaxbunmarshaller.unmarshal(xmlfile); how can escape characters? (&#x2) you jaxb parse error because xml content not well-formed. should &#x2; (with semicolon), not &#x2 .

listview - Dismissible item on a list in Android -

Image
do know, what's best practice implement dismissible item on recyclerview or listview? can see ui pattern e.g. in settings app close datasaver.

html - Syntax "Number.isFinite" don't work with Chutzpah -

Image
it doesn't work use syntax code "number.isfinite" in relation chutzpah. is supposed be? thank you! chutzpah uses phantomjs running js , current version of phantom not support this. new version (2.5) should coming out , when update chutzpah resolve issue.

nunit - Specflow Html report throwing errors -

Image
i getting errors when running specflow html report. have created specflow project nunit, have created nunit xml report want convert in html report. when run in command prompt, getting error. please let me know mistake making. i ran nunit3-console.exe --labels=all --out=testresult.txt "--result=testresult.xml;format=nunit2" "c:\users\senthil\documents\visual studio 2015\projects\unittestproject12\test123\bin\debug\test123.dll" then ran specflow.exe nunitexecutionreport test123.csproj /out:myresult.html throwing errors

javascript - How to maintain the font color after inserting <br> tags in a contenteditable div? -

first of , in contenteditable div , if user presses enter , want have gap of line , therefore following code. <div contenteditable="true" class="doc"></div> <script> $('.doc').keydown(function(e) { if (e.keycode == 13) { document.execcommand('inserthtml', false, '<br><br>'); return false; } }); </script> now , using tooltip ,which appears on double clicking word in div, if set font color red , remains red till press enter i.e. changes black press enter. wanted use same option change color red , same revert black, below. i=0; function setcolor() { if(i==0) { document.execcommand('forecolor',false,'#f00'); i=1; } elseif(i==1) { document.execcommand('forecolor',false,'#000000'); i=0; }