Posts

Showing posts from April, 2014

visual studio - View diff between two git revisions in VS2013 -

Image
when using git source control in vs2013, there way show diff between 2 arbitrary versions of source file in integrated editor (either built in functionality or free extension/plugin)? so far found out how display changes made since last commit or 1 commit next. if makes difference: i'm using vs c++. you can following: right click on file , choose "view history" on history tab choose 2 revisions you'd compare finally click on 1 of selected revisions , choose "compare..."

c# - MemoryCache over Threads -

i'm investigating code has cache layer @ bottom level uses memorycache class. c# windows service app not web/iis. there section of code spawns off number of threads in creates , executes code in poc perform calculations. these stored in above mentioned cache layer. been seen looks cached values seem getting stored per thread , not @ apication level. thought memorycache singleton sit out side of individual threads. can confirm behaviour expected? many comments. a memorycache thread-safe there no reason assume it's singleton. if want different threads access same memorycache instance need give them reference same instance (either singleton (really bad) static (still bad) or through argument passing dependency injection (good)). the simple way (which use global state) access default memory cache: var cache = memorycache.default; // not idea , harder test, works you can find specific docs here . make sure configure in app/web.config file .

Fiware - run Cosmos CLI error -

im trying run code http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/bigdata_analysis_-_user_and_programmer_guide and im stuck @ line "easy_install https://forge.fi-ware.org/frs/download.php/1309/cosmos-0.16.0-py2.7.egg " system print out: downloading https://forge.fi-ware.org/frs/download.php/1309/cosmos-0.16.0-py2.7.egg processing cosmos-0.16.0-py2.7.egg removing '/usr/lib/python2.6/site-packages/cosmos-0.16.0-py2.7.egg' (and under it) creating /usr/lib/python2.6/site-packages/cosmos-0.16.0-py2.7.egg extracting cosmos-0.16.0-py2.7.egg /usr/lib/python2.6/site-packages syntaxerror: ('invalid syntax', ('/usr/lib/python2.6/site-packages/cosmos-0.16.0-py2.7.egg/cosmos/cli/command_util.py', 145, 20, ' return {k: v k, v in json.iteritems() if k not in filter_keys}\n')) cosmos 0.16.0 active version in easy-install.pth installing cosmos script /usr/bin installed /usr/lib/python2.6/site-packages/cosmos-0.16.0-py2.7

php - Yii2 give array fields names and save to database -

can give each item saved array , database name. for example have 3 form fields saved same array. can setup fields below or if below not correct best way it? echo $form->field($model, 'arrayfields')->textinput([ 'name'=>'field1inarray[]', ]); echo $form->field($model, 'arrayfields')->textinput([ 'name'=>'field2inarray[]', ]); echo $form->field($model, 'arrayfields')->textinput([ 'name'=>'field3inarray[]', ]); also how go saving array database in controller/model? i used below in view <?= $form->field($model, 'example[arrayfield1]')->textinput(['maxlength' => 255])->label('array field 1') ?> <?= $form->field($model, 'example[arrayfield2]')->textinput(['maxlength' => 255])->label('array field 2') ?> and within controller save database did following publ

java - How to stop Eclipse / Scala IDE from uploading all my projects at once? -

[edit]: dont have git console installed , therefore use git-plugin eclipse. i have several projects in eclipse / scala ide this: project 1 project 2 project 3 ... it can happen work on i.e. project 1 , changes. after work on project 2 , create changes. project 2 still faulty, have not finished changing code , want go bed or this. now click on project 1 -> team -> commit ... , down in file-window have done pops (project 1 - want upload, , project 2 - faulty , dont want upload). i aware there filter, can type in text , upload stuff project 1, have type everytime. if forget use filter? upload faulty code! also filter primitive, cant save templates later click on, have type correct(!) filter-text everytime want commit. so there way click on project , upload that? or keep other projects being uploaded until ready? it practice select files wanted commit. you can using command line using git add <file-name> git commit . think eclipse provide

c++ - How to detect if there is a leap second when using the tm struct? -

according struct tm documentation , value tm_sec can 0 - 61 , range include leap seconds in systems. how can detect if there leap second in system , in opensuse 13.2 machine specifically? leap seconds not related particular system. not directly informatic problem rather physical one. in ideal world, every clock accurate, there no reason leap seconds. in our restricted world, clocks tend deviate. moving system time, specially moving backwards can cause bad things happen. if batch task stores time of last run know files has been processed , because of clock moving backwards thinks time before last run, process again file may plain wrong. for reason, system developpers invented leap seconds allow system adjust system clock (of course slight deltas, enough if check clock on regular base) without having move backwards. as noted @supuhstar, operating system implementation of leap seconds. leap seconds have true physical origin , introduced compensate variation betw

javascript - Generate report from form to confirm before submit -

i have form checkboxes (in fact radio buttons instead of checkboxes). want create report list of checked options. report should confirmed befor submit form. how this? there 2 other functions in code. form looks similar form below <form method="post" action="add.php" onsubmit="return otherfunction();"> <?php while($linia=mysql_fetch_array($result)){ echo "<tr><td>".$linia['description']."</td><td><input type='radio' name='check".$i."' value='1' onclick='activefunction(".$i.")'><input type='hidden' name='vcheck".$i."' value='".$linia['id_description']."'></td>"; } <button type='submit'>send form</button> ?> i need work that: checks of radio buttons click submit person should see checked options read , confirm if there no mistake

java - Check phone's internet connection continuously, even after the app is closed -

i need continuously check phone's internet connection inside application, after application closed, , send notification when internet off. i searched lot , couldn't find sample or clue or answer... can me how can implement this?

android - Titanium studio install modules -

i have been trying few days , still no hope. i have downloaded https://github.com/iamyellow/gcm.js gcm.js iamyellow, , install in titanium through help->install mobile module-> select .zip downloaded. after included in tiapp.xml in project keeps showing requested module not found. i created new project in app.js , still shows requested module not found require("net.iamyellow.gcmjs"); the folder available in ~/library/application support/titanium/modules/android , cant import app. according example provided in distribution should require module this: var gcm = require('lib.gcm');

How to generate xml description for each function using nusoap in php? -

Image
i have developed soap api using nusoap in php. have created function that. have created file service.php & when hit file on url document functions. this: my nusoap doc but want have xml description functions. this: required output please tell me how it this code service.php <?php require_once "lib/nusoap.php"; require_once "functions.php"; $server=new nusoap_server(); $server->configurewsdl("soap", "urn:soapn"); $server->register("addrecord", array("fname"=>"xsd:string","lname"=>"xsd:string","buis_name"=>"xsd:string","phone_num"=>"xsd:int","city"=>"xsd:string","state"=>"xsd:string", "zipcode"=>"xsd:int","email"=>"xsd:string" ,"w_store"=>"xsd:string","con_stor

Run java file (Storm helloWorld example) in linux command line including libraries -

i trying run apache storm in local mode in machine. i managed install , run storm follwoing: 1- install apachee zookeeper 2- install storm 3- configure storm (config.yaml) 4- start storm master , worker nodes (nimbus , supervisor) 5- start storm ui now issue run helloworld example i have using tutorial in link below http://wpcertification.blogspot.com/2014/02/helloworld-apache-storm-word-counter.html it has 4 java files 1- main: hellostorm.java 2- linereaderspout 3- wordspitterbolt 4- wordcounterbolt now when try run main file in command line (linux-based system), following error: error: package com.spnotes.storm.bolts not exist @ import com.spnotes.storm.bolts.wordcounterbolt; my guess didn't specify classpath correctly include location of storm, did following javac -classpath ~/public/apache-storm-0.9.4/lib/ hellostorm.java however still facting same problem. suggestions ? packages correspond directories if have import com.sp

php - How can I detect and print what characters str_replace() changed? -

i'm using code replace words each other. in scenario, in same time...just there 1 same word in #old , $string example $string = "da" , $string = "fjb" true $string = "ba" or $string = "dahjc" false. $string = "sdfsdfsdfa" $old = array("a", "b", "c"); $new = array("1", "2", "3"); $string = str_replace($old, $new, $string); how can detect characters got replaced str_replace() , print this: result: 'a' replaced '1' <?php $oldstring = "sdfsdfsdfa"; $main_array=array("a"=>"1","b"=>"2", "c"=>"3"); $old=array_keys($main_array); $new=array_values($main_array); $newstring = str_replace($old, $new, $oldstring); foreach ($main_array $key => $value) { if (strpos($oldstring,$key) !== false) { echo "result: {$key} replaced {$value} <br>"

ios - How to AutoLayout the buttons in uiview controller in iphone? -

Image
i have size of 4 inch , have added 4 icons in 3 different rows of equal size 60x60. can have proper view in iphone 4s,5,5s not in iphone 6 , 6 plus. how can apply auto layout , make icons bigger , of same ratio in iphone 6 , 6 plus. can made without coding? like this buttons should change size in iphone 6 , 6 plus i.e. should bigger , proper aligned. can possible without coding? a simple example: drag button object library viewcontroller's view in storyboard ctrl drag button view (drag left or right) , choose center vertically in container ctrl drag button view (drag top or bottom) , choose center horizontally in container ctrl drag button button (yes, same button) , choose aspect ratio in size inspector check button's aspect ratio constraint have multiplier of 1:1 ctrl drag button view (drag left or right) , choose equal widths in size inspector check button's equal width constraint have multiplier of 1:3 (or whatever value - 1:3 means that butto

r - plot lmer result in faceted ggplot -

i'm analysing repeated measures drug trials data , i'm not sure how plot lmer results when using faceted ggplots. have made initial plot of individual slopes master dataset, i'm doing lmer analyses separately sex. using publicly available data, has 2 treatment groups compared 4 have, replicable example below. uses reshape2 , lme4 , , ggplot2 packages. catanx <- read.fwf(file=("http://www.stat.ufl.edu/~winner/data/cats_anxiety1.dat"), widths=c(-6,2,-5,3,-5,3,-7,1,-7,1,-7,1,-7,1,-7,1,-6,2,-6,2,-6,2,-6,2,-6,2)) colnames(catanx) <- c('id','weight','age_months','gender','environment','origin','treatment','result','emotime1','emotime2', 'emotime3','emotime4','emotime5') library("reshape2") catanxrm <- melt(catanx, id.vars=c("id", "gender", "treatment"), measure.vars=c("emot

Python: terminate a multithreading program after some time using daemon thread -

i want implement program terminate after running time t , , t read command line using argumentparser . have following code (omit details): def run(): parser = create_arg_parser() args = parser.parse_args() class_instance = multithreadclass(args.arg1, args.arg2) class_instance.run() if __name__ == '__main__': run_thread = thread(target=run) run_thread.daemon = true run_thread.start() time.sleep(3.0) the program works expect (it terminates after running 3 seconds). mentioned before, running time (3.0 in code snippet above) should input command line (eg. args.arg3 = 3.0) instead of hard coded. apparently cannot put time.sleep(args.arg3) directly. wondering if there approach solve problem? answers without using daemon thread welcome! thanks. ps. if put argument parsing code outside of run function like: def run(args): class_instance = multithreadclass(args.arg1, args.arg2) class_instance.run() if __name__ == '__main__'

ruby - Step-by-step processes and contexts in RSpec -

i'm trying bdd rspec , i'm having hard time scaling techniques past simple examples. http://betterspecs.org/#contexts informs me should use 'context' method make expectations more simple describe. there 2 problems i'm having: 1) wrapping test in 'context' creates new scope, setup has done multiple times. haven't found way of using 'before' hooks make dry— can see repeated code below. 2) case see below step-by-step process, each step builds off next. first compositor instantiated, instruction added, instructions cleared. wouldn't big technical issue if 1) addressed, you'll notice context descriptions starting snowball, seems defeat purpose of 'context' method. can recommend refactor bring set of tests in line best practices? require 'spec_helper' describe compositor context 'when instantiated correct parameters' renderer = usbteensyrenderer.new("/dev/tty.usbmodem54121", 9600) com

qpython what is the alt button (previous command) -

does know how use/setup alt button in qpython 2.7 2? trigger alt+p previous command. on galaxy s6. there special key menu not see alt. under preferences see options control key, fn, or alt sends esc. unfortunatly feature trying access isn't developed in qpython. not possible access entered commands in qpython's console. , down arrows display escape sequences asyou can see on this question. the qpython3 on other hand has feature , seems app better developed. if can use python3 syntax instead of python 2.7, recommend go it.

mysql - PHP branching optimization and efficiency -

i've come across problems numerous times , have had feeling it's not efficient logic , can't seem find straight answer: in event of needing check database based on criteria, , update record if match true, while moving on different statement if match false, , inserting new record if database matches come false, there more efficient way optimize current branching? $id = *first query id* //returns null if no match if (is_null($_id)) { #no match $id = *fallback query looking id *; -->returns null if no match } if (is_null($id)) {#still no match $id = *last fallback query looking id*; -->returns null if no match } if (is_null($id)) { # no match found, doesn't exist in db insert //code insert new record } else { #match found //code update record* } have looked using replace into? http://www.mysqltutorial.org/mysql-replace.aspx

java - How can I access this variable inside of an ActionListener? -

public class daysalivegui { public static void main(string[] args) { eventqueue.invokelater(new runnable() { public void run() { try { daysalivegui window = new daysalivegui(); window.frame.setvisible(true); } catch (exception e) { e.printstacktrace(); } } }); } public daysalivegui() { initialize(); } private void initialize() { jbutton jbutton_calculate = new jbutton("calculate"); jbutton_calculate.addactionlistener(new actionlistener() { public void actionperformed (actionevent arg0) { int idaybirth = integer.parseint(jtextfield_dobday.gettext()); int imonthbirth = integer.parseint(jtextfield_dobmonth.gettext()); int iyearbirth = integer.parseint(jtextfield_dobyear.gettext()); int idaycurrent = intege

Logging MAC addresses into a csv using scapy and python -

alright, i'm trying create csv file list of mac addresses , ssids have been seen. code i've got far, of from: http://edwardkeeble.com/2014/02/passive-wifi-tracking/ using python 2.7. from scapy.all import * import csv, time datetime import datetime probe_request_type=0 probe_request_subtype=4 whitelist = ['de:ad:be:ef:ca:fe',] # replace phone's mac address def packethandler(pkt): if pkt.haslayer(dot11): if pkt.type==probe_request_type , pkt.subtype == probe_request_subtype , ( pkt.addr2.lower() not in whitelist , pkt.addr2.upper() not in whitelist): checkcsv(pkt) def printpacket(pkt): try: = pkt.notdecoded except: = none if extra!=none: signal_strength = -(256-ord(extra[-4:-3])) else: signal_strength = -100 print "no signal strength found" print "added: %s ssid: %s"%(pkt.addr2,pkt.getlayer(dot11probereq).info) open('logmacs.csv','ab

java - Manually Change Speaker Position -

unless mistaken, speaker consists of floppy metal sheet has many positions. in java, there way manually set position of speaker? looking along these lines: ... speaker.setposition(byte position); // or setspeakerposition(byte position); ... thanks in advance! you mistaken. speakers not metal sheets. (if want understand how typical speaker works, try this: http://electronics.howstuffworks.com/speaker.htm ) there isn't way (move "plate" specific position) in java. doubt possible @ hardware level ... unless speaker implemented in rather strange way / expensive / inefficient way. on top of that, in typical computer audio system, there number of hardware , software components between program , speaker plate, none of designed used way.

c# - In a panel, how can you add multiple visual elements per logical child? -

we have custom panel subclass we're each logical child that's added it, want add 2 additional visual children. if logical child removed, want remove 2 related visuals. internally map logical element 2 additional visuals keep track of of this. however, can't seem break one-to-one relationship between children collection , actual visual children in panel's implementation. here's our first attempt, we're not getting anywhere this. created custom subclass of uielementcollection exposes logicalchildren collection. while display proper items in panel, panel's children property returns visuals, not our logicalchildren collection , can't override children. we attempted use [contentproperty] attribute on class point different property, fixed xaml, still have children problem above. we considered newing on it, user cast down panel , @ guts. what want panel's children property hold logical things we've added externally. 2 additional visual

Facebook Graph API get page's comment -

using facebook graph api, want comments presents in page , filter them based on datetime. i've read this thread, doesn't expected. i can post , limit using date specific page e.g.: graph.facebook.com/110432309005026/tagged?since=<unix timestamp> now want same search comments. how far: graph.facebook.com/110432309005026/tagged?fields=comments{id,from,message,created_time} but how filter date of comment (not date of post) ? example, want comment since '2015-04-25 00:00:00' posts on page. need advice you can't looking however, filtering posts returned /tagged endpoint using since parameter. since looking comments date when fetch posts date comments can date. request instead: graph.facebook.com/110432309005026/tagged?fields=comments{id,from,message,created_time}&since=2015-04-25

windows phone - Error calling Instantiate in Unity on WP? -

gameobject obj = (gameobject) instantiate (resources.load ("actions/" + actions, typeof (gameobject))); no problem other platforms. but, when building on windows phone: object reference not set instance of object.

html - Android - Getting error when using fromHtml() to show content in a TextView -

basically objective show wordpress' post in activity requesting json. first request, later fill results inside object variables. variables object show in fields on view. this how make request: private void parsejsonfeed(jsonobject response) { jsonobject feedobj; try { if (response.length() != 0) { feedobj = response; jsonobject co = feedobj.getjsonobject("terms").getjsonarray("category").getjsonobject(0); category c = new category(escapenull(co.getstring("name"), true), co.getint("id")); itempost.setid(feedobj.getint("id")); itempost.settitulo(escapenull(feedobj.getstring("title"), true)); if (!feedobj.isnull("featured_image")) itempost.setimgurl(escapenull(feedobj.getjsonobject("featured_image").getstring("source"), false)); else itempost.

can't build the docker image with error saying image not found -

i trying build docker image public repository . had built before, today wanted update image latest one, removed older image, , tried pull new image. however, when tried $ docker pull dockerfile/ghost pulling repository dockerfile/ghost fata[0001] error: image dockerfile/ghost:latest not found i can't understand why doesn't work, supposed working. this need use docker pull ghost .

javascript - Keydown and keypress events gives different keyCode -

i've read through related answers , articles on so, still doesn't : on chrome console if add 2 listeners output keycode on keypress , keydown events different keycode when key lowercase. when uppercase however, keycode appears same 2 events. example: document.addeventlistener('keypress', function(e){ console.log('keypress', e.keycode); }); document.addeventlistener('keydown', function(e){ console.log('keydown', e.keycode); }); // open console // typing 'a' in result field outputs 'keypress 97' 'keydown 65' // on chrome 42 console. activate uppercase, , typing 'a' outputs 'keypress 65' , 'keydown 65' // why ? so normal behaviour ? what's difference between keydown , keypress in .net? … explains well. keydown tracking key itself, not state of key. if press a keydown generates keycode of keys.a , if press shift + a keycode of keys.a.

winforms - Setting Minimum Date for Date Time Picker for Windows Forms C# -

i'm working on to-do list windows forms application in c# features date time picker, through research able find able set minvalue property of date time picker within designer tab of form. the plan set minimum date value date time picker through following code: this.startdatepicker.mindate = system.datetime.now; this.startdatepicker.value = system.datetime.now; this isn't issue, code fine , works. sets minimum value date time picker today, preventing user choosing date before date. however, issue reason designer tab decides reset , automatically remove code. i wondering if there way prevent designer tab changing minimum value date time picker? are modifying .designer.cs file? it's autogenerated , changes lost. you're not supposed edit manually. just move lines form constructor same effect, right after call initializecomponent() .

scipy - Python multi dimensional sparse array -

i working on project need deal 3 dimensional large array. using numpy 3d array of entries going zero, it's lots of wastage of memory. scipy sparse seems allow 2d matrix. there other way can store 3d sparse array? scipy.sparse has number of formats, though couple have efficient set of numeric operations. unfortunately, harder ones extend. dok uses tuple of indices dictionary keys. easy generalize 2d 3d or more. coo has row , col , data attribute arrays. conceptually then, adding third depth (?) easy. lil require lists within lists, messy. but csr , csc store array in indices , indptr , data arrays. format worked out years ago mathematicians working linear algebra problems, along efficient math operations (esp matrix multiplication). (the relevant paper cited in source code). so representing 3d sparse arrays not problem, implementing efficient vector operations require fundamental mathematical research. do need 3d layout vector operations? you, e

java - JPA - EclipseLink make additional SELECT requests for relationships when merging an entity -

i've got question on "strange" behaviour when updating entity merge method. i have entity "personne" have 2 relationship (fetch = lazy) . have html form use modify fields of entity. when saving entity merge method, see select requests relationships. i don't understand why these selects done , avoid them because data loaded behaviour can "huge". there entity : @entity @table(name="personne") @namedquery(name="personne.findall", query="select p personne p") public class personne implements serializable { @id @generatedvalue(strategy=generationtype.identity) @column(unique=true, nullable=false) private integer id; @temporal(temporaltype.timestamp) @column(name="date_naissance") private date datenaissance; @column(length=75) private string denomination; @column(length=75) private string nom; @column(precision=10, scale=2) private bigdecimal poids; @column(length=75) private string prenom; @colu

c# - Import custom text format without separators -

i import .txt file format sql server table or convert each block of text pipe separated line. which tools or c# solution suggests resolve issue? any suggestions appreciated. thank you. ================= input (.txt file) ================= id: 37 name: josephy murphy email: jmurphy@email.com description: bla, bla, bla, bla... id: 38 name: paul newman email: pnewman@email.com description: bla, bla, bla, bla... : : ========================= output (sql server table) ========================= id | name | email | description 37 | josephy murphy | jmurphy@email.com | bla, bla, bla, bla... 38 | paul newman | pnewman@email.com | bla, bla, bla, bla... : : instead of datatable i'm writing directly sql server. need enter connection string , name of sql table in insert sql. if adding many lines consider using sqlcmd.exe comes sql server. accepts separator data , string sql. never used insert, use select sql. there host of different co

javascript - CORS to read a text file from a pastebin -

Image
i hoping use cors load code snippets pastebin, process them in browser. some code in progress here: http://www.boisvert.me.uk/opendata/sparql_aq+.html the code highlighted , there options run etc. i'd provide simple service, user saves text anywhere public, queries: http://www.boisvert.me.uk/opendata/sparql_aq+.html?sparqlurl=whatever-url for example, url is: http://pastebin.com/raw.php?i=gruu9zwe http://www.boisvert.me.uk/opendata/sparql_aq+.html?sparqlurl=http%3a%2f%2fpastebin.com%2fraw.php%3fi%3dgruu9zwe but when using cors, repository returns empty file. cors blocked systems (e.g. pastebin.com?) or doing wrong? i attach images firefox debugger, showing, unless i'm missing point, blank response returned cors, , in case helps, headers. finally, cors code: function corsrequest(url) { var xhr = new xmlhttprequest(); if ("withcredentials" in xhr) { // check if xmlhttprequest object has "withcredentials" property.

oop - JavaScript Inheritance Object.call() undefined -

i attempting create object-oriented approach program. read should create inheritance of world sprite sprite being parent, sprite.call(this, imagepath) comes imagepath undefined. assume other variables in call undefined. how appropriately call parent variables? function sprite(spritex, spritey, spritew, spriteh, scale, positionx, positiony, direction) { this.imagepath = world_sprite; this.spritex = spritex; this.spritey = spritey; this.spritew = spritew; this.spriteh = spriteh; this.scale = scale; this.positionx = positionx; this.positiony = positiony; this.direction = direction; this.speed = 5; this.nogravity = false; this.direction = 0; //physics stuff this.velx = 0;

export data from sheet1 to multiple sheets using vb.net -

i trying export specific data 1 sheet multiple sheets. i not asking give me whole code need example start for example: sheet1 has data value1 4 value2 7 goes sheet named value type of car honda goes sheet named car model civic category exp category2 wo goes sheet named category xlworkbook = xlapp.workbooks.open("..\desktop\test.xlsx") '~~> opens destination workbook. change path , filename applicable ' xlworkbook2 = xlapp.workbooks.open("c:\tutorial\book1.xlsx") '~~> display excel xlapp.visible = true '~~> set source worksheet xlworksheet = xlworkbook.sheets("sheet1") '~~> set destination worksheet xlwsheet2 = xlworkbook.sheets("sheet5") '~~> set source range xlsourcerange = xlworksheet.range("a1:l8") '~~> set destination range

python - Overlapping tick marks in inset plot matplotlib -

in older version of matplotlib (with winpython 3.4.2.3), if wanted include subplot inset, hid tickmarks below it: http://imgur.com/gsktcua,koqgek6#1 in upgraded version (with winpython 3.4.3.2), overlays both of axis tick marks: http://imgur.com/gsktcua,koqgek6#0 how revert old behavior, bottom plot's ticks hidden? thanks! here overview of plotting code: fig=plt.figure(8, figsize=(8,7), dpi=300) ax1 = fig.add_axes([0.1, 0.1, 0.8, 0.8], xscale='log', xlim=(5e-8, 1e-4), xlabel='...', ylabel='...',ylim=(-0.3,9)) # main axes ax2 = fig.add_axes([0.52, .52, .38,.38], xscale='log', xlim=(5e-8, 1e-4), xlabel='...', ylabel='...') # inset axes # main figure ax1.plot(...) # insert ax2.plot(...) xticks = ax2.xaxis.get_major_ticks() print(xticks) xticks[5].label1.set_visible(false) #xticks[-2].label1.set_visible(false) yticks = ax2.yaxis.get_major_ticks() print(yticks) yticks[-1].label1.set_visible(false) #start3, end3 = ax2.g

java - Does `javax.imageio.ImageIO` require file locking? -

my app saving images folder. simultaneously piece of software watches on folder , prints pasted images. problem i've encountered printing app can send on printer half rendered image or doesn't react saved images @ all. i'm using javax.imageio.imageio.write(renderedimage im, string formatname, file output) save bufferedimage png format. if locking required please provide code example explicit locks. if not explain why. i've tested on windows , jre 1.8 basically, should write image temporary file , rename final file name. way file written before other app becomes aware of it.

c# - Access to Path "something" is denied -

most of solutions here don't work. i trying upload file, image, folder in server called images, when click button upload it, after passes imageupload.saveas(path) exception "access path "any path here" denied, tried editing security tab of folder , gave permission network service , tried giving permission iis apppool\defaultapppool , still not working. enabled asp.net impersonation in iis manager other people said, still same error. the default identity applicationpool runs in, applicationpoolidentity , not network service account. you assign modify rights on folder applicationpoolidentity (look here ), or can change identity of application pool different user permissions on uploads folder. do take care when run applicationpool different user: make sure not give user more rights in absolutely needs.

java - Occasional exception org.hibernate.QueryException: could not resolve property -

issue: in our web application under high load sometimes, when there 2 simultaneous hibernate queries in different threads (in same millisecond), have 2 exceptions (in both threads): " org.hibernate.queryexception: not resolve property " on different entities , different properties. looks 2 queries have exchanged property mappings reason abstractpropertymapping class can't find required property in mappings of other query's entity , raises queryexception . each entity used in 1 thread. environment: apache tomcat 7 spring 4.0.6 hibernate 4.3.6.final configuration: <!-- configuration --> ... <bean id="transactionmanager" class="org.springframework.orm.hibernate4.hibernatetransactionmanager"> <property name="sessionfactory" ref="sessionfactory" /> <property name="nestedtransactionallowed" value="true" /> </bean> <bean id="transactiontemplate"