Posts

Showing posts from July, 2013

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&

asp.net - how to validate email with jquery -

i have input form asks user enter username , password. once user enters data, , clicks submit button , jquery run post request , send information controller /home/registeruser, im getting an exception of type 'system.nullreferenceexception' occurred in email2.dll not handled in user code additional information: object reference not set instance of object. for reason ajax request not able obtain values email , password, set null ie email = null. version information: microsoft .net framework version:4.0.30319; asp.net version:4.0.30319.18446 webform1.aspx <%@ page language="c#" autoeventwireup="true" codebehind="webform1.aspx.cs" inherits="email2.webform1" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>

android - GitHub XCRUN Error Between Xcode and Eclipse -

i use both xcode , eclipse. have eclipse project pull github, , when trying pull project getting message says xcrun: error: active developer path ("/applications/xcode 2.app/contents/developer") not exist, use xcode-select change any idea what's going on here? trying pull eclipse project getting error talking xcode. figured out. ran sudo xcode-select --reset in terminal, seemed clear issue , able use github normally.

android - Remove shadow overlay on top edge of LinearLayout -

Image
as above: have sliding drawer in form of linear layout, linear layout has semi transparent black background gradient, however, seems there sort of default overlay gradient applied top edge of layout default, there way disable this? tried: <style name="nooverlayshadow" parent="appbasetheme"> <item name="android:windowcontentoverlay">@null</item> </style> this code app, , working <style name="apptheme" parent="@style/theme.sherlock.light.darkactionbar"> <item name="actionbarstyle">@style/widget.styled.actionbar</item> <item name="android:actionbarstyle" tools:ignore="newapi">@style/widget.styled.actionbar</item> </style> <style name="widget.styled.actionbar" parent="widget.sherlock.light.actionbar.solid.inverse"> <item name="background">@android:color/tr

ruby on rails - Deploying to ec2 instance failing when access GitHub private repo -

i set github account year ago, , generated new ssh key @ time (to push , pull github command line). few days ago spun new ec2 instance, , downloaded .pem file gave me ssh it. able ssh server through command line using .pem file. i'm using capistrano deploy rails app, , running cap staging deploy:check . in deploy.rb file, have private repo git url, , in staging.rb file have set set ssh_options location of .pem file downloaded ec2 instance. when command starts run, connecting server fine, when tries access git repo, git_askpass=/bin/echo git_ssh=/tmp/<app_name>/git-ssh.sh /usr/bin/env git ls-remote -h git@github.com:<username>/<app_name>.git , fails message: permission denied (publickey). fatal: not read remote repository. been researching issue online, , i've gathered seems need same ssh both github , ec2 server. perhaps information incorrect...have been unsuccessful far. would love advice issue. thank time. if issue register pub

google apps script - Typo error: Cannot call method "getDataRange" of null -

im trying publish code, everytime when run code error cannot call method"getdatarange" of null. please me sort out .here code function doget() { var ss = spreadsheetapp.openbyid('sheet id'); var sheet = ss.getsheetbyname('sheet name'); var data = sheet.getdatarange(); var datefilter= charts.newcategoryfilter().setfiltercolumnindex(0).build(); var agefilter = charts.newnumberrangefilter().setfiltercolumnindex(7).build(); var transportfilter = charts.newcategoryfilter().setfiltercolumnindex(2).build(); var namefilter = charts.newstringfilter().setfiltercolumnindex(1).build(); var tablechart = charts.newtablechart().setdimensions(700, 300) .setdataviewdefinition(charts.newdataviewdefinition().setcolumns([0,1,2,3,4,5,6,7])) .build(); var piechart = charts.newpiechart() .setdataviewdefinition(charts.newdataviewdefinition() .setcolumns([1,7])).build(); var dashboard = charts.newdashboardpanel

jquery - Repeating multiple images with CSS repeat-x -

i'm making uhd project requires displaying huge images. there's no problem stationary browsers ios , mobile browsers limited in field. max resolution ios png 5 megapixels far lower of images need display. jpeg , other formats not option. so far decided split big images smaller ones , i've encountered problem. i've created fiddle show what's going on. jsfiddle as can see used 2 images in "background-image" show exact problem. first image (circle) appears on top of second (square). here code css: <style type="text/css"> html { overflow-x: hidden; } html, body { height: 100%; width: 100%;} body { overflow-x: hidden; background-image: url('http://www.clipartbest.com/download?clipart=di7erd49t'), url('http://i126.photobucket.com/albums/p89/robertthomas_2006/600x600.png'); background-repeat: repeat-x, repeat-x; background-positi

linux - cannot run node.js webservice on port 80 or 443 -

i have vps running centos , i'm experimenting node.js. ran example node.js server running correctly on various ports, whenever tried run node on port 80 (same error 443) following error: root@mic [~/projects/nodetutorial2]# node index.js server running on port 80. events.js:72 throw er; // unhandled 'error' event ^ error: listen eaddrinuse @ errnoexception (net.js:883:11) @ server._listen2 (net.js:1021:14) @ listen (net.js:1043:10) @ server.listen (net.js:1109:5) @ object.<anonymous> (/root/projects/nodetutorial2/index.js:8:4) @ module._compile (module.js:456:26) @ object.module._extensions..js (module.js:474:10) @ module.load (module.js:356:32) @ function.module._load (module.js:312:12) @ function.module.runmain (module.js:497:10) i've tried redirect port 80 3000 doing: sudo iptables -t nat -a prerouting -i eth0 -p tcp --dport 80 -j redirect --to-port 3000 apparently executed command twice

ios - How to retain ViewContoller when popped Objective -C -

how retain view contoller when popped stack ? basically have mp3 player view controller. when i'm in view controller, can play music. when music playing , navigate different controller, music stops playing, , when navigate controller, starts instance of it. guess fix, retain view controller ? this how initiate music player view controller: nsstring *songlargeartworkurl = [self.songartworkurl stringbyreplacingoccurrencesofstring:@"large" withstring:@"crop"]; musicplayerviewcontroller *musicplayer = [[musicplayerviewcontroller alloc] init]; musicplayer.songname = self.teststring; musicplayer.songartwork = songlargeartworkurl; musicplayer.songstream = self.songstreamurl; [self.navigationcontroller pushviewcontroller:musicplayer animated:yes]; instead of using local variable musicplayerviewcontroller , use instance variable. first time, allocate musicplayer instance. shown below: nsstring *songlargeartworkurl = [self.songartworkurl stringbyrepl

ruby on rails - Assign value using loop in HAML -

my question kind of general ruby question, i'm using haml i'll ask in context. i'm using twitter bootstrap , want iterate on list populate popover's content i have: %div =link_to link_name, link, ..., "data-content" => <my_content_here> and want put following data content. i've tried partials, can't seem work %div f.item.each |t| .myclass=t haml %div - f.item.each |t| = link_to link_name, link, ..., data: {content: your_content}, class: t you'll benefit reading on haml docs you need indent each code bock; div being block & . each loop being block the main thing need remember = equal <%= | - equal <%

sql - MySQL Doesn't Run in SqLite Can I Build it with Doctrine2 Query Builder? -

i have nice query updating "parent" (observation) value depending on set "child" (action) table. observation can have many actions, , when marked 'resolved' parent observation marked resolved too. this mysql script. update observation inner join ( select co.id obs_id, sum(at.resolved) tasks_resolved, count(at.id) total_tasks observation co inner join action_task @ on at.observation_id = co.id co.id = ( select task.observation_id action_task task task.id = 5 ) ) val on val.obs_id = observation.id set observation.resolved = case when val.tasks_resolved=val.total_tasks 1 else 0 end ; i wanted bring query doctrine 2 repository. tried afternoon build query builder script it, ended running whole script exec command. i started building functional tests, threw error because cannot have inner join in update - becau

xml - Android appcompatv7 : error in resources -

today when opened eclipse today , when created new android project. appcompatv7 gets automatically gets imported per new sdk. appcompatv7 showing error. when expanding appcompatv7 there error in res --> values-large --> theme_base.xml , res --> values-large-v14 --> theme_base.xml. error in xml file shows "no resources found matches following name". please , due new project showing error. <resources> <style name="theme.base.appcompat.dialogwhenlarge" parent="theme.base.appcompat.dialog.fixedsize" /> <style name="theme.base.appcompat.light.dialogwhenlarge" parent="theme.base.appcompat.dialog.light.fixedsize" /> </resources> for worth, had similar compile problem, , found out google's appcompat library had breaking api change few of base themes. fixed renaming: theme.appcompat.light to base.theme.appcompat.light , theme.base.appcompat.dialog.fixedsize to

javascript - Are loops considered "operators"? -

at javascript tutorial website knows , use reference, stated conditionals considered "operators". person here @ stackoverflow confirmed me while back. loops kind of behave similar conditionals in not "objects" , run blocks of code with twist , , i've been wondering if loops, loop , while loop , while loop considered "operators" or if considered "loops", categorically independent. i tried looking here, in various manuals , tutorial sites , found no information, sorry if base question. at javascript tutorial website knows , use reference, stated conditionals considered "operators". it’s wrong! (w3schools wrong lot. w3schools? stop using w3schools reference.) they’re called “statements” ecmascript standard. “control statements” correct, among other names, none of “operators”.

Access file unexpectadly decreased in size -

i've been working on access database when noticed size of file had decreased 23mb 4mb when compared backup made last week. understand kind of behaviour might expected if compacted , repaierd it, haven't done in while. i've run comparisons on 2 databases, , beside few changes i've made week, data, forms, reports, modules , queries seem same. i'm wondering if kind of pointer towards iminent corruption (which has happened once before on earlier version of database), or if there other explanation. i have 1 on 400mb in size, multiple users in time. when chance, i'll compact , goes ~100mb. if want development, i'll save current copy flash drive , work on copy. saving in location, goes ~100mb. you did made few changes, , if things safely, made changes non-production copy. reason shrinking. -edit choosing copy/paste location not shrink it, "save as" me.

android - Get the data from array list from onPost execute method of async task -

i using asynck task json , parse it.the value of parsed json storing in arraylist . want want arraylist in different class.i have made method getlist() arraylist there getting null value async class public class searchjobasync extends asynctask<string, string, string> { private string response; context c; searchmodel data; arraylist<searchmodel> values; getarraylist list; public searchjobasync(context c, getarraylist list) { this.c = c; this.list = list; } public interface getarraylist { public void getlist(arraylist<searchmodel> data); } public searchjobasync(context c) { this.c = c; } @override protected void onpreexecute() { super.onpreexecute (); commonfunctions.showprogress (c, "please wait...", true); } @override protected void onpostexecute(string s) { values = new arraylist<searchmodel> (); s

xml - Placing android button in a particular place -

Image
i want place android button1 in specific place in android screen, depends on textview1 size showing in different places. how can place android button in particular place <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".infoactivity" > <linearlayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_alignparentleft="true" android:layout_alignparentright="true" android:layout_alignparenttop="true" android:orientation="vertical" android:background="@drawable/backquiz"> <textview android:id="@+id

how to insert multi textbox array in ruby on rails -

i'm new ruby. need insert array textbox values has_many , belongs_to relationship.i used 2 models intrrattes , intrsetups. here new.html.erb file <%= form_for @intrsetup |f| %> <div class='row'> <div class='span6'> <div class="control-group"> <label class=" control-label">effective from<abbr title="required">*</abbr></label> <div class="controls"> <%= f.text_field :effective_from, :onclick => "return calender()" %> </div> </div> </div> <div class='span6'> <div class="control-group"> <label class=" control-label">effective to</label> <div class="controls"> <%= f.text_field :effective_to %> </div> </div> </div> </div>

python - multiprocessing.Manager() communication with main programm didn't work -

why didn't work code? tried make process multiprocessing worked in while 1 loop. want these processes have shared memory main process comunicate together. demo-code testing manager: import multiprocessing import time def f(ls,lso, ): print "input ls:" print ls print "input lso:" print lso ls[0] += 1 ls[1][0] += 1 ls_2 = ls[2] print ls_2 ls_2[0] += 1 print ls_2 ls[2] = ls_2 print "output ls:" print ls tmp = [] tmp.append([1, 2, 3]) tmp.append([5, 6, 7]) lso = tmp print "output lso:" print lso if __name__ == '__main__': manager = multiprocessing.manager() #ls = manager.list([1, [1], [1]]) ls = manager.list() lso = manager.list() lso = [[0, 0, 0], [0, 0, 0]] tmp = [] tmp.append(1) tmp.append([1]) tmp.append([1]) ls = tmp print 'before', ls, lso p = multiprocessing.process(target=f, args=(ls, lso,

arrays - stripping a line with proper indent in python -

input: $target: ensg00000097007|abl1 length: 3075 mirna : hsa-mir-203 length: 22 mfe: -30.5 kcal/mol p-value: 0.606919 position: 2745 target 5' c g c 3' gugguccuggaca cac caccaggauuugu gug mirna 3' gau aaa 5' i have strip last 2 lines , assign 2 arrays , read each character , obtain ouput shown down, after stripping line should in format : caccaggauuugu gug gau aaa and if line character read line1 should printed in lower case , if second line should in upper case the final output of program should "gaucaccaggauuuguaaagug" the code tried read did not strip lines in perfect alignment seen in input here code used: import fileinput import sys sys import argv script, filename = argv file = open(filename) og1 = "aguuccuuuguuuuggugacug" pattern = " " pattern1 = "mirna 3'" file = open(file

algorithm - Breakdown of the cost and time required for Fizzbuzz in worst case -

Image
the fizz-buzz function (in pseudocode) takes positive integer n . i'm curious algebraic breakdown of cost , time required of if-else statement. know worst case running time o(n). fizz-bizz(n) = 1 n if (n % 3 == 0) print "fizz" if (n % 5 == 0) print "buzz" if (n % 3 != 0 , n % 5 != 0) print n example of breakdown of algorithm: the time complexity o(n) because if statement has no real effect on that. complexity of if statement constant on large enough dataset. the if statement may different amount of work in iterations have multiple of 3 or 5 but, amount of work per loop iteration not dependent on n . in fact, averages out constant n becomes bigger. and, aside, think code may wrong. @ multiples of fifteen, should print both fizz and buzz . if want level in edit (the added breakdown), need assign arbitrary cost c i each statement (and cost constant single execution of statement) figure out how many

java - Cannot run applets in Google Chrome or other browsers (JRE 8) -

Image
i updated jdk , jre java 8 (the latest version). , having serious problem running java applets under jre 8. in java 7, used decrease security level of java control panel medium. latest version not showing medium security level option. have 2 options - high , very high . how run java applets now? please provide suggestion. how run java applets now? get author or deployer of applets sign them certificate issued certification authority.

c++ - Expose a template-based container class to Qt script engine? -

situation i have few instances of qvector<myclass> want them exposed qscriptengine . in project, myclass cache multi-dimensional data "point", , looks like: class myclass { public: myclass(); /* functions */ private: int m_index; double m_time; qlist<int> *m_data; }; the reason why doing because want users able write ecma script process these "points" comes different sets. question how expose whole container , it's contents qt script engine? i know can make myclass qobject , call qscriptengine::newobject it's qscriptvalue , set value engine's global object. expose "one point" script engine, , need pass whole instance of qvector<myclass> . ( any other kind of workaround welocme too! ) one of should work: you make myclass qobject , create explicit array qscriptengine::newarray , call qscriptengine::newobject every object in array, , add script values ar

database - need query for desired output in mysql db -

i have 2 tables item , condition below db structure item => id - integer item_name - varchar condition => cid - integer cond_name - varchar item_array - varchar (stores item id's separated space like: 1 5 9 17 18 cid cond_name iem_array 1 c1 1 5 9 2 c2 9 17 18 3 c3 3 7 11 in application in front end site have given option user can select 1 or more items based on have short list suggested items for have created column item_array keeps information of related items separated array. i need query list item_name item table based on related items of condition table. example if user selects 1 , 9 have display item id( 5 17 18 ) , corresponding item name. this. id | item_name ---+----------- 5 | item1 17 | item2 18 | item3 i tried write query select substring(s.item,2, length(s.item)) ( select replace(item_array," ",",") item `condition` it

.net - Is this a memory leak? Pls check code below -

in vb application use datasets follows: dim rs dataset dim sql string = "some sql" rs = getdataset(sql, db) ' work data sql = "another sql" rs = getdataset(sql, db) ' more code rs.dispose will cause memory leak if add dispose @ end of sub or should dispose rs after every usage of it? well, problem "memory leaks" in .net not same in languages direct memory management (like c/c++). in .net leaked memory result of referencing object 1 of garbage collector roots caused badly managed dependencies between object in graph, not missing memory deallocation. technically, there nothing wrong not disposing disposable object , application can work quite not calling dispose @ all. while have few nice examples of .net memory leaks in article, http://alexatnet.com/articles/memory-leaks-in-net-applications , missing 1 trivial example - missing dispose in case when object data consists of 2 parts - tiny managed wrapper around massive array of

ios - Shared iAd Banner doesn't appear between TableViews -

based on tutorial @ http://www.youtube.com/watch?v=u5xcvnhcq0w , implemented shared iad banner view show between header position of 2 tables. 2 table controllers under navigation controller. banner view showing in first table, not showing in next table. same code implemented in uitableviewcontrollers - (appdelegate *) appdelegate { return (appdelegate *)[[uiapplication sharedapplication] delegate]; } -(cgfloat)tableview:(uitableview *)tableview heightforheaderinsection:(nsinteger)section{ return 100.0; } -(void) viewwillappear:(bool)animated{ _uiiad = [[self appdelegate] uiiad]; _uiiad.delegate = self; [_uiiad setframe:cgrectmake(0,21,320,50)]; [self.view addsubview:_uiiad]; } -(void) viewwilldisappear:(bool)animated{ _uiiad.delegate = nil; _uiiad=nil; [_uiiad removefromsuperview]; } -(void)bannerviewdidloadad:(adbannerview *)banner{ nslog(@"ads loaded&

php - Arabic language text is not display proper in front side -

i have using arabic language in opencart site. & also, have add custom text in arabic language. but, text not display proper in front side. our module language file code. // website: www.opencartarab.com // e-mail : info@opencartarab.com // heading $_['heading_title'] = 'ãäÊÌÇÊ ÇÎÑì'; $_['tab_latest'] = 'ÂÎÑ'; $_['tab_bestseller'] = 'ÇáÇßËÑ ãÈíÚÇ '; $_['tab_featured'] = 'ããíÒ'; $_['tab_special'] = 'ÎÇÕ'; $_['text_reviews'] = 'based on %s reviews.'; ?> but, got front side - ������ ����� how can fix this? make sure php file saved in utf-8 encoding (see here: notepad++ converting ansi encoded file utf-8 or here http://www.herongyang.com/unicode/notepad-save-file-in-utf-8.html ) :)

facing while debug in visula studio 2012 -

i facing problem in deubgging in visual studio 2012 .while debug debugger attached in few seconds goes out of scope , studio gets restart or goes out of debugging state , running state .pleas me facing problem form many days

php - Get most recent date from two tables -

i have 2 tables table1: ______id_______|_______serials______|____date_____|__include__ 20 | 1123 | 22-05-2014| yes 20 | 2231 | 12-06-2013| no 21 | 3213 | 24-01-2014| yes 22 | 5123 | 27-10-2012| yes 20 | 1213 | 02-03-2014| yes table 2: ______id_______|______serials_______|____date_____|__rma__ 1 | 1123 | 01-05-2014| 1 2 | 2231 | 22-06-2014| 7 3 | 3353 | 20-01-2013| 5 4 | 1213 | 27-03-2014| 2 5 | 5123 | 06-03-2014| 9 i need data of matched serials 2 tables , need pull recent date 2 tables. how expecting output _____id_______|_______serials______|__recentdate_|__include__|__id__|__serial__|__rma__ 20 | 1123

sql - MySQL ON DELETE CASCADE -

i have been working on mysql past few months. kindly apologize if question silly. we have foreign key checks, enable - set @old_foreign_key_checks=@@foreign_key_checks,foreign_key_checks=1; disable - set @old_foreign_key_checks=@@foreign_key_checks,foreign_key_checks=0; similarly, do have query enable , disable on delete cascade in mysql? thanks. create new foreign key constraint using : create table table_name ( column1 datatype null/not null, column2 datatype null/not null, ... constraint fk_column foreign key (column1, column2, ... column_n) references parent_table (column1, column2, ... column_n) on delete cascade ); or alter existing constraint: alter table table_name add constraint constraint_name foreign key (column1, column2, ... column_n) references parent_table (column1, column2, ... column_n) on delete cascade;

ruby - Appium iOS - Can I use two @name identifiers for different hierarchies in XPath? -

i using appium v0.18 , trying use name in 2 different hierarchies in ios. error: an error occurred while executing user supplied javascript . my question is: can use multiple accessibility identifier in xpath ios? according answer on github , xpath quite complex parser of appium v0.18. not work.

listview - List items get mixed up after adding new items android -

i have listview displays list of items fetched server. have created alertdialog edittext takes user input , makes api call , user input gets added items server. again new updated items displayed in listview. the issue initailly when list displayed displayes properly. when user input posted, displayes randomly , not @ end of list. here code:- builder.setpositivebutton("post", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int id) { boolean worked = true; postedstring = input1.gettext().tostring(); if(postedstring .length()==0 || postedstring =="") { toast.maketext(newsdetails.this, "please enter comment.", toast.length_long).show(); input1.findfocus(); worked = false; } else

java - Adapter behaviour when loading image from URL ion library -

i m facing problem when want load images adapter using ion library. in fact, have items string corresponding url of iconic image want load each item on gridview. the problem due adapter view management (reusing existing view if m not wrong), , dont know how bypass this... for example, if load 10 elements image, first time works. then, when scroll bottom, , scroll top, image changes (due reuse of existing view...) can me ? this adapter code : public class protocoleadapter extends baseadapter { private context context; private list<protocoleitem> mliste; public protocoleadapter(context context, list<protocoleitem> liste) { this.context = context; this.mliste = liste; } private class viewholder { textview txttitre; imageview img; } public view getview(int position, view convertview, viewgroup parent) { viewholder holder = null; layoutinflater minflater = (layoutinflater) context

javascript - Demandforce appointment form, integration with Wordpress -

i developing website dentist friend. far it's looking good, using wordpress along enfold theme . one of requested features website include demandforce appointment form, customers able schedule appointments inside new website. i visited demand force , found way include contact form by: copying following css file header <link type="text/css" rel="stylesheet" href="//www.demandforce.com/widget/css/widget.css" /> did modifying header.php adding following script body; <script type="text/javascript"> d3cp_bid = 'private'; // business id in demandforced3 //d3cp_appt_source = 'my website'; //optional. see instructions. //d3cp_appt_returnpage = 'your_page_url'; // optional. see instructions. //d3cp_appt_postdata = 'false'; // optional. see instructions. </script> <script src="//www.demandforced3.com/b/burlingamesmile/scheduler.widget" type="text/javascript"><

How to create object in IOS similar to JAVASCRIPT -

how can create object similar in javascript? var writers = { publicaccess: false, ids: [] }; please ? use nsdictionary . the quickest way create following: nsdictionary *dict = @{ @"publicaccess": @no, @"ids": @[@"id1", @"id2"] }; with full objective-c syntax, , if don't want static dictionary, go: nsmutabledictionary *dict = [[nsmutabledictionary alloc] init]; [dict setobject:@no forkey:@"publicaccess"]; [dict setobject:[[nsmutablearray alloc] initwithobjects:@"id1", @"id2", nil] forkey:@"ids"];

php - Prepared Statements in MYSQLi in combination with "SELECT WHERE IN" -

i'm facing little problem mysqli , prepared statements: i want prepare , "in" statement in sqli not work me! :-( can or explain me i'm doing wrong? think it's because of way prepared statements work , therefore magic (strip, addslashed ...) preventing solution maybe need else can figure out. sql statement: $dbprepare = $db->prepare( 'select `name`, `image` `sometable` `number` in (?)' ); $dbprepare->bind_param('s', $numbers); and way of achieving "$numbers": $numbers = implode('","', explode(',', $_get['numbers'])); the "var_dump($numbers)" result this: string(5) "a","b" ($_get['numbers'] it's value this: &numbers=a,b) i know, maybe not best solution, wanna transfer (in end $_post) data "in" statement including prepared variable. for reference: working: $dbprepare = $db->prepare( 'select `nam

Writing to files faster in Python -

i have been mining tweets. main problem have been facing - have encode tweets utf-8 , write them file. my current method: def on_data(self,data): f=open('new','w') dict1=json.loads(data) val=dict1["text"] val= codecs.encode(val,"utf-8","ignore") var.x+=1 f.write(str(var.x)+"\t"+val+"\n") return true any way speed process? you're not closing file, means have wait until python figures out can safely closed when file handle isn't in use more. assuming want create new empty file every time on_data() called, can use with statement have python close file when with block exited: def on_data(self, data): dict1 = json.loads(data) val = dict1["text"] val = codecs.encode(val,"utf-8", "ignore") var.x+=1 open('new', 'w') f: f.write(str(var.x) + "\t" + val + "\n") return tr

xcode - iOS Simulator executing app, but "crashes" when pressing on "Button" -

Image
on xcode 6 beta 2, have built app 2 viewcontrollers. you can see action of "button" open second viewcontroller. but when pressing on "button", theres focus on xcode, , shows me screen: , highlights green code-line. how can fix it? **notice, havent wrote code ever, created storyboard. console: 2014-06-26 01:05:54.957 colormatcher[878:11914] *** terminating app due uncaught exception 'nsinvalidunarchiveoperationexception', reason: 'could not instantiate class named adbannerview' *** first throw call stack: ( 0 corefoundation 0x00447646 __exceptionpreprocess + 182 1 libobjc.a.dylib 0x01d728e3 objc_exception_throw + 44 2 corefoundation 0x0044756d +[nsexception raise:format:] + 141 3 uikit 0x010f53c0 uinibdecoderdecodeobjectforvalue + 317 4 uikit 0x010f5768 uinibdecoderdecodeobjectforvalue +