Posts

Showing posts from 2012

asp.net - Populate jQuery modal dialog form -

i have application contains gridview. when user selects 1 of items gridview, want able show jquery dialog box contains form pre-filled information selected item gridview. right have div html text boxes set modal dialog box. user clicks on it, , selected item's id retrieve. problem comes when want go out database, of details, pre-fill in of textboxes , other elements before displaying dialog box user. an easy comparison having user click on item can submit form processed of items selection filled in. wondering easiest way go is. right have selecting item gridview uses jquery ajax post id [webmethod] in code behind can go off database , details of record. problem obvious reasons webmethod can't magically fill in fields of form. send of information ajax query fill in, feels pretty messy because there no real strong connection random data send , field belong to. a lot of pondering out loud, interested in better understanding how use jquery , ajax within asp.net. thank , i

scheme - Saving program image in guile -

i've heard lisps support saving image of running program file. guile support this? i think interoperating other languages pretty integral guile is, , there lot of state in interpreter image opaque guile itself. know guile best working scheme interpreter built geda, can imagine having save not conses, x windows gschem might have open? isn't feasible reliably within guile. (and i'm not sure idea implement save-image-to-file in "limited" cases.) that said, can save program state, since program boundaries porous, file descriptors , memory maps leaking out of every pore, realize have save entire computer's state. done though, in form of "hibernate" power-saving mode! realize, too, that isn't want here.

iphone - classes, objects and memory consumption -

suppose have application draw 20 little uiimageviews on screen. suppose 20 playing cards faced down. so, have same image 20 times on screen. suppose have 2 cases: case 1 i have method not on class loads card texture, applies uiimageview , positions on screen. method run 20 times, cards put on screen image views. case 2 i have class once initialized load card background image, apply uiimageview , deliver object. suppose want animate 20 cards, using simple uiimageview translation. looking point of view of memory consumption, cpu load , run time execution of 2 cases mentioned lighter application , consume less memory? thanks. almost doesn't matter. real constraint views , gpu memory, same because you're still creating same 20 uiimageviews. setup cost minuscule in either case in of categories mention. , 20 images no problem either. make sure images sized reasonably. , load them uiimage's +imagenamed: method take advantage of caching in frameworks.

jQuery toggle menu hide/show (close other menus when new menu opens) -

thanks nick craver i've got nice toggle menu going, i've come problem if users keep clicking new menus page keep growing dont want, idea is: as 1 menu opens, open menus close. the full source @ http://the-dot.co.uk/new/ here 2 snippets of code i'm using. <script type="text/javascript"> $(document).ready(function() { $("ul li a").click(function() { $(this).parent().next().toggle("fast"); }); }); </script> and html structure is <ul class="navigation"> <li><a name="us" title="us">us</a></li> <li id="us">about thedot</li> <li><a name="portfolio" title="portfolio">portfolio</a></li> <li></li> <li><a name="contact" title="contact">contact</a></li> <li id="contact">contact deets </li> <l

sharepoint - HTML Calculated Column Formula Help! -

i'm trying use html calculated column can display rag status bar tasks in sharepoint. had working until added if containing % complete. can tell me i'm going wrong please? understand there < missing in front of div style in first , last lines - way display: <div style='width:100%;background-color:"&if(slippage>30,"red",if(and(slippage>=-7,slippage<=-29),"orange",if(and(slippage>=-7,slippage<=29),"orange",if(slippage<7,"green","green",if(% complete=100,"blue","blue")))))&";'></div>" thanks - rob this late of use, should use square brackets around column names; when there's space in them. as troublesome % complete column has space in it, imagine changing [% complete] resolve issue. means sharepoint identify single column name rather 2 separate entities.

Calling a Protected Superclass Class Method in Ruby -

i want call protected superclass class method instance method in base class. class class << self protected def foo puts "in foo" end end end class b < def bar puts "in bar" # call a::foo end end what's best way this? override method in b, calling super: class class << self protected def foo puts "in foo" end end end class b < def self.foo super end def bar puts "in bar" # call a::foo self.class.foo end end >> b.foo => in foo >> b.new.bar => in bar => in foo

java - How to handle extended permissions dialog -

i used restfb check extended permissions of user. click allow permission dialog not pop again next time. clicking "don't allow" on permission dialogue box bring every time when page accessed. don't want. want when clicking "don't allow" stop dialog forever. please suggest me way here code: java source: public boolean getcheckextperm() throws facebookjsonmappingexception, facebookexception { integer emailperm = getfbclient().execute("users.hasapppermission", getfbsigsessionkey(), integer.class,parameter.with("ext_perm", "email")); return emailperm == null ? false : emailperm.equals(new integer(1)); } view source: <script type="text/javascript"> var checkextperm = <s:property value="checkextperm" />; if (checkextperm == false) { facebook.showpermissiondialog('email', function (perms) { //if (perms == "email"

iphone - Xcode warning: application executable contains unsupported architecture(s):arm, arm (-19031) -

i've been receiving warning since loaded project in last xcode 4 preview. there no warning before can't rid of in xcode 3.2. i've been googling nobody seems have same error. my project , target settings correct (imho): architectures: standard (armv6 armv7), base sdk: latest ios (currently set ios 4.2), build active architecture only: false, valid architectures: armv6 armv7. i compared every project setting other projects , and found no differences. have recreated project starting scratch , copying classes, resources , frameworks same result. i must warning not shown when set debug configuration. i hope can me because don't know do. in advice. i kept getting error , driving me crazy. realized building project simulator instead of device. once made change, able upload app without problem.

localization - how to use i18n for one language cakephp -

i need launch web app in spanish moment , need translate app... i modified default.po , added configure::write('config.language', 'es') core.php... what now? don't want add routing rigth now. suggestions? pd: did in manual , @#$%^&%$@@ cant work i18n tricky 1 head around. if you're producing website in spanish, there no need use it, use po messages matter of course, just in case . there component lot: http://bakery.cakephp.org/articles/p0windah/2007/09/12/p28n-the-top-to-bottom-persistent-internationalization-tutorial there used script allow translation of slugs seo direct right language. last time looked, had vanished, i'll try piece you. for moment, used in router.php //route switch locale router::connect('/lang/*', array('controller' => 'p28n', 'action' => 'change')); //forgiving routes allow users change lang of page router::connect('/eng?/*', array( 'controller

fbml - facebook connect publish stream on tab application -

i need kind how create publish stream dialog inside application tab. i have code snippet on tab application: (tab.asp) <div id="contentfooter"> <ul> <li><fb:share-button class="url" href="<%=getconfig("appurl")%>" /></li> </ul> </div> that code snippet above work, want thing (in javascript): function fb_publish() { fb.ui({ method: 'stream.publish', message: 'blah...', attachment: { name: 'name....', caption: 'join win!', description: ('test'), href: '<%=getconfig("appurl")%>' },action_links: [{ text: 'play now!', href: '<%=getconfig("appurl")%>' }], user_prompt_message: 'what’s on mind?' },function(response) {

CakePHP and jqGrid -

i using cakephp , jqgrid, having difficult time making them talk nice. can go through trouble of building json response (i know, "it's not difficult" ;)) prefer return flattened version of result find("all"...). here current code (selecting fields want). there quick , easy way format nicely jqgrid? $result = $this->contact->find('all', array( 'fields' => array('first_name', 'last_name', 'company', 'title'), 'conditions' => array('or' => $filters), 'offset' => $skip, 'limit' => $rows )); thanks in advance! edit i able turn results of array jquery wanted it, i'm getting blank table (table renders cells empty). here updated code, ideas? $result = $this->contact->find('all', $options); $data = array(); ($i = 0; $i < count($result); $i++) { $da

oracle - How to compile Pro*C file in Visual Studio 2010 -

i installed visual studio 2010 recently, , migrated project visual studio 2005 2010. after migration, can't compile pro*c files in project. use oracle 10g precomplier. error message: syntax error @ line 48, column 9, file c:\visualstudio10\vc\include\vadefs.h: typedef _w64 unsigned int uintptr_t; pcc-s-02201, encoutered symbol "__w64" when expecting 1 of following: auto, char, const, double, enum .......... typedef name my project complied in vs 2005 correctly. what's matter on vs 2010? i don't know pro*c in detail, should read page ms doku: http://msdn.microsoft.com/en-us/library/s04b5w00.aspx since symbol __w64 32->64 portability warnings, may sufficient define symbol empty. place #define __w64 in central place or add empty symbol definition __w64 project's compiler options.

java - Writing on SDCard Problem - Android -

i'm trying write file sdcard in htc hero phone. create file in sdcard using: file = new file(path.getabsolutepath(), "filename.txt"); where path path externalstoragedirectory (i.e. \sdcard) when log path of file, \sdcard\filename.txt however, when create fileoutputstream write file, filepath changed \data\data , cannot access it. can please clarify how can create file in sdcard , write it? thanks! edit: path = environment.getexternalstoragedirectory(); log.d("sdcardplswork", path.tostring()); try { myfile = new file(path.getabsolutepath(), "sensorvalues.txt"); boolean = myfile.createnewfile(); log.d("sdcardplswork", myfile.tostring() + " " + i); fos = new fileoutputstream(myfile); log.d("fileandroid", getfilestreampath("sensorvalues.txt").tostring()); } catch(filenotfoundexception e) { e.printstacktrace(); } this i'

actionscript 3 - Enter Key Going To The Next Frame in Flash CS3 and Action Script 3 -

Image
in flash cs3 have 3 frames , when press enter frame 1 goes next frame. want stop in project. when user press enter key in frame 1 should not go frame 2. how in action script 3.0 using flash cs3? is in published swf or in flash ide? hitting enter key in flash plays timeline. this happens when hit enter while looking @ swf in flash. try opening in file system. if not should keyboardevents: stage.addeventlistener(keyboardevent.key_up, onkeyuphandler); private function onkeyuphandler(event : keyboardevent) : void { switch(event.keycode) { case keyboard.enter: nextframe(); break; } }

WPF Data binding: CollectionViewSource and ObjectDataProvider issue -

i have mainwindow.xaml file: <window.resources> <collectionviewsource x:key="cvs" source="{binding source={staticresource resourcekey=detailscollection}}" /> <collectionviewsource x:key="detailscopes"> <collectionviewsource.source> <objectdataprovider methodname="getvalues" objecttype="{x:type system:enum}"> <objectdataprovider.methodparameters> <x:type typename="entities:detailscope" /> </objectdataprovider.methodparameters> </objectdataprovider> </collectionviewsource.source> </collectionviewsource> <datatemplate x:key="accountdetail" datatype="{x:type entities:accountdetail}"> <dockpanel> <combobox dockpanel.dock="left" itemssource="{binding source={staticresource resourcekey=detailscopes}}&quo

How to make this naive python implement of Quicksort more pythonic? -

i'm 2 hours reading of diveintopython , implemented naive version of quicksort. import operator def even(num): return operator.mod(num,2) == 0 def last(list): return len(list)-1 def median(list): if even(len(list)): return len(list)/2 - 1 else: return len(list)/2 def sort(list, pivot_selector): if len(list) <= 1: return list else: = pivot_selector(list) pivot = list[i] less, greater, equal = [], [], [] x in list: if x < pivot: less.append( x ) elif x == pivot: equal.append( x ) else: greater.append( x ) return sort(less, pivot_selector) + equal + sort(greater, pivot_selector) if __name__ == "__main__": print sort([5,4,3,2],median) print sort([],median) print sort([2],median) print sort([3,2],median) print sort([3,2,3],median) print sort([1,3,2],median) print so

debugging - How to use Condition in Delphi Breakpoint properties -

i found nested loop fails when particular condition reached, somehow when = 1, j = 3 , k = 5 i tried right click on breakpoint , in condition set (i = 1) , (j = 3) , (k = 5) anyway breakpoint doesn't stop... what wrong? i've tried in d2007 , works fine. version using? procedure tform85.formclick(sender: tobject); var i,j,k : integer; z:integer; begin := 0 10 j := 0 10 k := 0 10 begin z := z + * j * k; // breakpoint on line. end; showmessage(inttostr(z)); end; have considered breakpoint may not reached because condition not being met?

c++ - How to collect the same type of Map's value -

we have 1 map key , value both int type. have search particular value in map , collect key in 1 vector. code snapshot like map<int,int>m; map<int,int>::iterator itr; vector<int> v; m.insert(make_pair<int,int>(1,2)); m.insert(make_pair<int,int>(2,2)); m.insert(make_pair<int,int>(3,2)); m.insert(make_pair<int,int>(4,4)); m.insert(make_pair<int,int>(5,5)); and current code like: for ( itr = m.begin(); itr != m.end(); ++itr ) { if ((*itr).second == 2 ) v.push_back((*itr).first ) } we optimize it. how can stl algorithm. it seems me going wrong way, want multimap. std::multimap<int,int> m; std::vector<int> v; m.insert(std::make_pair<int,int>(2,1)); m.insert(std::make_pair<int,int>(2,2)); m.insert(std::make_pair<int,int>(2,3)); m.insert(std::make_pair<int,int>(4,4)); m.insert(std::make_pair<int,int>(5,5)); typedef std::multimap<int,int>::iterator iterator; std::pair&

.net 3.5 - Installing Multiple Versions Of A Windows Service On The Same PC -

i have .net 3.5 windows service comes in several different configurations/flavours ie. release, test, debug etc. i've created installer package service built part of msbuild script, need able build installers in way allow each flavour of service installed on same machine. know best way this? thanks perhaps this article of help? the problem when reviewing serviceinstaller class using reflector, you'll see win32 call createservice in serviceinstaller.install method. createservice return error_duplicate_service_name return code whenever method called servicename or displayname parameter matches of installed service. causes win32exception thrown in above window , causes second install fail. can view complete documentation on createservice function here . to around this, needs done dynamically set service name during installation , service startup known value , make sure value different each instance

javascript - How to cancel change event for accordion controls -

$("#accordion").accordion({ change: function (event, ui) { alert('event have changed') }, changestart: function (event, ui) { return false; } }); is possible cancel change event? i not sure change other events in jqueryui returning false cancels event.

menu - joomla article list with descriptions -

Image
on joomla frontpage want have kind of menu every item has title , description , links article . list must available modification administrator. possible it? know how modify menu this, standart menu doesn't support descriptions. one option make so: make ordenery menus using joomla! menu manager then make modules every menu item , add menu link title , description make menu link title on module linked orginal menus made on first step unpublish menu module , publish these modules made same place menu module

.net - ASP.Net Web Services Response Time Slow -

we using asp.net web services. the architecture desktop based application developed in .net 3.5 - client app (client machine) asp.net based web service in .net 3.5 - business logic layer (iis on server) sql 2005 database - database layer (same or different server iis) the application developed , going in first implementation. on day 1 have faced show stopper issue. have loaded database of patient's 30000 records , response time of patient search screen more 20 seconds. have indexed database , removed unncessary calls a. client web service b. web service database. still response time 7 seconds not acceptable has got down under 3 seconds. main problem see 4 seconds being taken part in web service returns data of such size on network client. what solution this? if search queries return large result sets, consider adding paging functionality webservice calls. it seems unlikely user review 250 (or arbitrary number > 10) patients @ single glance. instead of meth

asp.net - Can i still store value in session if in browser cookie is disabled? -

can still store value in session if in browser cookie disabled? you can use cookieless sessions . in asp.net, necessary session-to-user link may optionally established without using cookies. interestingly enough, don't have change in asp.net application enable cookieless sessions, except following configuration setting. <sessionstate cookieless="true" />

android - Detect touch press vs long press vs movement? -

i'm fiddling around android programming, have small problem detecting different touch events, namely normal touch press (press on screen , release right away), long press (touch screen , hold finger on it) , movement (dragging on screen). what wanted have image (of circle) on screen can drag around. when press once (short/normal press) toast comes basic information it. when long press it, alertdialog list comes select different image (circle, rectangle or triangle). i made custom view own ontouchlistener detect events , draw image in ondraw. ontouchlistener.ontouch goes this: // has touch press started? private boolean touchstarted = false; // co-ordinates of image private int x, y; public boolean ontouch(view v, motionevent event) { int action = event.getaction(); if (action == motionevent.action_down) { touchstarted = true; } else if (action == motionevent.action_move) { // movement: cancel touch press touchstarted = false;

c++ - Testing stream.good() or !stream.eof() reads last line twice -

possible duplicate: why iostream::eof inside loop condition considered wrong? i have following piece of code: ifstream f("x.txt"); string line; while (f.good()) { getline(f, line); // use line here. } but reads last line twice. why happen , how fix it? something similar happens with: ifstream f("x.txt"); string line; while (!f.eof()) { getline(f, line); // use line here. } you very, want check bad, eof, , good. in particular eof (as !stream.eof() common mistake), stream being @ eof not mean last input operation failed; conversely, not being @ eof not mean last input successful. all of stream state functions – fail, bad, eof, , – tell current state of stream rather predicting success of future operation. check stream (which equivalent inverted fail check) after desired operation: if (getline(stream, line)) { use(line); } else { handle_error(); } if (stream >> foo >> bar) { use(foo, bar); } else { h

python - recursive file copying into subdirectory -

i need copy files , folders current folder subdirectory. best way so? tried following snippet fails fails if destination directory exists. def copy(d=os.path.curdir): dest = "t" in os.listdir(d): if os.path.isdir(i): shutil.copytree(i, dest) else: shutil.copy(i, dest) i have feeling same task can done in better , easier manner. how do it? i never on python, following solution came mind. doesn't simple, should work , can simplified (haven't checked, sorry, no access computer now): def copydirectorytree(directory, destination, preservesymlinks=true): entry in os.listdir(directory): entrypath = os.path.join(directory, entry) if os.path.isdir(entrypath): entrydest = os.path.join(destination, entry) if os.path.exists(entrydest): if not os.path.isdir(entrydest): raise ioerror("failed copy thee, destination `" + entrypath + "' directory exists , not

java - JAXB "(variable) is not a valid property" on a ResponseWrapper -

i have webservice: @webservice() public interface wmcservice { @webmethod(operationname="getgroupinfofromuserid") @responsewrapper(classname="wmc.web.service.basicgroupwrapper") @webresult(name="basicgroup") basicgroup getgroupinfofromuserid(@webparam(name = "id") long id); } @webservice(endpointinterface="wmc.web.service.wmcservice", servicename="wmcservice") public class wmcserviceimpl implements wmcservice { @override public basicgroup getgroupinfofromuserid(long id) { userhelper uh = new userhelper(); wmcuser user = uh.getbyid(id); if (user != null) { return user.getbasicgroup(); } else { return null; } } } and have responsewrapper: @xmlrootelement() @xmltype(name="group") @xmlaccessortype(xmlaccesstype.field) public class basicgroupwrapper { @xmlelement(name="groupname") private string grou

Lost at least one changeset in TFS - Now won't check in changes to file involved, what to do? -

we've lost @ least 1 changeset in tfs (we don't know yet if there's more, none). noticed changeset @ top of list gone. think there might 2 @ least because symptoms below exists @ least 1 other file we've discovered. additionally, can see hole in changeset numbering sequence, , don't believe changeset file described below one. the single file involved had 1 line changed, , version in tfs has file before change. doing latest or specific version gives me old file, before change. after doing "get specific version", in source explorer, in column shows workspace status, says "no" indicating file outdated. nothing i've tried far gives me file change checked in. if try view file source explorer, says file out of date , asks if want view server version or workspace version. selecting workspace version gives me file before change (probably because did specific version above), selecting server version gives me nothing, dialog goes away. if

php - Magento products not showing up consistently in frontend -

i have magento site running 20000 plus products. not show products in frontend. says "there no products matching selection", products still there in backend site. i know have run re-indexing process, , whenever complete re-indexing process products there in frontend. so now, question is: why happening again , again? fourth time faced problem. want know real causes of issue. afraid. thanks the 2 cuplrits caching , indexing problems (unless of course using clustered database, in case culprit). if it's feasible on site (or on dev environment, sure had foresight create), disable magento's caching temporarily , see if alleviates issue. try disabling flat_catalog settings see if having effect. also make sure browser cache set refresh server. hope helps! thanks, joe

java - Where to keep test-supplementary classes? -

i'm trying create directory structure in maven java project: pom.xml /src /main /java /com /xxx foo.java bar.java /test /java /com /xxx footest.java bartest.java /spikes <---- i'm not sure right english word them /com /xxx mockedhttpconnection.java thus, in 2 tests footest , bartest can use same mockedhttpconnection , decoupled them both, staying @ same time in same package them. think approach? have feeling i'm reinventing wheel, can't find patterns mechanism in java. if mockedhttpconnection own class i'd suggest store under /test/java/com/testutil . if third party class, add jar classpath .

sorting - Bash: sort numbers with exponents -

i trying sort 1 file numeric values this: 414e-05 435e-05 0.5361 0.7278 0.1341 0.9592 0.2664 with sort numers sorted except ones exponent, there way sort function evaluate expression? if version of sort command new enough, should support -g option (or --general-numeric-sort) if options long). described in info manual: sort numerically, using standard c function strtod convert prefix of each line double-precision floating point number. allows floating point numbers specified in scientific notation, '1.0e-34' , '10e100'.

c++ - How to remove the "default button" border? -

when have gtkbutton in gtk , default window (will activated when press enter), tiny border draw around inform user button default button. how remove border ? i tried: default-border , default-outside-border style properties. after hours finding this, i've discovered it: gtk_button_set_relief(gtk_button(button_widget), gtk_relief_half); gtk should have gallery showing how changes button behavior.

c - Checking enum values at compile time -

i'd check static initalizers @ compile time. i'm implementing macro cassert() this question . now, have "strange" situation typedef enum { eqadc_chan_a_00 = 0, eqadc_chan_a_01, eqadc_chan_a_02, eqadc_chan_a_03, eqadc_chan_a_04, ... // others eqadc_chan_max // eqadc_chan_max = 62 } eqadc_tinputbiosid; and have structure initialized this: const t_eqadc_pin_config eqadc_xpinconfig[eqadc_chan_max] = { { 123 }, /* eqadc_chan_a_00 */ { 321 }, /* eqadc_chan_a_01 */ ... /* others */ }; what strange (to me...) following statement cassert(( sizeof(eqadc_xpinconfig)/sizeof(eqadc_xpinconfig[0]) ) != 62 ); works fine, , "passes" (i.e. compiles without errors). instead, this: cassert(( sizeof(eqadc_xpinconfig)/sizeof(eqadc_xpinconfig[0]) ) != eqadc_chan_max ); does not (i.e. generates assertion, , stops compiler. trying figure out why happens, think problem related value of eqadc

How to force a LocalJumpError on return in Ruby? -

my function bar gets block, , i'd run block without allowing return . how do modifying bar below, , keeping else, including foo , intact? def bar() yield end def foo() bar p "it" return # works. i'd localjumperror. end end foo well, localjumperror when try , pass block return proc (as opposed lambda ). you can away not changing foo except how it's called, if like def bar() proc.new end def foo() bar p "it" return end end foo[] that gives localjumperror . anyway, this article might help. edit: return in proc return outer method, not anonymous method in block. might able set flag can check in bar see if returned prematurely: bar_finished = false def bar(&block) proc = proc.new &block l.call bar_finished = true end then, if return in block passed bar , bar_finished still false. not sure if adding non-local variable option, if so, track returns block , throw whatever except

android - Processing large Spanned objects with TextView (setText) -

well, give bit of history on project - i'm parsing string that's 100k in child thread, , returning spanned object html.fromhtml(). the issue when returns main thread - when trying settext using spanned created in thread, takes quite long time processing spanned object displayable format (settext). i process in child thread, unfortunately, since related ui, can't - has on main thread. so, question whether there way process spanned interpreted settext, doesn't spend lot of time on main thread processing after child thread has finished. testquestionsexplanations.settext(spannedexplanationsobj); my biggest issue locks main thread down doing this. i found work around problem. instead of sending whole spanned object , getting processed onto textview @ once, i'm sending smaller pieces, , appending them textview. this way progressdialog doesn't lock - it's jerky, it's better not moving @ all.

InsertSymbol in Word using C# -

i'm creating custom microsoft word mailmerge console application using c#. problem trying use insertsymbol command (from microsoft.office.interop.word). purpose drop in checked box symbol if field value true, , empty box if field value false. microsoft has definition of command here no concrete examples. the way have command set this: object ofont = "wingdings"; object ounicode = "true"; object obias = word.wdfontbias.wdfontbiasdontcare; oword.selection.insertsymbol(254, ref ofont, ref ounicode,ref obias); when try run command, error "this not valid number." there not lot of examples of command online , hoping ideas. thanks. thank robert sharing solution: object ofont = "wingdings"; object ounicode = true; object obias = word.wdfontbias.wdfontbiasdontcare; oword.selection.insertsymbol(254, ref ofont, ref ounicode,ref obias); it works well!

Selenium does not close browser window with log -

when run test in selenium 2, end selenium.close(); selenium.stop(); . in previous version closed both windows tested application , window test log . in selenium 2 second window stays opened - can close ? selenium 2.0a6 . there bug made .close() method fails. try .quit() instead.

javascript - How to read this JSON with jquery -

how read json jquery? lets want data "quote" object. many thanks! cbfunc({ "query": { "count": "4", "created": "2010-12-01t15:21:42z", "lang": "en-us", "diagnostics": { "publiclycallable": "true", "url": [{ "execution-time": "3", "proxy": "default", "content": "http://datatables.org/alltables.env" }, { "execution-time": "1", "proxy": "default", "content": "http://www.datatables.org/yahoo/finance/yahoo.finance.quotes.xml" }, { "execution-time": "12", "proxy": "default",

c++ - inheritance and namespaces -

i trying first useful object oriented program namespace usage. have base class b in namespace ns. if try inherit base class inheritance work, should use ns::b in class decleration below, case? or there more accepted sytle inheritance syntax? namespace ns { class d: public ns::b{ ... }; } best, umut if d in namespace ns , don't have qualify ns::b , since d , b in same namespace. can use class d : public b .

c# - Parsing XML Files in .NET -

i'm trying decide on best way load in configuration settings. basically, have application several people log into, , once they've logged in, want load of settings (for example: colors, font sizes, personal records, etc.) i thinking of using xml file because thought easy parse in .net, seems more difficult anticipated. <programsettings> <database file="c:\database.mdb" /> </programsettings> <usersettings> <user key="user1"> <layout color="red" fontsize="5" /> <data file="c:\test1.txt" /> </user> <user key="user2"> <layout color="blue" fontsize="2" /> <data file="c:\test2.txt" /> </user> </usersettings> note: reason of code not appearing, there major sections labeled "programsettings" , "usersettings." edit: whoever fixed me. anyway, "user ke

How to echo one html line in PHP? -

dear all, want echo line in php use "echo" doesn't work.any appreciated!! echo '<p><input type="button" name="back" value="back" onclick="window.location ='viewusers.php'" /></p>' it's because you're using " inside want echo. need escape quotes. this should it: echo '<p><input type="button" name="back" value="back" onclick="window.location =\'viewusers.php\'" /></p>'; another option in blocks. better if doing lot of echos that. such as: <?php if($output == "hello"): ?> <p><input type="button" name="back" value="back" onclick="window.location ='viewusers.php'" /></p> <php else: ?> <p>doesn't equal hello</p> <?php endif; ?> hope helps!

dom - Setting email id with capitalization -

i setting domain in firstsecond.com format. possible me set (on google apps) such both url , email appear 'f' , 's' in capitals. know capitalization doesn't matter other display, tougher note there 2 words without capitalization. i suspect might depend on client browsers , mail apps- wanted check same. thanks nope, can't guarantee how particular browser or email app displays domain. chrome, firefox, , ie (for example) convert lowercase. might consider registering first-second.com alias.

ios4 - How to convert a UTF8 string in a float value in objective-c -

i here problem: have nsstring contain "1.7" (for example) , have float number = 1.7 i' ve tried [mystring floatvalue] result 1.700000000004576 if try "1.74" result 1.74000000000000000067484 how can fix it? thank you! you correctly converting string float. problem floating point numbers cannot represent real numbers exactly. direct assignment: float x = 1.7; will still have precision error. that's how floating point numbers are. the workaround depends on needs. examples: if need more precision mathematical calculations, can use doubles. if you're trying generate output user, can format output limits number of digits shown after decimal point. if you're dealing money, convert floating point dollar amounts integer numbers of cents , perform calculations using integers, showing decimal point on output user.

xcode - How to choose Build Configuration in Build Action in the Scheme dialog? -

in xcode 4 preview 5 every time hit 'build', xcode build project debug configuration, how can build, example, release configuration? project dynamic library, scheme actions 'run', 'test', 'profile' , 'analyze' not make sense me. as of xcode 4 preview 5 'build' scheme action has changed. setting scheme scheme actions use particular build configurations allows me set scheme runs product debug configuration profiles release configuration. every scheme action has drop-down menu choose build configuration, except build action. did option go? xcode 4 under nda until final build released. should repost question in https://devforums.apple.com/ now

dom - jQuery: What is more efficient? Many ID specific selectors, or one "Contains Prefix Selector" -

i have snippet of javascript in project caches array of jquery objects (anchor tags) on dashboard: $.extend(cache, { dashboard : { buttons : [ $('#dash-new-lead'), $('#dash-jobs-calendar'), $('#dash-view-lead'), $('#dash-sales-reports'), $('#dash-search-leads'), $('#dash-new-job'), $('#dash-dispatch-jobs'), $('#dash-dispatch-reports'), $('#dash-manage-employees'), $('#dash-manage-trucks'), $('#dash-finalize-jobs'), $('#dash-payment-profiles'), $('#dash-employee-statements'), $('#dash-company-statements'), $('#dash-finance-reports'), $('#dash-admin-sources'), $('#dash-admin-statuses'), $('#dash-admin-companies'), $('#dash-admin-

cluster analysis - Using K-means clustering with predefined seeds in MATLAB -

i need , example showing how use k-means clustering in matlab using prespecified datapoints initial seeds. thanks idx = kmeans(x,k,'start',seeds) will run k-means predefined datapoints seeds (such k rows of x , can choose seeds long it's k -by-p array, p number of columns of x ) initial seeds. note if specify seeds , don't need specify k (pass [] instead). kmeans infer number of rows of seeds how many clusters want. by default, kmeans chooses k randomly picked rows of x seeds.

java - Appengine bulk downloader is not downloading list properties -

this related a previous question of mine , new information. i'm trying configure bulkdownloader download data java appengine app in such way list of owned objects transformed nested xml path inside each parent object. have been using export transform transform.child_node_from_list . however, list property never being downloaded , passed transform! this seems similar effect when looking @ entity in appengine datastore viewer - parent entity doesn't show list property @ all. have access through code. my question, then, this: how can access list property bulk downloader? if downloading --kind=parententity , think stopping downloading childentity ? (is there way specify "all kinds" or anything?) in python download config, model directly referenced in config file. need mock python model mimics jdo model , use reference? for reference, abbreviated versions of each of files follow: downloadconfig.yaml: transformers: - kind: parententity connector: s

Python shared libraries - Cheetah namemapper.so not found -

i'm using python cheetah template generation , can't use compiled _namemapper.so library installed. running on centos 5.4 python 2.4 installed, using cheetah 2.4.3. cannot life of me cheetah use _namemapper.so file built during install: filling conf/asterisk/sip.conf.ect -> conf/asterisk/sip.conf ... /usr/lib64/python2.4/site-packages/cheetah/compiler.py:1508: userwarning: don't have c version of namemapper installed! i'm disabling cheetah's usestackframes option painfully slow python version of namemapper. should copy of cheetah compiled c version of namemapper. however, have shared library sitting right next namemapper modules: $ ls -ltr /usr/lib64/python2.4/site-packages/cheetah/ | grep -i namemap -rw-r--r-- 1 root root 12376 jul 1 20:17 namemapper.py -rwxr-xr-x 1 root root 36982 dec 1 09:55 _namemapper.so -rw-r--r-- 1 root root 12541 dec 1 09:55 namemapper.pyc i've tried adding directory /etc/ld.so.conf.d/python-cheetah.conf , , _n

Sending additional information with JQuery remote form validation -

i'm trying remote validate field looking @ 2 different fields. issue is, in examples see on how remote validate sending additional data, they're using id of other field being processed. example on jquery validate api page remote() uses "#username" , sends in addition email field. my page odd, , has multiple forms same, , number of forms on page variable, can't have unique id each field. there way find out field or form being validated/making remote call? tried following, because thought $(this) have been text box being validated, or individual form being validated, doesn't appear case. number: { required: true, number: true, remote: { url: "confirm.php", data: { toy: function() { return $('select[name="toy"]:selected',this).val(); } }

asp.net - Easiest way to convert IGrouping to IHierarchicalDataSource -

i have list of business objects want display in menu. can use linq created nested groups match desired structure have manually iterate through each instantiate , populate menu items. i'm using devexpress aspxmenu supports ihierarchicaldatasource , ihierarchicalenumerable. what's easiest way me create convert grouped list (as igrouping) 1 of these interfaces? i had similar hierarchical list database display in tree control. ended doing using linq2xml create xelements necessary model hierarchy, , passing top element tree control.

c# - Using subreport inside an SSRS table/tablix cell -

in application have report 1 subreport contained inside table cell. within subreportprocessing event handler supply different set of data foreach instance of subreport. in vs 2008 worked okay. however, when switched on vs2010 , upgraded report file format, behavior changed. subreport instances in master table contain data supplied first table row. code looks this void localreport_subreportprocessing(object sender, subreportprocessingeventargs e) { // _index global variable reset 0 in databind procedure. trip currenttrip = _trips[_index]; e.datasources.add(new reportdatasource("datasourcename", currenttrip.items)); _index++; } is intended behavior? how can supply different datasets multiple instances of same subreport inside table? thanks in advance. vladislav after poking around , tinkering code, found workaround. solution create dummy parameter in subreport, need bind field in tablix dataset. field long both subreport parameter ,

c# - How to tell if the control or control interface is editable by the user? -

i'm looping through array of controls , need know controls end-user has ability (via javascript or directly) change value gets posted back. can find such list? so far have this: private function iseditablecontrol(byval control control) boolean return typeof control ieditabletextcontrol _ orelse typeof control icheckboxcontrol _ orelse gettype(listcontrol).isassignablefrom(control.gettype()) _ orelse gettype(hiddenfield).isassignablefrom(control.gettype()) end function i'm rather sure need know if control implements ipostbackdatahandler . public shared function iscontroleditable(byval ctrl control) boolean return typeof ctrl ipostbackdatahandler end function "if want server control design examine form data posted server client, must implement ipostbackdatahandler interface. contract interface defines allows server control determine whether state should altered result of post back, , raise appropriate events." these classes