Posts

Showing posts from July, 2015

java - How change ${USER} variable in intellij idea without change OS user name? -

by ${user} intellij idea means login name of current user. if login differ name used developer name? possible set user other value without changing os login name? you can modify file idea.exe.vmoptions or idea64.exe.vmoptions , should in bin folder of ide istallation. linux version, cold idea.vmoptions . need add there parameter: -duser.name=yourname this make ${user} variable inside intellij idea equals parameter value , don't have change current os user login name. i've tested in intellij idea 14.1.3 file , code templetes.

Unremovable php error at Wordpress White Screen of Death -

i know there lot of white screen of death pages, can't seem wrap head around one. on site ( http://www.wavo.be ), whitescreen of death. renamed plugins folder , custom theme folder.. errors dissapeared 1 stayed: notice: undefined index: rfd1b0e6b in /usr/local/pem/vhosts/109379/webspace/httpdocs/wp-includes/locale.php on line 1 any ideas should look? presume site updated , errors occured..

java - Priority Queue Sorting String -

i need use priorityqueue sort person objects. the person class: public class person implements comparable<person>{ private string firstname; private string lastname; public person(string firstname, string lastname){ this.firstname = firstname; this.lastname = lastname; } public string getfirstname() {return firstname;} public string getlastname() {return lastname;} public string tostring(){ return "name: " + firstname + " " + lastname + "\n"; } public int compareto(person p){ string pname1 = firstname + lastname; string pname2 = p.firstname + p.lastname; return pname1.compareto(pname2); } the main code: import java.util.priorityqueue; public class priorityq{ public static void main(string[] args){ priorityqueue<person> pers = new priorityqueue<person>(); pers.add(new person("sam", "sm

javascript - swiper.js multiple imgs per slide lazy loading not working -

thanks reading, try use swiper.js , works fine lazy loading demo, in demo, there 1 image per slide, want represent 4 imgs per slide, turns out first img in each slide show up. <div class="swiper-container"> <div class="swiper-wrapper"> <div class="swiper-slide"> <!-- required swiper-lazy class , image source specified in data-src attribute --> <img data-src="1.jpg" class="swiper-lazy"> <img data-src="2.jpg" class="swiper-lazy"> <img data-src="3.jpg" class="swiper-lazy"> <img data-src="4.jpg" class="swiper-lazy"> <img data-src="5.jpg" class="swiper-lazy"> <!-- preloader image --> <div class="swiper-lazy-preloader swiper-lazy-preloader-white"></div> </div&g

java - Client Socket cannot find Server Socket. Throws UnknownHostException despite having the same port number -

i'm following online tutorial used clients&servers in java before start working them. all trying right start server , connect client. it's couple lines of code client , server , seemed straightforward me, i'm not sure problem is. i run server program, run client program, client socket cannot find server socket reason though have same port number. here code. server: public class server { private serversocket serversocket; private int portnumber; public server(int portnumber){ this.portnumber=portnumber; } public void run() throws ioexception { serversocket = new serversocket(portnumber); system.out.println("server @ port "+portnumber); system.out.println("waiting client."); socket clientsocket = serversocket.accept(); system.out.println("connected."); } public static void main(string[] args) { int portnumber = 9999; tr

Environment expansion in R -

i have problem don't know how solve. prehistory: use r.net calculation (need wpf application). so, want parallelize app, , created dynamic proxy rengine class. needs serialize data pass , receive data from-to rengine instance via tcp. bad news - r.net classes cannot serialized. so, have idea serialize r objects in r , pass r serialized data between processes. so have same script this: a <- 5; b <- 10; x <- a+b; i need wrap this: wrapfunction <- function() { <- 5; b <- 10; x <- a+b; } serializedresult <- serialize(wrapfunction()); i'll serializedresult , pass byte array. need pass environments. won't a, b, x in .globalenv after these manipulations. how possible variables, defined in function body, in .globalenv? don't know names , count, can't rewrite basic script, replacing "<-" "<<-". other ways? thank you. i'm not sure understand requirements. seem go against f

linux - How to add numbers in a column and insert the total to a differentcolumn -

let me preface saying i'm complete newbie scripting. we have many mismanaged quota files need totals updated. i'd have script can calculate totals of each volume instead of doing mechanically every month. please see example below. our quota file looks this: /vol/vol1/nstorage1 tree 200g /vol/vol1/nstorage2 tree 5g /vol/vol1/nstorage3 tree 300g /vol/vol1/nstorage4 tree 145g /vol/vol1/nstorage5 tree 3g /vol/vol1/nstorage6 tree 5g # # vol1 total 700gb /vol/vol2/nstorage7 tree 20g /vol/vol2/nstorage8 tree 1g /vol/vol2/nstorage9 tree 30g /vol/vol2/nstorage10 tree 55g /vol/vol2/nstorage11 tree 25g /vol/vol2/nstorage12 tree 430g /vol/vol2/nstorage13 tree 20g # # vol2 total 550gb and on.... what trying take total sum 3rd column, , add "volx total ####gb" line. i have tri

Connecting to MySQL database on Google Cloud Storage from IPv6 -

i @ location has ipv6 rather ipv4 (this becoming more common) , cannot connect. i'm going storage->sql->accesscontrol ipv4, clicking "add item" , putting address under "network". haven't had issues enabling ipv4 way, haven't succeeded ipv6 in of several locations i've tried. missing something?? thanks.

html - How to get IE and Firefox to resize images in table _without_ stylesheet access? -

i encountering same frustrating problem has been asked here few times: fluid images in ie , firefox (max-width) why doesn't ie respect table width fluid image child both of these solutions offer "table-layout:fixed;" solution. however in case, helping friend runs simple multi-user wordpress site, , has few restrictions: it needs users able format bulk image posts little html knowledge. image posts done via widget reformats [img] linked image. unfortunately there no alternative this. i suggested below code, works cleanly in chrome , safari: <table class=" aligncenter" width="95%" cellpadding="3"> <tr> <td>[img]image 1[/img]</td> <td>[img]image 2[/img]</td> <td>[img]image 3[/img]</td> <td>[img]image 4[/img]</td> <td>[img]image 5[/img]</td> </tr> </table> the desired outcome works in chrome , safari this however ie , firefox show this i

javascript - Send an Ajax request in CasperJS and loop through results -

i trying fetch json values(mainly urls) call , assign variable. ultimlately loop through values , open each url casper. however, seen have incorrect concept on fetching values through ajax call casperjs. read through documentation dont seem understand why still getting error referenceerror: can't find variable: __utils__ ? casper.start(); var url = "http://dev.web-ui.com/generate.php"; casper.then(function(url) { var results = __utils__.sendajax(url, "get"); }); casper.run(); you have @ least 2 problem: the url parameter not url, last loaded page resource object contains url. __utils__ not available outside of page context. can require if want, won't fix problem, because dummy document.location outside of page context has not same domain url want query, request may fail due cross-domain restrictions. it's best in page context. example code: casper.then(function(resource) { var results = this.evaluate(function(url){

java - Statement in jdbc retrieving only the 1st record though there are several records -

the below code iterates, while loop, , retrieves records matched: resultset rs3 = st.executequery("select id fbprofiles age<=(select age fbprofiles id="+user+") , id not in("+user+")"); string id; query = "select id fbprofiles age<=(select age fbprofiles id="+user+") , id not in("+user+")"; system.out.println(query); //resultset rs4; while(rs3.next()) { st = con.createstatement(); id = rs3.getstring(1); system.out.println("id: "+id); /*query = "select name fbpages name in(select name pagelikes_"+id+" name not in('"+pagesliked.tostring()+"')) , category in("+category.tostring()+")"; system.out.println(query); rs4 = st.executequery(query); while(rs4.next()) { message += "<a href="+rs4.gets

c# - IIS Queuing Requests? -

i’ve created windows 10 universal app using mvvmcross , stephen cleary’s excellent asyncex library. update 27/10/2015 15:43 - stephen has answered question. tested , proven correct. in view, bind listview property in viewmodel asynchronously loads collection of place holder view models called assignabletaskplaceholderviewmodel (using asyncex functionality). the data comes web api service i’ve created. test harness, collection loaded 12 assignabletaskplaceholderviewmodel each holding id value. the datatemplate listview items binds elements property on assignabletaskplaceholderviewmodel called assignabletaskviewmodel. asynchronously calls web api method return detailed data (again using asyncex functionality). method returning mock data. when run app, expect see: 1) initial loading of placeholder collection taking small amount of time, then 2) detailed data each item in list loaded concurrently , taking same amount of time data load. what see detailed data being lo

html5 - Mouse Over an Image and Change Another -

this more difficult needs to explain... essentially, i'm trying make mildly interactive website menu system in hovering on picture changes picture, in html5. i perfected actionscript 3 in flash cc, can see i'm trying accomplish here. attempting convert actionscript canvas html5 results in loss of actions applied. i'm sure simple operation, building off of simple 'change image mouseover', seen button or similar element. here code used in actionscript: img1.visible=false; img2.visible=false; img3.visible=false; img4.visible=false; mclip1.addeventlistener(mouseevent.mouse_over, mover2); mclip1.addeventlistener(mouseevent.mouse_out, mout2); mclip2.addeventlistener(mouseevent.mouse_over, mover); mclip2.addeventlistener(mouseevent.mouse_out, mout); mclip3.addeventlistener(mouseevent.mouse_over, mover3); mclip3.addeventlistener(mouseevent.mouse_out, mout3); mclip4.addeventlistener(mouseevent.mouse_over, mover4); mclip4.addeventlistener(mouseevent.mouse_out, mo

Looping Through An XML with VBA (Excel) -

i complete newbie xml string, hoping point me in right direction. including sample xml , code trying work with. i able retrieve xml string , loop through it, must missing something, here want happen, starting @ order node loop through node , return basename , text, when reaches shipping address, need loop through node , results under child node? (basename , text) return first loop , continue getting rest of information. many can provide, thank mike here sample of xml: <?xml version="1.0"?> <listordersresponse xmlns="https://mws.amazonservices.com/orders/2013-09-01"> <listordersresult> <orders> <order> <latestshipdate>2015-10-29t06:59:59z</latestshipdate> <ordertype>standardorder</ordertype> <purchasedate>2015-10-25t04:04:33z</purchasedate> <buyeremail>y73fy@marketplace.amazon.com</buyeremail> <amazonorderid>258-7431234-

PHP: Extract specific word after specific word in a string? -

i have string looks this: {"ip":"xx.xx.xx","country_code":"ie","country_name":"ireland","region_code":"l","region_name":"leinster","city":"dublin","zip_code":"","time_zone":"europe/dublin","latitude":53.333,"longitude":-6.249,"metro_code":0} i need value country_name string. so tried this: $country = '{"ip":"xx.xx.xx","country_code":"ie","country_name":"ireland","region_code":"l","region_name":"leinster","city":"dublin","zip_code":"","time_zone":"europe/dublin","latitude":53.333,"longitude":-6.249,"metro_code":0}'; if (preg_match('#^country_name: ([^\s]+)#m', $country, $match)) {

pebble sdk - error: expected identifier before '_Bool' -

i had following code when dealing sync tuple: static void sync_tuple_changed_callback(const uint32_t key, const tuple* new_tuple, const tuple* old_tuple, void* context) { persist_write_bool(key,new_tuple->value->bool); } however, tried building (in cloud pebble), , got error: ../src/main.c: in function 'sync_tuple_changed_callback': ../src/main.c:25:44: error: expected identifier before '_bool' what's going on? there no bool member of value union - best bet use uint8 member instead, passing 1 true , 0 false: static void sync_tuple_changed_callback(const uint32_t key, const tuple* new_tuple, const tuple* old_tuple, void* context) { persist_write_bool(key,new_tuple->value->uint8 != 0); }

django - int() argument must be a string, a bytes-like object or a number, not 'method' -

in django 1.8 /python 3.4 how can method int? example: models.py class bid(models.model): bid_price = models.integerfield(default=1) def __str__(self): return self.bid_price def topprice(self): return 100 view.py def bidview(request, bid_id): bid_data = bid.objects.get(id=bid_id) if int(bid_data.topprice_text) < 100): the way it's written method returning int, have call method use return value: if bid_data.topprice() < 100: i have don't quite know you're trying here, topprice shouldn't method anyways.

wordpress - Get post type and category -

on frontpage (index.php) display posts of type 'event' category 'main' of type 'post'. how can merge 2 conditions? in current code, can filter 2 post-types not category 'main'. <?php global $wp_query; $args = array_merge( $wp_query->query, array( 'post_type' => array('post','event') )); query_posts( $args ); ?> just change $args this: <?php $args = array( 'post_type' => array('post','event'), 'tax_query' => array( 'relation' => 'or', array( 'taxonomy' => 'category', 'terms' => 'main', 'field' => 'slug' ), array( 'taxonomy' => 'event_tag', // needs whatever custom taxonomy have declared custom post type. 'terms' => 'main', 'field' => 'slug'

java - Error Could not find or load main class emma -

i want convert "coverage.ec" file coverage_report.html, running below command $ java emma report -r txt,html -in /users/user.name/desktop/coverage.ec but getting below error error: not find or load main class emma please provide suggestion on path have run command.

javascript - jQuery not recognizing selectors created by the .html() method -

this question has answer here: event binding on dynamically created elements? 19 answers i'm trying create dynamic content box. when click 1 button, box's content changes .html(). when click another, content changes again. this fine, created within box doesn't seem selectable. so example: $(document).ready(function(){ boxcontent1 = "<div class='studyselector'></div>"; $("#casestudy").on('click',function(){ $("#botbox").hide().html(casestudy).fadein(1000); }); }); in case, content of #botbox changes fine. however, when try interact it $(".studyselector").on('click',function(){ alert("testing!"); }); nothing happens. why happening? you have use event-delegation dynamically create nodes in dom after rendering: $('#b

html - table padding has no effect css -

#table_1 { border-collapse: collapse; height: 217px; width: 287px; perspective-origin: 143.5px 108.5px; transform-origin: 143.5px 108.5px; font: normal normal 300 normal 18px / normal nunito, serif; }/*#table_1*/ #tbody_2 { border-collapse: collapse; height: 217px; width: 287px; perspective-origin: 143.5px 108.5px; transform-origin: 143.5px 108.5px; border: 0px none rgb(128, 128, 128); border-spacing: 2px 2px; font: normal normal 300 normal 18px / normal nunito, serif; }/*#tbody_2*/ #tr_3, #tr_7, #tr_11 { border-collapse: collapse; height: 54px; vertical-align: middle; width: 287px; perspective-origin: 143.5px 27px; transform-origin: 143.5px 27px; border: 0px none rgb(128, 128, 128); border-spacing: 2px 2px; font: normal normal 300 normal 18px / normal nunito, serif; }/*#tr_3, #tr_7, #tr_11*/ #td_4, #td_8, #td_12 { border-collapse: collapse; h

How can i substract a single value from a column using pandas and python -

i have 1 data frame suppose: name age hb ali 34 14 jex 16 13 aja 24 16 joy 23 12 i have value "5" want substract each member of column "hb" new column be: hb 9 8 11 7 what best method this... thanks , regards. simply subtract scalar value pandas.series , numerical columns pandas automatically broadcast scalar value , subtract each element in column. example - df['hb'] - 5 #where `df` dataframe. demo - in [43]: df out[43]: name age hb 0 ali 34 14 1 jex 16 13 2 aja 24 16 3 joy 23 12 in [44]: df['hb'] - 5 out[44]: 0 9 1 8 2 11 3 7 name: hb, dtype: int64

Dynamic URLs in HANA XS -

i'm trying implement simple product catalog using hana xs javascript. pages of catalog should rendered on server side. how can handle "dynamic" urls based on data read hana database? example, http:///myapp/store/[product-slug]/ (products stored in hana database , have unique slugs). you can create router function on application. on ' http:///myapp/index.html ', create javascript function called 'getslug'. function path url , split string based on '/', result be: [0] store [1] [product-slug] create function router content. need have column in product table slug. the router function receive array of slugs. on function need implement structure of app. for example, every time fisrt item 'store', load html of products div. this kind o single page application. every time load page, call function: $(document).on('load', function(){ router(); )

google chrome - how to intercept browser print in java -

i working last week on point of sell(pos) interceptor. intercept receipt send printer , append data based on requirement. pos may native software or browser based. able things in native software print commands , browsers(internet explorer,firefox) except i can intercept chrome,safari,mozilla print stream not able data streams these . i have used lpdspooler purpose so main problem how use chrome,safari,mozilla print stream properly ..? or need use other way this.. i need intercept print browser before printing in java language,and able in browsers(firefox ,ie) , not able in(chrome,opera,safari)

material design - android: dynamically change FAB(Floating Action Button) icon from code -

how change fab icon in activity during runtime. have code -> floatingactionbutton fab = (floatingactionbutton) findviewbyid(r.id.fabmainactivity); i know possible using fab.setbackgrounddrawable(); newbie android, don't understand how this. any highly appreciated. thanks changing floatingactionbutton source: if (build.version.sdk_int >= build.version_codes.lollipop) { floatingactionbutton.setimagedrawable(getresources().getdrawable(r.drawable.ic_full_sad, context.gettheme())); } else { floatingactionbutton.setimagedrawable(getresources().getdrawable(r.drawable.ic_full_sad)); } this can replaced following code support library instead: floatingactionbutton.setimagedrawable(contextcompat.getdrawable(getcontext(), r.drawable.ic_full_sad));

bash - perl how to finish the script by 'cd $newdir' -

i have perl script creates directory $newdir based on input passed parameter, , script finish it's execution doing: cd $newdir so next command in bash linux 64bit (here program2 ) executed $newdir working directory. e.g.: perl $home/import_script.pl -i someparameter && $home/program2 . you can't. any cd (or similar) run in perl script affect perl script (or sub-shell spawned perl script). it can't affect parent shell directly. the thing output directory , cd or similar. (e.g. cd "$(perl "$home"/import_script.pl -i someparameter)" && "$home/program2" . realize means can't output anything else standard output perl script or confuse cd .) or have perl run second command also, etc.

c++ - Where and why do I have to put the "template" and "typename" keywords? -

in templates, , why have put typename , template on dependent names? dependent names anyway? have following code: template <typename t, typename tail> // tail unionnode too. struct unionnode : public tail { // ... template<typename u> struct inunion { // q: add typename/template here? typedef tail::inunion<u> dummy; }; template< > struct inunion<t> { }; }; template <typename t> // last node tn. struct unionnode<t, void> { // ... template<typename u> struct inunion { char fail[ -2 + (sizeof(u)%2) ]; // cannot instantiated u }; template< > struct inunion<t> { }; }; the problem have in typedef tail::inunion<u> dummy line. i'm inunion dependent name, , vc++ quite right in choking on it. know should able add template somewhere tell compiler inunion template-id. exactly? , should assume inunion class template, i.e. inunion<u> names type ,

java - Execute in future - time doubles somehow -

i sorry ask question going wrong code. playing around command patterns , want command class execute code in future - lets 2 seconds in future. problem somehow command gets executed in 5 seconds, not in 2??? each call decreases time variable until variable <= 0: // 2 seconds in nanoseconds private long timeleft = 2000000000; public boolean execute(final long delta) { this.timeleft -= delta; if (this.timeleft <= 0) { // execute this.timeleft = 2000000000l; return true } return false; } with lastexecution = system.nanotime(); , each command delta = system.nanotime() - lastexecution; full src on github: https://github.com/sheldor5/javagpp instead of decrementing countdown timer value inaccurate deltas, calculate target time , check it, , use milli-time, not nano-time, prevent sign issues. long targetmillis = system.currenttimemillis() + 2000; // 2 sec while (system.currenttimemillis() < targetmillis) { // while wait }

zip - Save logfile within Excel file using VBA -

i trying develop manner in vba track changes in document without having hide contents in sheet within workbook. i understand if change extension of excel file ".zip", can access excel document components sorted directories. there way save , write text file within 1 of these directories can access every time document opened, without having have user drag log file along excel document? some facts: when excel opens file, file blocked excel. there no possibility write file within vba you can store additional data file externally or after excel workbook has been closed you need have code externally workbook accomplish writing file after has been closed. may want use vsto or oldschool excel addin. you have ensure excel not destroy changes when restructuring or repairing file. in first run, idea sounds natural, not use sheets programmer's point of view. have full control on excel files when you use external libraries (e.g. spreadsheet gear) or you rem

symfony - iterate and print all date in range in twig -

i trying iterate dates in twig i have tried using this: {% x in range(startdate|date('u'), enddate|date('u'), 86400 ) %} {{ x|date('m/d') }} {% endfor %} it worked in dates. if startdate 10/01/2015 , enddate 10/31/2015 10/25 displayed twice. the scenario can replicated on octobers of year on 4th sundays i don't know if it's me can replicate this. is there other way iterate dates in range in twig? the \dateperiod class created purpose, , it's available since php5.3. $start = datetime::createfromformat("y-m-d", "2015-10-01"); $end = datetime::createfromformat("y-m-d", "2015-11-01"); $interval = new dateinterval("p1d"); $range = new dateperiod($start, $interval, $end); foreach ($range $date) { var_dump($date->format("y-m-d")); } you can try at: https://3v4l.org/vfsb6

java - Graphic in Panel flashed and then disappear -

recently needed write program draw bar graph when press prepared place. there 2 situation draw graphic, 1 press place in table, other choice region (such kaohsiung or taipei) in typebox enter image description here but not know why press place in table clear draw graphic on panel, when press typebox, drawing flash gone. here part of code issue public class google2 extends jframe implements actionlistener{ jpanel panel;//主要畫布 graphics g; int regnm=0,regns=0,regna=0,regn=0,regp=0;//生氣數量,傷心數量,憂慮數量,其他數量,正面數量 string[] stype = { "全部", "基隆", "台北", "桃園", "新竹", "苗栗", "台中", "南投", "彰化", "雲林", "嘉義" , "台南", "高雄", "屏東", "台東", "花蓮", "宜蘭", "外島", "國外"};//所有地區 jcombobox typebox = new jcombobox(stype);//下拉式印出地區 defaulttablemodel tmc = new defaulttablemodel(new object [][] {},new string [] { "place",&

c++ - estimate 2D transformation between two set of points using Ransac -

as know, opencv uses ransac in order solve problem of findhomograph , return useful parameters homograph_mask . however, if want estimate 2d transformation means affine matrix, there way use same methodlogy of findhomography uses ransac , return mask ? estimaterigidtransform use ransac internally, though parameters fixed @ moment - see code here - https://github.com/opencv/opencv/blob/master/modules/video/src/lkpyramid.cpp cv::mat cv::estimaterigidtransform( inputarray src1, inputarray src2, bool fullaffine ) { const int ransac_max_iters = 500; const int ransac_size0 = 3; const double ransac_good_ratio = 0.5; // ... // ransac stuff: // 1. find consensus for( k = 0; k < ransac_max_iters; k++ ) { int idx[ransac_size0]; point2f a[ransac_size0]; point2f b[ransac_size0]; // choose random 3 non-complanar points & b for( = 0; < ransac_size0; i++ ) { for( k1 = 0; k1 < r

regex - Password validation with regular expression -

can 1 me in creating regular expression password validation following conditions : numbers/digits not allowed @ beginning , end must in middle of string min 6, max 10 characters long special character should not allowed at least 1 digit , 2 characters mandatory. correct format- ab21cd, stack12flow incorrect format- stack123, 123stack here pattern \a[^0-9].*[^0-9]\z \a means start of string. [^0-9] means except numbers. .* means length of characters. can words , digits or signs. \z means end of string.again [^0-9] means should not end numbers if want minimum 6 , maximum 10 characters this ^[^0-9].{4,8}[^0-9]\z . character. {4,8} specifies minimum , maximum number of . occurrence . since have 2 characters @ first , last of string pattern accepts when put 4+2 characters or maximum 8+2 characters. based on comment. (?=\a\w{6,10}\z)(?!\a\d|.*\d\z|.*_)(?=.*\d) (?=include) positive ahead. means regex must match part include . (?!exclude) neg

How to adjust height of toolbar in lollipop devices in android -

i using toolbar in app. toolbar's height can adjusted correctly in pre-lollipop devices, toolbar getting cut bottom in lollipop devices means not showing completely. please me. xml code toolbar is: <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawermainactivity" android:layout_width="match_parent" android:layout_height="match_parent"> <framelayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/containerview"> <android.support.v7.widget.toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="?android:attr/actionbarsize" androi

windows - Python Command Prompt -

i have both python 3 python 2 version installed in windows pc. on calling variable name 'py' in cmd, python2.7 shows though have mentioned python34 folder path in local environment path values. please recommend fix. you can resolve setting environment variable set py_python=3 or editing py.ini in applications data folder , adding following line: [defaults] python=3 typically, application directory found in c:\documents , settings\[username]\application data or c:\users\[username]\appdata\local\ depending on windows version.

java - Wait for read lock? -

how can wait lock before checking it? basically, want cache list in private variable. populate list every once , while, other 99.999999% of time, want read it, don't want lock every time read. public class someservlet extends customservlet { private static object locker; private static list<string> somelist; // moderately heavy populate, not called private void populatelist() { // lock somelist.clear(); somelist.addall(gettheliststuff()); // unlock } public void dogetlikemethod(httpservletrequest req, httpservletresponse res) { // looking @ sort of method check lock // , wait it, preferably timeout if(!locker.islocked(1000) && somelist.isempty()) { populatelist(); } // lock present far less 0.01% of time checked } public void updatesomelist() { populatelist(); // populate list other reason } } this in servlet , not using

dictionary - Run Rand() Excel function until desired outcome occurs -

i trying simulate values portfolio, , part of includes generating pairs of 1200 randomly generated numbers. skipping few steps, portfolio consisting of multiple paths set up. in order calculate continuously compounded return, terminal values of each path need positive, in turn depend on randomly generated numbers. now question be, possible keep rand() function running, until of terminal values exhibit positive signs? or need manually click "calculate" until result want? thank in advance. there 3 approaches consider: use =randbetween(0,1200) instead of rand multiply rand result -1 if negative surround rand abs(...)

cloud - Why does this Salt run fail with "Unable to determine Chocolatey version"? -

trying cloud orchestration using salt. goal install packages on windows using chocolatey via salt. success: chocolatey installed on windows. failure: successive packages not installed on windows using salt's chocolatey module. when u locally. two windows 2012 instances on aws on installed chocolatey. $ sudo salt 'windows\*' test.ping windows2-minion: true windows-minion: true both got installed chocoloatey 0.9.9.11 version. next, trying install packages on these machines/minions master firing command (or other package name): $ sudo salt 'windows*' chocolatey.install jdk7 but got error: $ sudo salt 'windows*' chocolatey.install jdk7 windows2-minion: error: unable determine chocolatey version windows-minion: error: unable determine chocolatey version i using salt 2015.8.1 (latest version). master on rhel 7. machines on aws. just had same issue, able fix editing chocolatey.py module. change lane 105 in c:\salt\bin\lib\sit

Azure Table Storage Rowkey Query not returning correct entities -

Image
i have azure table storage lot of entities , when query entities rowkey(which of data type "double") less 8888 using query "rowkey le '8888' ".i entities rowkey greater 8888 also. even if storing double data type in rowkey, gets stored string (both partitionkey , rowkey string data type). behavior seeing correct because in string comparison 21086 smaller 8888 . what need make both of these strings of equal length pre-padding them 0 (so rowkey values 000021086 , 000008888 example) , when perform query, these values not returned.

char - C++ - Getting Byte from Console -

Image
i new c++ , coming c# / java background feel kind of spoilt. what trying achieve here data input user byte ( unsigned char ) using cin . #include <iostream> using namespace std; typedef unsigned char byte; int main() { byte num = 0; char exitkey = '0'; cout << "type in number between 0 , 255.\n"; cin >> num; cout << "\nyour number multiplied 2 is:\n" << (num * 2); cin >> exitkey; return 0; } the value returned ascii decimal value of character typed in. how can actual value, treating value number? help appreciated. thanks. it doesn't matter type-aliases use, when reading using cin >> character character, , read character. the value getting ascii code character '1' . if want read number, use proper numeric datatype, int .

hashtable - Java spell checker using hash tables -

i don't want codes. want learn logic myself need pointing right direction. pseudocode fine. need create spell checker using hash tables primary data structure. know may not best data structure job tasked do. words correct spellings come text file. please guide me on how approach problem. the way i'm thinking of doing it: i'm guessing need create adt class takes string words. i need main class reads dictionary text file , takes sentence inputted user. class scans string of words places each word arraylist noting spaces in between words. boolean method pass each word in arraylist class handle misspellings , return if word valid or false. i believe need create class generates misspellings word list , stores them hash table? there boolean method takes string parameter checks in table if word valid , return true or false. in generating misspellings, key concepts have out be: (take example word: "hello") missing characters. e.g. "ello", "