Posts

c++ - Can std::this_thread::sleep_for() have spurious wakeups? -

note, not question std::condition_variable::wait_for() . know can wake spuriously. my program’s behavior suggests answer question yes, stl documentation quite clear condition_variable case. @ least @ cppreference.com , correct answer this_thread appears no. compiler gcc 4.8.1, in case defect. the relevant sections of c++ standard (paragraphs [thread.thread.this]/7-9) not mention spurious wake-ups std::this_thread::sleep_for , unlike e.g. std::condition_variable::wait_for . template <class rep, class period> void sleep_for(const chrono::duration<rep, period>& rel_time); 7 effects : blocks calling thread relative timeout (30.2.4) specified rel_time . 8 synchronization : none. 9 throws : timeout-related exceptions (30.2.4). this implies behavior observing non-conforming.

c# - WCF ServerInspectorBehavior - How to keep a header in AfterReceiveRequest to use in BeforeSendReply -

i have wcf service have extended behavior. this code: public object afterreceiverequest(ref message request, iclientchannel channel, instancecontext instancecontext) { if (logger.isinfoenabled) { // header sent client need keep can return in beforesendreply var securitytoken = request.headers.getheader < string > (request.headers.findheader("token-id", "securityinfo")) var bufferedcopy = request.createbufferedcopy(int.maxvalue); var sizelog = string.format("request message size: ~{0} kb", getmessagelengthinkb(bufferedcopy.createmessage())); logger.info(sizelog); request = bufferedcopy.createmessage(); } return null; } public void beforesendreply(ref message reply, object correlationstate) { if (logger.isinfoenabled) { // here want securitytoken value ??? var bufferedcopy = reply.createbufferedcopy(int.maxvalue); var sizelog = string.format("r...

uml - 2 actors, same parent use case but each one having his own child use case -

i have parent use case child uses cases, example: parent use case: "selling subscriptions" child uses cases: "self buy subscription" "sell subscription else" etc my question is: correct have 2 different actors (customer , vendor) linked parent use case in top level use case diagram, each of them linked 1 child use case in more detailed use case diagram or there wrong ? the 2 actors should linked primary parent use case. then in detailed use case diagram can specific link secondary use cases. (if doesn't answer question please provide diagram want do)

css - Where should I divide a mobile-friendly website from it's android counterpart? -

i creating both mobile-friendly website , android app client. each have similar functionality , objectives. began create responsive pages website, thought occurred of using pages making webview menus android app. lead me thinking, android app needed @ all? my question what functionality can android app provide responsive website not? the purpose of app reading content(think ebook), sharing content others, , link buy physical book. believe reading content offline justification enough existence of app wondering else provide app can offer? my second question from design standpoint, should use webviews main menus , content? or should duplicate responsive pages android layouts/buttons.? webview based menus seems awkward, having use javascript run android functions. duplicating web pages android activities seems equally awkward. having webview apps not using native resources. means doesn't experience best of resources of apps. (it may lag little or doesn't cons...

vba - Access 2013 - Visual Basic issue -

i experiencing issue access 2013 while creating vba code button. button open form using: docmd.openform command implement while condition filters form going opened. i have 2 fields on current form with: - start date - end data the while condition must filter records column "date" between 2 given dates in previous form. this: where date >= me.begin_date.value , date <= me.eind_date.value i cant figure out use in while condition of vba code. can other things filters in vba like: search_filter = "itemid '*" & me.search_bar.value & "*' " docmd.openform "#3 search-result", acnormal, , search_filter but want have first code sample, translated vba code above piece of code. how can achieve this? sorry bad english btw. if recall correctly; generate query based on 2 values (in query builer do) forms!formname.recordsource = sql query ...

excel - Custom menu Passing a WorkSheet variable through .OnAction -

i have been using post guide pass variables until excel, vba: how pass multiple variables .onaction and has worked well. unfortunately, trying pass worksheet argument time, , not working. here block of code can take look. right click menu: menu.controls.add(temporary:=true, type:=msocontrolbutton, before:=i_menu) .begingroup = false ' ' ' ' ' ' .onaction = "'" & thisworkbook.name & "'!" & "'saute """ & num_doc & """,""" & num_etape & """'" .onaction = "'" & thisworkbook.name & "'!" & "'saute """ & num_doc & """,""" & num_etape & """,""" & ws & """'" .faceid = 478 .caption = "sauté" ...

java - ResourceNotFoundException on existing path -

i have following class: public class emailservice { static { velocity.setproperty("resource.loader", "class"); velocity.setproperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.classpathresourceloader"); velocity.init(); } public void sendterminalmoderationstatuschangedemail(terminal terminal, string to) { ... template subjecttemplate = null; try { subjecttemplate = velocity.gettemplate(existedpath, "utf-8"); } catch (urisyntaxexception e) { e.printstacktrace(); } ... } } in debug see existed path exists. got following error: unable find resource 'c:/program files (x86)/apache/apache-tomcat-7.0.52/webapps/root/web-inf/classes/velocitytemplates/terminalmoderationstatuschanged.vm' but file c:/program files (x86)/apache/apache-tomcat-7.0.52/webapps/root/web-inf/classes/velocityte...