Posts

jsf - ViewExpiredException after upgrade to jsf2 -

we upgraded major platform jsf 1.2 2.0. after upgrading we're getting several viewexpiredexception errors each hour. reading on topic seems expected exception when sessions expire, we've reviewed access logs , getting these exceptions when requests 5 minutes apart in cases. my questions follows: 1) other session expiration, other conditions might cause viewexpiredexception? 2) exception we're logging doesn't contain detail exact condition causing exception (missing session, corrupt session, unable restore particular component). there way introduce additional logging find out specific situation triggering exception in each case? mojarra 2.0.4-b09 tomcat 6 using memcached session manager session replication any appreciated. thanks! other session expiration, other conditions might cause viewexpiredexception? the enduser has requested/created views within session , submitting old view. default max views per session 15. in other words, if enduser...

c# - Column Values Customisation- Export Excel in ASP.NET -

i have export gridview in excel sheet 2003. code can export data excel sheet directly. if there null value column, how replace empty string in excel sheet. there date column null, there event handler occurs between export button click , loading data excel. if there 1 can compare values in database , can replace null value empty string. in evnt handler. please point me in right direction. thank you on click of export button, can iterate through grid rows , replace whatever need. example, code below replace : . : protected void btnexport_click(object sender, eventargs e) { stringwriter sw = new stringwriter(); htmltextwriter htw = new htmltextwriter(sw); string attachment = "attachment; filename=summaryreport" + datetime.now.tostring() + ".xls"; response.clearcontent(); response.addheader("content-disposition", attachment); response.contenttype = "application/ms-excel"; foreach (gridviewrow grdrow...

cocos2d extend touch area from a button -

i got radiobuttons toucharea small. toucharea depends on image size. there elegant way extend touch area cocos2d without using bigger image or make own touch areas cgrect? setcontentsize want. unfortunately image moves left bottom corner of contentsize. set anchorpoint moves contentsize around image stays in left bottom corner. ccmenuitem* pickeasy = [ccmenuitemimage itemfromnormalimage:@"radiobutton_off.png" selectedimage:@"radiobutton_on.png" target:self selector:@selector(pickeasytapped:)]; pickeasy.position = ccp(ss.width * 0.40, ss.height * 0.78); [pickeasy setcontentsize:cgsizemake(50, 50)]; thanks in advance. you need override rectinpixels method - (cgrect)rectinpixels { cgsize s = [self contentsize]; return cgrectmake(0, 0, s.width, s.height); } - (bool)containstouchlocation:(uitouch *)touch { cgpoint p = [self converttouchtonodespace:touch]; cgrect r = [self rectinpixels]; return cgrectcontainspoint(r, p); } - (bool)cctou...

javascript - How to access a variable state from the defining function rather than the calling object -

eg: func = (){ var i_want_this = "yes"; var callback = function(){ // want access value of i_want_this here // preferably single variable without whole scope }; obj.subfunc(some_stuff, callback); }; obj = { subfunc = function(stuff, callback){ // stuff callback(); } }; func(); you can use variable in callback; work way want to. this called closure .

Any ideas on how to create a local customised AVI player in Flash that will play from a USB drive? -

i'm looking create solution enable me have folder of avi files on usb drive, packaged along custom designed player (probably built in flash). creare packaged flash file in way autorun on inserting drive if @ possible. solution need platform agnostic (hence thinking flash best bet). has come across tutorial achieving similar above? i've been trawling through google not getting luck. any can provide gratefully received. thanks in advance, jh you don't want videos avi files if wanna work cross platform. why? flash has no support avi files. macs miss avi support. using avi blocks using authoring application adobe director uses underlying os video playback. if still want use flash suggest taking @ h264/mp4 codec/container.

c++ - std::unique_ptr usage -

std::unique_ptr<int> p1(new int); std::unique_ptr<int> p2(new int); p2=p1; it seems here p1 no longer "unique" since p2 refer also it legal c++ ? unique_ptr have copy_semantics ? if no, , if has move semantics, p1 set null after assign p2 ? edit: ok correct version is p2=std::move(p1) according that, after assign, p1 not valid ? , difference auto_ptr here? more safe explictly specfiy transfer of ownership implicitly case auto_ptr guess std::unique_ptr non-assignable , non-copyable. need use std::move(); so p1 = std::move(p2); have here more info.

sql - does an index provide order by itself? -

lets have create table mytable( varchar(200) b varchar(200) c varchar(200) ) create index on mytable (b) if select select a, b, c mytable; would sorted b? there 2 main types of indexes: clustering , non-clustering. the clustering index determines physical row order in table. inserting table (or updating respective field) causes database engine re-order data field clustering index on sorted correctly. that's why there can 1 clustering index on table. non-clustering indexes copies of columns, ordered desired. exist separately, , physical row order not connected them. that's why there can many non-clustering indexes want. most simple select on single table returns rows in physical order, not surprising receive them sorted way the clustering index is. however, not guaranteed , should not rely on it. always include order clause if result set order of concern. if order clustering index, there not work db engine, intent clear. if order non-cluste...