Posts

Showing posts from May, 2012

javascript - setting selected value inside combobox using its name not index -

if i'm rendering combobox this $('#mycombo').html('<option value=""></option>'); $.each(mydata, function (i, v) { $('#mycombo').append('<option value="' + v.personid+ '">' + v.personname + '</option>'); }); how can set selected value inside combobox if v.personname == 'john' p.s. know can set value using it's index $('#mycombo').prop('selectedindex', 2); but in case don't know index, know name. one simple answer $('#mycombo').html('<option value=""></option>'); $.each(mydata, function (i, v) { if (v.personname== 'john') $('#mycombo').append('<option selected value="' + v.personid+ '">' + v.personname + '</option>'); else $('#mycombo').append('<option value="

Will Python execute finally block after receiving Ctrl+C -

if stop python script ctrl+c, execute blocks, or literally stop script is? well, answer it depends . here happens: python executes code in try:... finally: block a ctrl-c emitted , translated in keyboardinterrupt exception processing interrupted , controls passes block so @ first sight, works expected. but... when user (not you, others...) wants interrupt task hits multiple times ctrl-c. first 1 branch execution in finally block. if ctrl-c occurs in middle of block because contains slow operations closing files, new keyboardinterrupt raised , nothing guarantees whole block executed, , have like: traceback (most recent call last): file "...", line ..., in ... ... keyboardinterrupt during handling of above exception, exception occurred: traceback (most recent call last): file "...", line ..., in ... ... file "...", line ..., in ... ... keyboardinterrupt

javascript - Three.js play multiple animation in same time -

my problem following one: i export blender 3d model in json, animations concatenated on frame, i've succeed play animation want, can't stop @ end, know if there way separate frame multiple animations in order play multiple animations in same time? actually play animation want in frame, search in object , beginning of animation , play that: if ((begintime = this.hasanim(object.parent.animations[0], object.name)) !== false) { var action = object.parent.mixer.clipaction(object.parent.animations[0], object.parent); action.time = begintime; action.play(); } where hasanim find if object or it's children has anim , , begintime in frame of animation in order play after. i assume way not clean , bit disorder, didn't found other way ... add 3d model has not skinned animations.

javascript - How to make specific validation for an input using jquery? -

i'm trying validate input time 00:00 pm or am. have done 00:00 mask() validation, i'm unable extend validation 00:00 or pm. i tried below code validation. $("#phone").mask("00:00"); but want give permission user put value in (00:00 or pm) format. appreciate if help. thank use selector inputmask validate input $("#phone").inputmask({ mask: "h:s t\\m", placeholder: "hh:mm xm", alias: "datetime", hourformat: "12" }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://rawgit.com/robinherbots/inputmask/3.x/dist/jquery.inputmask.bundle.js"></script> <input type="text" id="phone"/>

android - How to know Vendor ID for Ark Benefit S502Plus smartphone? -

in this tutorial tried connect smartphone android studio on linux mint. how can know vendor id? this page hasn't id ark. sorry bad english , help! :) you can vender id through command lsusb list usb buses , device details, or discover command open terminal , run: lsusb or: discover --vendor-id --model-id usb

php - Insert and select data from MySQL in WordPress Page -

i designing wordpress website, thorough design part, next phase database related things. 1. insert data database. 2. select data , display in page. 3. need create php page if dont want install widget.? need place code? i have googled plugin , got php code widget plugin , inserted 1 of pages widget i tried installing insert_php plugin not working continuing php_code_widget pages-> pages-> home page -> add row -> add widget -> php code widget. now in mysql database have simple table called rituals having 3 columns ritual id-> int -> auto increament. ritual_name-> varchar ritual_active-> varchar. now need insert ritual name database, , reference got code , have put in php code widget window. <?php require_once('../../../wp-load.php'); function insertuser(){ if(isset($_post['submit']){ global $wpdb; $rname=$_post['rname']; $ractive=$_post['ractive']; $table_name = $wpdb->prefix . "mahathiw

c# - About Resizing Buttons on PictureBox -

Image
i have project using a map animation(gif file) on picturebox . on map, have 4 buttons should on main streets. i have problem resizing form. in example, when resize: as can see, button locations incorrect. form layout order : mainform > tablelayoutpanel > panel > picturebox > buttons is there suggestion ? in advance note : when use static image panel instead of picturebox, works. must use gif image. ok if suggest also.

xaml - Xamarin Forms Delay in Navigation -

i’m working on xamarin forms project , stuck issue, want open popups. forms not have in build popups so, have different xaml pages , i’m loading them inside mainpage.xaml , changing visibility when required. **popup_1.xaml** <?xml version="1.0" encoding="utf-8" ?> <stacklayout xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x=http://schemas.microsoft.com/winfx/2009/xaml x:class="abc.views.popup_1"> <stacklayout > <label text="{binding firstname}" verticaloptions="centerandexpand" horizontaloptions="startandexpand" font="large" textcolor="black" /> </stacklayout> </stacklayout> i have many layouts popup_1 want them shown popup. here’s mainpage.xaml here contains 3 popup layouts. **mainpage.xaml** <?xml version="1.0" encoding="utf-8" ?> <contentpagexmlns="http://xamarin.com/schemas/2014/forms" xmlns:x=http

php - MySQL database performance -

i working on project php/laravel , mysql, have table has 20 columns, , in cases of columns empty... performance of application important me, , size of database not... want know impact of empty columns in application performance. thanks , sorry bad engilsh first of all, there huge difference between empty/blank database column , null value column. explained empty column in cases, there chance of low performance, because database needs more , more space accommodate empty values null value. more space means more hardware cost + difficult maintain + less performance. so best way set column type null database ignores field, use less space , thereby high performance if have large number of records , columns. note: mentioned, affect unless have huge load of data, won't affect if number of records comparatively less.

javascript - TypeError: uri.indexOf is not a function -

so i'm new javascript , i'm attempting build web application in node.js. i'm want add user authentication app passport.js. when try start server on command prompt, keep receiving error: typeerror: uri.indexof not function @ checkreplicasetinuri (c:\spectray\node_modules\mongoose\lib\index.js:115:30) @ mongoose.connect (c:\spectray\node_modules\mongoose\lib\index.js:238:40) @ object.<anonymous> (c:\spectray\server.js:15:10) @ module._compile (module.js:570:32) @ object.module._extensions..js (module.js:579:10) @ module.load (module.js:487:32) @ trymoduleload (module.js:446:12) @ function.module._load (module.js:438:3) @ module.runmain (module.js:604:10) @ run (bootstrap_node.js:394:7) @ startup (bootstrap_node.js:149:9) @ bootstrap_node.js:509:3 here's server.js file: var express = require('express'); var app = express(); var port = process.env.port || 8080; var mongoose = require('mongoose'); var passport = require('passport'); va

c# - WPF get all bindings pointing to a property in my model -

i have scenario this <stackpanel datacontext="{binding worldconfig}"> <textbox text="{binding width}"> </stackpanel> i want bindings pointing "width" property of worldconfig object i wrote function bindingutil.getallbindings(worldconfig, "width") but searches through windows find frameworkelement datacontext equals first parameter , searches bindingexpression resolvedsourcepropertyname equals second parameter. , quite inefficient. thought of caching results change bindings in runtime break it. i'm looking more efficient way this. i'm thinking these bindingexpressions must stored in somewhere can query can't find it, search results i'm getting searches how opposite of this.

javascript - Not able to pass object with AngularJS to web backend -

title says all. i'm new i'm sure must simple mistake. here's controller $scope.removeproduct = function(product){ console.log(product._id); var indata = new object(); indata._id = product._id; console.log(indata); $http({ url:"/api/deleteprod/", indata, method: "post" }).then(function () { console.log("got here"); var index = $scope.vehicles.indexof(product); $scope.vehicles.splice(index, 1); }) }; and here's server side. module.exports = function(app, mongoose, config) { app.post('/api/deleteprod', function(req, res){ console.log("in app post",req); var mongoclient = mongodb.mongoclient; var url='mongodb://localhost:27017/seedsdev'; }); }; obviously want pass _id server can work it, when output req it's 50 pages long , has none of info wanted. befor

Stored Procedures and Events Aurora via CloudFormation -

i use cloudformation's aws::rds::dbcluster resource create aurora mysql database cluster. my question is, has created stored procedures events in aurora mysql via cloudformation? possible? delivering these via cloudformation allow me recreate infrastructure without deploying stored procedures , events separately. there's no way configure stored procedures , events aws::rds::dbcluster cloudformation resource directly. my suggestion provision aws::ec2::instance containing userdata script installs mysql client, executes contents of user-provided mysql script creating events/stored-procedures on newly-created db instance.

Passing URL with query parameters as function parameter in JavaScript -

i have url looks like https://go.feeds4.com/merchants/?pid=1676&mid=4261 how pass function parameter. trying pass value not able in function. does & in query paramter cause issues? html <a href="javascript:;" onclick=rendernewmodal(<?php echo '"'.htmlspecialchars_decode($merchant->affiliate_link).'"'; ?>);> <i class="fa fa-angle-right" aria-hidden="true"></i> </a> on view page source, can see following <a href="javascript:;" onclick=rendernewmodal("https://go.feeds4.com/merchants/?pid=1676&mid=4261");> js function rendernewmodal(url) { alert (url); } i don't see alert showing value of url. please help. you have 2 problems: when putting data html document, have encode html not decode from html attribute values need quoting when contain characters (like quotes) mashing strings make javascript literals error

c# - Value was either too large or too small for a UInt64 while deserializing data -

Image
i posting json string method , getting error while deserializing class. error : error converting value -1 type 'system.nullable`1[system.uint64]'. path 'mymappings 1 .mysqlcolumns[7].size'. inner exception : {"value either large or small uint64."} below class in want output after deserializing json value : public class mymappings { public string name { get; set; } public list<mysqlcolumns> mysqlcolumns { get; set; } } public class mysqlcolumns { public string column { get; set; } public string datatype { get; set; } public string isnullable { get; set; } public uint64? size { get; set; } public uint64? numericprecision { get; set; } public uint64? numericscale { get; set; } } string myjson = "mymappings": [ { "name": "dbo.table1", "mysqlcolumns": [ { "name": "address&qu

java - 'mvn -v' work,but'mvn' or 'mvn compile' throw an exception -

i'm new maven. had downloaded , unpacked it. had added bin directory system path. 'mvn -v' work well, see ``` apache maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-15t01:29:23+08:00) maven home: d:\apache-maven-3.2.5\bin\.. java version: 1.8.0_101, vendor: oracle corporation java home: d:\program files\java\jdk1.8.0_101\jre default locale: zh_cn, platform encoding: gbk os name: "windows 7", version: "6.1", arch: "amd64", family: "dos" ``` however, when tried compile java project using 'mvn compile', threw exception. project consists of pom.xml file , 2 java file tutorial https://spring.io/guides/gs/maven/#initial . exception says, ``` e:\code\java\test_maven>mvn compile slf4j: failed load class "org.slf4j.impl.staticloggerbinder" slf4j: see http://www.slf4j.org/codes.html#staticloggerbinder further details. constituent[0]: file:/d:/apache-maven-3.2.5/bin/../lib/aeth

android - Background of fragment dose not change on brodcast receive -

i trying change background of fragment on broadcast receive not change. wanted when user click on button broadcast in order change background of fragment enter image description here menu class : implemented fragment listener , here code implemented function public class menu extends activity implements setting_fragment.setting_fragmentlistener { view frag; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.menu_activity); //hide fragment frag = findviewbyid(r.id.fragment); frag.setvisibility(view.gone); } public void setfragment(view view){ frag.setvisibility(view.visible); } @override public void closefragment(string txt) { if(txt=="close"){ frag.setvisibility(view.invisible); } } @override public void broadcolor(string col) { intent = new intent(); bundle b=new bundle(); b.putstring("col",col); i.putextras(b);

c# - Issue with querying data from mongo for nested elements -

i new mongo db , using c# mongo driver find stuff. below query in robo mongo returns me results. db.getcollection('mycollection'). find ({ "startdatetime":{ $gte : isodate("2016-12-08t00:00:00.0000z") }, "pages.pageevents.pageeventdefinitionid": luuid("dd6a6fdc-a96a-3f42-a824-49uuee741aa9") }); below way writing c# code. startdatetime working. not sure how pages.pageevents.pageeventdefinitionid . pages collection, pageevents further collection inside pages , each pageevent has pagedefinitonid . pages , startdatetime @ same level in document. var builder = new querybuilder<mydata>(); var filter = builder.and(builder.gte(_ => _.startdatetime, datetime.now.adddays(-30))); var results= driver.mycollection.findas<mydata>(filter).select(x => x);

r - Simulating data for multi-level logit model -

i attempting simulate multi-level data (random intercept) testing multi-level bayesian logistic regression model. have done far: n.country <- 42 #number of units obs <- rbinom(n.country, 10, .8) #number of obs. per unit n.obs <- sum(obs) #overall number of obs country <- rep(1:n.country, obs) e.country <- rnorm(n.country,0, 3) #country-specific error e.obs <- rnorm(n.obs, 0, 5) #observation-specific error # continuous independent variables set.seed(666) x1 = rnorm(n.obs) x2 = rnorm(n.obs) x3 = rnorm(n.obs) x4 = rnorm(n.obs) x5 = rnorm(n.obs) x6 = rnorm(n.obs) x7 = rnorm(n.obs) x8 = rnorm(n.obs) #dependent variable l <- 2*x1 + 3*x2 + 1.75*x3 + 2.5*x4 + 1.5*x5 + 3.5*x6 + 0.5*x7 + 1.75*x8 + e.country[country] + e.obs ## prob. of dependent variable described linear ## combination of covariates , country-specific intercepts pr = 1/(1+exp(-l))# pass through inv-logit function y = rbinom(n.obs,1,pr) #dv de

mysql - PHP MySQLi Photo single page -

i have made photo gallery, shows photos mysqli database, when click on link on each photo, must go single page shows photo. index.php $query = mysqli_query($conn, "select * images"); while($row = mysqli_fetch_array($query)) { $id = $row['id']; $image = $row['image']; echo "<td><a href='single.php?id=$id'><img src='$image'></a></td>"; } single.php $id = $row['id']; $query = mysqli_query($conn, "select * images id='$id'"); <?php while($row = mysqli_fetch_array($query)) { $image = $row['image']; echo "<img src='$image'>"; } single.php change first line to $id = intval($_get['id']);

hadoop - cant impersonate on hive server2 -

im trying connect hive server 2 through jdbc connector, im getting error: 'user x cant impersonate y' i added these properties core-site.xml file: <property> <name>hadoop.proxyuser.hive.hosts</name> <value>*</value> </property> <property> <name>hadoop.proxyuser.hive.groups</name> <value>*</value> </property> also, in hive-site.xml have: <property> <name>hive.server2.enable.doas</name> <value>true</value> <description> setting property true have hiveserver2 execute hive operations user making calls it. </description> </property> i have authentication set none , connecting anonymous. have restarted cluster since changing config files running: hadoop fs -chmod g+w /user/hive/warehouse hadoop fs -chmod g+w /tmp can suggest why im still getting error? if trying connect user named anonymous , p

node.js - Understanding mongoose connections in express.js -

i learning express.js using following project: https://github.com/scotch-io/easy-node-authentication/tree/linking in server.js can see , understand following initiates connection database using url database.js: var mongoose = require('mongoose'); var configdb = require('./config/database.js'); mongoose.connect(configdb.url); /app/models/user.js contains following: var mongoose = require('mongoose'); var userschema = mongoose.schema({ local : { email : string, password : string, }, ... } module.exports = mongoose.model('user', userschema); finally /config/passport.js contains: var user = require('../app/models/user'); i can see how passport.js obtabs model user.js failing understand how user.js aware of connection setup in server.js initiated object "mongoose" not exported? what missing? as can see in file index.js @ last line var mongoose = module.exports = e

Htaccess keep images and css -

i have folder structure this: index.php css/style.css images/image.png .htaccess in htaccess i'd add rules in order create url looks like: home/5/6 goes page: index.php?var1=5&var2=6 doing home/5 index.php?var1=5 works in way it: rewritecond %{request_uri} !\.(?:css|js|jpe?g|gif|png)$ [nc] rewriterule ^home/(.*)$ index.php?var1=$1 rewritecond %{request_uri} \.(?:css|js|jpe?g|gif|png)$ [nc] rewriterule ^home/(.*)$ $1 [nc,l] however 2 (or more) variables css , images no longer loading when adding htaccess: rewritecond %{request_uri} !\.(?:css|js|jpe?g|gif|png)$ [nc] rewriterule ^home/(.*)/(.*)$ index.php?var1=$1&var2=$2 rewritecond %{request_uri} \.(?:css|js|jpe?g|gif|png)$ [nc] rewriterule ^home/(.*)/(.*)$ $2 [nc,l] in image , css tags use relative paths only. oke found out of others , here solution: rewritecond %{request_uri} !\.(?:css|js|jpe?g|gif|png||ttf|woff)$ [nc] rewriterule ^home/(.*)/(.*)$ index.php?var1=$1&var2=$2 [nc,l] rewri

Simple HTML single password form -

i preface question with, newbie go easy on me. i trying create simple html form single password field. what happen when type in password take me website same name. example: type in monkey, take monkey.html. it sounds super easy lost. i not find duplicate here form give 404 on wrong password. <form onsubmit="location=this.password.value+'.html'; return false"> <input type="password" name="password" /> </form> the return false stop form submitting. use inline js because issue simple not worth rolling out unobtrusive script e.preventdefault , all.

select only one row from multiple rows MySql -

i have orders table follows: id | cust_id| status 1 25 1 2 25 1 3 25 0 4 26 0 5 26 1 6 26 0 7 27 1 8 27 1 9 27 1 i need 2 queries: 1. fetch 'cust_id' having @ least 1 status 0. eg. in above table should cust_id 2 rows 25 , 26 because have @ least 1 0 in 'status' column. 2. fetch 'cust_id' having status 1. eg. in above table should cust_id 1 row 27 because has 1's in 'status' column. assuming status numeric select distinct cust_id my_table status = 0 select disctint cust_id my_table cust_id not in (select distinct cust_id my_table status = 0 ) these 2 queries .. if need both result in same select can use union select distinct cust_id my_table status = 0 union select disctint cust_id my_table cust_id not in (select distinct cust_id my_table status = 0 )

gcloud - Is there any way to speed up Google Actions SDK development? -

i'm new working google actions sdk, current workflow looks this: make changes app.js. run 'gcloud app deploy', , wait 8-10 minutes operation complete. run 'gactions preview -action_package=action.json -invocation_name="my action"'. run 'gactions simulate' or run web simulator. rinse , repeat. obviously, painful step here gcloud app deployment. there way test changes without having sit through 8-10 minute deployment process each change? host server (node app.js) ever provided it's accessible via https, , update action.json point it: "httpexecution": { "url": "https://example.com/myapp" } then no longer need rely on gcloud. alternatively host locally , make use of ngrok. there's tutorial here: https://developers.google.com/actions/tools/ngrok

python - Matplotlib: Use colormap AND use different markers for different values -

i have bunch of (x,y) points stored in array xy , colouring using third array kmap , using matplotlib's in built cmap option. plt.scatter(xy[:, 0], xy[:, 1], s=70, c=kmap, cmap='bwr') this fine. now, want extra. while continuing use cmap , want use different markers according whether kmap values >0, < 0 or =0. how do this? note: can imagine breaking points, , scatter-plotting them separately, different markers, using if statement. then, don't know how apply continuous cmap these values. separate dataset looks option. keep consistency between colors, may use vmin, vmax arguments of scatter method import matplotlib.pyplot plt import numpy np #generate random data xy = np.random.randn(50, 2) kmax = np.random.randn(50) #data range vmin, vmax = min(kmax), max(kmax) #split dataset ipos = kmax >= 0. #positive data (boolean array) ineg = ~ipos #negative data (boolean array) #plot 2 dataset different markers plt.scatter(x = xy[ipos, 0

java - Why is arraylist's size not right when multiple threads add elements into it? -

why arraylist's size not right when multiple threads add elements it? threadcount = 100; list<object> list = new arraylist<>(); (int = 0; < threadcount; i++) { thread thread = new thread(new mythread(list, countdownlatch)); thread.start(); } class mythread implements runnable { // ...... @override public void run() { (int = 0; < 100; i++) { list.add(new object()); } } } when program done, size of list should 10000. actually, size may 9950, 9965 or other numbers. why? i know why program may raise indexoutofboundsexception , why there nulls in it, not understand why size wrong. i not understand why size wrong? as arraylist not thread-safe 2 threads may add @ same index. 1 thread overwrites.

android - Displaying horizontal recyclerview along with images and text in expandable listview -

click here view image hi want display horizontal recycler view images below text view inside expandable listview shown in image,how can achieve please me,thanks in advance. you can use horizontal recyeclerview & specify layoutmanager horizantal linearlayoutmanager layoutmanager = new linearlayoutmanager(this, linearlayoutmanager.horizontal, false); recyclerview horizontalrv = (recyclerview) findviewbyid(r.id.recyclerviewid); horizontalrv.setlayoutmanager(layoutmanager);

VTK 7.x How to show non ASCII text on TextActor -

environment: ubuntu 14.04 64 bit vtk 7.1 vtk 7.x remove ftgl. https://gitlab.kitware.com/vtk/vtk/merge_requests/660 how show non ascii text now? try code, show nothing: vtksmartpointer<vtktextactor> textactor = vtksmartpointer<vtktextactor>::new(); textactor->setinput("\u5728\u7ebf\u5de5\u5177"); // or textactor->setinput("中文"); any appreciated! thanks vtk developers. vtk supports non ascii text. have specify font file on vtktextproperty -- default fonts in vtk support ascii. the following example use droid font display chinese characters. vtksmartpointer<vtktextactor> textactor = vtksmartpointer<vtktextactor>::new(); textactor->gettextproperty()->setfontfamily(vtk_font_file); textactor->gettextproperty()->setfontfile("/usr/share/fonts/truetype/droid/droidsansfallbackfull.ttf"); textactor->setinput("utf-8 freetype 中文: \xe4\xb8\xad\xe6\x96\x87"); http

mysql - neo4j configuration for junit and passing arraylist instance in cypher query -

this case retrieving data through mysql , save in arraylist object, need same object cypher query ,am running program junit test `public class dummytest { @test @rollback(true) public void checkmysqlconnection() { connection connection = null; resultset tabledatasrsult = null; try { class.forname("com.mysql.jdbc.driver"); properties properties = new properties(); properties.setproperty("user", "root"); properties.setproperty("password", "root"); string url = "127.0.0.1:3306/unicity"; connection = drivermanager.getconnection("jdbc:mysql://" + url, properties); assert.assertnotnull(connection); string sqlq = "select dist_id,pv_date,post_date odh"; preparedstatement preparedstatement = connection.preparestatement(sqlq); tabledatasrsult = preparedstatement.executequery(); arraylist<odhdo> odhdos = new

php - How to display uploaded picture immediately inside submition form (CodeIgniter)? -

i want create form users can add products database. have upload picture , choose couple of options select boxes. far have controller , view working fine - validate both upload , select boxes, set values select boxes if error accoured. however, want users able see uploaded picture , manipulations if necessary (rotate, crop - pretty sure know how not question here) before submitting hole form. the desired steps this: there button "upload picture" or picture gets uploaded automatically. (if there button have change validation settings upload) picture dynamically displayed user ( have ideas how can not test them because of missing first step) user manipulation if user exits before submitting delete uploaded picture (pretty sure can handle one) here code far controller: public function create() { $this->load->helper(array('form', 'url')); $this->load->library('form_validation'); $th

Keras ,Tensorflow Couldn't open CUDA library libcudnn.so. LD_LIBRARY_PATH:? -

i installed cuda 8.0 , copied cudnn file in directory install cuda (gpus on linux) says. i run mnist_cnn.py , got following information: using tensorflow backend. tensorflow/stream_executor/dso_loader.cc:111] opened cuda library libcublas.so locally tensorflow/stream_executor/dso_loader.cc:105] couldn't open cuda library libcudnn.so. ld_library_path: tensorflow/stream_executor/cuda/cuda_dnn.cc:3448] unable load cudnn dso tensorflow/stream_executor/dso_loader.cc:111] opened cuda library libcufft.so locally tensorflow/stream_executor/dso_loader.cc:111] opened cuda library libcuda.so.1 locally tensorflow/stream_executor/dso_loader.cc:111] opened cuda library libcurand.so locally x_train shape: (60000, 28, 28, 1) 60000 train samples and finally traceback (most recent call last): file "mnist_cnn.py", line 65, in <module> model.add(dropout(0.25)) file "/home/nsknsl/.local/lib/python3.5/site-packages/keras/models.py", line 308, in add ou

.net 3.5 - insert multipes rows in one request c# -

in visual studio 2008 create smart device net 3.5, please want insert 5000 in 1 request ,for example "insert group_user select 1,5 union select 2,5 ..." dosent work ,i tried directly in sqlmanagment ready inserted exception (le nombre de valeurs dans la liste de sélection de sous-requête est insuffisant. insert many values ) , sorry english :( please need ! public string addgroupuser(list<groupuser> listgroupuser) { string concatenation = ""; (int = 0; < listgroupuser.count; i++) { int nbreenreg = listgroupuser.count; int idgroup = listgroupuser[i].group_id; int iduser = listgroupuser[i].user_id; int dernierelement = nbreenreg - 1; if (i == dernierelement) { concatenation += " select " + iduser + " ," + idgroup + " "; } else

c# - Wav files not working after conversion of DSS and DS2 file -

in web application need convert dss , ds2 files .wav format done using switch audio converter link http://www.nchsoftware.com/ problem after converting wav format unable play audio files below code used <form id="form1" runat="server"> <div> <audio controls="controls" autoplay="autoplay"> <source src="sounds/dpm317.wav"/> </audio> actually dpm317 in dss format , had converted .wav format after converting has placed thatwav file in application creating folder sounds , placed converted dss file in folder , had placed path in source src not working can me out mistake new this

settings - Change diff font in GitKraken -

Image
i program apl , have been considering switching sourcetree gitkraken. however, have been unable change diff view font. font pretty essential apl, holding move back. is there way change font face (and size) in gitkraken? both official hacky answers welcome. sourcetree, using apl385 unicode font, size 16: gitkraken, using default font: for comparison, here stack overflow's rendering: c←⊃chunk (c1 c2)←{⍵{(1,1↓<\⍵)⊂⍺}'::'⍷⍵}c c2←#.strings.deb 2↓c2 c2←c2{0∊⍴⍺:⍵ ⋄ 0∊⍴⍵:⊂⍺ ⋄ (⊂⍺),⍵}1↓chunk c2←¯2↓∊c2,¨⊂⎕ucs 13 10 r⍪←c1 c2 this tip not font there's zoom icon @ bottom right allows zoom in didn't notice initially. hth.

c# - Npgsql connection string, dynamic database querying -

i have following connection string: npgsqlconnection conn = new npgsqlconnection($"server={_server};port={_port};user id={_userid};password={_password};database={database}"); where database selected collection of countrycodes (gb, us, de etc) , corresponding database queried. the countrycode selected series of methods determine latitude , longitude (utm) lie on map (ie 51.503471, -0.119586 output: gb because it's within bounding box of great britain). lat/lon values passed in user, different each query, , possibly in different countries (and different database). the rest of connection data stays same, server/userid etc not changing, database being queried may change each time user submits lat/lon . is there way hold connection open without specified database in postgres/npgsql , or have reopen (and close @ end of query) connection each time query submitted? no, postgresql connection connection specific database - can't switch database reta

How to add files to Microsoft Word Document using Java -

Image
i implement feature "create object file" of microsoft word document (see below picture more detail) how can add files (support many file types e.g. docx, pptx, xlsx, txt, pdf, jpg, odt, ods, odp, etc.) microsoft word document(.docx) using java? is there library can that? (i can use none-commercial library.) thanks in advance earist

xaml - Ignore horizontal mouse scrolling with nested ScrollViewer -

Image
i have scrollviewer around grid vertically scroll it's content. <scrollviewer> <grid background="{themeresource applicationpagebackgroundthemebrush}"> ... </grid> </scrollviewer> inside of grid have scrollviewer horizontal content. <grid> <scrollviewer name="scrollviewer" verticalscrollmode="disabled" verticalscrollbarvisibility="disabled" horizontalscrollmode="disabled" horizontalscrollbarvisibility="hidden"> ... </scrollviewer> <button name="buttonright" horizontalalignment="right" verticalalignment="stretch" tapped="buttonright_tapped" /> <button name="buttonleft" horizontalalignment="left" verticalalignment="stretch" tapped="buttonleft_tapped" /> <grid> the horizontalscrollmode disabled , horizontalscrollbarvisibility hidden because mou

angular - angular2-jwt token alwas not valid -

so have simple angular 2/laravel app wit jwt authentification support. have service verifies everytime route called if jwt token valid or not using angular2-jwt tokennotexpired() function, function return false reason, user redirected login page. so goes user logs in, token generated backend , saved on local storage, service check if token valid before initiating route using canactivate lifecycle hook. here did far: login component: ... this.http.post(server_url + 'auth', body, { headers: headers } ).subscribe( data => { localstorage.setitem('auth_token', data.json().token); this.authhttp.get(server_url + 'auth/user', headers) .subscribe( data => { this.store.dispatch({ type: set_current_user_profile, payload: data.json().user }); l

php - form validation not working in CodeIgniter -

i'm not able run form validation in codeigniter. not returning errors or submission database. when i'm using $this->form_validation->set_rules('subemail', 'email', 'required|valid_email'); my code gets executed not in below case. why? controller name form_sub : class form_sub extends ci_controller { public function __construct() { parent::__construct(); $this->load->database(); $this->load->library('form_validation'); #loading model $this->load->model('form_model'); $this->load->helper(array("form",'url')); }#eof constructor public function index(){ $this->load->view('form.php'); }//default page public function subscribe(){ echo "hello1"; $config = array( 'field' => 'email',

How to mark mails in Gmail as 'read' and Delete them using Mail::Webmail::Gmail, using Perl script? -

using perl , need read mails in gmail, mark them 'read' , delete them. i have tried below code given in http://search.cpan.org/dist/mail-webmail-gmail/lib/mail/webmail/gmail.pm use mail::webmail::gmail; use data::dumper; $gmail = mail::webmail::gmail->new( username => 'user@gmail.com', password => 'password', ); print dumper $gmail; @labels = $gmail->get_labels(); print dumper @labels; $messages = $gmail->get_messages( label => $labels[0] ); print dumper $messages; not able labels, messages. missing here ? is there other way achieve these tasks in perl. thanks in advance. subhash that module last updated in 2006 , documentation says: because gmail in beta testing, expect module break make updates thier interface. attempt keep module in line changes make, but, if after updating newest version of module, feature require still doesn't work, please contact me issue. you try contacting author, ten years since

c++ - Is the HEAP a term for ram, processor memory or BOTH? And how many unions can I allocate for at once? -

i hoping had schooling lay down whole heap , stack ordeal. trying make program attempt create 20,000 instances of 1 union , if day may want implement larger program. other current project consisting of maximum of 20,000 unions stored ever c++ allocate them think anti millions while retaining reasonable return speed on function calls, approximately 1,360,000 or so? , how think handle 20,000? heap area used dynamic memory allocation. it's used allocate space variable collection size, and/or allocate large amount of memory. it's not cpu register(s). besides think there no guarantee heap is. this may ram, may processor cache, hdd storage. let os , hardware decide in particular case.

c# - InvalidOperationException when SOAP webservice - but working on dev machine -

i have webservice class inherits soaphttpclientprotocol [webservicebinding(name = "gp_ws_mysoap", namespace = "https://www.xxx/yyy/")] internal class webservicenestle : soaphttpclientprotocol { public webservicenestle(string surl) : base() { url = surl; } [soapdocumentmethod("https://www.xxx/yyy/test", requestnamespace = "https://www.xxx/yyy/", responsenamespace = "https://www.xxx/yyy/", use = soapbindinguse.literal, parameterstyle = soapparameterstyle.wrapped)] public xmlnode test(string a, int b) { var results = invoke("test", new object[] { a, b }); return (xmlnode)results[0]; } } on development machine, webservice call works, on production, exception " system.invalidoperationexception : xml element named '' namespace" namespace present in current scope: the stacktrace of exception is: system

office365 - LTR Direction - office 2016 -

i want office 2016 (english installation) in left right direction, all office software(word,excel, outlook ans so.. opens in right-to-left direction . i tried change file->options->advanced->show document content-> marked left-to-right view. checked in office tools , default language english. updateed 3.4.2017 in excel succeed vba command post: ltr excel vba . in rest of office didn't succeed. in word succeed using save new tamplet , use default templet. on outlook didn't found solution. as @siha mentioned office takes localization settings os -> chnged localization settings , didn't work. as @siha mentioned office takes localization settings os -> chnged localization settings english. then i: delete office. restart pc. install office. open office (all need) works great. returned local setting language. thanks @shia