Posts

c# - How to use Linq to find dates in listed but not in another -

i have 2 list objects: 1 describes list of shifts , describes list of sick leave. what trying compare 2 lists , return result gives list of sick leave, dates in sick-leave not in list of shifts. i have written code, not return list: var nonavailabledates =availability .where(a=>! shiftday.any(b=>b.shiftdate.date == a.startperiod.date)).tolist(); can please show me have gone wrong? thanks you're looking set difference operation, except() method in linq (will give elements in first collection not in second): list<datetime> shifts = new list<datetime>{ datetime.parse("1/1/2014"), datetime.parse("1/2/2014")}; list<datetime> sickleaves = new list<datetime>{datetime.parse("1/1/2014"), datetime.parse("1/3/2014")}; var sickleavesthatarenotalsoshifts = sickleaves.except(shifts); // contains 1/3/2014 edit: give shot. we're joining , taking items don't have match. var sickleavesnotin...

vba - Excel: How to use a checkbox form marco to hide column on MAC -

i'm using activex checkbox following macro in worksheet: private sub checkbox1_click() if checkbox1 = true columns("p:v").hidden = true else columns("p:v").hidden = false end if end sub and works fine on pc. when try on mac, doesn't work since mac doesn't have activex support. tried using regular form control checkbox, doesn't appear function @ when use macro. have ideas? i'm kind of vba/excel noob. if put 2 forms checkboxes on sheet , name them "cbb" , "cbc" can assign macro below both of them. column affected depend on checkbox triggers sub. code regular module: if want in sheet module replace activesheet me sub checkbox_click() dim vis boolean, ac string, col string ac = application.caller activesheet vis = (.shapes(ac).controlformat.value = 1) select case ac case "cbb": col = "b" case "cbc": col = "c...

Php - Is it possible to block access to a webpage depending on the address used? -

consider following scenario. there site on local network can accessed 1 of 2 ways: 11.11.11.111/testsite (ip) test.site.com (vhost) is possible php allow access using test.site.com? edit: while there many suggestions how solve problem, went publi design & john v.'s mod_rewrite suggestion, implemented in httpd.conf file , redirected forbidden page. what worked me was: rewriteengine on rewritecond %{http_host} !^test.site.com$ [nc] rewriterule .? - [f] i avoid php request , go 1 level. haven't tried this, maybe .htaccess file you, using similar this: rewriteengine on rewritecond %{http_host} !^11.11.11.111/testsite$ [nc] rewriterule ^(.*)$ test.site.com/$1 [l,r=301] you might have play around it, imagine along lines should want be.

c# - Customizations vs Residue collectors -

i don't grasp difference between customizations , residue collectors. according documentation , if register customization can build, exampleclass handle requests type were not handled other builders . if register residue collector type exampleclass handle requests, were not handled (other) builders where's difference? tl;dr that's valid question. difference between 2 priority , order in they're given chance handle requests. customizations first, while residue collectors last. autofixture, @ core, consists of chain of responsibility each node in pipeline called specimen builder . these builders organized in 3 categories, determine position in chain: customizations engine residue collectors specimen builders higher in chain handle incoming requests first, effectively overriding further down . customizations typically ad-hoc specimen builders created user handle kind of requests in particular way. hence, they're given highest priority....

sql server 2008 - C++ ADO.NET Cannot insert the value NULL into column -

i'm trying insert lines in database, got error while executing code : #using <mscorlib.dll> #using <system.dll> #using <system.data.dll> #using <system.xml.dll> #include <sstream> #include <time.h> #include <string> #include <iostream> #include <tchar.h> using namespace system; using namespace system::data; using namespace system::xml; using namespace system::data::sqlclient; // entry point application int _tmain(void) { sqlconnection ^ mysqlconnection; sqldataadapter ^ mydataadapter; dataset ^ mydataset; datarow ^ myrow; sqlparameter ^ myparameter; try { mysqlconnection = gcnew sqlconnection("data source=nectarys-pc;initial catalog=monitoringn;integrated security=true;"); mydataadapter = gcnew sqldataadapter(); mydataset = gcnew dataset(); // open connection mysqlconnection->open(); mydataada...

python - Why am I not getting the correct response? -

i complete python noob foreshadowing done, trying parse information out of soap response. body of reponse below: <soap:body> <processmessageresponse xmlns="http://www.starstandards.org/webservices/2005/10/transport"> <payload> <content id="content0"> <customerlookupresponse xmlns=""> <customer> <companynumber>zq1</companynumber> <customernumber>1051012</customernumber> <typecode>i</typecode> <lastname>name</lastname> <firstname>basic</firstname> <middlename/> <salutation/> <gender/> <language/> <address1/> <address2/> <address3/> <city/> ...

javascript - adding a new section on webpage using only css and js -

i trying click on image on webpage , open new section on page created in css , javascript/jquery. thought using .addclass() not entirely sure how go it. can give me example of being done? an example clicking on element id foo , adding div id bar after element: $("#foo").click(function(){ $(this).after('<div id="bar">some content</div>'); }); of course, there multiple methods in jquery insert content somewhere in dom tree, see: https://api.jquery.com/category/manipulation/dom-insertion-outside/ https://api.jquery.com/category/manipulation/dom-insertion-inside/