Posts

Showing posts from July, 2010

Some problems with basic DotNetNuke localization methods -

i'm writing simple dnn module - using dnn 5.6.1 , working direct in vb.net source file within desktopmodules subfolder of dnn website. to localize error message within module, i'm trying use: dim basestring string = localization.getstring("coveringerrormessage", me.localresourcefile) however, returning "nothing". though me.localresourcefile seems point correct path - /desktopmodules/mymodule/app_localresources/mymodule - mymodule.ascx.resx resides, , though "coveringerrormessage" defined. i've checked can edit resx files admin language editor. beyond this, i've got problem addmodulemessage() not showing message - i'm wondering if there's obvious setup step i've missed. all ideas appreciated - 1 of frustrating things @ present. it'll coveringerrormessage.text rather coveringerrormessage . there's not . adds .test resource key.

mysql - clsql trouble in SBCL -

i'm trying clsql working (used use cl-mysql, looking @ alternatives). attempting play around @ point, , i'm getting stopped @ connect (connect '("localhost" "test" "user" "password") :database-type :mysql) gets me erred while invoking #<compile-op (:verbose nil) {bdff0b9}> on #<clsql-uffi-source-file "clsql-uffi" "uffi" "clsql_uffi"> [condition of type asdf:operation-error] backtrace: 0: ((sb-pcl::fast-method asdf:perform (asdf:compile-op clsql-uffi-system::clsql-uffi-source-file)) ..) 1: ((lambda (sb-pcl::.pv. sb-pcl::.next-method-call. sb-pcl::.arg0. sb-pcl::.arg1.)) ..) 2: ((lambda ())) 3: ((flet sb-thread::with-recursive-lock-thunk)) 4: ((flet #:without-interrupts-body-[call-with-recursive-lock]324)) 5: (sb-thread::call-with-recursive-lock ..) 6: ((flet sb-c::with-it)) 7: ((sb-pcl::fast-method asdf:operate (t t)) #<unavailable argument> #<unavailable ...

Perl: precedence (Leftward list operator) -

from programming perl pg 90, says: @ary = (1, 3, sort 4, 2); print @ary; the commas on right of sort evaluated before sort commas on left evaluated after. ... list operators tend gobble .. , act simple term" does assignment result in sort being processed or happen when @ary expanded print? what mean "comma" stuff?? understanding in assignment statement, comma has lower priority list operator therefore sort runs first , gobbles it's arguments (4 , 2) .. how heck comma being evaluated @ all?? statemnent becomes (1, 3, 2, 4) list assigned.. comma acting list separator , not operator!! in fact on pg:108 says: not confuse scalar context use of comma list context use.. what leftward , rightward list operator? print @ary rightward list operator?? has low priority? print($foo, exit); here, how precedence evaluated? print list operator looks function should run first! has 2 arguments $foo , exit .. why exit not treated string??? after priority-w...

mysql - sql join with where clause -

i using mysql have 2 tables join , tables larger know better way query them. tables used website storing pictures various users. kind of facebook. first table images table has id , source location field. , other table called user_images foreign key image id going image table. reason tables not put because multiple users can have same picture , doing things way away redundancy. here query source locations of images particular user select i.source_location user_images u inner join images on i.image_id = u.image_id u.user_id = 'user' so question is, better query faster results shown below or not matter. select i.source_location (select image_id user_images user_id = 'user') u inner join images on i.image_id = u.image_id basically think doing clause before join make faster results because db have shorter set compare because join table alot smaller. dont know if right way of going through this. what best way go this? if else has better ways of doi...

visual c++ - Unforgiving GCC C++ compiler -

ms vs x86 compiler has no problem following definitions, gcc (arm) complains. gcc dumb or msvs_x86 clever? bool checkpointinside(const ciwvec2& globalpoint) { return checkpointin(globalpoint, ciwvec2()); }; /// error: no matching function call 'fair::sprite::checkpointin(const ciwvec2&, ciwvec2)' bool checkpointin(const ciwvec2& globalpoint, ciwvec2& localpoint) { return false; }; according c++ standard, cannot bind rvalue non-const reference. microsoft compiler has evil extension allows this, however. g++ correct not accept program.

c# - How do Linq Expressions determine equality? -

i considering using linq expression key in dictionary. however, concerned strange results, because don't know how equality determined linq expressions. does class derived expression compare value equality or reference equality? or in other words, expression<func<object>> first = () => new object(); expression<func<object>> second = ()=>new object(); bool aretheyequal = first == second; your test compares expressions . expressions offer reference equality; test show "false". cheek semantic equality need lot of work, example - are: x => 123 and y => 123 equivalent? crude test can compare tostring(), exceptionally brittle.

iphone - Getting contact points on bodies in Cocos2d & Box2d -

i'm new cocos2d , box2d, have been following tutorials , hacking. however, have 1 problem cannot solve. i create 2 bodies , fixtures (in box2d world) , create "contact listener" object. object stores list of contacts along "contact point". when 2 bodies collide contact point reported (i think) in world co-ordinate system. my problem can't seem convert contact point usable co-ordinate on both of bodies. i want add crack graphic sprite (connected body) @ point of contact on both bodies/fixtures. has solved this? may storing "contact point" relative "world" wrong way go. check out this . take @ b2body::getlocalpoint(const b2vec2 &worldpoint)

javascript - function checkForm() doesn't work with Internet Explorer -

ok works on , every browser ive tried on, when try internet explorer, dont have checkform action there. @ awesome. here script. function mm_preloadimages() { //v3.0 var d = document; if (d.images) { if (!d.mm_p) d.mm_p = new array(); var i, j = d.mm_p.length, = mm_preloadimages.arguments; (i = 0; < a.length; i++) if (a[i].indexof("#") != 0) { d.mm_p[j] = new image; d.mm_p[j++].src = a[i]; } } } function checkform() { var errors = ""; if (isempty("name")) { errors += "- name missing\n"; } if (isempty("email")) { errors += "- email missing\n"; } if (isempty("phone")) { errors += "- phone missing\n"; } if (isempty("dateneed")) { errors += "- date needed missing\n"; } if (isempty("zipcode")) { error...

java - how to add simple code to an android application -

i have confusion regarding put regular java code in android application. i'm using eclipse sdk , default when create application makes .java file oncreate() method. put code, inside method? right in layout have imagebutton, once button clicked want open new webview page gets it's html code index.html file found in assets folder. have far... button button = (button)findviewbyid(r.id.imagebutton1); if(button.ispressed()) { webview webview = new webview(null); setcontentview(webview); try { inputstream fin = getassets().open("index.html"); byte[] buffer = new byte[fin.available()]; fin.read(buffer); fin.close(); webview.loaddata(new string(buffer), "text/html", "utf-8"); } catch (ioexception e) { e.printstacktrace(); } } i have block of code @ end of oncreate() method right under line: setcont...

visual studio 2010 - How I can format date in report to appear exactly as I want - RDLC -

i have report in application , report show long date db , used expression make shorter: =formatdatetime(fields!statementdate.value,dateformat.shortdate) and date show : 1/1/2010 i need make : 2010/1/1 how can it? that expression trick =cdate(fields!fecha.value).tostring("yyyy/m/d")

objective c - What causes this EXC_CRASH in my iPad app? -

i got symbolicated stack trace crash report ipad app (excerpt): exception type: exc_crash (sigabrt) exception codes: 0x00000000, 0x00000000 crashed thread: 0 0 imageio 0x34528eb4 _cgimagepluginidentifypng + 0 1 imageio 0x34528d90 _cgimagesourcebindtoplugin + 368 2 imageio 0x34528bda cgimagesourcegetcount + 26 3 uikit 0x341b8f66 _uiimagerefatpath + 366 4 uikit 0x342650ce -[uiimage initwithcontentsoffile:] + 50 5 uikit 0x342b0314 +[uiimage imagewithcontentsoffile:] + 28 6 designscene 0x00013a2a -[ltimagecache fetchimageforurl:] (ltimagecache.m:37) … here contents of -[ltimagecache fetchimageforurl:] : - (uiimage *)fetchimageforurl:(nsstring *)theurl { nsstring *key = theurl.md5hash; return [uiimage imagewithcontentsoffile:[self filenameforkey:key]]; } and contents of -[ltimagecache filenameforkey:] : - (nsstring *) filenameforkey:(nsstring *) key { return [_cachedir stringbyappendingpathc...

Migrating a windows service from .NET 3.5 to .NET 4.0 -

i have set of windows services installed using installutil utility .net 3.5 version. if migrated projects 4.0, need uninstall them , reinstall them using utility v4.0 directory them work? or enough change target version project properties, re-compile them, , copy them installed location? note : i'm using features .net 4.0 dynamic types the assembly identification still same, should not need uninstall , reinstall service working. obviously need ensure .net 4.0 runtime on server, should it. service need "stopped" when go update exe.

python - Convert bmp image into DICOM -

i have 800 images in bmp format , convert them dicom. have started this, not working reason. my experience vtk limited: file_in = 'c:/programfile/image.bmp' file_out = 'test1.dcm' vtkgdcmimagereader() here in python: r = vtkbmpreader() r.setfilename( 'test1.bmp' ) w = vtkgdcmimagewriter() w.setinput( r.getoutput() ) w.setfilename( 'test1.dcm' ) w.write() if input bmp uses lookup table, can pass it: r = vtkbmpreader() r.setfilename( 'test1.bmp' ) r.allow8bitbmpon() r.update() r.getoutput().getpointdata().getscalars().setlookuptable( r.getlookuptable() ) w = vtkgdcmimagewriter() w.setinput( r.getoutput() ) w.setfilename( 'test1.dcm' ) w.setimageformat( vtk_lookup_table ); w.write() and opposite (dicom -> bmp): r = vtkgdcmimagereader() r.setfilename( 'test1.dcm' ) w = vtkbmpwriter() w.setinput( r.getoutput() ) w.setfilename( 'test1.bmp' ) w.write() of course can command line, use gdcm2vtk : ...

java - I asked a question about arrays before, but this one won't compile -

i asked array little while ago, , can't see problem is. tired. have done wrong? basically, taking string array , trying check see if contains numbers or x (isbn number validation). want take number given input (booknum), check input, , feed valid input new array (book). @ line 'booknum.charat[j]==book[i]' i 'not statement error'. gives? string[] book = new string [isbn_num]; booknum.replaceall("-",""); if (booknum.length()!=isbn_num) throw new isbnexception ("isbn "+ booknum + " must 10 characters"); (int i=0;i<booknum.length();i++) { if (character.isdigit(booknum.charat(i))) booknum.charat[j]==book[i]; j++; if (book[9].isnotdigit()|| book[9]!="x" || book[9]!="x") throw new isbnexception ("isbn " + booknum + " must contain digits" + "or 'x' in last posit...

c++ - Qt - custom decimal point and thousand separator -

how can convert number (double) string, custom decimal point , thousand separator chars? i've seen qlocale, don't want choose localization country, rather specify own decimal point , thousand separator chars. thanks qt doesn't support custom locale. deal group , decimal point characters trivial: const qlocale & clocale = qlocale::c(); qstring ss = clocale.tostring(yourdoublenumber, 'f'); ss.replace(clocale.groupseparator(), yourgroupchar); ss.replace(clocale.decimalpoint(), yourdecimalpointchar); btw, spbots' question not irrelevant. more detail goal helps , lead different approach may serve better.

Facebook like button group connection issue -

recently got idea link forum facebook more traffic, when changed href url group (http://www.facebook.com/?sk=group_166066160111619) kept giving me errors... there way link facebook group site allow likes? have tried approach, linking group url facebook developer page, , got same error explained above. if open facebook group, see there no button link there, instead has "join group" link. therefore guess not possible have button pointing group. however, can have button pointing facebook page (not group), facebook page has button in profile page. following page http://bugs.developers.facebook.net/show_bug.cgi?id=10674 discuss similar issues. facebook provide solution soon. hope helps !

objective c - download .zip or .doc file on iphone -

i want download .zip or .pdf or .doc file on iphone server via webservice request , webservice deploy on iis. i dont know this piece code downloads pdf , saves temporary location nsdata *pdfdata = [nsdata datawithcontentsofurl:pdfurl]; nsstring *filename = [[pdfurl path] lastpathcomponent]; nsstring *filepath = [nstemporarydirectory() stringbyappendingpathcomponent:filename]; nsurl *fileurl = [nsurl fileurlwithpath:filepath]; nserror *writeerror = nil; [pdfdata writetourl: fileurl options:0 error:&writeerror]; if( writeerror) { nslog(@" error in writing file %@' : \n %@ ", filepath , writeerror ); return; } nslog(@"%@",fileurl);

regex - What would cause RegexKit to spawn a "Requested configuration not supported" error? -

i have framework installed per instructions on website , regexkit.h imported appcontroller header file. i'm using simple method defined in appcontroller.m make sure working. - (ibaction)test:(id)sender { nsstring *str = @"torpedos: 0 1 1 0 1 lasers: 150 150"; nsstring *rgx = @"torpedos: (([0-1x]) ){3,8}"; nsstring *torpstr = null; [str getcaptureswithregexandreferences:rgx, @"$0", &torpstr, nil]; nslog(@"%@", torpstr); } i error in console when click test button: -[nsmaptable initwithkeypointerfunctions:valuepointerfunctions:capacity:] requested configuration not supported. i've spent half day searching net , looking through apple dev docs, , i've found notation in apple docs indicating entries must explicitly removed if aren't using garbage collection (which am). and... when configuring map tables, note options listed in “nsmaptableoptions” guarantee rest of api work correctly—i...

How to set the id on detached Hibernate proxy without LazyInitializationException? -

i'm using object, has on 15 related entities (parents). in ui side need ids of these entities, don't need hibernate's fetch functionality , use lazy proxy concept avoid hit database on 1 hand , have objects populated ids on other. to achieve have use property acces instead of field access parent entities: @id @access(accesstype.property) // helps avoid database hit on get, not on set!!! private long id; so far good, load object database (no joins made) , show on web ui relations (simple select inputs @ most). don't create clones (value objects) ui, use detached hibernate objects directly. when changes ui (change parent object) framework calls setid() related proxy entities , .... results in initialization of these proxies! here code hibernate basiclazyinitializer this: else if ( method.equals(setidentifiermethod) ) { initialize(); // here db hit occurs!! setidentifier( (serializable) args[0] ); return invoke_implementation; ...

html - What are the differences between these web units? -

possible duplicate: what difference px,em , ex? what differences between these web units? pros , cons, , appropriate time use each of them? px, ex, em, pt, % px stands pixels. says on tin: each dot on screen pixel. ex refers x-height of given font, i.e. height of lowercase letter x font. em refers maximum height required font. commonly-used relative font size because calculated based on computed font size of element (or parent if inherited). pt stands typographic point, 1/72 of inch. % percentage relative given property otherwise inherited element's parent. note em , % work same way. ems decimal representation of percentages, i.e. 1 = 100%, 0.01 = 1%. you can find more units @ css3 spec .

spring - springmvc-resteasy and exception mapping -

i using resteasy spring mvc integration (springmvc-resteasy using resteasy 2.0, spring 3.0) map application exceptions http responses declaring resteasy exception mapping providers. application not explicitly extend javax.ws.rs.core.application , ideally rely on framework's automatic scanning of exception mapping providers. here 1 of exception mappers looks like. @provider public class myappexceptionmapper implements exceptionmapper<myappexception> { public response toresponse(myappexception exception) { return response.status(response.status.bad_request).build(); } } and exception class looks this public class myappexception extends runtimeexception { public myappexception(string s, throwable t) { super(s,t); } } when application throws myappexception , not mapped http-400 response (i usual http-500 framework) is there missing? if problem not "registering" provider framework, how register exception mappers when usi...

networking - Weird TCP issue with Amazon S3 -

this question exists because has historical significance, not considered good, on-topic question site, please not use evidence can ask similar questions here. more info: https://stackoverflow.com/faq i having weird tcp issue makes no sense @ all. tearing hair out. when downloading file amazon s3 (and amazon s3- every other site works fine) percentage of time connections dies. happens our servers in seattle web server behind nat router. connecting directly router works fine. our servers here in victoria works fine, , can't replicate @ all. web server in seattle (tried 10 different servers) -> snat router (2 different routers; old kernels , new kernels) -> amazon s3 = doesn't work ~10% of time web server in seattle -> snat router -> other website = works router box -> amazon s3 = works web server in victoria -> snat router in victoria -> amazon s3 = works things i've tried: disabling window scaling low...

iphone - Core Data Relationships Help ... should be basic i hope -

Image
so have 2 relationships between 2 entities in core data, titled "number" , "info." give user number , when them in return give me name can tie specific number. cannot seem code right this. far closest think have gotten this: (usernumber *pinnumbers in [entryview pinnumberarray]) { if ([numberstring isequaltostring:pinnumbers.pin]) { userinfo *info = pinnumbers.info; [info setname:namefield.text]; } } where loop through number have entered , if can find inside array core data populates them assign name this. show me example of how might done? thanks. if model this: such there one-to-one bidirectional relationship between usernumber , userinfo, seems have 'number' attribute of userinfo , simplify model. (is case 'number' unique each userinfo?) but, going current model, assuming one-to-one relationship, should work - provided usernumber has 'number...

google app engine - AppEngine Datastore Asynchronous put -

in http://blog.notdot.net/2010/09/under-the-hood-with-app-engine-apis , explains how can perform asynchronous datastore request. want perform asynchronous put request. how do that? thanks! as of gae 1.5.0 there ' put_async '.

c# - Map System.Uri using Entity Framework Fluent Api -

pretty simple question. have model has property system.uri type. uri s don't have default parameterless constructor, , no id field. there way override model generation store in db in custom way (e.g. string )? in nhibernate, i've done before implementing iusertype , not find yet similar mechanism in codefirst. obviously, create custom type uses uri under hood , exposes regular mappable properties & constructor, i'm curious if there's way map system type don't have make wrapper that. ef not support custom type mappings nh. for system.uri in particular, i'd use wrapper property , map actual value string; it's not bad.

c# - I need cmd output and errors to be posted on a textblock at run time -

currently have command this. first, upon button click event execute batch file , create new text file saving log, results , erros text file. create textblock textblock shows these results , errors @ during process of running batch file. possible? my current code writing text file: system.diagnostics.process runantc = new system.diagnostics.process(); runantc.startinfo.filename = "c:\\gui\\batch.bat"; runantc.startinfo.useshellexecute = false; runantc.startinfo.redirectstandardoutput = true; runantc.startinfo.redirectstandarderror = true; runantc.start(); string procoutput = runantc.standardoutput.readtoend(); string procerror = runantc.standarderror.readtoend(); // create writer , open file textwriter outputlog = new streamwriter("c:\\gui\\processoutput.txt"); outputlog.write(procoutput); outputlog.close(); // create writer , open file textwriter outputerror = new streamwriter("c:\\gui\\error.txt"); outputerror.write(procerror); outputerror.c...

iphone - What is the difference between copyItemAtPath:toPath:error and copyItemAtURL:toURL:error: of NSFileManager? -

i want copy file @ path path b, in case exists @ b want overwritten , want use 1 of mentioned methods 1 one should use? saw documentation , pretty same. i can make nsurl objects strings both same? cocoa attempting standardize on urls. consistent use of urls can in cases improve performance, because nsurl object can cache information filesystem , avoid redundant io in case information requested again. however, in context of 1 method itself, doesn't make difference.

Sphinx4 Speech Recognition from a video -

does sphinx4 support speech-to-text processing on video files? if yes, need jmf? there tutorials ?? i couldn't find anything, not in forum , , nobody responding in irc channel ! does sphinx4 support speech-to-text processing on video files? yes. there no specifics of video. need extract audio track , pass recognizer. if yes, need jmf? there different way extract audio track video. can jmf or mplayer is there tutorials ?? http://cmusphinx.sourceforge.net/wiki/tutorial

shell - Suddenly can't create local/remote git branches -

not sure how i've managed can't create local , remote branch anymore. ~/myapp(master) > git checkout -b new_feature origin/new_feature fatal: git checkout: updating paths incompatible switching branches. did intend checkout 'origin/new_feature' can not resolved commit? i've tried re-cloning app in case .git directory corrupted, no luck. suggestions? you can't create remote branch way, need first git checkout -b new_feature create new local branch , git push origin new_feature push branch remote.

google maps - How to Find Specific Nearby Locations in android -

i have requirement in project finding nearby movie theaters upto radius user present location want show these finding location in google map. have seen posts here did not clarity on this. there direct api calls nearest specific places or other way find. get list of places surrounding user's current location

Using Facebook Connect SDK for my iPhone app -

okay, using cocos2d developing iphone game, , wish implement facebook connect. i found tutorial integrating facebook connect in cocos2d forums (http://www.cocos2d-iphone.org/forum/topic/3392), link provides downloading facebook sdk is... broken. , have no idea download it! every link find in google seems have been removed facebook's documentation. , tutorial bit old... there updated content such? can guide me should started? (downloading sdk) facebook seems notoriously bad dropping support or unlinking features. try: http://developers.facebook.com/docs/guides/mobile/#ios

mysql - Finding schema differences -

i want compare db schema tables , columns identical. mysql> select a.table_schema, a.table_name information_schema.tables left join information_schema.tables b on a.table_name = b.table_name a.table_schema = 'india' , b.table_schema = 'china' , b.table_name null; i expected above query return tables present in india db not there in china db. not seem working. apart tables differences need find columns may different in 2 db's. i not want use applications navicat. need query or unix command. you need move and b.table_schema = 'china' predicate join: select a.table_schema, a.table_name information_schema.tables left join information_schema.tables b on b.table_schema = 'china' , a.table_name = b.table_name a.table_schema = 'india' , b.table_name null to find column information: select a.table_name, a.column_name information_schema.columns left join information_schema.columns b on b.table_schema = 'china...

c# - Dictionary of generic lists or varying types -

i want have dictionary maps strings generic lists of varying types. i.e. in following form: key value string list<t> string list<u> string list<v> string list<u> ... currently i'm using dictionary<string, ilist> , extracted typed list each dictionary keyvaluepair<string, ilist> pair entry follows: type layertype = pair.value.gettype().getgenericarguments()[0]; list<layertype> objectsclicked = pair.value list<layertype>; is there nicer way this? [edit] has been noted, above doesn't compile, apologies - that's when ask question while you're still working on somethings. more explanation. i'm making basic spatial data viewer. final view consists of group of layer<t> s. each layer provides delegate render type (given offset , scale) , way check of objects in current window. hit testing, list each layer of objects have been hit. list list<point> point layer, etc... ...

asp.net - problem with repeater -

while running code exception occuring @ <%eval("firstname")%>.. exception message "databinding methods such eval(), xpath(), , bind() can used in context of databound control." do..my code follows <div>this repeater <asp:repeater id="repeater1" runat="server" datasourceid="sqldatasource1"> <headertemplate> <table> <tr> <th>firstname</th> <th>lastname</th> <th>city</th> </tr> </headertemplate> <itemtemplate> <tr> <td><% eval("firstname")%></td> <td><% eval("lastname")%></td> <td><% eval("city")%></td> </tr> </itemtemplate> <footertemplate> </table> ...

ios - NSSring from plist created from NSArray -

i create nsarray , write file: a.plist. use nsstring: initwithcontentsoffile, , can see content in xml. then, add a.plist project , use nsstring: initwithcontentsoffile xml string. filepath = [[nsbundle mainbundle] pathforresource:@"a" oftype:@"plist"]; nsstring *pliststr = [[nsstring alloc]initwithcontentsoffile:filepath]; however, failed recreate xml string. user nsarray test: nsarray *plist2array = [[nsarray alloc]initwithcontentsoffile:filepath]; but successfully. i think may result "text encoding" when add project. problem tried utf8,utf16 , on. still can't find solution. hope help,thanks! i find it! rename file: a.plist ->a.txt(or else), in project can xml string.

login - How to integrate Janrain on android phone? -

i' trying find how integrate janrain android app..... i found janrain iphone given in janrain engage section couldnt find android applicaion. if knows wer find , please leave link ...... and documentation help... thank you,, you can download engage sdk on github , find instructions setting application here .

javascript - jquery not working inside html file -

i'm trying basic jquery tutorial i'm not able work. i'm calling jquery library google , try create script inside html. if same in .js file wouldn't have problem. missing here? <html> <head> <title></title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> </head> <body> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"> $(document).ready(function() { $("a").click(function() { alert("hello world!"); }); }); </script> <a href="">link</a> </body> </html> you need split up: <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"> ...

linux - Need to get the dates of all mondays in a year -

i need sort data on weekly base , have dates in logfile. therefore sort out data per week create list dates of mondays given year. have tried work out , idea have use ncal year , month argument looping on months , extracting mondays. isn't there more efficient way? to mondays, getting dates , filtering mondays: for in `seq 0 365` date -d "+$i day" done | grep mon of course, take monday , keep incrementing 7 days.

c# - Binding dictionary to Accordion panes -

i have accordion control several panes. on page load want set controls inside panes data dictionary (every pane has 1 10 controls). aspx <cc1:accordion id="accordion1" runat="server" fadetransitions="true" selectedindex="0" headercssclass="accordionheader" contentcssclass="accordioncontent" width="370px"> <panes> <cc1:accordionpane id="accordionpane1" runat="server"> <header> text </header> <content> <asp:label id="lbltitle" runat="server" text='<%# eval("key1")%>'></asp:label></li> </content> </cc1:accordionpane> <cc1:accordionpane id=...

php - Is it possible to update multiple rows at the time using Zend_Db_Table? -

i have simple array. $a = array( array('id' => 2, 'year' => 2010), array('id' => 3, 'year' => 2011) ); and have mysql table id primary key. update table this: foreach ($a $v) { $db->update($v, array('id = ?' => $v['id'])); } and $a contains 3700 rows. need create 1 big query instead of loop. how can it? thank in advance. sorry english. what asking isn't done, use update() either set lot of records have same values or set 1 record have many differnt values. one way around aggregate updates, using array ids year 2011 run this: $where = array(); // should contain ids need year set 2011 // e.g. $where[] = array("id" => 3); $db->update("table_name", array("year" => 2011), $where); doing reduce number of queries assuming have many rows same year. documentation here . or use method like this edit after op response the nature of problem...

iphone - Audio Streaming in background crash the app -

i using digitaldj's audiostreamer project (https://github.com/digitaldj/audiostreamer) stream audio in background in application. works fine when app in foreground gets crashed in ground. here strange crash log. incident identifier: f6f6b97c-1943-460d-8a4e-5608b47e6989 crashreporter key: 3a88f20a9e18f468445bddc212b7aa673c6dc89b hardware model: ipod4,1 process: imixtapes [1075] path: /var/mobile/applications/7c64d2d8-0c63-4a73-8452-763209481693/imixtapes.app/imixtapes identifier: imixtapes version: ??? (???) code type: arm (native) parent process: launchd [1] date/time: 2011-02-18 13:24:15.849 +0530 os version: iphone os 4.2.1 (8c148) report version: 104 exception type: 00000020 exception codes: 0x8badf00d highlighted thread: 6 application specific information: imixtapes[1075] has active assertions beyond permitted time: {( <sbprocessassertion: 0x66ce420> identifier: uikitbackgroundcompletiontask pr...

netbeans - Easiest way to create Jira WS client -

i'm looking easiest way create jira webservice client. first tried jira soap client example seems have dependencies on libraries jira-rpc-plugin. want call webservice remote server looking jar version of said plugin, unfortunately download link in plugin repository doesnt seem work. so tried build myself. got kind of stuck maven project when imported netbeans, tells me project malformed , gives me ton of errors. don't want hassle set maven manually tried method. i wanted consume wsdl webservice client in netbeans when try generate jax:ws style client, run problem "undefined simple or complex type soapenc:array". next step download old jax:rpc plugin - necessary? thanks in advance did try guide - worked me (but i'm working eclipse) http://www.j-tricks.com/1/post/2010/08/jira-soap-client.html francis

ios - viewDidUnload called after dealloc? -

when i'm debugging ipad app, found because of low memory, view controllers' viewdidunload got called. seconds later, viewdidload called. , again because of low memory, viewdidunload , viewdidload again. file system keep swapping files due low memory. is supposed this, or have done wrong? then wanna release view controller rid of this. viewdidunload called before dealloc , , crash due selector sent deallocated view controller. thank help. this normal behaviour. viewdidunload called in low memory situation notify controller view has been released. there's clear outline of steps in view controller programming guide ios . specially, @ steps detailed in section understanding how views loaded , unloaded , covers unload cycle: the app receives low-memory warning system. each view controller calls didreceivememorywarning method. if override method, should use release memory or objects view controller object no longer needs. not use release...

iphone - Objective-C Check for downloaded file size -

i'm creating app downloads .zip file s3 server. works fine. want able interrupt current download. if save current size (bytes) of file, able send new request range header other part of file. problem lies in fact cannot determine size of 'already' downloaded content, because can see file in directory when download completed. if interrupt, there isn't partial file saved. at time use following code this: -(void) downloadfile:(nsmutablearray*)paramarray withdict:(nsmutabledictionary*)options { nslog(@"download thread started"); nsstring * sourceurl = [paramarray objectatindex:0]; nsstring * filename = [paramarray objectatindex:1]; nsautoreleasepool *pool = [[nsautoreleasepool alloc] init]; nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; nsstring *newfilepath = [documentsdirectory stringbyappendingstring:filename]; nserror *error=[[[nserror...

linux - Alternative for Gadwin Print Screen -

does know alternative gadwin print screen ? i'm using linux, couldn't find download version it. thanks help. i found shutter replacement gadwin. supports taking screenshots of rectangular section on desktop, feature use lot. website - http://shutter-project.org/ download ubuntu - https://apps.ubuntu.com/cat/applications/shutter/

Pydev can't import poplib -

i'm using aptana studio 3 beta comes pydev, appears working apart can't import poplib part of standard library. i added poplib forced builtins , seems prevent marking error completions don't work. doing right? shouldn't in standard library work? edit: have same problem random well this works me. i'm using vanilla eclipse, not aptana. idea pydev-related problems use latest version pydev under heavy development. enter "http://pydev.org/nightly" update site , see whether there's newer version. another idea re-parse standard library: in settings, choose python interpreter list , click "apply". should make pydev parse libraries again. remove interpreter , add again.

c# - ForEach giving Invalid Cast at Runtime -

i have following: foreach (itemoption itemoption in p.items.select(e => e.itemoption).groupby(e => e.id)) { // work on itemoptions } this compiles. @ runtime invalid cast exception: unable cast object of type 'grouping[system.string,mynamespace.itemoption]' type 'mynamespace.itemoption'. if change code to, e.g. string type of item : foreach (string itemoption in p.items.select(e => e.itemoption).groupby(e => e.id)) { // work on itemoptions } then compiler tells me types incompatible. why doesn't compiler flag type incompatibility in first code block? i did further investigation , found that, given following code: var foo = p.items.select(e => e.itemoption).groupby(e => e.id)); type singleelementtype = foo.elementat(0).gettype(); singleelementtype is: system.linq.lookup`2+grouping[system.string, mynamespace.itemoption] update following on answers have put simpler case demonstrate issue given objects:...

c++ - IN_ADDR struct strangely defined in android -

i trying compile networking code on android , seeing compilation errors. struct using is ip_mreq_source should defined in header so: struct ip_mreq_source { struct in_addr imr_multiaddr; struct in_addr imr_sourceaddr; struct in_addr imr_interface; }; where in_addr should defined as: typedef uint32_t in_addr_t; struct in_addr { in_addr_t s_addr; }; my detailed error coming out of g++ (gcc 4.4.3) android based compiler: arm-linux-androideabi-g++ -mmd -mp -mf groupsock/groupsockhelper.o.d.org -fpic -ffunction-sections -funwind-tables -fstack-protector -d__arm_arch_5__ -d__arm_arch_5t__ -d__arm_arch_5e__ -d__arm_arch_5te__ -wno-psabi -march=armv5te -mtune=xscale -msoft-float -fno-exceptions -fno-rtti -mthumb -os -fomit-frame-pointer -fno-strict-aliasing -finline- limit=64 -igroupsock/include -igroupsock/../usageenvironment/include -iandroid- ndk-r5b/sources/cxx-stl/system/include -igroupsock -dandroid -wa,--noexecstack -dandroid_ndk -wall -fexceptions ...