Posts

Showing posts from July, 2012

php - Passing $_POST to Db Class Without any Processing -

i trying pass $_post global variable directly database through mysqli_real_escape_string without processing... here code working fine. what possible problem arising due type of coding? what security risks? is shortcut or there still more...??? class db{ ... more ... public function insert($args=array()){ if(!isset($args['table']) || !isset($args['values'])){ return false; } $table=$args['table']; $values=$this->process_insert($args['values']); $query="insert {$table} {$values}"; $result=$this->query2db($query); //method returns mysqli_query() if($result){ return true; }else{ return false; } } protected function process_insert($data=array()){ $values=""; $fields=""; $glue=", "; if(isset($data)){ foreach($data $key=> $value){

ios - Create and custom one UIButton for multiple data -

Image
i have array of content follow: array = [name1,name2,name3...] and want display these content on label of button. problem hardcore if array have many item , dont want create many button that. please can me findout way generate 1 common button instance these data. if array have 2 item, view display 2 buttons , on... thank much! p/s: problem solved @janmenjaya answer, here code, still have little bit stuck y position. func displayfilelist() { in 0..<fileidlist.count { let yref : cgfloat = 35 let title = string(fileidlist.indexof(i)) let button = uibutton(frame: cgrect(x: 0, y: yref * cgfloat(i), width: 919, height: 30)) button.settitle(title, forstate: uicontrolstate.normal) button.settitlecolor(uicolor.blackcolor(), forstate: uicontrolstate.normal) button.backgroundcolor = uicolor.yellowcolor() button.layer.borderwidth = 1; button.layer.bordercolor = uicolor.blackcolor().cgcolor self.filebuttoncon

qt - ListView exceeding parent area -

this question has answer here: hide highlight of listview while scrolling 1 answer i'm using listview , i'm loading onto rectangle . while scrolling content or down content not correctly hidden , remains visible user. can me on issue? as reported documentation : note: views do not enable clip automatically . if view not clipped item or screen, necessary set clip: true in order have out of view items clipped nicely. hence, experiencing common behaviour , should either 1) clip view via other item s (e.g. header rectangle , footer rectangle z:infinite or set clip property true , i.e. listview{ //... clip:true //... } clipping has perfomance disavantages can affect application grows. hence, usage, outside views scenario, should evaluated carefully.

java - Special characters in xml when transforming from document to clob -

i pass xml in clob oracle java source, signs xml , returns result, returned result contains special characters. f.e. input xml: <a>žė</a> output xml: <a>&#382;&#279;</a> if try print out result in java there's no special characters, in oracle these. if character stream first clob, , assign result clob, there's no special characters, appear when transform document clob. code reproduce: create or replace , compile java source named test_encoding import java.io.bufferedreader; import java.io.bytearrayinputstream; import java.io.bytearrayoutputstream; import java.io.fileinputstream; import java.io.inputstream; import java.io.inputstreamreader; import java.io.reader; import java.io.bufferedreader; import java.io.writer; import java.io.stringwriter; import java.security.*; import java.security.cert.x509certificate; import java.sql.clob; import java.sql.connection; import java.sql.drivermanager; import java.sql.preparedstatement; impor

android - Hello World App crashing in Cordova 6.4.0 -

Image
i new cordova , can't cordova "hello world" application display on android emulator can run same app in browser successfully. can run app in online cloud emulators. cordova version : 6.4.0 nodejs : 4.6.1 ubuntu : 14.04 64bit this android virtual device settings this stacktrace when trying run hello world app. [ 11-08 08:45:27.115 3256: 3256 w/google-breakpad ] ### ### ### ### ### ### ### ### ### ### ### [ 11-08 08:45:27.115 3256: 3256 w/google-breakpad ] chrome build fingerprint: [ 11-08 08:45:27.115 3256: 3256 w/google-breakpad ] 1.0.0 [ 11-08 08:45:27.115 3256: 3256 w/google-breakpad ] 10000 [ 11-08 08:45:27.115 3256: 3256 w/google-breakpad ] 3874b69a-4a70-400e-94db-0744eafe8cbf [ 11-08 08:45:27.115 3256: 3256 w/google-breakpad ] ### ### ### ### ### ### ### ### ### ### ### [ 11-08 08:45:27.115 3256: 3256 f/libc ] fatal signal 6 (sigabrt), code -6 in tid 3256 (m.example.hello) [

html - getContext('2d') returns null in Safari 10 -

i cannot reproduce problem on our macbook's have logs users. problem when try use of rendering methods on canvasrenderingcontext2d crashes because it's null. so have canvas element, has getcontext method return null. short list of checked potentials: the canvas element created, existing, has positive size , has getcontext method getcontext call executed after page loading (onload listener) there no other calls of getcontext other parameters ('webgl' example) in getcontext('2d') '2d' string in lower case this problem reproducing on safari 10 in cases error occurs not after page load after user actions. mean canvas destroyed , re-created times, , worked. i'm not sure if relevant situation described here, had similar situation able solve. perhaps helps down line. gist of problem browsers deal html5 canvases quite differently. in particular, amount of memory willing allocate canvases en total , individual canvases (con

theorem proving - Relationship between existential and universal quantifier in an inductive Coq definition -

suppose want inductive definiton of substring (with string being synonym list). inductive substring {a : set} (w : string a) : (string a) -> prop := | ss_substr : forall x y z : string a, x ++ y ++ z = w -> substring w y. here can example prove following: theorem test : substring [3;4;1] [4]. proof. eapply ss_substr. cbn. instantiate (1:=[1]). instantiate (1:=[3]). reflexivity. qed. however, proof "existential" rather "universal", in spite of fact inductive definition states forall x y z , constrains shapes. seems unintuitive me. gives? also, possible make inductive definition using exists x : string a, exists y : string a, exists z : string, x ++ y ++ z = w -> substring w y ? one important thing note exists not built-in functionality of coq (contrary forall ). actually, exists notation, behind there inductive type named ex . notation , inductive type defined in co

php - Enter value of user_id in another table according to user login session -

<?php session_start(); include_once 'dbconnect.php'; $error = false; if( isset($_post['btn-classroom']) ) { $classroom_name = trim($_post['classroom_name']); $classroom_name = strip_tags($classroom_name); $classroom_name = htmlspecialchars($classroom_name); $users_id = $_session['users']; if(empty($classroom_name)){ $error = true; $classroom_nameerror = "please enter classroom name."; } if(!error){ $query = "insert classroom (classroom_name, users_id) values('$classroom_name', '$users_id')"; $result = mysql_query($query); if($result){ $errtyp = "success"; $errmsg = "classroom created!"; unset($classroom_name); } else{ $errtyp = "danger"; $errmsg = "something went wrong, try again later..."; } } } ?> <!doctype html> <html> <head> <title&

c# - Unit Tests in Visual Studio 2015 don't run -

neither integrated test environment nor resharper won't run unit tests. when starting visual studio test output pane shows 10+ lines stating: an exception thrown while initializing part "microsoft.visualstudio.testwindow.controller.testplatformprovider". this i've tried far: clear folder %localappdata%\microsoft\visualstudio\14.0\componentmodelcache create simple test project 1 class library, 1 class , 1 test library containing 1 unit test class uninstallation , new installation of visual studio 2015 all actions didn't fix problem. simple test won't run. running tests command line using mstest work. ensure anti-virus programs not quarantining visual studio components. i had problem when our corporate department changed our sophos protection quarantine policy. vs2015 unit testing stopped working everyone, similar error.

oracle - Date Conversion from M20161 to Jan16 -

how convert m20161 jan-16 in oracle 2016 year , 1 month. if "m" literal going present, enclose in double quotes in format mask. since there no day part it'll default first day of month. select to_date('m20161', '"m"yyyymm') res dual result: res --------- 01-jan-16 to display date in desired jan-16 format, use to_char() function , mon-yy format model. select to_char(to_date('m20161', '"m"yyyymm'), 'mon-yy') res dual result: res ------ jan-16

json - @JsonIgnore doesn't work in Scala case class -

i have simple case class case class project(@jsonignore id: option[uuid], name: option[string]) i using com.fasterxml.jackson com.fasterxml.jackson.core:jackson-databind:2.8.4 com.fasterxml.jackson.core:jackson-annotations:2.8.4 org.skinny-framework.com.fasterxml.jackson.module:jackson-module-scala_2.12:2.8.4 ... private val mapper = new objectmapper() mapper.registermodule(defaultscalamodule) mapper.configure(deserializationfeature.fail_on_unknown_properties, false) mapper.writevalueasstring(project) writes id resulting json despite @jsonignore what doing wrong? update: a current workaround: @jsonignoreproperties(array("id")) case class project(id: option[uuid], name: option[string]) this works :)

Why is MySQL select returning different result for the same value depending if it is quoted -

while querying table of products this: select product_id products product_id = 1701114; i 2 rows result: 1701114 , 1701114b. but after adding single quotation marks this: select product_id products product_id = '1701114'; i expected single row result. product_id column primary key of varchar type , unquoted value digital may cause, it's quite surprising equality sign changes 'like' your column product_id varchar column. bad idea compare integer ( 1701114 ) rather string ( '1701114' ). what happens mysql silently converts product_id values numbers in order compare them 1701114 . '1701114b' no number , should not convertable number, raise error, in opinion. however, mysql developers have decided convert nonetheless starting left right , going far possible. convert '1701114b' 1701114 , hence unexpected match.

Compile Less files in Sass Gulp task -

in projects have several files - sass, less & css. need solution on how compile , assemble everything. it important can determine order. it may be, in area " plugins " (see source file) less file added . need support less? here current setup (without less): source file: (master.scss) // variables @import "../scss/_variables.scss"; // frameworks // google font @import "https://fonts.googleapis.com/css?family=open+sans:400,300,600,700"; @import "https://fonts.googleapis.com/css?family=oswald:400,300,700)"; // icon font @import "bower_components/font-awesome/scss/font-awesome.scss"; // bootstrap @import "bower_components/bootstrap/scss/bootstrap.scss"; // plugins // swiper - modern touch slider @import "/bower_components/swiper/dist/css/swiper.min.css"; // lightgallery - customizable, modular, responsive, lightbox gallery

google chrome - Link to local file on locally run page not working -

i have jsp contains link local file: <a href="file:///f:/sp64647/examples/dynamic_diff/data/actionsourcedriver/summary.txt">link</a> on clicking link following error: not allowed load local resource: file:///f:/sp64647/examples/dynamic_diff/data/actionsourcedriver/summary.txt copying link browser works perfectly. but clicking on link doesn't anything. right-clicking , opening in new tab or new window doesn't work. i trying chrome.

Android Studio Element above another -

i started "programming" in android studio , can't make 1 element above one. <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" android:paddingbottom="@dimen/activity_vertical_margin" tools:context="com.example.krzysztofbzoma.minutnik.mainactivity"> <textview android:id="@+id/dwukropek" android:layout_width="wrap_content" android:layout_height="wrap_content"

javascript - How to reload a dynamic content using script -

i have page contains dynamic data, i'm trying reload particular <p></p> only. html <p id="spa<?php echo $id; ?>"></p> my script this $("#spa" + id).load(location.href + " #spa" + id); but it's not working, appreciated. following shows how add new script tag script reload <script language="text/javascript"> function load_js() { var head= document.getelementsbytagname('head')[0]; var script= document.createelement('script'); script.type= 'text/javascript'; script.src= 'source_file.js'; head.appendchild(script); } load_js(); </script> the main point inserting new script tag -- can remove old 1 without consequence. may need add timestamp query string if have caching issues.

r - GA-Algorithm returning "non-numeric argument to binary operator" when parallel computing -

for reason ga algorithm returns "non-numeric argument binary operator" when use option parallel = true. optimization algorithm seems works without option or when setting parallel = false. have installed neccessary packages , date. r version work 3.3.2 on 64bit machine. i calling function within function try optimize. code below simple example of general structure of problem returns same error code. fun_in <- function(a, b, c, d, e) { return(a + b + c + d + e) } fun_out <- function(a, b, c, d, e, f, g) { x <- f +g y <- fun_in(a = a, b = b, c = c, d = d, e = e) z <- x + y return(z) } library('ga') <- 1 b <- 1 c <- 1 d <- 1 e <- 1 f <- 1 g <- 1 fitness <- function(x) -fun_out(a, b, c, d, e, f, g) lower_bound <- c(1,1,1,1,1,1,1) upper_bound <- c(5,5,5,5,5,5,5) coef_names <- c('a', 'b', 'b', 'd', 'e', 'f', 'g') ga <- ga(type = "real-valued&quo

jquery - Bootstrap-Table Plugin, Filter by initial filter value -

in bootstrap-table plugin , colud use code default search input: data-search-text= "custom text" it works. i use extension plugin.( filter control ) how can initial filter value it?

css - Bootstrap design with white space both side -

i using bootstrap design webpage. since many people uses large screens prefer webpages content centered white space on both sides. example page: https://www.nhstateparks.org/visit/state-parks/dixville-notch-state-park.aspx i have tried make design this: <div class="container-fluid text-center"> <div class="row content"> <!--uses offset white space on left --> <div class="col-sm-2 col-md-offset-2"> sidebar links </div> <div class="col-sm-6"> main content </div> <div class="col-sm-2"> <!--this added white space on right --> </div> </div> </div> but want page behave page do. when shrink page, "use" blank space on left , right before start scale content. see stackoverflow.com this. not start sca

android - ObservableParcelable<String> is not working -

in official documentation see use of observableparcelable string this: public final observableparcelable<string> name = new observableparcelable<string>(); but since string not implement parcelable there no possibility of being compiled. how can make object extend baseobservable , have observable fields , parcelable @ same time? you can save not parcelable fields, example: public class viewmodel extends baseobservable implements parcelable { private observablefield<string> title = new observablefield<>(); private observableint count = new observableint(); private viewmodel(parcel parcel) { title.set(parcel.readstring()); count.set(parcel.readint()); } @override public int describecontents() { return 0; } @override public void writetoparcel(parcel parcel, int flags) { parcel.writestring(title.get()); parcel.writeint(count.get()); } public s

ios - Adjust Quality while streaming video with AVPlayer -

how can able set low or high quality video withstreaming video avplayer? my code follow: self.videoplayeritem = [avplayeritem playeritemwithurl:videourl]; videoplayer = [avplayer playerwithplayeritem:self.videoplayeritem]; videoplayer.actionatitemend = avplayeractionatitemendnone; cgrect frame = self.frame; videoplayerlayer = [avplayerlayer layer]; [videoplayerlayer setplayer:videoplayer]; [videoplayerlayer setvideogravity:avlayervideogravityresizeaspectfill]; thanks time you can lower video quality/bitrate setting avplayeritem 's preferredpeakbitrate . re-set 0 usual "highest quality/bitrate supported connection" behaviour. n.b. bitrate less or equal preferredpeakbitrate must available work, e.g. in hls stream.

sql - How to add decode inside of the WHERE condition? -

the inside of decode add condition? example: where decode (id, 'a', name not in ('b'), name not in('c') so please give solution... maybe can change in this, without having use decode (id='a' , name not in ('b')) or name not in ('c')

http headers - Efficient way to inspect Cookie creation in real time -

i want inspect happens cookies when browse website, in order figure out how website track data. i guess can use chrome developer tools, , use network tab, , within each http requests one-by-one (there 100 of them) , check cookie tab , "response cookies", right? is there easier way this? tool see cookies being created / changed?

verilog - Scope of `define macros -

this question regarding system verilog macros. have top-module, sub-module , sub-sub module. sub-sub module instantiated in sub-module instantiated in top module. if define macro `define abc in sub module, code written inside `ifndef abc gets compiled in top module/sub-sub module the scope of `define macros , other compiler directives compilation unit . compilation unit stream of source text compiler parses. macro gets defined @ point appears in compilation unit , visible point onward. the scopes defined modules , other namespaces irrelevant because macros pre-processed before verilog or systemverilog syntax gets recognized. means can never have instance specific control on macro definitions. there sight difference between how verilog , systemverilog define compilation unit. in verilog, each compilation unit compilation step, or 1 invocation of tool compiles source code. tools have 1 compilation step, requiring compile source code in 1 step. other tools (e.g.

c# - How to insert text box value in database on combo box selected item? -

i designed 1 login form , in used combobox1, textbox1, textbox2 , button. when select "admin" in combobox username , password in textbox1 , textbox2 checked admin table in database if username , password correct show admin form. how can this? code: private void button1_click(object sender, eventargs e) { if (combobox1.selectedtext == "admin") { sqlcommand cmd = new sqlcommand("select * admin"); sqldatareader dr = cmd.executereader(); if (dr.read()) { textbox1.text = dr["username"].tostring(); textbox2.text = dr["password"].tostring(); admin ad = new admin(); ad.showdialog(); } } } based on code you're trying set value of textbox1 , textbox2 from values have in database. i'm guessing you're trying check if they're equal? if you're better off modifying query returns details admin base

kernel PCA with Kernlab r , out of memory error -

trying apply kernel pca kernlab in r on 12*250,000 data set kpc <- kpca(~.,csv.data,kernel="rbfdot",kpar=list(sigma=0.2),features=2) getting bellow error error: cannot allocate vector of size 604.1 gb in addition: warning messages: 1: in crossprod(t(x)) : reached total allocation of 16305mb: see help(memory.size) 2: in crossprod(t(x)) : reached total allocation of 16305mb: see help(memory.size) 3: in crossprod(t(x)) : reached total allocation of 16305mb: see help(memory.size) 4: in crossprod(t(x)) : reached total allocation of 16305mb: see help(memory.size) any suggestion how can manage run algorithm on such large data set? thanks.

javascript - Get image data from DOM -

i making extension grabs image website , upload our server , here problem if trying upload 1000-2000 images targeted website gives 429 while making file object since have made 1000 request load images in dom & again reading make file object, there way grab image data loaded in dom without making 1 more request ? example: suppose trying grab images google, first show images in dialog box (generated extension) gives user choice select/unselect images want upload, on submit generate file object , send server. so here making 3 requests, first making request load images on website itself, grab image url , load in dialog box @ last read make file object, there way in single request?

machine learning - Why do Recurrent Neural networks need dataset iterators to prepare data -

i have problem why recurrent neural networks need dataset iterators prepare data. can please explain reason. in recurrent neural network complete dataset sequence, every sample neural net must provide output. they commonly used in time series. imagine 4 sensors in person (in hands , legs) , have predict state of person (walking, running, falling, ...) data1 (x1,x2,x3,x4) -> running data2 (x1,x2,x3,x4) -> running data3 (x1,x2,x3,x4) -> running data4 (x1,x2,x3,x4) -> falling data5 (x1,x2,x3,x4) -> falling data6 (x1,x2,x3,x4) -> in floor data7 (x1,x2,x3,x4) -> in floor .... it hard predict label see single data, if see sequence (current , past data) task easier. the iterator provide order see data.

mvvm - Sub-modules within a Region in WPF Prism -

Image
i have 3 modules within wpf application (module a, b , c). module c has sub-modules (c1, c2, ..., c5). in fact, module c it's "container" sub-modules, not sure if module c module. wondering best design following prism approach. @ moment solution schema: prismmodularapp - app.config - app.xaml - bootstrapper.cs - shell.xaml prismmodularapp.controls prismmodularapp.infrastructure - regionnames.cs prismmodularapp.modules.a - aviewmodel.cs - anavigationitemview.xaml - aview.xaml - amodule.cs prismmodularapp.modules.b - bviewmodel.cs - bnavigationitemview.xaml - bview.xaml - bmodule.cs prismmodularapp.modules.c - cviewmodel.cs - cnavigationitemview.xaml - cview.xaml - cmodule.cs my shell has 2 regions: maincontentregion , mainnavigationregion: every module has 2 views (xnavigationitemview , xview) 1 mainnavigationregion , other 1 maincontentregion the module c (the 1 told container sub-modules c1, c2, ... c5) has area in maincontentregion sub-na

asp.net - Apply a CSS generic fix for RDLC's -

i experiencing issue rdlc's in microsoft edge. vertical scroll disappears in browser, in chrome/firefox , ie9 or lower fine. i have had thought use conditional statements have found out edge not support this. i want apply overflow-y:auto rdlc's if microsoft edge in use , if not, not apply. does know how so? im using asp.net/c#.

c# - How to show button in gridview if a column empty -

in application have 1 editable column , if editable column empty need show add link button displays edit link button.how can display add link button if particular editable column in gridview empty <asp:templatefield> <itemtemplate> <asp:button visible='<%# string.isnullorempty() %>' runat="server" text="edit" id="edit" commandname="edit" /> <asp:button visible='<%# !string.isnullorempty() %>' runat="server" text="add" id="add" commandname="edit" /> </itemtemplate> </asp:templatefield> i tried working unable edit the easiest way add templatefield gridview 2 buttons have visibility based on column value. <asp:templatefield> <itemtemplate> <asp:button visible='<%# string.isnullorempty(eval("editablefield").tostring()) %>' runat="server"

java - Spark's serialization -

i have own .jar , want .jar deployed spark. got have problems new code in "numberformat" , "locale" java clasess used global variables: private numberformat machinelocale private locale locale if include new code , try deploy in spark following error: caused by: org.apache.spark.sparkexception: job aborted due stage failure: task 1 in stage 1.0 failed 4 times, recent failure: lost task 1.3 in stage 1.0 (tid 9, sparkslave4.local): java.io.ioexception: com.esotericsoftware.kryo.kryoexception: error during java deserialization. serialization trace: locale (java.text.decimalformatsymbols) symbols (java.text.decimalformat) numberformat please, can give me clue? how have deal these classes? lot

javascript - How to check if variable is of type function Number() or function String() js -

in javascript. how can test if variable equal function number() or function string() . i reading react prop schema definition type set property. have this.props.fieldtype function number() or function string() . i have tried: if(this.props.fieldtype instanceof number) and if(object.getprototypeof(this.props.fieldtype) === number.prototype) according instanceof description not work. not sure why. trying check if property has value of function number() of function string() if literally mean the functions number or string , use == (or === ): if (this.props.fieldtype === number) { if mean "is number" or "is string", use typeof , not instanceof : if (typeof this.props.fieldtype === "number") { if mean "is object created via new number " (which unusual) instanceof want: if (this.props.fieldtype instanceof number) { examples of three: var props = { numberfunction: number, number: 42, n

Timeranges overlapping algorithm in Python -

Image
i have list of different ids, start dates , end dates, let's : [ (5, d.datetime(2010, 9, 19, 0, 0, 0), d.datetime(2010, 9, 19, 0, 5, 10)), (6, d.datetime(2010, 9, 19, 0, 0, 0), d.datetime(2010, 9, 19, 12, 59, 59)), (4, d.datetime(2010, 9, 19, 10, 30, 17), d.datetime(2010, 9, 19, 20, 20, 59)), (6, d.datetime(2010, 9, 19, 14, 12, 0), d.datetime(2010, 9, 19, 23, 59, 59)), (5, d.datetime(2010, 9, 19, 17, 0, 22), d.datetime(2010, 9, 19, 19, 14, 20)) ] i need somehow find overlapping timerange , prepare new list ids under coverage @ specific timerange, example list above result should : [ ('5,6', d.datetime(2010, 9, 19, 0, 0, 0), d.datetime(2010, 9, 19, 0, 5, 10), ('6', d.datetime(2010, 9, 19, 0, 5, 10), d.datetime(2010, 9, 19, 10, 30, 17), ('4,6', d.datetime(2010, 9, 19, 10, 30, 17), d.datetime(2010, 9, 19, 12, 59, 59), ('4', d.datetime(2010, 9, 19, 12, 59, 59), d.datetime(2010, 9, 19, 14, 12, 0), ('4,6', d.dat

xamarin.forms - xamarin compilation error : no resource found -

i using xamarin forms(portable) , after updating xamarin.forms version 2.3.2127 nuget started getting compile time error. list of error follows error error retrieving parent item: no resource found matches given name 'widget.appcompat.actionbutton'. error error retrieving parent item: no resource found matches given name 'theme.appcompat.light.darkactionbar' error error retrieving parent item: no resource found matches given name 'theme.appcompat.light.dialog'. error error retrieving parent item: no resource found matches given name 'widget.appcompat.light.actionbutton'. error no resource found matches given name: attr 'coloraccent'. error no resource found matches given name: attr 'coloraccent'. error no resource found matches given name: attr 'colorprimary'. error no resource found matches given name: attr 'colorprimarydark

Icon not found build Electron App -

i have package.json { "name": "app", "version": "1.0.0", "description": "description", "main": "main.js", "scripts": { "start": "electron .", "pack": "build --dir", "dist": "build" }, "author": "author", "license": "cc0-1.0", "devdependencies": { "electron": "^1.4.1" }, "build": { "appid": "myid.1", "mac": { "category": "type.type" }, "win": { "iconurl": "https://www.google.it/images/branding/product/ico/googleg_lodp.ico" } }, "dependencies": { "jquery": "^1.7.4" } } but when build --win return me warning: warning: application icon not set, default electron icon

Empty request sent when querying on NEST 5.0.0-rc1 -

the problem no matter query i'm building, never sent elasticsearch. instance one: _elasticclient.searchasync<costsearch>(d => d.query(q => q.match(f => f.field(c => c.agencytrackingno == costquery.query)) ) ); the request sent empty object, means i'm getting values index , type. can check on following logs: [11:47:36 inf] post http://localhost:9200/costs/costsearch/_search request: {} status: 200 {"took":1,"timed_out":false,"_shards":{"total":1,"successful":1,"failed":0},"hit s":{"total":1,"max_score":1.0,"hits":[{"_index":"costs","_type":"costsearch","_i d":"1","_score":1.0,"_source":{ "id": "-0897-98df7-df8-96", "title": "test cost", "budget":

python - Need assistance with sentence analysis -

my code takes sentence , finds given word in sentence. if word in sentence needs has found word , positions said word in. if word not in sentence should display error message. i have this: print("please insert sentence without punctuation") sentence=(input()) variable1='sentence' print("which word find in sentence?") word=input() variable2='word' if 'word'=='country': 'variable3'==5 'variable4'==17 if word in sentence: print([word], "is in positions", [variable3], "and", [variable4]); else: print("your word not in sentence!") i want deal misunderstandings in presented code. first, print("please insert sentence without punctuation") sentence=(input()) is simpler sentence = input("please insert sentence without punctuation") now have variable called sentence wihich should not muddled string 'sentence' similarly can

java - Having trouble generating WebService artifacts -

i'm having trouble generating message , response artifacts web service. meet error in cmd when try: c:\users\kingmarkmcc\workspace\webservicejx>wsgen -cp -keep . webserviceimp option "-classpath" requires argument here webserviceinterface : package cacheserver; import javax.jws.webmethod; import javax.jws.webservice; import javax.jws.soap.soapbinding; import javax.jws.soap.soapbinding.style; @webservice @soapbinding(style= style.document) public interface webserviceinterface { @webmethod object get(object k); @webmethod void put(object k, object v); @webmethod void remove(object k); @webmethod void flush(); @webmethod int size(); } and below implementation of webservice package cacheserver; import java.util.linkedhashmap; import java.util.map; import javax.jws.webservice; @webservice(endpointinterface = "cacheserver.webserviceinterface") public class webserviceimp implements webserviceinterface{ cachedatast

c# google Contact api Insert contact without permission -

c# google contact api, want register users in google contact list. issue each time when save contact google asks permission. using below code in asp.net website want use web.api. protected void page_load(object sender, eventargs e) { if (request.querystring["code"] != null) getaccesstoken(); } protected void googlebutton_click(object sender, eventargs e) { /*https://developers.google.com/google-apps/contacts/v3/ https://developers.google.com/accounts/docs/oauth2webserver https://developers.google.com/oauthplayground/ */ string clientid = "yourclientid"; string redirecturl = "http://www.yogihosting.com/tutorialcode/googlecontactapi/google-contact-api.aspx"; response.redirect("https://accounts.google.com/o/oauth2/auth?redirect_uri=" + redirecturl + "&response_type=code&client_id=" + clientid + "&scope=https://www.google.com/m8/feeds/&approval_prompt=force&access_t

php - How to retrieve file id from google drive file URL -

i have url of file, details of file, file_id required? there way retrieve file_id url.i'm looking like $driveservice->files->getfileidfromurl($url) apparently google doesn't provide explicit interface, using regex extract id string best bet. see easiest way file id url on google apps script how javascript. regexes available in php. can test php regexes @ http://www.phpliveregex.com/

safari - How to generate the Apple certificate properly? -

i've followed tutorial on this website if want save results message prevents me saving results: 1 error prohibited sender being saved: apns certificate or private key not valid but why error? i've tried couple of methods, placing -----begin certificate----- , placing without it, nothing works. i've created couple of certificates each 1 false according error. have forgot do? placing -----begin certificate----- , placing without it, nothing works. you must copy , paste whole content of files, including -----begin certificate----- , ----- end certificate----- . but why error? you have done error in 1 of steps: error means certificates not valid. not valid in general (e.g. malformed, etc.): not specific related push notifications, apns or pushpad. if know ruby, can see exception raised certificates running following snippet: private_key = openssl::pkey.read apns_private_key certificate = openssl::x509::certificate.new ap

java - DeepLearning4J IllegalArgumentException for CNN with custom Matrix -

i have custom 7(height) , 24(width) matrix input used training. output labels age ( young, mature, old). go deeplearning4j convolutional neural networks. after building basic convolutional neural network first training item gives following error , have no clue about. exception in thread "main" java.lang.illegalargumentexception: invalid size index 2 wher it's >= rank 2 @ org.nd4j.linalg.api.ndarray.basendarray.size(basendarray.java:4066) @ org.deeplearning4j.nn.layers.convolution.convolutionlayer.preoutput(convolutionlayer.java:192) @ org.deeplearning4j.nn.layers.convolution.convolutionlayer.activate(convolutionlayer.java:247) @ org.deeplearning4j.nn.graph.vertex.impl.layervertex.doforward(layervertex.java:88) @ org.deeplearning4j.nn.graph.computationgraph.feedforward(computationgraph.java:983) @ org.deeplearning4j.nn.graph.computationgraph.computegradientandscore(computationgraph.java:889) my dl4j code //model config here multilayerconfiguration.builder bu

php - Method result is null when using ajax call yii2 -

here controller: public function actionusagereport($from = 0, $to = 10) { $service = new service; $ibs_username = yii::$app->user->identity->services[0]->ibs_username; $results = $service->fetchuserconnections($ibs_username, $from, $to); foreach ($results $index => $result) { $usages[$index]['login_time_formatted'] = $result['login_time_formatted']; $usages[$index]['logout_time_formatted'] = $result['logout_time_formatted']; $usages[$index]['duration_seconds'] = $result['duration_seconds']; $usages[$index]['bytes_in'] = $result['bytes_in']; $usages[$index]['bytes_out'] = $result['bytes_out']; $usages[$index]['credit_used'] = $result['credit_used']; $usages[$index]['remote_ip'] = $result['remote_ip']; } if (yii::$app-

android - adb: error: remote object '/data/data/com.me.myproject' does not exist -

1. added adb path ~/.bash_profile export path="/users/myname/library/android/sdk/platform-tools:$path" 2. logged in emulator adb -s emulator-5554 shell 3. changed permission of app folder , parent folder chmod 777 /data/data/com.me.myproject chmod 777 /data/data 4. still can not stuff outside. why? adb -s emulator-5554 pull /data/data/com.me.myproject i have same problem , don't know how resolve, , did this: adb shell , run-as package (not rooted device) cp 'database/xx.db /sdcard/xx.db' adb pull /sdcard/xx.db

javascript - (function(){}) vs function(){}(); -

this question has answer here: difference between (function(){})(); , function(){}(); [duplicate] 3 answers location of parenthesis auto-executing anonymous javascript functions? 4 answers consider following 2 examples: first: var x = (function(){ return 786; }()); second: var y = function(){ return 786; }(); i know can't use function(){ return 786; }(); directly anoomymus self calling function since assigining variable x can use function. so, is there difference in result of behaviour of variable x in first , second method? no. there wouldn't difference. wrapping function in parentheses converts them function declaration expression , ok valid expression run on own. var x = (function(){ return 786; }()); here, anonymous fun

c# - ILSpy , NRefactory 'System.ArgumentException' -

i'm trying use dlls ildecompile 1 project, works fine of dlls i've tried decompile others i'm getting following error: unhandled exception of type 'system.argumentexception' occurred in icsharpcode.nrefactory.csharp.dll i know error means have not find way fix/go around (since it's in dll). i have used ildecompile , same dll throws above error works fine. can see in code of ilspy (that's using same dll) following piece of code: if (child.parent != null) { throw new argumentexception("node used in tree.", "child"); } this have ... static string decompile(string pathtoassembly) { string assemblyname = pathtoassembly; decompilersettings settings = new decompilersettings(); settings.fullyqualifyambiguoustypenames = true; var resolver = new defaultassemblyresolver(); resolver.addsearchdirectory(path.getdirectoryname(pathtoassembly)); var parameters = new rea