Posts

Python/Tkinter: Update button from every second -

i'm trying start thread (without understanding threads are) call function different python file every second, , set label's text attribute str returns. result a label every second updated show current time. use while true loop stop succesive code running, including tkinter's tk.mainloop() . i've seen lot of questions topic on haven't gotten solution work far. what python method can start process continually calls external function? , should before or after mainloop() ? mainloop() loop doing? python program continues yet somehow tkinter still able check events? running python 3.4 this how i'd it. no, i'd wrap class , instantiate class i'm stealing whole-cloth the linked question import tkinter tk import customfunc def run(): root = tk.tk() s_var = tk.stringvar() tk.label(root, textvariable = s_var).pack() def update_time(): s_var.set(customfunc.func()) root.after(1000, update_time) update_...

java - Why WebElement and List<WebElement> are processed not in the similar way via xpath and List is always null? -

i'm using thucydides 0.9.229 selenium shipped it. obtain webelements try them via list @findall({@findby(xpath = "//div[text()='Расположение']/../../td[2]//input[@type='text']")}) private list<webelement> placement; with no result, placement returned null, while here @findby(xpath = "//div[text()='Расположение']/../../td[2]//input[@type='text']")}) private webelement placement; there placement not null, correct webelement handled well. far understand, firs example should return 1-value list anyway, more values if there additional elements fitting criteria. so, wrong, why can't list of webelements there? i have same issue @findall, , returns null. however, can use @findby list of elements too. may used mark field on page object indicate element or list of elements. @findby(xpath = "//div[text()='Расположение']/../../td[2]//input[@type='text']")}) private list<webelemen...

java - Eclipse auto-generates wrong type of JavaDoc template for getters and setters -

i have configured customized template getter , setter javadocs in eclipse's code templates. however, it's used when use "generate getters , setters" dialog (which creates methods. the template not used when creating javadoc comments existing getters , setters, either typing /**lf or right clicking method , choosing source > generate element comment. when that, eclipse seems using generic method template, not specific getter or setter template. is there way change this? if matters, i'm using os x 10.9.2 eclipse kepler service release 2 (build id 20140224-0627). under preferences => java => code style => code templates, there's getter body , setter body , can edited, clicking edit on upper right of fields outline view. hope helps...

carmen rails undefined method `country_code' for nil:NilClass -

i'm having following error while trying pass locals partial: undefined method `country_code' nil:nilclass this code looks like: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>trial</title> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <script type="text/javascript"> $(document).ready(function() { $('select#order_country_code').change(function(){select_wrapper = $('#order_state_code_wrapper'); $('select', select_wrapper).attr('disabled', true); country_code = $(this).val(); url = "subregion_options?parent_region=#{country_code}"; $('#order_state_code_wrapper').load(url); }); }); </script> </head> <body> <%= form_for(:order) |f| %> <div class="field"> <%= f.label :country_code %><br /> <%= f.country_select :...

javascript - Can I add on the webpage, data that I get from a Highcharts function? -

i add text canvas, on top of legend , other text implemented in highcharts; thinking add elements page on have chart container. now not sure if can so, since data require needs come data highcharts uses build charts (csv files), average, min-max , on. is there easy way so; or should add different script in page, written in pure js, retrieve data , present it? or can add these info directly on canvas? still new hc, not sure can , such. in general, once loaded file, can create chart , add info on page, snippet: $.get(url, function(data){ createchart(data); addextrainfotothepage(data); }); now can write 2 functions , want. you have solution, after created chart can add info th page, snippet: $.get(url, function(data){ // parse csv file ... $("#contianer").highcharts({ // set options, series etc. }, function(chart) { // add info min/max/avg page here // have access series like: // chart.series[index]...

java - Error in moving variables from android class to php side -

i developing app , have problem in transferring variables android php script. connection established. appreciated. here java code. // open url connection servlet fileinputstream fileinputstream = new fileinputstream(sourcefile); url url = new url(uploadserveruri); // open http connection url conn = (httpurlconnection) url.openconnection(); conn.setdoinput(true); // allow inputs conn.setdooutput(true); // allow outputs conn.setusecaches(false); // don't use cached copy conn.setrequestmethod("post"); conn.setrequestproperty("connection", "keep-alive"); conn.setrequestproperty("enctype", "multipart/form-data"); conn.setrequestproperty("content-type", "multipart/form-data;boundary=" + boundary); conn.setrequestproperty("uploaded_file", filename); dos = new dataoutputstream(conn.getoutputstream()); dos.writebytes(twohyphens + boundary + lineend); dos.writebytes("content-disposition: form...

I can not update a record with fluent nhibernate 3 and map with generatedby.assigned generator -

i have design fluent n hibernate, use nhibernate linq query database. app use domain driver architecture. database mssql 2012. don't have problem insert, update or delete table except case of 1 table use id without seed identity. need use in map following: public class syschoollogomap : classmap<syschoollogo> { public syschoollogomap() { readonly(); table("syschoollogo"); id(x => x.id).column("imgid").generatedby.assigned(); map(x => x.contenttype).column("contenttype").nullable(); map(x => x.imagenbytes).column("image").not.nullable().length(50000); map(x => x.imglenth).column("imglen").nullable(); map(x => x.imagefile).column("imgfile").nullable(); map(x => x.officialuse).column("officialuse").nullable(); map(x => x.imagecode).column("imagecode...