Posts

Showing posts from September, 2011

c - Why is waitpid not waiting for a process to quit? -

i have simple code written in c , os osx: int main() { pid_t pid = 1244; int pid_status; waitpid(pid, &pid_status, 0); printf("%i\n",pid_status); } 1244 process id opera browser running right now: korays-macbook-pro:helloworld koraytugay$ ps -p 1244 pid tty time cmd 1244 ?? 0:09.19 /applications/opera.app/contents/macos/opera what expect happen when run program, should wait until close opera, is: korays-macbook-pro:helloworld koraytugay$ ./koko 1798668342 korays-macbook-pro:helloworld koraytugay$ ./koko 1637806134 korays-macbook-pro:helloworld koraytugay$ ./koko 1707163702 why program directly quitting , these different numbers? waitpid effective child processes. see manual page http://man7.org/linux/man-pages/man2/wait.2.html . you find waitpid returning -1. please check errno

java - could not set a field value by reflection setter of <class> -

have seen similar question in forum, here mapping value in junction table & hibernate.propertyaccessexception: not set field value reflection setter i've applied solution mentioned in question still facing same problem. don't know missing. classes - employeeid.java @idclass(value = employeeid.class) public class employeeid implements serializable{ private int empid; private int deptid; public employeeid() { } public employeeid(int empid, int deptid) { this.empid = empid; this.deptid = deptid; } public int getempid() { return empid; } public int getdeptid() { return deptid; } @override public int hashcode() { final int prime = 31; int result = 1; result = prime * result + deptid; result = prime * result + empid; return result; } @override public boolean equals(object obj) { if (this == obj) return true;

haskell - Pass Args to generate -

does quickcheck have way pass args object (or @ least specify seed) generate (:: gen -> io a) function (or equivalent)? see has quickcheckwith takes args, can return result. there doesn't seem generatewith function.

ios - Prevent Image Overlaps in Table View Cell -

Image
in cellforrowatindexpath method have following code. var cell = tableview.dequeuereusablecellwithidentifier("media item", forindexpath: indexpath) mediaitemtableviewcell let mediaitem = tweet!.media[indexpath.row] let imagedata = nsdata(contentsofurl: mediaitem.url) if imagedata != nil { cell.mediaimage = uiimage(data: imagedata!) } else { cell.mediaimage = nil } return cell when run code image overlaps on tableviewcell . i love have image become thumbnail size , not overlap bounds of tableviewcell. best way approach this? i've tried resizing image image still becomes clipped. thanks. have marked aspect-fit in uiimage , clipsubviews on mediaitemtableviewcell class in interfacebuilder? (attached image).

python - Divides dates in day, month, week Django -

i need generate chart of orders closed day , month. generate average, total sum, etc. need split data period between 2 dates. start date = '01/01/2015' end_date = '01/04/2015' need generate data: so exemple: 2015/01/01 total sum: 100, average: 10 2015/02/01 total sum: 500, average:50 2015/03/01 total sum: 40, average:2 2015/04/01 total sum: 40, average:2 but in django, queryset return total between 2 dates filter_params = self.request.get context['orders_confirmed'] = bid.objects.filter(date_confirmed__gte=filter_params.get('summary_date')) context['orders_confirmed'] = context['orders_confirmed'].filter(date_confirmed__lte=filter_params.get('final_summary_date')) it shows me total, exemple 1500, how divide data? use timedelta time intervals. e.g.- first_time = datetime.now() or in case first_time = filter_params.get('summary_date') second_time = first_time + timedelta(days=30) . . . e

javascript - How to create a mask for jQuery Masked Input Plugin that allow alphanumeric, spaces and accented characters? -

how create mask jquery masked input plugin allow alphanumeric, spaces , accented characters? i have $.mask.definitions["a"] = "[a-za-z0-9 ]"; $("#input").mask("a?aaaaaaa"); but doesn't include accented characters. you can following masking support alphanumeric , space. jquery('.alphanumeric-field').mask('z',{translation: {'z': {pattern: /[a-za-z0-9 ]/, recursive: true}}});

Import error in MATLAB -

i'm brand new matlab , having trouble importing module called sigtool. code: >> path('/space/jazz/1/users/gwarner/sigtool/program') >> sigtool returns: undefined function 'fileparts' input arguments of type 'char'. error in sigtool (line 72) parentdirectory=fileparts(which('sigtool')); the weirdest part i've been able open before. used same code , haven't edited sigtool directory or changed it's path since. ideas? your usage of path wiping out matlab's default search path. if change first line path(path,'/space/jazz/1/users/gwarner/sigtool/program') the path added bottom of search stack. can add directory top of stack using addpath : addpath('/space/jazz/1/users/gwarner/sigtool/program')

dynamic template system which autoloads from HTML (minimal PHP) -

i have templating engine wrote , use, wanting go better , want know if i'm planning write exists or not, because have specific wants this. my question: templating system features describe below exist? if not , there libraries allow of features possibly integrate eachother , integrate of own code, have write of stuff? i believe answer no , figured i'd ask before spending many many hours making myself. my intention integrate php,html,css, , js single object oriented system of interact cleanly 1 another. wrote javascript class system integrate accomplish that, given i've established describe below. tldr; in short, i'm looking object oriented templating engine autoloads html, css, javascript, , php files without having special syntax or new languages write in. plus, able use html files build php objects based on paramaters in file. what i'm wanting: autoloading . example, given template.html: <div class="templateengine content">

oracle - How can I copy table data from one schema to a table of a different name in a different schema? -

i have table called census in prod schema, , table called census_backup in dev schema. does toad have gui feature allow me copy table data prod.census dev.census_backup? i know can copy table data dev schema using "copy data schema," seems that feature allow me copy data table of same name in dev schema. i don't know if there existing feature in toad in graphical way , being able choose target table name. however, why not using simple sql this, such as: create table dev.census_backup select * prod.census; ? to user having grants create tables in dev schema , grant select in prod schema.

What are some techniques to avoid script approvals with a Jenkins workflow Groovy script? -

the following script jenkins workflow plugin: def mapping = readfile 'a file' mapping.eachline { def line = it.tokenize('|') sh "${line[1]}" } requires script approvals: staticmethod org.codehaus.groovy.runtime.defaultgroovymethods tokenize java.lang.string java.lang.string staticmethod org.codehaus.groovy.runtime.defaultgroovymethods eachline java.lang.string java.lang.string in order have script run build must attempted, manual approval must granted, , build must attempted again, , on. for large scripts rather tedious process keep white listing methods. is there subset of groovy methods not require script approval and/or white listing? you need approve newly run methods come up. the script security plugin ships methods whitelisted already. methods listed here have not made in yet. jenkins-25804 tracks desire whitelist routine computational methods default. note if using groovy cps dsl scm script source, there intent

Apache Spark RDD filter into two RDDs -

i need split rdd 2 parts: 1 part satisfies condition; part not. can filter twice on original rdd seems inefficient. there way can i'm after? can't find in api nor in literature. spark doesn't support default. filtering on same data twice isn't bad if cache beforehand, , filtering quick. if it's 2 different types, can use helper method: implicit class rddops[t](rdd: rdd[t]) { def partitionby(f: t => boolean): (rdd[t], rdd[t]) = { val passes = rdd.filter(f) val fails = rdd.filter(e => !f(e)) // spark doesn't have filternot (passes, fails) } } val (matches, matchesnot) = sc.parallelize(1 100).cache().partitionby(_ % 2 == 0) but have multiple types of data, assign filtered new val.

java - How to break the line before a date pattern using Shell script? -

i have text file that: 13/03/2015 09:21:02 descrição de log (sessão terminada);name.lastname -- 127.0.0.1:66666 -> 0.0.0.0 -- 00:01 -- 13/03/2015 09:21:02 descrição de log (autenticação realizada com sucesso);name.lastname..... i know how can break line every time have date. pattern dd/mm/yyyy. text like: 13/03/2015 09:21:02 descrição de log (sessão terminada);name.lastname -- 127.0.0.1:66666 -> 0.0.0.0 -- 00:01 -- 13/03/2015 09:21:02 descrição de log (autenticação realizada com sucesso);name.lastname..... can me that? can java code, sed, awk, whatever... thanks. with gnu sed: sed -r 's, ([0-9]{2}/[0-9]{2}/[0-9]{4} ),\n\1,g' filename the [0-9]{2}/[0-9]{2}/[0-9]{4} part of regex matches date pattern; whole regex matches surrounded spaces avoid false positives , because example data suggests input meets format. , used separator instead of / in s command because search regex contains slashes.

javascript - How can I make an Angular directive wait for isolate scope data to be available? -

i have controller loads data api. unfortunately have scenario cannot use resolve load data. angular.module('myapp').controller('mycontroller', function() { var mycontroller = this; formservice.find('123').then(function(response) { mycontroller.formdata = response.data; }); }); my controller's template uses directive uses data: <form-component form-data="mycontroller.formdata"></form-component> and directive: angular.module('myapp').directive('formcomponent', function() { 'use strict'; return { restrict: 'e', scope: { formdata: '=', }, templateurl: 'formcomponent.html', link: function($scope, element, attrs) { // outputs "undefined" not yet loaded when // directive runs. console.log($scope.formdata); } }; }); as can see, when directive r

sql - Removing While Loop in String Search Query -

i have query takes 1 record #itemtemp , , locates entries reportcsharp match, inserting matches #link_table . @ present, query runs in 7.5 min, appears slow iterating on 1458 records in #itemtemp table. declare @num int , @path varchar(100) , @output varchar(100) , @max int set @num = 1 set @max = (select max(num) #itemtemp) while @num < @max begin set @path = (select path #itemtemp num = @num) insert #link_table select itemid , path , @path reportcsharp script '%"' + @path + '"%' set @num += 1 end how can remove while loop , replace more set based operations? insert #link_table select rcs.itemid, rcs.path, it.path reportcsharp rcs inner join #itemtemp on rcs.script '%' + it.path + '%';

css - opacity over gradient background -

i want use opacity gradient, not text color. here code : .large-thumb { position: absolute; bottom: 15px; z-index: 99; padding: 5px 5px 20px; color: #fff; background: #323232; /* old browsers */ background: -moz-linear-gradient(top, #323232 0%, #858585 50%, #e7e7e7 100%) ; /* ff3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#323232), color-stop(50%,#858585), color-stop(100%,#e7e7e7)) ; /* chrome,safari4+ */ background: -webkit-linear-gradient(top, #323232 0%,#858585 50%,#e7e7e7 100%) ; /* chrome10+,safari5.1+ */ background: -o-linear-gradient(top, #323232 0%,#858585 50%,#e7e7e7 100%) ; /* opera 11.10+ */ background: -ms-linear-gradient(top, #323232 0%,#858585 50%,#e7e7e7 100%) ; /* ie10+ */ background: linear-gradient(to bottom, #323232 0%,#858585 50%,#e7e7e7 100%); /* w3c */ filter: progid:dximagetransform.microsoft.gradient( startcolorstr='#323232', endcolorstr='#e7e7e7',

javascript - Unhide and hide contents within the div using jquery -

hello after searching of answers on stackoverflow hiding , unhiding stuffs within div don't proper answer because of them depends on form.my scenario have textarea want tapped , person start typing div expands , show buttons post or cancel button, example google+ "share what's new" home screen. <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.js" type="text/javascript"></script> <script type="text/javascript"> $(function(){ $('textarea').click(function(){ $('button').show().removeattr('disabled'); $('.second').show(); }); }); </script> </head> <body> <form> <div> <textarea></textarea>

ios - How can I pass a NSMutableDictionary value to multiple controllers in my storyboard? -

i have objective-c controller called linkedinlogincontroller , inside have function contains nsdictionary called newresult shown below: - (void)requestmewithtoken:(nsstring *)accesstoken { [self.client get:[nsstring stringwithformat:@"https://api.linkedin.com/v1/people/~?oauth2_access_token=%@&format=json", accesstoken] parameters:nil success:^(afhttprequestoperation *operation, nsdictionary *result) { nslog(@"current user %@", result); nsmutabledictionary *newresult = [result mutablecopy]; //copies nsdictionary 'result' nsmutabledictionary called 'newresult' [newresult setobject: [newresult objectforkey: @"id"] forkey: @"appuserid"]; //copies value assigned key 'id', 'appuserid' database can recognize [newresult removeobjectforkey: @"id"]; //removes 'id' key , value linkedinloginjson *instance= [linkedinloginjson new]; //calls linkedinpost

inversion of control - How to Install a module that needs an instance per something else that is registered in Castle Windsor -

i trying hang of ioc , di , using castle windsor. have object have created can multiply instantiated on different generic types. example mytype<generic, generic2> on installation of mytype's assembly container.register(component.for(typeof (imytype<>)).implementedby(typeof (mytype<>))); then in main modules initialization install mytypes module mytypeinstaller iwindsorinstaller. then manually resolving various types of mytype want (this spread around different installers). like container.resolve<imytype<type1, type2>(); that creates actual instance of mytype registered generic types passed in. this works fine, instances of mytype<,> need created. now, have module have created install last. want say, container.resolveall<imytype<,>>() then create instances of new object each object exists. however cant seem resolve of imytypes<,> without knowing concrete types each 1 instantiated as. at rate, possi

haskell - Using do notation with if/else -

i'm trying use do notation return list element if it's even : ghci> { x <- [1,2,3]; if (even x) [x] else []} <interactive>:43:36: parse error on input `else' what doing wrong? in addition, please note if code non-idiomatic. you forgot "then". also, i'm not sure monad this.. do { x <- [1,2,3]; if (even x) [x] else []}

windows - Java - Paste a file from clipboard after it has been downloaded -

i have trouble windows explorer. my application starts download of file , puts system clipboard meanwhile. if user pastes file @ place of windows explorer, file isn't having real size, size depending on progress of download. does have idea of how advise explorer wait until download has finished , copy file target directory afterwards? i tried "tunnel" file on loopback interface using local smb server didnt unfortunately... thanks in advance downloading file , calling paste clipboard method: new thread(new runnable() { @override public void run() { final string = gettext(); int selectedrows[] = customjtablemodel.table.getselectedrows(); list<file> filelist = new arraylist<file>(); for( int i=0; selectedrows.length>i; i++ ) { // build relative file/folder path string filename = (string)table.getvalueat(table.ge

regex - Java Pattern Matcher Woes -

i'm looking pattern check boolean terms in conditions: if exist them selves string = "and"; string b = "\tand"; string c = "and "; if not part of word or phrase string d = "this or that"; terms or phrases ignore: string e = "band"; string f = "l'or" string g = "can do"; code have far find them if have spaces before , after delimiter , sort of adjustment breaks progress have. i used page reference still no dice. have tried using both find() , matches() find seems broad in scope , matches doesn't seem broad enough. ideas? final static pattern booleanterms = pattern.compile("(.*)(( or )|( or )|( not )|( not )( , )|( , ))(.*)"); public static void main(string[] args) { set<string> terms = new hashset<string>(); terms.add(" or"); //false terms.add("or "); //false terms.add("or"); // false terms.add(" or "); //true (string s

calling a subroutine in scheme -

i'm trying call subroutine function on scheme have far. (define (main) (display "ingrese un parametro: ") (define x (read-line)) (newline) (display "ingrese una posicion: ") (define dig (read)) (newline) (if (string? x) (begin (if (number? dig) (begin ;(vababa x dig))) <---calling subrutine this subroutine im trying call define (vababa x1 dig1) (define (string-pad-right x dig1)) (define b (string-pad-left x dig1)) (define z (string-append b)) z ) but not returning nothing.. please tell me im doing wrong. in vababa using unbound variable x . perhaps meant x1 ? it's not allowed use define in procedure bodies evaluates values based on previous ones. (define (vababa x1 dig1) (define (string-pad-right x dig1)) ; x not exist anywhere (define b (string-pad-left x dig1)) ; x not exist anywhere (define z (string-append b)) ; , b not exist yet z) ; , b exists won'

wkhtmltopdf - mikehaertl/phpwkhtmltopdf wrapper - Works when running PHP file from command line -

i have made following file: test.php <?php require 'vendor/autoload.php'; use mikehaertl\wkhtmlto\pdf; $htmlstring = <<<eot <!doctype html> test </html> eot; $pdf = new pdf($htmlstring); $pdf->setoptions(array( 'orientation' => 'landscape' )); $pdf->saveas('new.pdf'); ?> when run command line (ubuntu 12.x): sudo php test.php i file shows in directory , works intended. take following file trying apply above real world scenario - note: when echo $htmlstring valid , expected string. testpdf.php <?php // start session , check if user logged in session_start(); if(!isset($_session['permission'])) { die('please login.'); } // dependencies require 'vendor/autoload.php'; use mikehaertl\wkhtmlto\pdf; require 'database.php'; // initialize $client = $db->real_escape_string($_get['client']); $sta

How do I connect my objective-c application with php file? -

i have made php file connects mysql server , works unsure on how connect objective-c application working on php file. i wondering how connect objective-c application php file? i figured out here code. nsstring *strurl = [nsstring stringwithformat:@"http://localhost/write.php]; nsdata *dataurl = [nsdata datawithcontentsofurl:[nsurl urlwithstring:strurl]];

CakePHP belongsToMany jointable -

Image
i'm making blog , want able assign multiple categories or tags article , article can have multiple categories. this have in database: articles , categories , join table articles_categories . project : join table : in table/articlestable.php: public function initialize(array $config) { $this->addbehavior('timestamp'); $this->belongstomany('categories', [ 'alias' => 'categories', 'foreignkey' => 'article_id', 'targetforeignkey' => 'category_id', 'jointable' => 'articles_categories' ]); } in table/categoriestable.php: public function initialize(array $config) { $this->table('categories'); $this->displayfield('name'); $this->primarykey('id'); $this->addbehavior('timestamp'); $this->belongstomany('articles', [ 'alias'

java - How to find out an email is bounced with Spring's MailSender -

i sending emails through gmail. sends emails, when enter wrong email address not throw exception; however, email sent me. i changed email configuration , threw authentication exception not throw sendmail exception wrong email addresses. try { simplemailmessage message = new simplemailmessage(); message.setto(receiveremail); //the value xc@cvcbdfgxcvwesdc.org message.setcc(myemailaddress); message.setsubject(subject); message.settext(msg); mailsender.send(message); } catch (mailsendexception send) { //i used mailexception send.printstacktrace(); } i added following code not show anything } catch (mailsendexception send) { // failed send /there 1 other // type of exception system.err.println("failed messages size:" + send.getfailedmessages().size()); the mailsender won't able determine if email bounced in sense imagine, @ least not du

java - Getting an exception when adding audio to mediaplayer -

Image
so after added images wanted add, went , tried add audio this <mediaplayer fx:id="gameintro" autoplay="true"volume="0.1"> <media> <media source="@audiofiles/gameintrotheme.mp3" /> </media> </mediaplayer> but didn't work. error relates problem caused by: javafx.fxml.loadexception: file:/c:/users/owner/documents/netbeansprojects/millionairetriviagame/dist/run30649974/millionairetriviagame.jar!/millionairetriviagame/menulayoutfxml.fxml:18 @ javafx.fxml.fxmlloader.constructloadexception(fxmlloader.java:2605) @ javafx.fxml.fxmlloader.loadimpl(fxmlloader.java:2547) @ javafx.fxml.fxmlloader.loadimpl(fxmlloader.java:2445) @ javafx.fxml.fxmlloader.loadimpl(fxmlloader.java:3218) @ javafx.fxml.fxmlloader.loadimpl(fxmlloader.java:3179) @ javafx.fxml.fxmlloader.loadimpl(fxmlloader.java:3152) @ javafx.fxml.fxmlloader.loadimpl(fxmlloader.java:3128) @ javafx.fxml.fxmlloader.loadimpl(fxmlloader.java:3108

Apache crashing and stopped working -

edit: new error: [fri apr 10 00:31:01.708007 2015] [ssl:warn] [pid 4720:tid 272] ah01909: www.example.com:443:0 server certificate not include id matches server name , yes old 1 still there.. happens after has crashed , have started apache again.. i have installed xampp 4 times , each of them times has been on fresh installation of windows. nothing dropbox , notepad++ , , xampp self installed on system. have tried resolve , below list of things have tried running control panel administrator turning off windows firewall trying on fresh installation of windows something else may need know have changed htdocs location c:\dropbox\website dropbox website folder inside dropbox folder. have tried changing 443 port 444 can't change 80 8080 because mean doing ip :8080 on end can't on cloudflare. error log same when has crashed , displays exact same things... before did display threads per child , did change it, still no luck... after doing on new fresh copy of windows s

javascript - MongoDB Malformed Geometry with geojson -

using mongodb v2.6.5 when attempt save geojson document db receive following error: name: 'mongoerror', code: 16755, err: 'insertdocument :: caused :: 16755 can\'t extract geo keys object, malformed geometry?: { _id: objectid(\'55271b90d075728028d4c9e1\'), ..., location: [ { _id: objectid(\'55271b90d075728028d4c9e3\'), loc: { type: "point", coordinates: [ -105.01621, 39.57422 ] } } ] } ], status: [ "lead" ], created: new date(1428626320406), lastname: "doe", firstname: "john", __v: 0 }' } i'm attempting insert point table 2dsphere index, managed through mongoosejs shown below. var geoaddressschema = new schema({ // holds points. loc: { type: { type: string }, coordinates: [] } }); var lead = new schema({ // other fields ... location: [geoaddressschema], // ... }); leadaddressschema.index({ location: '2dsphere' }); the geojson being saved:

c++ - Pass function as parameter to integrate object using lambda -

for educational purposes i have function integrate takes in std::function parameter. double calculus::integralsimple(std::function<double(double)> fn, double begin, double end) { double integral = 0; (long double = begin; < end; += _step) { integral += fn(i) * _step; // _step defined in class } return integral; } currently calling function main.cpp using calculus cl; std::cout << cl.integralsimple(calculus::identity,0,1); std::cout << cl.integralsimple([](double x) { return x*x; }, 0, 1); where identity static function defined in calculus.h , other uses lambda function. i wondering whether make syntax easier user , closer mathematics way. prefer user have type: std::cout << cl.integralsimple( x*x ,0,1); // take function of form std::cout << cl.integralsimple( x*sin(x) - x*x ,0,1); is there way achieve in c++? that boost.lambda designed for. syntax this: #include <iostream> #include &

php - How do I post information from a <form> and get information into the form from that also needs to be posted into the same database? -

i'm making form puts student information student table. part of information requires foreign key parent_guardian_id parents table . i'd offer parents' names choice select or dropdown input foreign key. seems need , post @ same time? need @ least 2 other pages. insight. //check student first name: if (empty($_post['student_first_name'])) { $errors[] = "please enter student\'s first name."; } else { $student_first_name = mysqli_real_escape_string($dbc,($_post['student_first_name'])); } if (empty($errors)){//if requirements met: $query="insert student (student_first_name, student_last_name, student_street, student_city, student_zip, student_phone, student_email, parent_guardian_id) values ('$student_first_name', '$student_last_name', '$student_street', '$student_city', '$student_zip', '$student_phone', '

Array controls XML delievy AS3 -

so, let's have array on flash, like: var myarray:array = [option2, option3] and let's have xml file this: <easformat> <option1> <easimg>img01.jpg</easimg> <easname>carro 01</easname> <easprice>250.000</easprice> </option1> <option2> <easimg>img02.jpg</easimg> <easname>carro 02</easname> <easprice>180.000</easprice> </option2> <option3> <easimg>img03.jpg</easimg> <easname>carro 03</easname> <easprice>80.000</easprice> </option3> <option4> <easimg>img04.jpg</easimg> <easname>carro 04</easname> <easprice>150.000</easprice> </option4> </easformat> i have xml loaded. want display nodes of xml match array values (options 2 , 3). guys

android - Error when trying to retrieve BLOB image from database -

i didn't receive responses on first question similar one, i'm going try again explain better understand. i trying retrieve image database stored blob image pulled through simplecursoradapter. can store image fine, when try , retrieve image gives me error "unable convert blob string". i'm not sure why error i'm not trying convert blob directly string. i'm new android programming take as can get. thank time. stacktrace 04-06 14:34:00.163 4145-4145/com.gnumbu.errolgreen.importedapplication e/androidruntime﹕ fatal exception: main process: com.gnumbu.errolgreen.importedapplication, pid: 4145 android.database.sqlite.sqliteexception: unknown error (code 0): unable convert blob string @ android.database.cursorwindow.nativegetstring(native method) @ android.database.cursorwindow.getstring(cursorwindow.java:438) @ android.database.abstractwindowedcursor.getstring(abstractwindowedcursor.java:51) @ android.widge

user interface - Sending request to a Client from Server GUI - Java -

i have server-client application n number of clients connected server. have 2 question i'm not able answers. 1.assign clients jbutton in server when click button can send request it. 2.how run method in client when jbutton of particular client clicked in server gui.

Persistant MySQL connection in Python for social media harvesting -

i using python stream large amounts of twitter data mysql database. anticipate job running on period of several weeks. have code interacts twitter api , gives me iterator yields lists, each list corresponding database row. need means of maintaining persistent database connection several weeks. right find myself having restart script repeatedly when connection lost, result of mysql being restarted. does make sense use mysqldb library, catch exceptions , reconnect when necessary? or there made solution part of sqlalchemy or package? ideas appreciated! i think right answer try , handle connection errors; sounds you'd pulling in larger library feature, while trying , catching how it's done, whatever level of stack it's at. if necessary, multithread these things since they're io-bound (i.e. suitable python gil threading opposed multiprocessing) , decouple production , consumption queue, too, maybe take of load off of database connection.

ios - download web page source code on iphone -

i need download particular webpage on iphone. redirects me if use desktop. tools out there me this? have tried sitesucker didnt work. thanks! if redirects when use desktop access it, can right click link , download page source. since want on iphone, can following: // download webpage nsurl *url = [nsurl urlwithstring:@"https://yoururl.here"]; nsdata *urldata = [nsdata datawithcontentsofurl:url]; [urldata writetofile:filepath atomically:yes]; and can access data through simulator folder or directly nsstring. nsurl *url = [nsurl urlwithstring:@"https://yoururl.here"]; nsstring *source = [nsstring stringwithcontentsofurl:url encoding:nsutf8stringencoding error:null]

C High Accuracy timestamp in microseconds in multithreaded programming in Windows 7 -

this question has answer here: microsecond resolution timestamps on windows 8 answers how high accurate/close accuracy timestamp in microseconds(system time) in multithreaded/threadsafe c programming in windows 7 (in 2015). probably timestamp year:day:month:hour:mins:secs:millisecs:microsecs if you're looking real-world timestamps , not time-interval-measurement (as suggested comment timestamps in year:day:month:hour:mins:secs:millisecs:microsecs format), getsystemtimeasfiletime () best thing you're going get. populates filetime struct, uses units of 100ns, although actual resolution of data provided not going high-resolution filetime struct's units imply (apparently designer of filetime struct wanted leave plenty of room future improvement!) once have filetime object, can convert systemtime object using filetimetosystemtime (). syste

jquery - How to set a javascript function to onchange action in boostrap dropdown? -

this boostrap drop down query. <div id="drop"> <ul class="dropdown-menu" role="menu" aria-labelledby="menu1"id="mymenu"> <% try { resultset r = db.jdbc.getconnection().createstatement().executequery("select name item "); while (r.next()) { %> <li role="presentation" id="menu2" ><a role="menuitem" tabindex="-1" href="#"><%=r.getstring("name")%></a></li> <% } } catch (exception e) { e.printstacktrace(); } { if (db.jdbc.getconnection() != null) {

mysql - Treat as number and search in between -

in table there column type varchar. , value in rows this: +------------+----+ | price | id | +------------+----+ | rp 100000 | 1 | | rp 200000 | 2 | | rp 50000 | 3 | | rp 1000 | 4 | | rp 1000 | 5 | | rp 2000 | 6 | | rp 35000 | 7 | | rp 45000 | 8 | i tried query select table price between rp 100000 , rp 200000 but result it still fetch row not in between range, such selects id 1,2,4,5,6 . i think caused of 0 value query try ignore. , think solve treating var-char number (price/amount in rupiah) query recognize trying do. can how achieve this? in advance. try way: select * yourtable substring(price,3) between 100000 , 200000 see here: http://sqlfiddle.com/#!9/37197/4 you don't need cast value implicit done. what substring(price,3) doing getting third character of column price therefore without rf character (note blank space) , comparing numbers on between operator. the substring(price,3) return st

ios - How to Create a framework which includes UIControls and their actions? -

i need create framework using existing ios project. project contains uicontrols , actions.i need include them well?. i have created project , made framework , embedded it's nib file in framework itself.then have created project , added framework it.now can retrieve same nib file, , have populated ui.but while try trigger button(this button outlet , action written in framework compile source) action on nib says button unrecognized.so think nib(view) , implementation file(controller) not linked inside framework link inside xcode project.please let me know inferences or facts know.

android - Getting serialization exception while calling SOAP WEB-Service -

i getting serilization error @ androidhttptransport.call(soap_action, envelope); here's full code webservice class public class webservicecall extends asynctask<string, void, void> { string result = ""; httptransportse androidhttptransport; public webservicecall() { // todo auto-generated constructor stub } @override protected void doinbackground(string... urls) { try { soap_action = namespace + method_name; // adding values request object request = new soapobject(namespace, method_name); // adding double value request object propertyinfo weightprop = new propertyinfo(); weightprop.setname("weight"); double w = double.parsedouble(urls[0]); weightprop.setvalue(w); weightprop.settype(double.class); request.addproperty(weightprop); // adding string value request object