Posts

Showing posts from August, 2013

jetty - JNDI not working in JUnit after upgrading Wicket from 6.20 to 7.0 -

i decided upgrade recent wicket project 6.20 7.0. quite smooth main code, had problem setup code jndi in junit environment. using : try { // create , bind jndi resource database connection initialcontext ic = new initialcontext(); ic.createsubcontext("java:comp/env"); ic.createsubcontext("java:comp/env/jdbc"); sqlserverconnectionpooldatasource ds = new sqlserverconnectionpooldatasource(); ds.seturl("jdbc:sqlserver://localhost:1433;databasename=myproject;username=myuser;password=mypassword"); ic.bind("java:comp/env/jdbc/myproject", ds); } catch (exception e) { e.printstacktrace(); } this worked fine wicket 6.20, throws javax.naming.noinitialcontextexception on call createsubcontext(). after fruitless experimentation, key information in http://www.eclipse.org/jetty/documentation/current/jndi-embedded.html . with change jetty 7 jetty 9 between

php - L4.2 Extend/override Cashier to add Tax feature -

i using laravel 4.2 cashier , need modify protected function buildpayload() don't want directly in vendor file break code when composer update... how should proceed override function own logic ? i use cashier in 1 of controller doing: $user->subscription('testplan') ->create(input::get('stripetoken'), [ 'email' => 'email@email.com, ]); but want add withtax() parameters... so: $user->subscription('testplan') ->withtax(10) ->create(input::get('stripetoken'), [ 'email' => 'email@email.com, ]); i know how directly in stripegateway.php file it's bad practice... i know need add: protected $taxpercent = 0; public function withtax($tax) { $this->taxpercent = $tax; return $this; } protected fun

How do I force a transaction to execute on a certain future block #? (Ethereum, JS API) -

i'm trying send transaction , have execute on block. appears possible according js api: https://github.com/ethereum/wiki/wiki/javascript-api#web3ethsendtransaction see parameter #2, unless i'm misunderstanding it. but every time try this, fails "invalid address": incrementer.increment.sendtransaction({from:eth.coinbase}, 28410, function(err, address) { if (!err) console.log("no err " + address); else console.log("err " + address); }); ...whereas removing block parameter 28410... incrementer.increment.sendtransaction({from:eth.coinbase}, function(err, address) { if (!err) console.log("no err " + address); else console.log("err " + address); }); ...succeeds fine. anybody know going on this? i'm trying possible? the web3.eth.sendtransaction(transactionobject [,callback]) function has indeed 2 parameters. (see here: https://github.com/ethereum/web3.js/blob/master/lib/we

javascript - Why won't my comparison array work? -

i building game want take player inputs prompts for, , compare them inputs have used, , reject choice if choose same thing twice. here relevant code: var playerchoicerow = 0; var playerchoicecolumn = 0; var playerattackarray = []; function playerattack(playerchoicerow,playerchoicecolumn) { (var i=0; i<playerattackarray.length; i++){ if ([playerchoicerow,playerchoicecolumn] === playerattackarray[i]){ alert("you have attacked space, please choose another."); playerchoicerow = prompt("please choose number between 0 , 5."); playerchoicecolumn = prompt("please choose number between 0 , 5."); } } if (playerchoicerow === undefined){ alert("please choose number between 0 , 5!"); playerchoicerow = prompt("please choose number between 0 , 5."); } if (playerchoicecolumn === undefined){ alert("please choose number between 0 , 5!"); playerchoicecolumn = prompt("please choose n

dataframe - Merging different data frames with different columns in R -

Image
i tried following code: library(ggplot2) library(dplyr) library(tidyr) other <- read.table(text='phase year v14 v15 other 2017 0.016488414 0.027183601 other 2016 0.016937669 0.016937669 other 2016 0.020214521 0.010313531 other 2016 0.025205761 0.099279835 other 2016 0.014341085 0.037596899 other 2016 0.01622807 0.04254386', header=true) code <- read.table(text='phase year v5 v8 v19 v21 code 2017 0.016488414 0.053921569 0.01114082 0.027183601 code 2016 0.033197832 0.016937669 0.016937669 0.016937669', header=true) test <- read.table(text='phase year v6 v11 v20 v22 test 2017 0.032531194 0.027183601 0.016488414 0.305258467 test 2016 0.106368564 0.025067751 0.016937669 0.025067751', header=true) # tidy data code_df <- code %>% gather(key, value, v5, v8, v19, v21) test_df <- test %>% gather(key, value, v6, v11, v20, v22) other_df <- other %&g

vb.net - No src property for Adobe PDF Reader control (axAcroPDF, COM control) -

i'm testing using adobe pdf reader control acropdf.dll library. add it, go in toolbox, choose "choose items...", go in com tab, etc. i add in form successfully, when try access src property in this tutorial , property doesn't exist. what's problem ? should try find version of library , manually add toolbox ? or ? try latest version of adobe reader, install , re-add form. check if other properties available, may find properties documentation interface here . try use loadfile() method load pdf file.

android - Mobile Vision API - concatenate new detector object to continue frame processing -

i want use new face detection feature vision api provides along additional frame processing in application. this, need have access camera frame processed face detector, , concatenate processor using face detected data. as see in sample, camerasource abstracts detection , camera access, , can't have access frame being processed. there examples of how camera frame in api, or, maybe, create , concatenate detector receives it? possible @ least? thanks, lucio yes, possible. you'd need create own subclass of detector wraps facedetector , executes frame processing code in detect method. this: class myfacedetector extends detector<face> { private detector<face> mdelegate; myfacedetector(detector<face> delegate) { mdelegate = delegate; } public sparsearray<face> detect(frame frame) { // *** add custom frame processing code here return mdelegate.detect(frame); } public boolean isoperational() { return mdelegate.i

linux - Scan bluetooth low energy using hcitool? -

when run command makes ble device scanning 5 seconds only: $ sudo timeout 5s hcitool -i hci0 lescan the output shown in terminal screen. but when redirect output file save addresses of advertising devices, every time run command find file empty , output isn't visible in terminal nor in file. the command used: $ sudo timeout 5s hcitool -i hci0 lescan > file.txt what have in order make hcitool correctly redirect ouput file? timeout default sends sigterm program. looks hcitool doesn't handle gracefully. instead use sigint (equivalent ctrl-c). sudo timeout -s sigint 5s hcitool -i hci0 lescan > file.txt

wpf - How to use a data trigger in a text box that uses the selectedItem of a dataGrid? -

i want use data trigger in text box set isenabled property according value of property of selected item in data grid. i trying this: <textbox.style> <style targettype="textbox"> <style.triggers> <datatrigger binding="{binding mydatagridname, elementname=selecteditem.myproperty1.myproperty2}" value="1"> <setter property="isenabled" value="false"/> </datatrigger> </style.triggers> </style> </textbox.style> but textbox enabled. check when select item, has property1 , property2 has 1 value. guess problem don't set trigger correctly. try code, need specify datagrid elementname not selecteditem: <textbox.style> <style targettype="textbox"> <style.triggers> <datatrigger binding="{binding elementname=mydatagridname, path=selecteditem.myproperty1

c# - How to build an Universal app to read and write NFC tags -

i have been searching how can build universal app read nfc tags , not found clear way start code. some 1 knows how read , write nfc tag windows phone?? there code sample nfc-ndef-tag-reader shows how read nfc tags on windows phone 8. the function subscribeformessage still available on universal windows platform. can still use code in windows universal app.

sqlite - django.db.utils.OperationalError: parser stack overflow -

i have re-usable django application should support python2.7 , python 3.x , pypy . developed in python 2.7 @ beginning , of tests worked well. made them worked in python3.3 too. have problem python3.4 , pypy , pypy3 ; django.db.utils.operationalerror: parser stack overflow my tests run on sqlite3 . check trace, guess query size. couldn't find solution solve problem. i overrided builtin sqlite3 code in python3.4 environment pring sql, raise error for. big sql. it doesn't matter, don't need check sql, post in here show how big . can bigger that. because queryset building on runtime in loop. by way, told before, there no problem python2.7 , python3.3 . problem raises others. are there configuration handle this? here sql: select "river_approvement". "id", "river_approvement". "content_type_id", "river_approvement". "object_id", "river_approvement". "field", "river_appro

javascript - How to add specific class to specific id in jquery -

im try add specific class when user click li specific id, im try when li has click remove of other class , add specific class li, exemple if user click in li id 1 class asigned one, if user click in li id 2 class add 2 , remove class 1 etc, etc. code this: <ul class="menu-primary"> <li id="1"><a href="#">index</a></li> <li id="2" ><a href="#">other</a></li> <li id="3"><a href="#">thats why</a></li> <li id="4"><a id="3" href="#">sports</a></li> <li id="5"><a id="4" href="#">clients</a></li> <li id="6"><a id="5" href="#">things history</a></li> <li id="7"><a href="#">contact</a></li> </ul> jquery

Self Organized Maps (SOM) neighborhood and weight updates -

i studying self organized map (som) in neuron nets field. have 2 questions: 1) why neighborhood size decreasing? 2) why not update winner? happen in case? thanks in advance the power of som create neural network displayable , human readable, so: 1) neighborhood size decreased in order stability in algorithm increasing iterations. 2) mean of updating neighborhood create map (that displayable) near units have similar weights. if update winner unit, map not created since similar units left scattered in map.

regex - Match a domain in a urls ending with specified word -

i have list of urls need sort. try explain need. example: http://test56.testdom.com/dev123/85056704/test/test.php?something=else&t=1 http://test14.testdoma.tv/dev234/93181034/test/backup.zip http://test22.testdomai.me/dev945/23145034/test/test.zip http://test12.testdomain.co.uk/dev184/95342034/test/random?random=123&stuff=true http://test76.testdomains.de/dev643/13453534/test/random.zip i need regex match full domain name, in urls ending zip , this: test14.testdoma.tv test22.testdomai.me test76.testdomains.de so basically: "if there's zip , match test / ". how can write regex this? in notepad++, don't output you'd in programming language. can use find , replace regex, i.e.: find: https?://(.*?)/.*\.zip replace: $1 the above, replace url's ending in zip, corresponding domain. subject: http://test56.testdom.com/dev123/85056704/test/test.php?something=else&t=1 http://test14.testdoma.tv/dev234/93181034/test/backu

android parse sdk facebook login cannot get email -

im integrated parse , facebook sdk project , work , id , user name of facebook user issue cannot thing else email or gender or other information add permission them. this permission : private static final list<string> permissions = arrays.aslist("public_profile","email","user_friends","user_birthday","user_location","user_relationships"); button click code : button mbtnfb=(button)findviewbyid(r.id.mbtnfb); mbtnfb.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { parsefacebookutils.loginwithreadpermissionsinbackground(mainactivity.this,permissions , new logincallback() { @override public void done(parseuser user, parseexception err) { if (user == null) { log.d("myapp", "the user cancelled facebook login."); } else if (user.isn

ruby on rails - Is it possible to modify database using SQL injection with Active Record -

this question has answer here: rails methods vulnerable sql injection? 2 answers using rails 4.0 have controller action uses request parameters in active record query: @clients = client.where(params[:where]).order(params[:order]).limit(params[:limit]) would possible user, using sql injection, modify database, or obtain information database not contained in clients table? if example appreciated, simple method prevent possibility (i understand placeholders or hash parameters remove vulnerablity don't see how create same functionality using them) thanks in advance. edit i understand these methods have vulnerabilities. question concerns extent of vulnerablity. not able find answer specific question in rails guides. the where method assumes argument sql fragment if it's string. what happens next depends on database used, example on mysql

How to maintaining listView (java/android) -

i have listview in subactivity of app.. when go subactivity main activity , try return subactivity, item of listview disappear.. how fix problem? if close app , restart it, listview empty... why? my mainactivity: final arraylist<string> listcron = new arraylist<string>(); .... @override public boolean onoptionsitemselected(menuitem item) { // handle action bar item clicks here. action bar // automatically handle clicks on home/up button, long // specify parent activity in androidmanifest.xml. int id = item.getitemid(); switch(id) { case r.id.history: intent history = new intent(getapplicationcontext(), historyclass.class); history.putstringarraylistextra("history", listcron); startactivity(history); break; default: return true; } return super.onoptionsitemselected(item); } my subactivity: @override protected void oncreate(bundle savedinstancestat

semantic web - How to import rdf file into named graph? -

i new rdf. have foaffriends.rdf file in working directory. need import , use named graph store in tdb model rather unnamed model , store in external xml file. following code produces blank files. how can fix this? how know uri use? string directory = "mydatabases/dataset1" ; dataset dataset = tdbfactory.createdataset(directory) ; dataset.begin(readwrite.read) ; model model = dataset.getnamedmodel("foaffriends.rdf") ; dataset.commit(); fileoutputstream fout=new fileoutputstream( "samresult.xml"); model.write(fout); dataset.end();

javascript - Change \n or \r into <br/> -

this question has answer here: how replace line breaks in string <br /> tags? 10 answers i have string getting api looks this: [{"lat":"39.142971","lng":"-77.215924","hours":"monday - wednesday: 11:30am 11:00pm\r\nthursday: 11:00am 11:00pm\r\nfriday-saturday: 11:00am 12:00am\r\nsunday: 11:30am 10:00pm","phone":"3019634847","name":"dfh alehouse, gaithersburg"}] when parse hours running through make new lines when display on web page: hours = hours.replace(/(?:\\[rn])+/g, "<br/>"); but when displays, not inserting line breaks. odd thing me when store own data in database , type \n above code works. when taking api. javascript parses \r\n automatic line breaks. regex should line breaks (instead of strings). should this: hours = ho

c# - Stop default Autocomplete behavior when hitting spacebar in Visual Studio 2015 -

note keyword here "default". know can hit escape , default behavior gets aborted. don't want hit escape key every time ide thinks knows want. didn't have in 2013. addendum 2 seems i'm still having difficulty communicating i'm after here. want happen nothing when press space bar... want space character show on screen. time want ide insert suggestion when hit tab bar. hope that's clearer? this driving me nuts. 2013 , before allowed set completion characters (maybe resharper?) in 2015 see no way stop default behavior of autocomplete. for example, have class foo , don't have namespace specified already, yet have class foobar in 1 of specified namespaces, if type: public void dosomething(foo// <-- space) ...it automatically puts foobar . how heck turn off behavior? i should mention still want autocomplete, on tab though. edit -> intellisense -> toggle completion mode from : https://msdn.microsoft.com/en-us/lib

java - Highlight cell when row is selected -

the problem having when select row, cell custom cell renderer doesn't highlight cell other cells. public component gettablecellrenderercomponent( jtable table, object value, boolean isselected, boolean hasfocus, int row, int column) { setfont(applicationstyles.table_font); if (value != null) { bigdecimal decimalvalue = tobigdecimal(value); decimalvalue = decimalvalue.setscale(2, bigdecimal.round_half_even); decimalformat formatter = new decimalformat("$##,##0.00"); formatter.setminimumfractiondigits(2); formatter.setminimumfractiondigits(2); string formattedvalue = formatter.format(value); settext(formattedvalue); } return this; } the easiest way format data override setvalue(...) method of default renderer demonstrated in swing tutorial on using custom renderers . don't have worry highlighting. or maybe easier use table format renderer

ios - buttons disappear on rotation -

Image
i'm reworking existing project allow screen rotation , multiple devices whenever rotate screen in simulator, buttons disappear. started scratch toy example works not active project. things cause this? in storyboard auto layout. as per question first must check whether application using size class or not , 1 other thing please check constraints breaking or not while changing orientation. it issue not breaking of constraints follow below procedure. if can see per below image need change constraints only. secondly if not need use size class selecting main.storyboard or viewcontroller.xib. then need go file inspector , select use size class below use auto layout . for making application multiple device orientation size class comes in handy. please have @ images below. application without size class result how ui displayed in device. enabling size class file inspector. once have made changes , viewcontroller able change constraints according device of dif

Passing a VARIANT from mac OS X Excel 2011 VBA to c++ -

i under mac os x, , using excel-2011 vba. know how pass various types vba c++ , inversely, this . now, know if possible somehow pass vba variant c++ (i using gcc 5.2). of course, there's no variant in gcc but, after all, variant "just" union. (the optimistic guy.) have guys heared classes mimicking microsoft's variant , allowing achieve ? (in first time, accept forget iunknown , idispatch !) i aware of mono , , looked it, have variant class, don't know if wise. looked document explaining in detail object model of excel-2011 mac, without success. precision. not saying microsoft's variant is, under windows, optimal way exchange data between c++ , excel but, com , atl , stuff, quite used , works do, trying stick of "same kind" under mac os x. may wrong, in case, know how want do. i opted porting variant to mac os x, see here : bstr's , variant's under... mac os x where described how trying it.

python - TypeError: Image data can not convert to float -

i want create 16 bit image. have written code. import skimage import random random import randint xrow=raw_input("enter number of rows present in image.=>") row=int(xrow) ycolumn=raw_input("enter number of columns present in image.=>") column=int(ycolumn) a={} x in xrange(1,row): y in xrange(1,column): a=randint(0,65535) a[x,y]=a imshow(a) but whenever run code, error displaying "typeerror: image data can not convert float".is there solution this. i apologies mistakes in write up, first question have asked above. from understand of scikit-image docs ( http://scikit-image.org/docs/dev/index.html ), imshow() takes ndarray argument, , not dictionary: http://scikit-image.org/docs/dev/api/skimage.io.html?highlight=imshow#skimage.io.imshow maybe if post whole stack trace, see typeerror comes somewhere deep ims

c# - How to iterate over a class that contains list of two classes? - RestSharp -

this data : { "-jxsjfigbqqz1kqmmr0i" : { "bizcarddata" : { "company" : "tesla", "designation" : "developer", "email" : "phani@tesla.com", "name" : "phani", "phone" : "5135921241" }, "transdata" : { "date" : "15-08-29", "location" : "39.1395996,-84.5295417", "tag" : "sender", "time" : "03:17:00" } }, "-jxsjknjivtfqwe1asor" : { "bizcarddata" : { "company" : "spotify", "designation" : "designer", "email" : "komarapa@spotify.com", "name" : "phani komaravolu", "phone" : "5135921241" }, "transdata" : { "date" : "15-

javascript - Unable to modify ko observable when function defined with object prototype -

i understand in general bad practice modify prototypes object.prototype.whatever syntax when using knockout, i'm trying understand why isn't working @ all: var foo = function() { var self = this; self.bar = ko.observable("bar"); }; foo.prototype.capitalizer = function() { self.bar("bar"); }; var vm = function() { var self = this; self.whatever = new foo(); }; js fiddle here: http://jsfiddle.net/vvdo7z70/8/ when works expected: var foo = function() { var self = this; self.bar = ko.observable("bar"); self.capitalizer = function() { self.bar("bar"); } }; var vm = function() { var self = this; self.whatever = new foo(); }; js fiddle here: http://jsfiddle.net/vvdo7z70/10/ is not possible pass relevant ko bindings object.prototype syntax? or there way it? for one, self isn't defined

ffmpeg - LIVE555 RTSP H.264 Raw Video File Stream - ffplay Errors -

i streaming raw .h264 video file via rtsp using live555. to receive stream using ffplay. however, when watching video notice bad video quality , bunch of errors in ffplay-console: input #0, rtsp, 'rtsp://xx.xx.xxx.x/stream': sq= 0b f=0/0 metadata: title : stream comment : stream duration: n/a, start: 0.099989, bitrate: n/a stream #0:0: video: h264 (high), yuv420p(tv, smpte170m/smpte170m/bt470m), 16 80x1050 [sar 1:1 dar 8:5], 60 fps, 60 tbr, 90k tbn, 120 tbc [h264 @ 03f92100] rtp: missed 46 packetsq= 28kb sq= 0b f=1/1 [h264 @ 03f92100] rtp: missed 74 packetsq= 23kb sq= 0b f=1/1 [h264 @ 03f92100] rtp: missed 43 packets [h264 @ 03f92100] rtp: missed 35 packetsq= 179kb sq= 0b f=1/1 [h264 @ 05710640] left block unavailable requested intra4x4 mode -1 @ 0 38 [h264 @ 05710640] error while decoding mb 0 38, bytestream 48108 [h264 @ 05710640] cannot use next picture in error concealment [h264 @ 05710640] concealing 2989 dc, 2989 ac

python - xpath query on id //*[@id="page"] returns two elements -

i'm trying scrap site ketabejam.ir i'm using python3.4.1 , parsing use lxml 3.4.1 way parsed lxml.html.fromstring method when load document on interpreter , ask following query number of pages , can handle pagination: s = doc.xpath("//*[@id='page']") surprisingly result: >>>len(s) == 2 true i got address of element firebug's minimal xpath, when choose normal xpath , query run smoothly bug, or i'm doing wrong?? looking @ page source page linked, there 2 elements id in page. 1 of top of table, , other 1 of bottom of table. the copy minimal xpath version of firebug works based on id of element. available elements have id tag , creates xpath in format - //*[@id="elementid"] which getting. ideally, in every html page , there should 1 element particular id , id should unique across page. , seem firebug 's minimal xpath depends on that. in context, think both elements return same link, can us

php - Mysql return the row position with sorting -

the ff table: +-----------------------------+ + value| name |asort + +-----------------------------+ + 111 | alpha |a + + 161 | beta |b + + 092 | delta |c + + 141 | beta |a + + 113 | beta |e + + 092 | delta |f + + ... + + ... | more items + +-----------------------------+ +-----------------------------+ + value| name |asort + +-----------------------------+ + 141 | beta |a + + 161 | beta |b + + 113 | beta |c + + ... + + ... | more items(beta) + +-----------------------------+ i want return of "3" "113" row position group name beta , sort asc asort you need use variable calculate rank ( row-number-in-mysql ) because mysql doesnt have row_number . sql fiddle demo select ff.*, @rownum := @rownum + 1 rank ff, (select @rownum :

java - Audio files won't stop playing when I go to next item in list -

here code: public apjmenu createmenu(string menulabel, string[] menuitems) { // create menu item passed in title apjmenu menu = new apjmenu(menulabel, getsoundfilename(menulabel), this.audiosourcetype); apjmenuitem menuitem; (int = 0; < menuitems.length; i++) { menuitem = new apjmenuitem(menuitems[i], getsoundfilename(menuitems[i]), audiosourcetype); menuitem.setenabled(true); menuitem.addactionlistener(this); menuitem.addmenukeylistener(this); menuitem.setactioncommand(menuitems[i]); menu.add(menuitem); } return menu; } this main program does. of audio files added menus enables audio playback. however, there referenced jar file communicates program , reads in text , makes calls play corresponding audio file. if run program, generate menu plays audio navigate item list. apjmenuitem class // referenced classes of package enhancedwidgets: apcomponent, apcomponentgeneri

ubuntu - AWS security group settings -

currently, connect pc redhat instance, , redhat, connect ubuntu. thing is, cannot manage connect ubuntu, have timeout error. in security group of ubuntu, put following settings in inbound: type=ssh protocol=tcp port=22 source=publicipofredhat/32 and redhad, connect using ssh -i ~/.ssh/ubuntu.pem ubuntu@publicipofredhat this setting not work, know why. i changed setting , put securitygroupofredhat instead of ip , works. setting, means instance within security group can access ubuntu (which dont want), right ? could please these settings ? explain me wrong , how fix ? include redhat private ip , should make work. generally, connecting security group security group better (than including ips in security group). it's less brittle. if other instances in same sg redhat instance, need use more specific security groups.

c# - asp.net WEB API with database connection -

i'm new asp.net web api. i'm trying create apis have connections database. example login method or add data database. when tried search example tutorial, couldn't find example has connection string inside it. my questions : how set connection string database? (i.e. user name , password) can connect database not in localhost? (i.e. server) if explain me asp.net web api has connection database, appreciate it. **im using visual studio 2012 right now. database use mssql. thx 1. how set connection string database? example username , password? : better put connections string in webconfig, can change when need how to: read connection strings web.config file 2. can connect database not in localhost (for example in server): of course, first, need choose technology use access database, can use entity framework, classic ado.net, nhibernate, example entity framework read: entity framework (ef) documentation , read: using web api 2 entity framework 6

python - How can I process variable substitutions in bash? -

so have files contain placeholder values @user@ or @shell@ (all-caps variable names, enclosed in @'s, representing environment variable names). want replace placeholders actual values of environment varables reference. in past when i've seen sort of thing done, specific variables hard-coded, eg: sed -e 's/@some_variable@/$some_value/' <infile >outfile but won't work current use-case want more flexibly support arbitrary substitutions. wrote code in python want: import re import fileinput os import environ sys import stdout pat = re.compile(r'@([a-z_]+)@') line in fileinput.input(): stdout.write(pat.sub(lambda match: environ[match.group(1)], line)) but i'd prefer not use python if can it. surely there's way perl or sed one-liner? perl -pe 's/\@(\w+)\@/$env{$1}/g' 1 way job. if want throw error if variable mentioned in file doesn't exist in environment, use perl -pe 's/\@(\w+)\@/die "$1 not

vba - Using a Converted string in CurrentDB.Execute or DoCmd.RunSQL? -

table school year has (in order): id primary key description short text in format of xxxx-xxxx current year boolean (only 1 checked @ time) i'm creating button appends new year cycle table increasing year one. ex: 2009-2010 -> 2010-2011 however, current code, i'm doing string int conversion , string it's not staying back. table appends new data fine, data wrong. id , current year accurate, description mathematical calculation , becomes -1 . (as in 2010-2011 = -1). however! msgbox display displays full year string. how go fixing issue? in advance. here's code: private sub newyear_click() dim iyear integer dim sdesc string dim idesc1 integer dim idesc2 integer iyear = dcount("id", "school year") 'row count primary id number sdesc = dlookup("description", "school year", "[id] =" & iyear) 'grabbing string idesc1 = cint(right$(left(sdesc, 4), 4)) + 1 '

python 3.x - PyInstaller statsmodels.stats.diagnostic import kstest_normal -

i'm using pyinstaller on 1 of scripts i'm getting error on line of code wrote: from statsmodels.stats.diagnostic import kstest_normal the command used pyinstaller fitness_of_statistical_tests.py --hidden-import=scipy.linalg.cython_blas --hidden-import=scipy.linalg.cython_lapack the full error is: traceback (most recent call last): file "c:\python34\lib\site-packages\pandas\__init__.py", line 7, in <module> pandas import hashtable, tslib, lib importerror: cannot import name 'lib' during handling of above exception, exception occurred: traceback (most recent call last): file "<string>", line 9, in <module> file "c:\python34\lib\site-packages\pyinstaller\loader\pyimod03_importers.py", line 311, in load_module exec(bytecode, module.__dict__) file "d:\seds\gahndiwashingtonmethod\fitness_of_statistical_tests_view.py", line 11, in <module> statsmodels.stats.diagnostic import kst

java - How can I delete consecutive duplicates recursively without an int parameter? -

i need fix previous code. if input "aabbcdefgghijkllaa", output needs "abcdefghijkla". current code have changed outputs "alkjihgfedcba". (the input may not in alphabetical order, , output should in same order original input.) should create new method reverse or there way fix current methods? here code: package recursion; public class recursion { static string = "aabbcdefgghijkllaa"; static int b=a.length()-1; static string result = ""; public static void main(string[] args){ system.out.println("input: " + a); system.out.print("output: "); removeduplicates(a); } public static string removeduplicates(string a){ if (b <= 0){ system.out.print(a.charat(0)); result=result+a.charat(0); } else if (a.charat(b) == a.charat(b-1)) { b--; removeduplicates(a); } els

arrays - plot multiple y values against one x values in python -

here y values: [1.00, [(1.99-2.27e-17j),(0.61+9.08e-17j), (0.12-0j)], [(1.9+4.54e-17j), (0.61-9.081e-17j), (0.12+4.54e-17j)], [(1.99+4.5e-17j), (0.61-9.08e-17j), (0.12+4.54e-17j)], [(1.99-2.27e-17j), (0.61+9.0e-17j), (0.12-0j)], 3.00] and here x values: array([ 0. , 0.2, 0.4, 0.6, 0.8, 1. ]) as can see, first , last x values correspond 1 y value , rest of x values correspond multiple y values. how plot real part of y values against x ? here solution might you. note isn't efficient (especially problem bigger datasets), might put on right track. main issue dimensionality between xs , ys not same. from numpy import * matplotlib import pyplot plt ys = [1.00, [(1.99-2.27e-17j),(0.61+9.08e-17j), (0.12-0j)], [(1.9+4.54e-17j), (0.61-9.081e-17j), (0.12+4.54e-17j)], [(1.99+4.5e-17j), (0.61-9.08e-17j), (0.12+4.54e-17j)], [(1.99-2.27e-17j), (0.61+9.0e-17j), (0.12-0j)], 3.00] xs = array([ 0. , 0.2, 0.4, 0.6, 0.8, 1. ]) pxs = [] pys = [] i, yelems

java - Get all chrome windows -

i want chrome windows running currently. below code windows. final windef.hwnd[] windowhandle = new windef.hwnd[1]; user32.instance.enumwindows(new winuser.wndenumproc() { @override public boolean callback(windef.hwnd hwnd, pointer pointer) { if (matches(hwnd)) { windowhandle[0] = hwnd; return false; } return true; } }, pointer.null); how can running chrome windows ? i think better use completed third party library sigar. https://support.hyperic.com/display/sigar/home you api work processes. @ least can @ source code. sigar sigar = new sigar(); processfinder find = new processfinder(sigar); find.find("exe.name.ct=chrome");

django - Getting a SQL error when running "python manage.py migrate" using a MySQL database -

i've been through introductory tutorial django using sqlite per instructions. however, real project want use mysql, deleted tutorial project files , started fresh setup. trouble when run "python manage.py migrate" following mysql error: _mysql_exceptions.programmingerror: (1064, "you have error in sql syntax; check manual corresponds mysql server version right syntax use near '%s' @ line 1"). i have following in site settings database section: databases = { 'default': { 'engine': 'django.db.backends.mysql', 'name': 'vocabulator$database', 'user': 'vocabulator', 'password': '<password>', 'host': 'mysql.server', } } i connected database in bash using, 'mysql --user=vocabulator --host=mysql.server --password=<password> "vocabulator\$database" ', appears have entered these s