Posts

Showing posts from January, 2011

java - Selenium click sometimes causes page to load and sometimes doesn't -

clicking on button in web page causes entire page load, , part of load. how can call waitforpagetoload without page loading, , able run additional commands after elements present, or other command can use, wait page loaded , enable me run additional commands on page. (using selenium 2.) clicking on button in web page causes entire page load, , part of load. i assume design, , not problem. if testing, should know behavior expecting. if expecting full page load, use clickandwait . if expecting partial load, use click followed waitforcondition .

android - NoSuchMethodError when exporting a signed apk -

i tried compile reddit-is-fun , reddit reader android. if start application adt (either debug or running) launch , run correctly on phone (htc desire). however, if export signed , zipaligned package , install it, not work. logcat shows nosuchmethoderror exceptions jackson . 2 jars, present in repository , added build path. made sure 2 have same versions , replaced them newer ones. i'm not familiar using jar libraries. "linked" resulting apk static library linked executable when compiling c++? how can make sure app on device load same version used compiling? (which problem). sounds proguard obfuscation breaking it. try disabling proguard confirm (or add jackson whitelist in proguard.cfg )

iphone - how to save image in subfolder (AnyName) in document in phone help me -

her i'm using coding in program nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *docspath = [paths objectatindex:0]; nsstring *imagecachedirpath = [docspath stringbyappendingpathcomponent:@"image"]; nsstring *imagecachepath = [imagecachedirpath stringbyappendingpathcomponent:@"1.jpg"]; [[nsfilemanager defaultmanager] createfileatpath:imagecachepath contents:dataobj attributes:nil]; what problem in coding.send sample code . one potential problem 'image' directory not exist when try create file in - it's required createfileatpath method run properly. check if image folder exists , create if required: nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *docspath = [paths objectatindex:0]; nsstring *imagecachedirpath = [docspath stringbyappendingpathcomponent:@"image"]; nsstring *imagecachepath = [imagecached...

facebook - Scroll page from within cross domain iframe -

situation: have page iframe, contains form. iframe longer screen page , user has scroll down submit it. loads contents of iframe, it'll scrolled same amount before submitting page. want @ top of page. since user scrolled facebook page , not iframe, cannot use scrollto (not allowed cross domain iframes). question: possible submit form facebook reload entire page , still gives me access form data? not sure if you're asking, if it's iframe app can use fb.canvas.scrollto control main facebook page position. can either call selectively or can put code in <head> section of every page: <script src="http://connect.facebook.net/en_us/all.js"></script> <script type='text/javascript'> window.onload=function() { fb.canvas.scrollto(0,0); } </script> that way every time load new page in iframe, main page return top.

C++ Member Initialization List -

please explain how use member initialization lists. have class declared in .h file , .cpp file this: class example { private: int m_top; const int m_size; ... public: example ( int size, int grow_by = 1 ) : m_size(5), m_top(-1); ... ~example(); }; i'm initializing m_size on object creation because of const . how should write constructor? should repeat : m_size(5), m_top(-1) , or can omit step? example::example( int size, int grow_by) { ... code here } or example::example( int size, int grow_by) : m_size(5), m_top(-1) { ... code here } this initialization list : example::example( int size, int grow_by) : m_size(5), m_top(-1) { ... code here } and should done in cpp file. don't error when did in header in example?

php - MySQL Trigger Problem -

i'm starting use triggers in mysql, , have problem. wrote triggers update users table , make notifications=notifications+1 (to user) when insert in notifications table. seems work, have made 'check-cron-script', runs every minute, , updates users table 100% true values should there (count notifications table). cron sends me email if updates rows. if script makes change, it'll send me email containing user_id had bad value. while ago, received 2 emails in row (22:53, 22:54) telling me script found bad value in users table, , had update 1 row. both emails same (same user, same thing). , i'm wondering happened. update query: insert notifications (user_id,title,notification) values (%i,%s,%s) after insert trigger: begin if new.`new` > 0 update users set notifications=notifications+1 id=new.user_id; end if; end after update trigger: begin if old.`new` != new.`new` if old.`new` > 0 update users set notifications=notifications-1 id=old.user_id; end if; if new...

Store two integers from a String in C -

i trying write program prints 2 numbers string. for example, string = '20,66' trying break string apart can store '20' , '66' 2 separate variables. here code working on: #include <stdio.h> char line[80]; int main(void) { // variables int start_number, end_number; int i, j; while(1) { printf("enter number: "); fgets( line, sizeof(line), stdin); // how find comma for( i=0; < strlen(line); i++) { if(line[i]==',') break; } // how find 2 numbers for(j = 0; j < i; j++) { printf("1: %c\n", line[j]); } for(j = + 1; j < strlen(line); j++) { printf("2: %c\n", line[j]); } if (strcmp(line, "quit\n") == 0) { printf("now terminating program..."); break; } } } ...

css - Is it possible to nest media queries within media queries? -

is possible? seems neat solution me, i'm not sure if work. @media screen , (min-device-width : 320px) , (max-device-width : 480px) { /* code both portrait , landscape */ @media (orientation:portrait) { /* code portrait */ } @media (orientation:landscape) { /* code landscape */ } } you should able nest @media rules way in css3 , isn't yet supported browsers. see this answer details. you have expand , repeat top-level media queries inner rules work across browsers (and imagine scss processor generate similar): @media screen , (min-device-width: 320px) , (max-device-width: 480px) { /* code both portrait , landscape */ } @media screen , (min-device-width: 320px) , (max-device-width: 480px) , (orientation: portrait) { /* code portrait */ } @media screen , (min-device-width: 320px) , (max-device-width: 480px) , (orientation: landscape) { /* code landscape */ }

c# - TimeZoneInfo.GetSystemTimeZones() how to Select entries for specific country codes only? -

timezoneinfo.getsystemtimezones() gives enumeration of time zones. question how select entries specific country codes only. know utc offset , country code , need able select correct time zone value. first, have discovered can't use utc offset due daylight savings variations (among perhaps other regional deviations). perhaps if provided utc offset current offset, , regularly polling it, use this? regardless, don't think country code + utc going easy these reasons (which no doubt know): timezones have many-to-many relationship countries while "tokyo standard time" japan (or @ least, "jp" , utc+9:00 concievably give tokyo standard time), "central asia standard time"? sure, if had map of every country every timezone might able somewhere here. the same utc offset in same country can yield different timezones for instance, in australia, queensland (brisbane) not observe daylight savings time, whereas other eastern states do. yields...

python - Code for playing video in wx.Media after the wmv file is loaded -

i newbie in wxpython , have write code can start playing video after load file. have been going through lot of forums tried implement 10 - 20 codes, wx.media not playing video file @ all. able load file not play it. i need simple code in manually enter path name of video file , after file loaded should start playing. i using windows xp, python 2.7 , wxpython python 2.7. i grateful of if me on one. following code using load() , play() file. still not working. import wx import wx.media class testpanel(wx.panel): def __init__(self, parent): wx.panel.__init__(self, parent, -1, style=wx.tab_traversal|wx.clip_children) # create controls try: self.mc = wx.media.mediactrl(self, style=wx.simple_border) except notimplementederror: self.destroy() raise self.mc.load(r"c:\documents , settings\n1002401b\desktop\test1.wmv") #self.slider.setrange(0, self.mc.length()) #folder, ...

grails - Better way to discover relationship dynamically when saving a new record? (otherSide fails) -

given relationship: class { string name static hasmany = [b:b] } class b { string name static belongsto = [a:a] } i have record b want save. i've discovered via working grails reflection (omitted in code example below) needs instance of class b. beyond that, record b knows: it has relation "a" relation "a"'s key since it's dynamic case, we not know , must discover: relation "a" instance of class a (so can call a .find(a's key)) the "other side" of relation - class a's perspective - relation " b " (so can call .addtob (b)) so how save b database? here's how i'm doing it: class assoctests extends grailsunittestcase { protected void setup() { super.setup() // don't know part, it's in db def = new a(name:"al") a.save() } void testassociation() { // want create new b such name="bob" ...

html - height for form element "select" displayed incorrectly in IE on server but on local machine is ok -

i have next code element form "select": <div style="width: 300px; margin: 0 auto; background: yellow;"> <form> <select style="width:100%; height: 24px; line-height: 16px; padding: 2px; background: none repeat scroll 0 0 #ffffea; border: 1px solid #b7ab8c; color: #605436; font-family: arial,tahoma,verdana,sans-serif; font-size: 12px;"> <option>item 1</option> <option>item 2</option> </select> </form> the element displayed differently on local machine , server ie. can't change height element "select" ie on server, while on local machine display correctly. thanks. displayed differently on local machine , server ie this problem "document mode" ie using render page. open page on both local machine , server, hit f12 in both of them bring developer tools. compare "browser mode" , "document mode" between 2 pages. ...

javascript - jQuery Countdown - reset timer -

i'm using jquery countdown plugin , have quick query. my code looks this: function docountdown(){ var nextnoon = new date(); if (nextnoon.gethours()>=12){ nextnoon.setdate(nextnoon.getdate()+1); } nextnoon.sethours(11,30,0,0); $('h3 .timer strong').countdown({until: nextnoon, compact: true, description: '', onexpiry: function(){docountdown()}}); } $(window).load(function(){ docountdown(); }); so basically, counts down untill next 11:30am . need reset counter when reaches 11:30am , automatically go 23:59:59 on timer. currently sticks @ 00:00:00 though docountdown function called onexpiry (tested console.log , calls it). is because javascript bases time off page load , stores it? the reason because nextnoon creation miscalculates times between 11:30am , 12:00pm. half hour period, if() evaluate false, set time 11:30am of current day. we've passed time, since we're between 11:30am , 12noon. count...

cobol - Calling CICS program from JCL batch -

is possible call cics program jcl batch? if yes how? if no why not? yes. technically, cobol batch program communicating cics, , execute cobol batch program jcl. can read more in cics transaction server manual. the external cics® interface application programming interface enables non-cics program (a client program) running in mvs™ call program (a server program) running in cics region , pass , receive data means of communications area. cics application program invoked if linked-to cics application program. introduction external cics interface i believe cics program cannot use maps (must conversational), it's been while since i've worked cics, might mistaken.

sql server - Copy Each Identity Of Inserted Records -

i have 2 table first: table: tbl#sell sellid clientid productid 1 3 3 5 4 6 second: table: tbl#sell2 sellid clientid productid now want copy every record of first table second one. "sellid" column in second table (sell2.sellid) auto increment (identity). for insert tbl#sell2.sellid set new identity , must store identity in tbl#sell1.sellid clear? solution? , plz. thanks i want store tbl#sell2.sellid in tbl#sell.sellid you can use triggers : http://msdn.microsoft.com/en-us/magazine/cc164047.aspx http://msdn.microsoft.com/en-us/library/aa258254(v=sql.80).aspx

javascript - Chrome execCommand returns error -

how use execcommand() in chrome? here code have right being used insert special character when hitting tab button function editable(supr){ document.getelementbyid('codeline').contenteditable='true'; document.getelementbyid('codeline').onkeydown=function(e) { if(e.keycode==9){ e.preventdefault(); range1 = document.getelementbyid('codeline'); range1.execcommand("inserthtml",false,"p"); } } } the execcommand() method method of document objects, not elements. ie provides execcommand() method of textrange , controlrange objects, these not present in other browsers. document.execcommand("inserthtml", false, "p"); you may want consider happens if user presses tab key when user has selected text: in case you'd want delete contents of selection before inserting tab character.

algorithm - Finding the maximum sum from a matrix -

there matrix m rows , n columns. task find maximum sum choosing single element each row , column. came solution, finds maximum whole matrix , sets row , column 0 adds sum , proceeds finding next max. repeats m times. but problem approach if there repetitive elements. i'll try explain example. here matrix.. 3 6 5 3 9 4 9 2 8 1 4 3 4 7 2 5 now, if follow above method.. sum 9 + 7 + 5 + 3 whereas should 9 + 8 + 7 + 3. how solve problem.. i'm stuck update: columns cost of seats can assigned person , rows number of persons. want assign them in such way, max cost. isn't http://en.wikipedia.org/wiki/assignment_problem , typically solved http://en.wikipedia.org/wiki/hungarian_algorithm ? obviously, want maximum rather minimum, surely can achieve maximising costs -(the real cost) or, if worried -ve costs, (max cost in matrix) - (real cost).

asp.net - using jquery with elements inside a asp:gridview -

i trying add style jquery elements inside grid-view jquery cannot identify element. trying this $("name").css("border", "3px solid red"); thanks the problem .net creates big long ugly names default. may call select "myinput" .net turns "somebiguglylongcontainerid$myinput". when try find "#myinput" jquery, can't because doesn't exist. there 2 solutions. if using late enough version of .net, can set clientidmode="static", , stop .net renaming, in fact called "myinput". the other solution inject generated id jquery inline code. $("#<%=myinput.id%>").css("border", "3px solid red"); .

how to record popup window using Jmeter? -

is there way record popup window using jmeter? requirement record authentication window contains username , password. possible? yes, while recording script, jmeter capture http requests use port specified in http proxy server. in case, since pop-up window in browser, jmeter capture it.

SHA1 in base64 and HMAC in HEX output issues ios iphone -

iam having fun time implementing sha1 , hmac methods in iphone applecation. need access webservice(which not controll) , require both sha1 , hmac encryption. for sha1 in base64 use following approach. -(nsstring*)sha1ith64base:(nsstring *)stringtoencode { unsigned char result[cc_sha1_digest_length]; const char *cstr = [stringtoencode utf8string]; cc_sha1(cstr, strlen(cstr), result); nsdata *pwhashdata = [[nsdata alloc] initwithbytes:result length: sizeof result]; nsstring *base64 = [base64 encode:pwhashdata]; nslog(@"sha1 in base64 %@",base64); return base64; } for hmac using following approach: - (nsstring *) encodewithhmacsha1:(nsstring *)k0:(nsstring*)m0 { const char *ckey = [k0 cstringusingencoding:nsasciistringencoding]; const char *cdata = [m0 cstringusingencoding:nsasciistringencoding]; unsigned char chmac[cc_sha1_digest_length]; cchmac(kcchmacalgsha1, ckey, strlen(ckey), cdata, strlen(cdata),...

iphone - Can you add an html file in the xcode groups folder and open it in a UIWebView? -

i want load html file on web view without having upload web. have file in groups folder in xcode. can open in webview? just path resource, , tell webview load it. should similar you'd need. [webview loadrequest:[nsurlrequest requestwithurl:[nsurl fileurlwithpath:[[nsbundle mainbundle] pathforresource:@"myhtmlpage" oftype:@"html"]isdirectory:no]]]; where webview iboutlet uiwebview

c - Why does the address of a local variable vary when executing multiple times, but not when debugging it with GDB? -

why when running code gdb, same addresses variables declared, while executing binary don't same addresses. #include<stdio.h> void main() { int *x,q; //i saw address of variable q in program through gdb during __1st__ execution. //i re-compiled program make x point address. x=0x7fffffffe2bc; *x=3; printf("%d",(*x)); } i ran program through gdb , never segfaulted. $ gdb -q ./a.out reading symbols /home/eknath/needed2/a.out...done. (gdb) r starting program: /home/eknath/needed2/a.out 3 program exited normally. (gdb) q $ but normal execution of program produces segfault. $ ./a.out segmentation fault i don't know if question duplicate of is address gdb debug program? note: have not switched off aslr the reason same address local variables while running under gdb gdb (in order simplify debugging scenarios) disables address space randomization. you can ask gdb not set disable-address-randomization o...

How to impose conditions on a "GROUP BY" statement - MySQL -

i have following mysql query: select * products catalog = 1 group style order name asc limit 0, 100 since have multiple products same "style", return information whatever first product has "style" (through group condition). because products have "discount", question follows : how make "group style" condition gives first priority product has discount? ultimate goal use 1 query instead of after going through each returned style , checking if there products discount if specify "group style, discount", returns 2 products same style: 1 , 1 without discount. not need -- need return 1 match (unique) style give preference items match style have discount. you cannot impose priority within groupped set in single query. can restrict results using before applying group by, strip result of rows not satisfying condition. find order within groupped sets use query this: (assuming id primary key here) select p.* ( select ...

flex - how to install adobe air in android emulator -

i implementing 1 application related android in adobe flex, .apk generated , while installing .apk file in emulator, emulator showing 1 pop install adobe air, while again installing on adobe air , showing no mobile device connected system. how can install adobe air in emulator test application made in adobe flex? thanks in advance narasimha to install air runtime on emulator: adb -e install -r runtime_emulator_froyo_20100930.apk from site: http://flashsimulations.com/2010/10/19/developing-android-applications-with-adobe-air/

c# - Wizard in asp.net, client vs serverside -

im going make wizard in asp.net. step 1 7 radiobuttons, leading different steps. each step have dropdown lists or similar, leading final page. final page same no matter "route" take. know is: solve creating asp:wizard, or maybe show/hide asp:placeholders? or make steps on clientside, using generic handler save database, generate json results populate dropdowns etc? thanks if have know-how of jquery , other stuff must use jquery/jquery plugins. wizard plugins http://thecodemine.org/ stackoverflow thread

internet explorer - Does IE fail when removing tag attribs with jquery? -

i´m using different box title atrib in elements. i´ve developed simple jquery stuff but... "best friend ever", ie, don´t work correctly. it´s simple don´t remove title atrib other browsers do. result: i´ve box showing title atrib , own browser box on this. how can resolve this? (code next). note: works on chrome, safari, firefox, opera. ie don´t. <title>box</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <style type="text/css"> #dbox { background: #003767; padding: 5px 8px; position: absolute; margin: 20px; color: white; font-size: 14px; display: inline; /* border radius specif browsers */ -webkit-border-radius: 3px; /* safari, chrome */ -khtml-border-radius: 3px; /* ktml browsers */ -moz-border-radius: 3px; /* firefox, mozila found. */ -o-border-radius: 3px; /* opera, opmob */ } </st...

java - What about TimeFormat? Converting Timestamp -

how format java.sql timestamp displaying? what timeformat, how can convert timestamp string showing time? this 1 way it... new simpledateformat("hh:mm:ss") .format(new date(timestamp.gettime())); edit : turns out simpledateformat can format timestamps easier: new simpledateformat("hh:mm:ss") .format(new timestamp(system.currenttimemillis()));

Qt: showFullScreen() on a QWidget doesn't remove Mac OSX Menu Bar -

we our application full screen alright, osx menu bar still shown above it... is there way around problem? yes, might bug suggested. try framelesswindowhint, this: #include <qtgui/qapplication> #include <qlabel> int main(int argc, char *argv[]) { qapplication a(argc, argv); qlabel label("test!"); label.setwindowflags(qt::framelesswindowhint); label.showfullscreen(); return a.exec(); } i tested on mac os x 10.7.1 (which not supported) , seems work.

collect email using hominid/mailchimp rails 3.0 -

i collect emails of prospective users of app. i've created page simple form. first question since i'm not using db, need model? , secondly, how use "form_for" form generation if don't need use model. thank you i've done this. first created simple form email field , submit button in views (app/views/home.html.erb). use form tag helper create form rather writing own html: http://guides.rubyonrails.org/form_helpers.html . made sure route form action correct action in controller. in controller use hominid subscription, redirect index using redirect_to (':action => home'). that's took.

javascript - jQuery: Can't retrieve an attribute of a dynamically created DOM element -

here's situation: i'm writing simple ajax application performs crud functions. when user double clicks on particular element, element changes text box can edit inline. when text box loses focus (code below), value of textbox gets posted php script updates database. all groovy except 1 thing. when create new record, gets popped onto top of list ajax, can't edit record without refreshing page. mean, edit looks it's been committed, when refresh, reverts original. after refreshing, there no issues. to boil down: when try run following code on newly created rows in table (both in database , on page), edit appears made on page, never makes database. //make changes on focusout $('#editable').live('focusout', function(){ var parentlistitem = $(this).parents('li'); var thetext = $(this).val(); var parentlistitemid = parentlistitem.parents('ul').attr('id'); $(this).remove(); parentli...

JOSSO's <ignore-url-patterns> example needed -

just wondering if show me example of how works josso's partner-app in joss-agent-config.xml? just solved today. set url patterns josso ignore-url-patterns tag need use tag namespace: <agent:partner-app context="/" id="liferay">    <agent:ignore-url-patterns>       <s:value>*.css</s:value>       <s:value>*.js</s:value>       <s:value>*.gif</s:value>       <s:value>*.jpg</s:value>       <s:value>*.png</s:value>    </agent:ignore-url-patterns> </agent:partner-app> this assumes have xmlns:agent="urn:org:josso:agent:core" , xmlns:s="http://www.springframework.org/schema/beans". the xsd ignore-url-patterns uses "##other" scope must tag namespace. i've used spring's <value /> tag...

jquery - Vertical content slider for wordpress -

does know vertical category content slider plugin wordpress? try one, used : http://wordpress.org/extend/plugins/slidedeck-lite-for-wordpress/

c++ - Autotools vs CMake -

i have been looking pros & cons of autotools , cmake. know opinions people having used 1 (or both) of these tools projects. i used autotools year ago , know 1 of points relies on shell scripting, hence not need installed run. looks linux oriented, , not possible run configure file on windows. i have choose build system tool an open source project have compiled @ least linux & windows. written in c++, , uses qt gui front-end, rest of "generic". thanks help. i not recommend autotools windows. use cmake. why? windows doesn't have native sh.exe, , emulation slow. it's easy configury stuff wrong. i'm not saying it's impossible in cmake, cmake surely abstracts more away, worry less. cmake documentation can bit hard read, once it's set up, should fine toolchains ever supported cmake. cmake integrates testing, packaging etc... autotools slow on windows, not work msvc, , has weird quirks windows (and other oses) hard debug, , hard fi...

c# - What is a good system automation testing tool for C # and .NET? -

what system automation testing tool c# , .net? it can depend on requirements these 2 questions place start testing automation tools .net https://stackoverflow.com/questions/120359/tools-for-automated-gui-testing-on-windows

android layout - Remove the white border of Custom Dialog which is an activity -

i have custom dialog, has label , text box , 2 buttons. decided build activity dialog, , in manifest file, mentioned theme dialog. so custom dialog working fine. but, want remove white boder of custom dialog. i read other posts,which can remove border using <item name="android:windowbackground">@color/transparent_white</item> however in case activity, looks dialog. please help

php - Kohana 3 Pagination & Route question -

this bit cryptic, on day 1. use if dont mind. controller search, on action_query($search_term) so right /search/query/some query?page=1 (this without route) need setup in format.. /search/some query/1 1 being page pagination $pagination = pagination::factory(array( 'current_page' => array('source' => 'route', 'key' => 'page'), 'total_items' => $count, 'items_per_page' => 100, 'view' => 'pagination/basic', )); with route route::set('page', '<controller>/<action>/<search_term>(/<page>)') ->defaults(array( 'action' => 'query', 'search_term' => '[a-za-z0-9 ]', 'controller' => 'search', 'action' => 'page', 'page' => '1...

vb.net - Adding Controls dynamically. Asp.Net and VB -

i'm trying add "panel" controls dynamicaly. code below, clicking "add" button, displays "panel" controls(which within table), number of "education" can enter unlimited. know how capture data, can't figure out how implement/code this,can please give me pointers same? should reading ajax? don't know ajax.. <asp:panel id="panel1" runat="server"> <table> <tr> <td><asp:textbox id="colluniv_name" runat="server"></asp:textbox></td> <td><asp:textbox id="colluniv_location" runat="server"></asp:textbox></td> </tr> <tr> <td><asp:textbox id="startdatetext" runat="server"></asp:textbox></td> <td><asp:textbox id="enddatetext" runat="server"></asp:textbox></td> <...

Android Bar Code Reader Functionality -

i need product bar code scanning. know how integrate functionality own custom app? should write activity uses library? if library? or call app has capability within app? the zebra crossing project start. apache 2.0 license , clients android, java, , think actionscript too. http://code.google.com/p/zxing/

ios - iPhone compass presents the wrong heading pitch angle is > about 45° -

this might hard explain geometry careful in spelling out. visible in standard compas app , data in cllocationmanager. 1) when holding phone in portrait orientation, consider pitch angle 0° 2) when pointing camera sky (such taking picture of cloud) pitch angle goes 0° -> 90° 90 degrees straight up. 3) when phone tilted upward (> 0 degrees , rotating on "x" magnetometer axis) , when phone @ (but not exactly) 45 degrees, compass heading rotates 180 degrees. while camera still point "n", compass report "s". 4) next (roughly) 90 degrees, compass heading rotated 180 degrees. this rotation of heading destructive me , not align accelerometers. there tutorial (i did not find 1 off bat) on using the raw data (x, y, z) clheading data calculate heading data? the end result want heading of compass match heading of camera. you can't rely on solely compass heading. see answer you're looking for, , in particular cmattitude object...

javascript - How to untoggle jQuery dropdown clicking elsewhere? (with jsFiddle link) -

please see fiddle . question #1 if click on "overview" , click again, dropdown toggled/untoggled. but if click on "overview" once - click on "per x" once - , on, dropdowns remain open. i have recent dropdown appear, , prior disappear whenever user clicks either outside button, or clicks on button. question #2 this css (from shaw's fullcalendar) has class fc-state-active inserted in first <span> when user activates dropdown, replacing fc-state-default . of course, should affect clicked button. any either issue appreciated! thanks! edit: at point answer @demian brecht gets close solving problem - still can't untoggle dropdown menu clicking anywhere else on screen or clicking same button again. you can see current state of code @ http://jsfiddle.net/qetgr/ if can give me solution great. thanks. try #1: $(".toggle").click(function(){ $('#nav ul:visible').toggle(); $('ul',t...

javascript - Simple Google Script not working -

i have decided use google scripts when can when using spreadsheets, start increasing knowledge. untrained , got stuck quite quickly. i saw code on youtube different script thought extracted needed , work... function y_add_up_function() { var ss = spreadsheetapp.getactivespreadsheet(); var sheet = ss.getsheets()[0]; var range = sheet.getrange["i2:j15"]; var data = range.getvalues(); var sum = 0; (var = 0; < 14; ++i) { var row = data[i]; if(row[1] == "y") { sum = sum + row[0]; } } return sum; } https://spreadsheets.google.com/ccc?key=0auzrl_i_w9e0den2ve9ztly1u0c4n0m3rm1ozkncale&hl=en&authkey=cmrboy4e there spreadsheet can see trying ss add have ticked y next price getting error reads: typeerror: cannot call method "getvalues" of undefined. (line 5) please teach me doing wrong ^_^!!! cheers! the error means trying call method on undefined object. if ...

python - tkinter call two functions -

is possible make tkinter button calls 2 function? some thing maybe?: from tkinter import * admin = tk() def o(): print '1' def t(): print '2' button = button(admin, text='press', command=o, command=t) button.pack() make new function calls both: def o_and_t(): o() t() button = button(admin, text='press', command=o_and_t) alternatively, can use fun little function: def sequence(*functions): def func(*args, **kwargs): return_value = none function in functions: return_value = function(*args, **kwargs) return return_value return func then can use this: button = button(admin, text='press', command=sequence(o, t))

android - How do I prevent the members of a compound view from restoring their inidividual states? -

i have custom viewgroup object composed of 2 spinners (whose values interdependent), , layout defined in xml file. want compound view object able restore own state upon orientation changes. problem though have overridden onrestoreinstancestate(parcelable state) in custom view object code, , can see code appear correctly restore object state when step through code, after restore custom viewgroup state individual spinners seem restore erraneously on top of custom restore. this fine if did correctly, seems system stores instance states spinners id, , since there multiple instances of compound view, saves state of 1 of them , restores of them. how can tell spinners compound view holds not restore themselves? subclassing spinner empty onrestoreinstancestate method didn't work because spinner throws runtime exception if fail call spinner.onrestoreinstancestate dummy subclass method.

email - 3rd party mail sending service -

i'm running web-app send emails users when sign-up, invite friends, , want reset password. sending out general marketing email. have postfix server set up, don't have reverse dns set (due hosting provider limitations). i'm afraid emails users not delivered. i've tested , mail go straight spam box gmail. instead of diy approach, there emailing providers out there can guarantee high deliverability of emails? i'd rather not have deal myself can concentrate on building app. looked mailchimp seem service bulk mailing , not individualized emails (in case of user sign validation, friend invitation, , reset password). or getting wrong? mailchimp have service transactional mail built on top of amazon ses, can check out here . you can check out postageapp , product manager. specialize in transactional emails , make real easy design, send, , manage of emails. happy answer questions may have!

objective c - looking for Iphone tutorial app to search for venues around my location -

i new objective-c , iphone developing. wondering, if can direct me tutorial on how make simple app search venue burger king , display venues close location. non commercial app, me understand how things work , feet wet on category. have done simple mapkit app put pin on map that's it. thank on matter. this more or less example app want understand how code. http://itunes.apple.com/qa/app/fastfood-de/id436336483?mt=8 thanks solution: on same boat, took me while find something. came across tutorial in nutshell shows looking for. s forward geocoder. http://www.totagogo.com/2011/02/08/google-local-search-ios-code/ hope else helped me. look here: how use google api in iphone query hotels around place you can use response places.

blackberry - How to send a checkbox field that is checked as a parameter to pushScreen -

i wrote simple program push screen whenever field in checkbox in checked. code: public myscreen() { // set displayed title of screen settitle("sfts"); labelfield datelabel = new labelfield("today's route paln",field.field_hcenter); add(datelabel); _datefield = new datefield("date/time: ", system.currenttimemillis(), datefield.date_time); add(_datefield); add(new separatorfield()); for(i=0;i<name.length;i++) { s[i]=new checkboxfield(name[i]+","+addr[i]+","+time[i],false); add(s[i]); s[i].setchangelistener(f); } } fieldchangelistener f=new fieldchangelistener() { public void fieldchanged(field field, int context) { uiapplication.getuiapplication().pushscreen(new secondscreen(field)); } }; there no error while compiling whenever check field in checkbox, getting illegalstateexcpetion in emulator. please...

Upgrade Rails App From 1.2.3 to 3.1.0? -

i'm working on rails 1.2.3 version. want upgrade rails version ruy version 1.8.6 1.9.7. is major pain work such older version in running condition. want advance features of rails not supporting older version . please suggest me way upgrade version , ruby version. thanks.... that quite leap. best bet create new rails 3.1 app , manually migrate code over. gem install rails #=> install latest stable release rubygems gem install bundler rails new myapp the first thing you'll need open gemfile , add in gems you're using in current application, , idea find gem versions of plugins you're using (in vendor/plugins ). make sure have proper gem installed type of database you're using ( mysql2 , sqlite3 , or pg ). after you've added gems need, run bundle install bundle gems application. as far views, models, , controllers, stuff should okay copy on new application. need tweak few things, part stuff should work. you'll need open config/a...

java - accessing static field of class from jsp -

in web app, servlet printing html below protected void doget( httpservletrequest request, httpservletresponse response ) throws servletexception, ioexception { response.setcontenttype( "text/html" ); printwriter pw = response.getwriter(); pw.println( "<html><head></head><body>" ); printbody( pw ); pw.println( "</body></html>" ); } where printbody is private void printbody( printwriter pw ) { pw.println( "<form id='pool' method='post'>" ); pw.println( "<table>" ); pw.println( "<tr><th>home team</th><th>away team</th><th>tiebreaker?</th></tr>" ); bettingpoolgame[] games = bettingpool.getgames(); (int = 0; < games.length; i++) { pw.println( "<tr><td><input name='home" ...

android - Asynchronously processing the attached files in an email (Spring Mail Integration) -

if have spring app mail server inbound channel, best way process every file in every email (i poll approx. every 1 min, , fetch 1 email multiple attachments). although can apply multithreading @ receiving channel (simpleasynctaskexecutor or threadpooltaskexecutor) doesn't because if have 10 files attached in email, processing pretty bound 1 thread. i've been keeping pretty synchronous until now, because wanted aggregate data every email, , send response after files have been processed. believe done in better way. in general how can asynchronously process every file in every email, , again asynchronously build email reply? looks asking java.util.concurrent.future . java core concept block until (method) result calculated. (see javadoc example) the spring @async support future concept too. so think need having method uses @async takes 1 attachment of mail argument , returns ever calculated in future. need invoke methods attachments (asynchronous) , stor...

In my logout functionality is an error in Logcat in twitter android app -

my twitter android app clent base means window base,i using twitter 4j otweet.com my application.i stored auth token through shared prefrence.i getting error in logcat..that is.. twitter4j.twitterexception: read error: failure in ssl library, protocol error. and code is: httpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost("http://api.otweet.com/1/account/end_session.format"); try { // execute http post request httpclient.execute(httppost); } catch (clientprotocolexception e) { // todo auto-generated catch block } catch (ioexception e) { // todo auto-generated catch block } } visit following link http://blog.doityourselfandroid.com/2011/02/13/guide-to-integrating-twitter-android-application/

python - libusb-1.x VS openUsb -

have few questions libusb vs openusb i'm author of project called berry4all allows tethering blackberries via usb. cuurrently i'm using libusb-0.x i'd /need migrate either libusb1.x or libopenusb ... i'm not sure pick some of things need: - linux support - mac osx support (need work , able package it) - python bindings opinions on either , why pick 1 on other. i go libusb-1 because seems architecturally simpler, more actively maintained, more portable , more mainstream openusb. webpage lists successful projects based on it, , small comparison openusb might find useful.

unix - How to fork interactive programs -

i have interactive program high start-up cost. after start-up, i'd fork process separate concurrent sessions. ideally each separate session become gnu screen window being able individually telnet/ssh each session fine too. it shouldn't hard write scratch seems should have been done/considered before , maybe there reasons why bad idea... i know alternative approach use shared memory data that's expensive initialize. reason i'm reluctant go down path shared data uses c++ data structures pointers, makes hard mmap unrelated process. this database - startup phenomenally expensive, db provides several different means of connecting - example oracle's beq protocol. telnet has issues, consider ssh. either way, consider daemon answers requests connect on port (you use af_unix sockets guess), creates separate session. stevens advanced programming in unix envrionment or rochkind's advanced unix programming have discussions , complete examples. sinc...

javascript - Checking if a Variable has been assigned an Element or a String -

i building small library involves object manipulation, , there input might assigned id of element (which use document.getelementbyid ), or document.getelementby ... , whatever goes here. does know how determine if string or html element typeof should work: typeof variable == "string"

ios - AQGridView cells disappear when scrolling horizontally and can't lock it -

i pulled aqgridview latest git repos based on recommendations here. it, unfortunately when scrolls horizontally cell's disappear. also, locks when scrolling vertically not horizontally. noticed open issue in git it, closed no resolution. has gotten work demo's? thanks, graeme. https://github.com/radhikas/aqgridview/tree/

How to apply CSS to buttons? -

i want apply css buttons not referencing buttons id in css stylesheet. how proceed? <button id="buttonedit">save</button> i try: input[type=button] { fonr-size: 80%; } but doesn't work. thank you. do have styles associated buttonedit id in css? i've copied in button "try yourself" area on w3schools, , added own style in header button { font-size: 80%; } as else has posted, , worked. did before test see button, added style & refreshed. button text got smaller. if there no styles associated buttonedit messing things up, i'd triple check didn't accidentally forget colon after font-size.

couchdb - how to filter view with "any" comparison? -

i have database in couchdb contain 4 documents... here sample , here the document source: {"_id": "...","gender": "f","hat": "blue"} {"_id": "...","gender": "f","hat": "red"} {"_id": "...","gender": "m","hat": "blue"} {"_id": "...","gender": "m","hat": "red"} here view: function(doc) { emit([doc.gender,doc.hat], doc); } but want fetch data following case : select gender 'f' , kind of hat (done | sample ) select kind of gender , have "red' hat (stack) how make second point works?? how filter view "any" comparison ?? for second point, need view this; function(doc) { emit(doc.hat, null); } query ?key="red". note: emit null save space in index. query ?include_docs=true d...

javascript syntax explanation -

Image
possible duplicate: what mean? (function (x,y)){…}){a,b); in javascript please explain , give example javascript below, can't find document explain this: (function([arg, arg ...]) { //javascript code here })([str, str ...]); i'm asking question because see in google facebook javascript code, of them using syntax. javascript share | improve question edited may 23 @ 10:34 community ♦ 1 1 asked oct 14 '11 @ 8:05 alwayz change 95 1 2 12 marked duplicate felix kling , richard everett , matt ♦ , gordon , chrisf ♦ nov 14 '11 @ 17:16 ...