Posts

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; } ...

javascript - Is it possible to trigger an click event, which will be registered by Google Tag Manager by using the .trigger() function? -

i got task, in have implement advanced tracking functionality sorts of forms, using google tag manager. thoughts now, create hidden anchor tag , append point in dom on load. giving anchor tag specific classes , ids based on page- , contenttype, each 1 of them unique. now tried following: gave anchor tag class "gtmanalyticslink", wanted use trigger filter in google tag manager interface. main goal of task possibility of analyzing process of filling out forms , other defined tasks, user can on website. @ steps of form, change text of anchor tag filling in current events (e.g. "invalid input in field xyz") , trigger click event using trigger() function, these clicks not recognized clicks google tag manager while being in preview mode. now question is, possible google tag manager register click events not fired natively (by user), trigger("click")? thanks in advance! patrick

dotnetnuke - How do I prevent a user from using special characters in display name on DNN -

Image
how prevent user using special characters in display name on dnn? i have managed right username using below, doesn't work, though dnn text indicates field meant apply username , display name. in site settings, tab "user account settings" can find setting "user name validation". there can add validation expression. think regex. happy dnning! michael

Python variable assignment changes value -

i network engineer trying learn python programming job requirement. i wrote code below # funtion chop first , last item in list def chop(t): t.pop(0) , t.pop(len(t)-1) return t when run function on list t , assign variable a. gets remainder of list after function executed , becomes new list.this works perfect. >>> t = ['a', 'b', 'c', 'd', 'e' ,'f','g','h','i','j','k','l'] >>> a=chop(t) >>> ['b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k'] >>> later when try works value of changes output of print chop(t) whereas did not run variable through function chop(t). can explain why happen? >>> print chop(t) ['c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'] >>> ['c', 'd', ...

jquery - unable to delete record with php and ajax -

i'm trying delete record row id table using php , ajax when click on button neither shows error nor performs action. here delete.php code: <?php session_start(); include 'db.php'; if(isset($_get['name'])){ $user = $_get['name']; $query = mysqli_query($con, "select * login username='$user'") or die (mysqli_error()); $result = mysqli_num_rows($query); while($row = mysqli_fetch_array($query)){ $_session['user'] = $row['username']; } } $query = mysqli_query($con, "select * pm touser = '".$_session['user']."' order pmdate desc" ) or die (mysqli_error()); $result = mysqli_num_rows($query); while($row = mysqli_fetch_array($query)){ $id = $row['id']; $delquery = mysqli_query($con, "delete * pm id ='$id'") or die (mysqli_error()); $delresult = mysqli_num_rows($delquery); } ?> and here ajax , delete code of html <a href="home.php?name='...

java - JScrollBar + JTextPane with HTML not properly scrolling to maximum value -

i have following problem in project of mine, took me while figure out whats causing problem, , can reproduce simple code attached. i dynamically adding content jtextpane htmleditorkit. set autoscroll off because want control manually (when user scrolled up, stop, , when event triggered activated again). the problem is, when set value of jscrollbar it's maximum value, it's different one, moment, after having content inserted htmldocument. when trigger setvalue again second time manually, scrolls correct maximum value. it seems jscrollbar not aware correct maximumvalue right after adding htmldocument, , (delayed) time later. using caret.setupdatepolicy(defaultcaret.always_update); is not solution, because doesn't work properly. doesn't scroll maximum value too, leaving view pixel below, don't want. here full code reproducing issue. if click on right button (add & scroll), inserts div element body. moment last visible line reached, doesn't scr...

python - "Apps aren't loaded yet" and "django.core.exceptions.ImproperlyConfigured" in Django? -

Image
this directory structure of django project. when running python code of importing model: from scraping.models import linkvendorstandard file "framework_product_processing.py" throws exception: django.core.exceptions.improperlyconfigured: requested setting default_index_tablespace, settings not configured. must either define environment variable django_settings_module or call settings.configure() before accessing settings. when add code: import django django.setup() to initialize django project settings, exception: django.core.exceptions.appregistrynotready: apps aren't loaded yet. i have following 2 questions behavior: the file:"framework_product_process.py" in django project structure @ same level "views.py" can access model without having setup django project.if file accessible same python path of view why django.core.exceptions.improperlyconfigured ? even after adding import django;django.setup() code why django.core.exception...

mysql - PHP Does not let me query a table -

Image
i have database can make queries tables without problems except 'employees' table. tried making basic query in php: <?php error_reporting(0); require "init.php"; $sql = "select * empleados;"; $result = mysqli_query($con, $sql); $response = array(); while($row = mysqli_fetch_array($result)){ $response[]=$row; } echo json_encode($response); ?> ... , not results. when run query other tables, works well, can be? this same query works fine phpmyadmin news: if use select dni empleados works, if use select * empleados doesn't.... (dni key, possible can access primary key?) be careful special characters such spanish accents, if remove these query works correctly

module - Difference between stock_move and stock_picking on Odoo(Openerp) ? -

can please tell me what's difference between stock_move & stock_picking ? if stock_move trace mouvements of products location why using stock_picking ? stock_picking collection of stock_move. normally, when stock_picking created, includes many items in , each line in picking stock move. stock_picking done when stock_moves in picking done. same concept sale_order , sale_order_line

server - http request stops at dynamic dns -

i have server running @ home host small site home project. can access via internet using dynamic dns. want send http request (ifttt maker) using same way, stop @ dynamic dns server. if response dynamic dns just <frameset rows="100%,*"> <frame frameborder="0" src="http://#myipadress"> </frameset> and if send request site (like submit button) automatically redirected " http://#myipadress ?query". how can http request follow dynamic dns redirects?

c# - searching for mulitple columns in a dataGridView -

i have code searching specific column name or column number in datagridview : string str = kartsearchtxt.text; string value = ""; (int = 0; < datagridview1.rows.count; i++) { value = datagridview1.rows[i].cells[3].value.tostring(); if (value.contains(str) == false) { datagridview1.rows.removeat(i); i--; } } } i've tried diffrent solutions having "2 loops " searching through columns aswell , didnt work . how can search through multiple columns ? in advance use loop this for (int = datagridview1.rows.count - 1; >= 0; i--) { foreach (datagridviewcolumn column in datagridview1.columns) { if (!column.visible || column.displayindex < 0) continue; value = datagridview1.rows[i].cells[column.displayindex].value.tostring(); if (value.contains(str) == fals...

stop my idle remote desktop session form being logged out on windows server 2012 r2 -

i'm running performance tests virtual windows 2012 r2 server. tests take several hours run, if remote desktop session disconnected or idle more ~30 minutes, when reconnect using mstsc.exe login again , existing session either logged out @ point, or has expired during intervening period. i've used gpedit.msc on server set idle session timeout remote desktop never , restarted server - i'm still seeing same behavior. ideas? note: i'm not admin on server, normal user permissions. i've enabled "set time limit disconnected sessions" , set "never" under 'computer configuration' - suggests dominant setting, , there's no overriding group policy.

swift - How to know the account used for google sign in ios sdk -

i have integrated google sign in sdk in ios forgot account did it. i have configuration file , client id , reverse client id so how can know google account used create sign in. for getting user details of logged in user can use api https://www.googleapis.com/gmail/v1/users/me/profile for more details refer link

java - SunCertPathBuilderException => Maven JAXB2 generation with certificate -

i'm using maven-jaxb2, generate classes make calls webservice. <plugin> <groupid>org.jvnet.jaxb2.maven2</groupid> <artifactid>maven-jaxb2-plugin</artifactid> <version>0.12.3</version> <configuration> <schemalanguage>wsdl</schemalanguage> <schemas> <schema> <url>https://my-secured-webservice.com/file?wsdl</url> </schema> </schemas> <generatedirectory>src\main\java</generatedirectory> <verbose>true</verbose> </configuration> <executions> <execution> <phase>generate-sources</phase> <goals> <goal>generate</goal> </goals> </execution> </executions> </plugin> the wsdl needs certificate correctly installed on machine. c...