Posts

Showing posts from April, 2011

android - Get SMS of specific phone number -

android - Get SMS of specific phone number - i wondering, how can read sms message specific number programmatically? know how read sms using content provider not sure if should utilize "person" column or "address" column or totally different way please help thanks it list out messages specified number. uri msmsinboxqueryuri = uri.parse("content://sms/inbox"); cursor cursor1 = getcontentresolver().query(msmsinboxqueryuri,new string[] { "_id", "thread_id", "address", "person", "date","body", "type" }, null, null, null); startmanagingcursor(cursor1); string[] columns = new string[] { "address", "person", "date", "body","type" }; if (cursor1.getcount() > 0) { string count = integer.tostring(cursor1.getcount()); while (cursor1.movetonext()){ string ...

java.util.Collection and java.util.Set interfaces -

java.util.Collection and java.util.Set interfaces - what's purpose of java.util.set interface if contains absolutely equal methods in comparing java.util.collection? there no prohibition multi-implementing in java, , set realization (hashset) work fine without set interfaces. why need useless baggage? javadoc describing contract of collection (emphasis mine): a collection represents grouping of objects, known elements. some collections allow duplicate elements , others not. on set : a collection contains no duplicate elements. in other words, set abstraction describes (ekhem!) subset of collection s. collections

model view controller - Mvc Front-end and Mvc Back-end: wrong architecture? -

model view controller - Mvc Front-end and Mvc Back-end: wrong architecture? - i building web-application twitter style one-page app, perchance with user authentication. 80% of interactions happen in front-end javascript, , help of backend answers providing info db... until thought utilize symfony2, plus mvc framework front-end backbone or ember (prefer ember seems more documented , in general more organized , easier). while getting learning symfony2, came attending many of things symfony2 offers of no utilize app. don't need its' views views going templated javascript, , don't need it's routers either handled states js on front-end.. symfony2 used json-responding mechanism, guess doctrine helps who's not back-end guy queries easily, , of course of study authentication. guess forms handled javascript. i've seen lots of other questions regarding symfony2 , backbone, restful, etc. there many different answers, need bundle create restful apis (wh...

lisp - How can I destructure an &rest argument of varying length in my elisp macro? -

lisp - How can I destructure an &rest argument of varying length in my elisp macro? - i have programme takes inputs chunk of info , list of rules, applying both set of standard rules , rules given input chunk of data. size of both inputs may vary. i want able write list of rules this: class="lang-lisp prettyprint-override"> (rule-generating-macro (rule-1-name rule-1-target (rule-action-macro (progn actions more-actions))) (rule-2-name rule-2-target (rule-action-macro (or (action-2) (default-action)))) ;; more rules ) right now, rules more verbose -- more class="lang-lisp prettyprint-override"> (defvar rule-list `((rule-1-name rule-1-target ,@(rule-action-macro (progn actions more-actions))) (rule-2-name rule-2-target ,@(rule-action-macro (or (action-2) (default-action)))) ;; more rules ) the latter form looks uglier me, can't figure out how write macro can handle variable-length &rest a...

c# - How to model collection of mixed entities using EF code first -

c# - How to model collection of mixed entities using EF code first - i'm using ef5 in vs2010. have working sample 2 types: person, business i'd add together collection like dbset<customer> customers where objects in customers can either person or business. in app i'd able like: mycontext.customers.add(new person()); mycontext.customers.add(new business()); i think client table like id (id of person or business) discriminator how can achieved code first? create base-class customers id property , derive person , business customers? c# ef-code-first entity-framework-5

primes - Sieve of Eratosthenes Time Complexity -

primes - Sieve of Eratosthenes Time Complexity - what time complexity of sieve of eratosthenes algorithm find prime numbers? how calculate it? please describe it... thanks help! check thess links queries regarding - http://en.wikipedia.org/wiki/sieve_of_eratosthenes http://www.algorithmist.com/index.php/prime_sieve_of_eratosthenes time-complexity primes sieve-of-eratosthenes sieve

javascript - Sharepoint 2010 List Settings -

javascript - Sharepoint 2010 List Settings - i using list in created approval required column choice(drop down) values yes or no. have people picker column. objective people picker must disabled or hide if value no beingness selected , people picker must available when value yes selected choice(drop down). ideas? thanks, prasath. you seek editing display form of list in sharepoint designer, , add together jquery script attach dropdown changed event handle diplay/hide logic. javascript sharepoint sharepoint-2010 sharepoint-list

php - Wrong utf8 character output savexml and tcpdf -

php - Wrong utf8 character output savexml and tcpdf - hi i'm using tcpdf load svg file, manipulate , send pdf. the svg file contain utf8 characters , after saving utf8 characters don't show properly. here svg file <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <svg xmlns="http://www.w3.org/2000/svg" height="742" id="svg_area" shape-rendering="crispedges" title="test" viewport-fill="" viewport-fill-opacity="0" width="1042" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs id="4d"/> <g cbarre="2" id="image_dbb524bdfdfb4e4180b8bb48ef3f68cc" transform="rotate(0,176.5,522)"> <text font-family="arial" font-size="14" height="20" id="txtimage_dbb524bdfdfb4e4180b8bb48ef3f68cc" visibility="visible" x="404" y="435...

ios - Having problems getting UIImageView to display correct image? -

ios - Having problems getting UIImageView to display correct image? - okay weird basically, app collects weather info via json, parses , turns temperature , current conditions nsstrings, reason, i'm having 2 issues, never works in simulator, works on ios device, , can't show "scattered clouds" image, images stored in resources folder without file extension (scattered clouds instead of scattered clouds.png, ect) have been wondering if maybe code crap? - (void)connectiondidfinishloading:(nsurlconnection *)connection { nserror *myerror = nil; nsdictionary *res = [nsjsonserialization jsonobjectwithdata:jsonresponse options:nsjsonreadingmutableleaves error:&myerror]; nsarray *results = [res objectforkey:@"current_observation"]; nsarray *cur = [results valueforkey:@"weather"]; nsarray *tmp = [results valueforkey:@"temp_f"]; nslog(@"current conditions: %@, %@º...

testing - Angularjs e2e test - How to use input(name).enter(value)? -

testing - Angularjs e2e test - How to use input(name).enter(value)? - i'm new in writing scenarios e2e testing in angularjs . want write scenario test login. have form has email field follow: <input type="email" placeholder="enter e-mail" name="email" ng-model="form.email" value="" required autofocus > and in scenario i'm having having next line tries pass email address input field: input('form.email').enter('blabla@blabla.com'); but unfortunately i'me getting next error after running test: 6ms input 'form.email' come in 'blabla@blabla.com' selector [ng\:model="form.email"] did not match elements. suggestion? check create sure have: browser().navigateto('/'); without navigating first angular not have reference dom. you can utilize : pause(); to see browser displaying @ given time when running e2e test. testing angul...

actionscript 3 - Native video in Air on iOS stopping sound and microphone -

actionscript 3 - Native video in Air on iOS stopping sound and microphone - i'm trying play native video in stagewebview in air ipad app plays sound , requires user interaction via microphone. seems work, when start playing video, sound , microphone stop. if dispose stagewebview , sound , mic after 15 seconds (and need sound , mic work @ to the lowest degree straight after stagewebview released). i tried work on ios5 ipad1, , on ios6 ipad2, using air 3.4, 3.5 , 3.6 beta. tried switch mute button of ipad, , tried alter soundmixer.audioplaybackmode media , ambient. didn't worked , i'm stucked. here code deals microphone : var microphone:microphone = microphone.getmicrophone(); microphone.addeventlistener(sampledataevent.sample_data, __michandler); private function michandler(event : sampledataevent) : void { trace("mic working !"); } for sound : _snd = new sound(); _snd.load(new urlrequest(path)); _sndchannel = _snd.play(); private func...

ksoap2 - Error When calling asp.net web service through android -

ksoap2 - Error When calling asp.net web service through android - such e/dalvikvm(2193): not find class 'org.ksoap2.transport.androidhttptransport', of android httptransport , write in place of "input" request.addproperty("input", searchnamestring); want result calling web service android app not able display please help me on how retrieve result webservice , how display android app. please help me on this. prefer url post question me. create soap envelope security header in android using ksoap2 if ksoap2 library not working fine alter kshoap2 library. you utilize androidhttptransportse instead of androidhttptransport. android ksoap2

Maven not using filePermissions and directoryPermissions on deploy -

Maven not using filePermissions and directoryPermissions on deploy - i setting maven on common, shared nfs directory under unix. in site settings.xml, have filepermissions , directorypermissions setup this: <servers> <server> <id>release.repo</id> <filepermissions>666</filepermissions> <directorypermissions>777</directorypermissions> <configuration></configuration> </server> <server> <id>snapshot.repo</id> <filepermissions>666</filepermissions> <directorypermissions>777</directorypermissions> <configuration></configuration> </server> </servers> we using profiles, in profile section, have this: <profile> <id>linux64</id> <activation> <activebydefault>false</activebydefault> </activation> ...

javascript - Grails: How to display data from datasource based on selection in GSP form -

javascript - Grails: How to display data from datasource based on selection in GSP form - i have pulldown menu generated mysql datasource. <g:select onchange="selected()" id="name" name="name" from="${listofnames()}" noselection="['':'--']"/> this populates menu 1 column table now based on selection want display additional columns same table text on gsp form. so user selects name1 dropdown. display underneath dropdown menu name1. age 21. grade yes. i have action within controller called alldetails queries values associate name , returns string. not sure how pass parameters "${remotefunction(action:'alldetails', params: \'name=\' params.name')} what best way this. run javascript remote function within selected() or gsp tag calls action somehow? how display returned string? alter innerhtml? tried http://www.grails.org/ajax-driven+selects+in+gsp you can...

Nginx don't work with sites-avaliable -

Nginx don't work with sites-avaliable - here config: nginx.conf user www-data; worker_processes 2; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; worker_rlimit_nofile 8192; events { worker_connections 1024; utilize epoll; } http { client_max_body_size 15m; server_names_hash_bucket_size 64; postpone_output 1460; sendfile_max_chunk 128k; sendfile on; fastcgi_cache_path /tmp/fcgi-cache/ levels=1:2 keys_zone=one:10m; include /etc/nginx/mime.types; default_type application/octet-stream; server_tokens off; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; error_log /var/log/nginx/err...

Django 1.4.3 keeps using dummy database engine settings value -

Django 1.4.3 keeps using dummy database engine settings value - i can't figure out why django doesn't utilize database engine specify in settings.py file instead uses value django.db.backends.dummy . here db part of my settings.py file located @ /project/app/settings.py: databases = { 'default': { 'engine': 'django.db.backends.mysql', 'name': 'my_db_name', 'user': 'my_user', 'password': 'my_pass', 'host': '', 'port': '', } } and here django debug log shows: databases {'default': {'engine': 'django.db.backends.dummy', 'host': '', 'name': 'my_db_name', 'options': {}, 'password': u'********************', 'port': '', 'test_charset...

php - Selecting random rows from a table automatically -

php - Selecting random rows from a table automatically - i'm working on project requires back-end service. using mysql , php scripts accomplish communication server side. add together new feature on back-end , ability generate automatically table 3 'lucky' members table_members every day. in other words, mysql pick 3 random rows table , add together these rows table (if possible). understand that, can accomplish if manually phone call rand() function on table ... painful! there way accomplish above? update: here solution on after comments/suggestions other users create event `draw` on schedule every 1 day starts '2013-02-13 10:00:00' on completion not preserve enable insert tbl_lucky(`field_1`) select u_name tbl_members order rand() limit 3 i hope helpful , others. you can utilize insert ... select , select 3 rows order rand() limit 3 for more info insert ... select statement - see it's possible automate every day job m...

asp.net - Get client id of the control -

asp.net - Get client id of the control - i got client id of dropdown value as ctl00_timecardcontentplaceholder_uc_0_1_drpdwncompany i have value above string value 1 client id. any methods substring() there value string. solution getclientidfromconrol(control control) { string strid=control.clientid; string strclientsid = strid.substring(38, 1); homecoming convert.toint32(strclientsid); } if want 1. you can utilize split function job. string dropdown="ctl00_timecardcontentplaceholder_uc_0_1_drpdwncompany"; string[] split=dropdown.split('_');//split underscore character; string result=split[4].tostring(); // here 1 result hope helps. asp.net .net string

ruby - bundle is identical to bundle install? -

ruby - bundle is identical to bundle install? - i have nail simple question bundler command(http://gembundler.com/). there differences between next two? or equivalent them? $ bundle vs $ bundle install i checked both of gemfile.lock generated after executing bundle(and bundle install). certainly confirmed both of gemfile.lock identical. currently they're identical. bundler's default action install . that's subject alter though. ruby bundle bundler

php - how to check a empty table already in database -

php - how to check a empty table already in database - this question has reply here: mysql check if table exists without throwing exception 8 answers i creating admin panel of site.when admin come in category , table of same category name create in database, fields table same.. in starting admin come in lot of category..then how can check table created in database..because tables empty. i trying code <?php $con = mysql_connect("localhost","root",""); if (!$con) {die('could not connect: ' . mysql_error());} $sql="select * admin";//(for trial im changing name manuaaly) $result=@mysql_query($sql); if (!$result) { echo "no table exists"; } else { echo "yes"; } ?> but in show "no table exists", if table ...

Delete row in SQL Server -

Delete row in SQL Server - i want delete rows in table date not equal getdate() query not working says there no row affected. here sql query: delete message datesent != (select convert(varchar, getdate(), 101)) here select statement: select account.username + ' ' + '(' + convert(varchar, message.datesent, 101) + ')' + ':', message.message, message.samplecolumn business relationship inner bring together message on account.empid = message.empid order message.messageid if datesent date, don't need convert getdate() value string. delete message convert(datetime, datesent, 101) <> getdate() sql-server-2005 delete-row

performance - Matlab execute function each cell Matrix with matrix and cell postion as arguments -

performance - Matlab execute function each cell Matrix with matrix and cell postion as arguments - i need apply function each pixel of each image in set of ~400 images. function wrote (called customf ) requires 3 arguments: matrix, , position of cell in matrix ( m , n ). position of pixel needed in order compute lbp (local binary pattern) requires values of surrounding pixels. customf(matrix, m, n) returns integer d 0 < d < 256 , , store each value of d in matrix of same size image. given set quite large, i'd code efficient possible, don't understand how utilize cellfun or arrayfun in such way. or improve solution? (using nested for might inefficient?) thanks! can write customf in different way? instead of working on entire image each pixel ( m , n ), why don't give local patch required computing lbp of patch's central pixel? for example, if customf needs @ pixels -/+ k away m , n compute response d @ m , n , may have k = 5; lo...

Best tutorial for Ruboto (ruby for Android)? -

Best tutorial for Ruboto (ruby for Android)? - i'm done ruby want seek hands on ruboto, ruby on android. google failed give me sufficient (almost no results).so plese allow me know tutorials on ruboto. from looks of it, ruboto's own documentation still under development! ruboto's github wiki provides tutorials , examples, they're not totally complete. however, may plenty started. sure read readme (which available on github wiki): https://github.com/ruboto/ruboto/blob/master/readme.md that should set go through own tutorials: https://github.com/ruboto/ruboto/wiki/tutorials-and-examples as ivaylo strandjev has said, you'll need larn create apps ruboto sufficient knowledge of ruby. there, ruboto extending ruby's capabilities communicate android. understanding how need! you're right, though! there aren't lot of tutorials, yet, because ruboto still effort. provided have knowledge of ruby, however, these tutorials , thorough reading ...

jqgrid returning back to the same grid page. -

jqgrid returning back to the same grid page. - i using jqgrid c# mvc i have scenerio click on record , need open web page user can modify info record. passing page # page. my question when done page, homecoming grid on same page on before. is there illustration of how can pass page # grid. i think easy way implement requirements implementing of saving of state of grid in localstorage of web browser. posted the answer , other answers extension of same thought (you can utilize illustration the query see answers). jqgrid

java - Saving two BufferedImages within a LayeredPane -

java - Saving two BufferedImages within a LayeredPane - i working layeredpane contains 2 images, 1 on each layer. have been working on method obtains image positions (based on label positions images in) , save bottom image (lower 1 within layeredpane) , top 1 if @ covering bottom image (may part of image), have been having problem , i'm bit unsure on how working properly. i have been stuck working on quite while help existing code or thoughts on how should approach way big help me. thanks in advance. public void saveimagelayering(bufferedimage topimg,bufferedimage bottomimg, jlabel toplabel, jlabel bottomlabel) { int width = bottomimg.getwidth(); int height = bottomimg.getheight(); point bottompoint = new point(); point toppoint = new point(); bottompoint = bottomlabel.getlocation(); toppoint = toplabel.getlocation(); system.out.println("image x coordinate " + bottompoint.x); system.out.println("image y coordinate ...

javascript - Jquery move element on scroll? -

javascript - Jquery move element on scroll? - example: have menu horisontally (on header), if scroll page downwards (about >100px top) menu (horisontal) move left side of browser (vertical) , fixed there... any help? try this: here working jsfiddle , source. $(window).scroll(function() { var headerh = $('.header').outerheight(true); //this calculate header's total height, borders, margins, paddings var scrolltopval = $(this).scrolltop(); if ( scrolltopval > headerh ) { $('#subnav').css({'position':'fixed','top' :'0px'}); } else { $('#subnav').css({'position':'static','top':'0px'}); } var scrollleftval = $(this).scrollleft(); if ( scrollleftval > 1 ) { alert('i scrolled left'); } }); javascript jquery

CSS Compatibility tables for various webkit versions -

CSS Compatibility tables for various webkit versions - i'm wanting know if there anyway can see css back upwards webkit browsers? i've had @ caniuse , i've had @ ppk's website. i'm after what microsoft have done ie. if there out there can post please? webkit seems poorly documented, no official summary or reference published. here resources: safari css reference apple; not detailed mdn css reference, extensive not finish summary of back upwards css in different browsers, including separate page of webkit extensions css666, summary of css back upwards in browsers, compact, has info not nowadays @ mdn sitepoint css reference, yet summary of css support webkit css properties, compilation of -webkit- properties css webkit

UPDATE multiple rows in a MySQL table based on id existence in another table -

UPDATE multiple rows in a MySQL table based on id existence in another table - i programmatically, i'm in learning mood today... looked around didn't find problem. i have 2 tables item , person , , 3rd contains associations, item_person . not has item association doesn't exist. now, want maintain status column in item table partly based on whether item associated person. so... table: item item_id description status table: person person_id name table: item_person item_id person_id imagines want update item status 1 if association exists in item_person ... is there single mysql query can handle this? is there single mysql query can update if association doesn't exist in item_person . -- if association exists... update item bring together item_person ip on ip.item_id = i.item_id set i.status = 1 -- if association not exist... update item left bring together item_person ip on ip.item_id = i.item_id set...

r - Comparing columns in two different data frame -

r - Comparing columns in two different data frame - so have 2 info frame, , want match 1 column in first info frame sec column in other info frame. df = data.frame(source=c("xrhxl8gq","2b790qqv","mrgapjpq","esmfibv1","ujobob24","ujobob24","esmfibv1"), conv=c(362,247,222,160,86,65,34), all=c(19,17,26,12,22,25,11), intent=c(47,47,74,31,58,60,0)) df2 = data.frame(name=c("bob","david","mark","sara","alice","cara","chad","donna","elaine","gary"), source_id=c("xrhxl8gq","sr354136fh","2b790qqv","myx645th","mrgapjpq","esmfi546", "ujobob24","esmfibv1","fmhl45ts","sefihn")) what want end match source source_id can insert new column in df name. >...

c# - How to bind image in Gridview using xml parsing in windows metro app -

c# - How to bind image in Gridview using xml parsing in windows metro app - i'm working on first windows 8 app. i'm trying display gridview populated image , image description. want info xml file created. found itemsource property of gridview , seek bind xml file can't this. please tell me right way task. thanx you can't bind xml file straight gridview.itemssource , need parse first object. i'd create class info displayed in gridview : public class gridviewitem { public string description { get; set; } public imagesource image { get; set; } } the next step parse xml file list of gridviewitem s: var xmlstring = await fileio.readtextasync(storagefile); var xml = xdocument.parse(xmlstring); var items = xml.element("rootnode").elements("itemnode").select(i => new gridviewitem { description = (string)i.element("descriptionnode"), image = parseimage(i.element("imagenode")) ...

c# - Cannot drag text into a WPF window -

c# - Cannot drag text into a WPF window - i'm trying set wpf window can take different types of info via drag , drop . if create new project , set window following: <window x:class="dropshare.window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="window1" height="300" width="300" allowdrop="true" dragenter="window_dragenter"> <grid> </grid> </window> and set code-behind to: public partial class window1 : window { public window1() { initializecomponent(); } private void window_dragenter(object sender, drageventargs e) { } } i ever dragenter firing files. never fires else - text, images, etc. is there i'm missing? tutorials i've read have seemed suggest that's needed dragenter event handler let's me state ...

c - Stdin not flushed after normal dummy program -

c - Stdin not flushed after normal dummy program - here piece of c code wrote after testing stuffs. i know not vulnerability concern, don't understand why stdin not flushed after normal homecoming of program, @ point prompt stdin,stdout,stderr. mean why remaining chars on stdin redirected stdout after end of normal execution of programme , not flushed? $cat dummy.c #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <errno.h> int main(){ char rbuf[100]; if (read(0, rbuf,5) == -1){ perror("learn count"); printf("errno = %d.\n", errno); exit(1); } //printf("rbuf : %s\n",rbuf); homecoming 1; } here execution: $ gcc -o dummy dummy.c $ ./dummy aaaaa /bin/sh $ /bin/sh sh-3.2$ exit exit $ i guess remaining string of stdin printed on mew stdout prompt. plus line feed @ end, somehow emulates come in pressed user ex...

pointers - C++ segmentation fault while passing address values between functions -

pointers - C++ segmentation fault while passing address values between functions - i trying write simple c++ algorithm solve sudoku. trying pass address values between different functions segmentation fault @ runtime. (needless say, not quite experienced :)) the code manage pass address of a[0] main function , can read values using pointers within main. when seek pass address solve function, gives segmentation fault. (also secondary question, can read values correctly in main, using cout << *(a+5) etc. correctly (commented out in main), when seek print 81 values stored using loop, gives out nonsense values (again, commented out in code). code works literals *(a+3) or a[3], not when int gets involved for(int i, whatever) cout << *(a+i);) #include <iostream> using namespace std; int * get_input(); void solve(int *); int main() { int * a; = get_input(); //cout << *a << " " << *(a+1) << " " << ...

php - How to dynamically update a file name with increasing integers? -

php - How to dynamically update a file name with increasing integers? - i want update file name looks each time updated. some_name_1, some_name_2, some_name_3, etc. each update increment trailing integer one. below prototype, wanted create sure best practice way it, before implementing it. also, i'm not 100% php implicit casting correctly. is practice way update file name? // ... in class private function updatefilename() { $pattern = '#_(\d+)$#'; $subject = $this->file_name; // $subject holds current file name preg_match($pattern, $subject, $matches); if($matches[0]) { $patterns = array(); $temp = $matches[0]; $patterns[0] = '/$temp$/'; $replacements = array(); $replacements[0] = $matches[0] + 1; preg_replace($patterns, $replacements, $subject); // $subject holds new name } } clarification the file name hash, , 1 string of characters. the _1, etc @ end of string ( ...

iphone - Wrong coordinates after rotating, scaling and moving one image and sending the transform to other ViewController -

iphone - Wrong coordinates after rotating, scaling and moving one image and sending the transform to other ViewController - i'm manipulating image (scale, position, rotation). 1 time that's done, user redirected viewcontroller i'm loading same image in same position. i'm sending transform string 1 viewcontroller other: nsstringfromcgaffinetransform(self.myimage.transform) but image not in right position, it's moved. i've tried send bounds, center, frame of image along transform, i'm not getting identical position, scale , rotation of original image. thanks in advance! iphone ios objective-c rotation transform

internet explorer - Make Browser to remember name/password in form by ExtJS 3 -

internet explorer - Make Browser to remember name/password in form by ExtJS 3 - i have create form, browser can see , save password. found lots of sollutions, , in firefox - illustration - user owlness's sollution nice , useful. chrome doesn't show , console says: uncaught typeerror: cannot phone call method 'addunits' of null <form id="auth-form" action="" method="post"> <input id="auth-username" type="text" name="username" class="x-hidden"> <input id="auth-password" type="password" name="password" class="x-hidden"> <input id="auth-submit" type="submit" class="x-hidden"> </form> ... new ext.formpanel({ region: 'south', //id: 'login', el: 'auth-form', autoshow: true, height: 125, ...

c - how to symlink a shared object file (lib) -

c - how to symlink a shared object file (lib) - how symlink lib file loaded shared library? root@root:/usr/lib# ls -l /usr/lib/ | grep libpcap -rw-r--r-- 1 root root 351636 2010-01-04 20:15 libpcap.a lrwxrwxrwx 1 root root 14 2011-08-18 01:56 libpcap.so -> libpcap.so.0.8 lrwxrwxrwx 1 root root 16 2011-08-18 01:56 libpcap.so.0.8 -> libpcap.so.1.0.0 lrwxrwxrwx 1 root root 25 2013-02-19 10:01 libpcap.so.1 -> /usr/lib/libpcap.so.1.0.0 -rw-r--r-- 1 root root 204128 2010-01-04 20:15 libpcap.so.1.0.0 root@root:/usr/lib# start-wfw checking wlan0 homecoming 1 root@root:/usr/lib# /tmp/wfw: error while loading shared libraries: libpcap.so.1: cannot open shared object file: no such file or directory root@root:/usr/lib# stop-wfw stopping () wfw: no process found os: backtrack 5 r1, 64 | arch: x86_64 initially, echo ld_library_path, returns blank line. after creating symlink, ran ldconfig, , retried executable, no avail. i...

Call disconnect for asterisk -

Call disconnect for asterisk - how capture phone call disconnect asterisk using phpagi ? e.g. if user disconnects phone call event invoked ? how capture ? you can check homecoming results of php-agi api calls, illustration stream_file returns -1 on hangup. you invoke agi script on h extension in dialplan. if have clean something, register shutdown function. another approach register signal handler edmund long described in blog. pcntl php extension, enable pcntl recompile php --enable-pcntl . <?php declare(ticks=1); function sig_handler($signo) { //do stuff in here exit(0); } //register hangup handler if (function_exists('pcntl_signal')) { pcntl_signal(sighup, "sig_handler"); } asterisk disconnect ivr

c - How strcpy works behind the scenes? -

c - How strcpy works behind the scenes? - this may basic question some. trying understand how strcpy works behind scenes. example, in code #include <stdio.h> #include <string.h> int main () { char s[6] = "hello"; char a[20] = "world isnsadsdas"; strcpy(s,a); printf("%s\n",s); printf("%d\n", sizeof(s)); homecoming 0; } as declaring s static array size less of source. thought wont print whole word, did print world isnsadsdas .. so, thought strcpy function might allocating new size if destination less source. now, when check sizeof(s), still 6, printing out more that. hows working actually? you've caused undefined behaviour, can happen. in case, you're getting lucky , it's not crashing, shouldn't rely on happening. here's simplified strcpy implementation (but it's not far off many real ones): char *strcpy(char *d, const char *s) { char *saved = d; while (*s) { ...

c++ - Ending a for loop when a string is empty -

c++ - Ending a for loop when a string is empty - so have function calls string , converting string int array. for (i = 0; ; i++) { areainta[i] = area[i] - '0'; areacounter++; } before had for(i = 0; < 5; i++) because 5 max limit int array, had problems that. how can create status end loop when string has no more values left, because might phone call "50" or "540" or "1" or "1930" etc... for (i = 0; area[i]!='\0'; i++) { areainta[i] = area[i] - '0'; areacounter++; } c++

c# - Mutex not behaving as expected when loading Form settings -

c# - Mutex not behaving as expected when loading Form settings - based on code project article on windows forms user settings david veeneman, have been playing around saving start location , start size of application. it works in single instance, when expand multiple instance run problems. i've wrapped section dealing loading setting , saving settings in mutex protect writing , settings file. i windows stack lastly known location. seems work fine of time, if open 4 or 5 windows in rapid sucession first 3 open perfectly, there gap, , after of them start open @ same location. render form/application: private mutex savesetting; private const int start_location_offset = 20; private void mainform_load(object sender, eventargs e) { // mutex before reading of location // can't have situation window drawn // in wrong position. this.savesetting = new mutex(false, "savesetting"); this.savesetting.waitone(); ...

mono - Debug reference's code in MonoDevelop -

mono - Debug reference's code in MonoDevelop - in visual studio when i'm debugging project if go in code that's reference project vs seek find reference's source code , symbols can step through code. how in monodevelop on osx when trying debug monomac application? in preferences under monodevelop menu there settings section called "debugger". in there settings called "debug project code only; not set framework code" unchecking tell monodevelop go other assemblies if has debug mono monodevelop

c# - How best to handle an unexpected socket error? -

c# - How best to handle an unexpected socket error? - i have chat client class class chatclient { task connectasync(string server); task sendmessageasync(string message); task disconnectasync(); } once user has connected connectasync able phone call sendmessageasync send messages other users. under hood there connection class basic wrapper socket class. 1 of main differences has onerror event. i'm using observable message stream (reactive extensions) reads connection , produces stream of incoming commands server. my question - when socket produces error, best handle error from? should handle within onerror event handler, or should intercept error observable stream , handle there? i can't see upside or downside either way, i'm wondering best practice dictates? something having event on connection class has struck me beingness little hacky, don't know why. any suggestions? thanks i have best solution ever transparent end user. ...

mercurial - How to migrate to just 1 or 2 hg + svn repository hosts? -

mercurial - How to migrate to just 1 or 2 hg + svn repository hosts? - i utilize svn + hg. should merge 1 or 2 repository hosts? there disadvantage in merging 1 or 2 repository hosts? used hg (bitbucket, googlecode) , svn (xp-dev.com , googlecode). if matters take between bitbucket, xp-dev.com , googlecode, 1 best? think disadvantage code.google it's open source , i'm indifferent towards bitbucket , xp-dev both seem able want. well, it's subjective question (and answers), bad format. i'll seek answer never used xp-dev, can nothing gcode - public repo, little space-limit bitbucket - private repos (but free plain little team of 5 users), no space-limits, hg/git without subversion from point - bitbucket wins but, if using subversion must also, can see @ assembla "all in 1 solution" (or assembla portfolio): private , public "spaces", 1gb total amount of separate spaces (free plain, paid plains differ), git-github repo/svn-exter...

java - Get line number of the last printed line on a PDF Page using itext -

java - Get line number of the last printed line on a PDF Page using itext - i creating pdf in want number each line printed , next statistics also each page has start numbering zero total lines in pdf, total lines on each page, etc... all of these done runtime . , not after creation of pdf . pdf created cannot opened again. so dont have shot @ pdf, how can set line numbers in pdf specially when text varies every time. i have used page events not able find line events in itext i using itext 2.1.5 java . java pdf itext

jquery - Execute href and Open URL in a new window -

jquery - Execute href and Open URL in a new window - i have postback method in asp.net , after want open new blank page. i displaying message client side , explicitly clicking href href not firing. <a href="../tools/pagename.aspx" target="_blank" id="aprocess"></a> function downloaddata() { $("#aprocess").click(); } i want execute href in new page. window.open() not want use. want open new window. using window.open() may blocked browser sometime. hence href phone call explicitly want trigger. use if want url opened in current window document.location.href = 'http://url.com'; if want url opened in new window without using window.open() . can utilize window.showmodaldialog("http://url.com",window); jquery asp.net

c++ - QT + winId() - Determine handle type -

c++ - QT + winId() - Determine handle type - is there way, either @ runtime or (preferably) using preprocessor macros, determine whether handle returned qwidget::winid() handle cocoa window or handle carbon window? windows obvious, i'm more interested in mac. particular library i'm using knows how utilize various handles, needs know which type handle before using it. there preprocessor defines in qtcore/qconfig.h this. search qt_mac_use_cocoa on internet. c++ cocoa qt carbon

java - How to read a pdf file stored in sdcard using mupdf reader stored in android device -

java - How to read a pdf file stored in sdcard using mupdf reader stored in android device - hi working on making app in android reads pdf given url , store in sdcard , open mupdf reader in android device. i getting next error in logcat : logcat : 02-15 05:47:10.276: e/androidruntime(3134): java.lang.runtimeexception: unable start activity componentinfo{com.ohile.openpdf/com.ohile.openpdf.mainactivity}: android.content.activitynotfoundexception: no activity found handle intent { act=android.intent.action.view dat=file:///mnt/sdcard/pdf/read.pdf typ=application/pdf } 02-15 05:47:10.276: e/androidruntime(3134): @ android.app.activitythread.performlaunchactivity(activitythread.java:2180) 02-15 05:47:10.276: e/androidruntime(3134): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2230) 02-15 05:47:10.276: e/androidruntime(3134): @ android.app.activitythread.access$600(activitythread.java:141) 02-15 05:47:10.276:...

directx - Multiple light sources in HLSL -

directx - Multiple light sources in HLSL - i learning shader programming. i've got basics down, multiple lite sources different types challenging. need utilize single render pass each lite type or multiple passes? or, if there valid reasons both, utilize cases each? you not need utilize separate pass each lite type if using forwards rendering. perform lighting lights in same shader. if used defered rendering render each lite type in separate pass. directx hlsl

python - Angular movement in pygame -

python - Angular movement in pygame - i've made function allowes me move object diagonal: if(myx > targetx): dx = myx - targetx else: dx = targetx - myx if(myy > targety): dy = myy - targety else: dy = targety - myy if(dy == 0): dy = 1 if(dx == 0): dx = 1 #calc motion if(dx < dy): speedy = dy/dx speedx = 1 if(dx > dy): speedy = 1 speedx = dx/dy elif(dx == dy): speedx = 1 speedy = 1 if(myx < targetx): speedx = speedx * -1 if(myy < targety): speedy = speedy * -1 homecoming speedx,speedy the code perfectly, problem dosen't work want to. right object speeds if move closer it, looks rather odd. aware why this, there easy way prepare speed constant, not direction? if way dx , dy scalars of vector points guy target. split magnitude of both of them, here represented dz. dx , dy ...

c# - Find control created in Code-behind using jQuery -

c# - Find control created in Code-behind using jQuery - i want able access label command in jquery created in codebehind. i have added controls page in codebehind so label l = new label(); l.id = "txt" + i; l.text = dr["category_name"].tostring(); l.cssclass = "heading"; divcat.controls.add(l); is possible find these controls via id or alternative alternative in jquery? next gives error saying there no such control: $(function () { $(".hoverlabel").hover(function () { $("#<%=txt1.clientid %>").show(); }); }); i not sure work or not. can take benefit of clientidmode="static" eg. <asp:textbox id="txtecho2" runat="server" clientidmode="static" /> in case label l = new label(); l.id = "txt" + i; l.text = dr["category_name"].tostring(); l.cssclass = "heading...

joomla2.5 - Joomla K2 item facebook comment notify author email -

joomla2.5 - Joomla K2 item facebook comment notify author email - ok, bit tricky, there has way facebooks fb.event? the setup , problem. every k2 item (page) has comment box. need notify author of said page when comments made on entries so when makes entry on facebook comments box, want create sure specific author notified via email comment has been made. i'm thinking 1 first have create sort of variable each author , connect wwith specific email. write fb.event handler sending email based on author. is there can help me figure out how this? edit please follow link php variable external file? finish solution on subject , trying accomplish here. you need utilize fb.event.subscribe , subscribe comment.create event. on firing event can phone call ajax function send email. reference: http://developers.facebook.com/docs/reference/javascript/fb.event.subscribe/ facebook joomla2.5 facebook-comments notify joomla-k2

Regex Replace quotes with Powershell -

Regex Replace quotes with Powershell - i editing web log files , want remove double quotes feilds, not all. for example, in next line, want remove double quotes ip address , server.domain.com, leave rest. 2013-02-18 21:47:46.636 post /path/page.html - - "173.194.79.106" "mozilla/4.0 (compatible; msie 6.0; ms web services client protocol 4.0.30319.296)" - "server.domain.com" 200 1079 15 i looping through file loading each line foreach-object i can line without quotes around ip address this: [regex]::replace($_,"`"(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})`"", '$1') so attempted utilize below same server.domain.com item this: [regex]::replace($_,"`"[a-za-z]*\.[dd][oo][mm][aa][ii][nn]\.[cc][oo][mm]`"",'$1') and result this: 2013-02-18 21:47:46.636 post /path/page.html - - "173.194.79.106" "mozilla/4.0 (compatible; msie 6.0; ms web services client protocol 4.0.303...

c++ - Deadlock - Creating a QThread from the main thread -

c++ - Deadlock - Creating a QThread from the main thread - i trying debug situation 2 threads have been locked on same mutex(qmutex). connection between 2 threads -one thread created another. i.e. first main thread( gui thread) , create object of user defined class. constructor of object new thread created. wrong usage ? //some part of code: void main() { mymainthread *obj = new mymainthread(); // class inherits qwidget } //this class declaration in file class someobj { someobj() { } startanotherobjthread() { anotherobjthread obj = new anotherobjthread(this); obj->start(); } } mymainthread() { someobj *obj = new someobj(); obj->startanotherobjthread(); } c++ linux qt qt4

java - Delete child objects when parent object is deleted -

java - Delete child objects when parent object is deleted - i experiencing problem on on spring web application developing. have checked site similar issues, none of solution seem work me. i have 3 entities: person, team , teammembership, bridging entity break manytomany relationship between person , team 2 onetomany relationships. initially, had team , teammembership delete working correctly whereby if deleted or updated team, teammemberships automatically deleted or updated correctly. when introduced person entity, stopped working correctly. hibernate exception saying deleted object re-saved cascade i want work such if delete team or person object, corresponding teammemberships orphaned , deleted. please assist. code samples follows: person: @onetomany(mappedby="person", cascade=cascadetype.all, fetch=fetchtype.eager, orphanremoval=true) private list <teammembership> teammemberships; team: @onetomany(mappedby="team", cascade=cascadety...

JQuery hover multiple elements one function -

JQuery hover multiple elements one function - i have 3 divs hidden inner divs, when rollover on each div inner div should display , when rollout hides again. for example, rollover div1, div1 inner appears, rollout, div1 inner disappears. however when move mouse div1 straight on div2, both treated rollout, eg div1 inner disappears (as should), div2 inner appears(as should) instantly disappears div1 inner. apart writing separate functions div1 2 , 3 i'm not sure do, help much appreciated!! jsfiddle.net/user1688604/uzpeh/3 var box = $("#box1,#box2,#box3"); var inner = $(".item"); $(box).hover(function() { $(this).find(inner).stop(true,true).css({"left":"20px"}).animate({"top":"-10px", "opacity": "1"},400); }, function() { $(this).find(inner).stop(true,true).animate({"top":"-20px", "opacity": "0"},400, function() { $(inner).css({...

setPixel is not working in android -

setPixel is not working in android - i using setpixel function manipulating bitmap not working. app crashes. 02-21 13:05:04.582: e/androidruntime(839): java.lang.illegalstateexception: not execute method of activity public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.activity_main, menu); homecoming true; } public void function(view view){ bitmap img = bitmapfactory.decoderesource(getresources(), r.drawable.test); int imgwidth = img.getwidth(); int imgheight = img.getheight(); for(int x = 0; x < imgwidth; x++){ for(int y = 0; y < imgheight; y++){ int pixcolor = img.getpixel(x,y); if(pixcolor == color.white){ img....

batch file - Left-string, variable matching in a DOS command? -

batch file - Left-string, variable matching in a DOS command? - is possible string pattern match in dos? instance want following: if "%username" == "abc*" (echo 1) i know asterisk doesn't work here , can't find alternative. have ideas? try if "%username:~0,3%" == "abc" (echo 1) this substring %username 3 characters beginning good luck string batch-file pattern-matching dos

math - How do you round a two decimal places in Javascript? -

math - How do you round a two decimal places in Javascript? - i trying round number 2 decemals , giving me integers! var 4 = 10.99 + 89.78899999 total = number(a) + number(b); here have: math.round(total, 2); // gives me 101 need show 100.78 what trick this? you should utilize tofixed(2) with: alert(12.432432.tofixed(2)); // 12.43 math.round for: "returns value of number rounded nearest integer." btw, 4 isn't valid variable name in javascript, can't begin number. valid characters javascript variable names javascript math decimal

jquery - Call specific controller from JSON in CodeIgniter -

jquery - Call specific controller from JSON in CodeIgniter - there code: var formobject = { run : function(obj) { if (obj.val() === '') { obj.nextall('.update').html('<option value="">----</option>').attr('disabled', true); } else { var id = obj.attr('id'); var v = obj.val(); jquery.getjson('update.php', { id : id, value : v }, function(data) { if (!data.error) { obj.next('.update').html(data.list).removeattr('disabled'); } else { obj.nextall('.update').html('<option value="">----</option>').attr('disabled', true); } }); } } }; $(function() { $('.update').on("change", function() { formobject.run($(this)); }...

compiler construction - LL1 grammar in compiling -

compiler construction - LL1 grammar in compiling - i have question ll1 grammar. if have grammar this: <s>::=<a> <a>::=<a> auto cat | epsilon what first <a> can be? epsilon? , if epsilon, language not ll1! confused... first(a) = {epsilon, car} if non-terminal , : α production, add together first( ). if : epsilon production, add together epsilon first( ). if : α1 α2 α3 ... αm production, add together first( α1 ) first( ). if α1 derives epsilon, add together first( α2 ) first( ). if both α1 , α2 derive epsilon, add together first( α3 ) first( ), , on. compiler-construction programming-languages

add/remove dom elements mobile page using any javascript framework -

add/remove dom elements mobile page using any javascript framework - i trying create mobile page shows list of items (which huge on 2500) using unordered list. created page , hangs after sometime. someone told me mobile has lesser processing powerfulness have remove dom elements not in viewable screen area. how can accomplish this? items have displayed in order. on first load, can show 10 items on screen, user can scroll down, scrolls down, can show next 10 items (11 - 20) , remove previous 10 items dom. next, if scrolls have show previous 10 items (1 - 10) or if scrolls downwards have show next 10 items (21 - 30). if scrolls multiple times downwards reach items in 1000's? please help... dom mobile memory-optimization

how to find status of my code with regard to my app's git repo on heroku -

how to find status of my code with regard to my app's git repo on heroku - i have created app on heroku , pushed code (after creating git repo git init ). app folder contains requirements.txt in wrongfully set matplotlib before numpy . (actually numpy needed install matpplotlib , should come before it). when pushed heroku master, the compilation failed error message 'numpy needed install matplotlib'. corrected order of items in requirements.txt , using git add , git commit etc committed it. tried force code 1 time again using git force heroku master . failed same error message here requirements.txt django==1.4.3 south==0.7.6 distribute==0.6.28 dj-database-url==0.2.1 django-registration==0.8 numpy==1.6.2 matplotlib==1.2.0 psycopg2==2.4.6 python-memcached==1.48 wsgiref==0.1.2 simplejson==3.0.7 then tried find status using git status , produced # on branch master # branch ahead of 'origin/master' 2 commits. # nil commit (working dire...