text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
} return shortcutFilename; } return ""; // not found } ```
[ 0.14197032153606415, -0.23593220114707947, -0.12446279078722, -0.3772754967212677, 0.39637166261672974, -0.09812908619642258, 0.4302400052547455, 0.3770316243171692, 0.022194132208824158, -0.4110247492790222, -0.26164138317108154, 0.7993459701538086, -0.30302420258522034, 0.088277496397495...
It's simple enough to code up a class to store/validate something like `192.168.0.0/16`, but I was curious if a native type for this already existed in .NET? I would imagine it would work a lot like `IPAddress`: ``` CIDR subnet = CIDR.Parse("192.168.0.0/16"); ``` Basically it just needs to make sure you're working w...
[ 0.23798812925815582, 0.1288103610277176, 0.308694452047348, 0.2396652102470398, -0.015890436246991158, -0.2918626368045807, 0.03951685130596161, 0.2853872776031494, -0.17185291647911072, -0.6641109585762024, -0.0069305491633713245, 0.56601881980896, -0.1907632052898407, 0.08237647265195847...
Are there any known methods of finding peers without using a dedicated central server? ie: If I have peers which are disconnecting and reconnecting to the internet but getting a new IP address each time, and I want to connect to them without setting up a dedicated server to register with. I was thinking about using p...
[ 0.3128737509250641, 0.004159686621278524, 0.16212019324302673, 0.3258700370788574, -0.08080870658159256, -0.26174288988113403, 0.20392495393753052, 0.10533338040113449, -0.12971635162830353, -0.9790383577346802, 0.1492248773574829, 0.09396635740995407, -0.09693099558353424, 0.3210812211036...
existing models of finding peers would be preferable. There's no way around having to know at least one initial peer to discover more. Fully P2P protocols, such as Gnutella or Gnutella2, or the simpler Overnet (made famous by Storm Worm), are based on each client having a start-up list of a few peers. These can come of...
[ 0.3307309150695801, -0.2542145550251007, -0.07951616495847702, 0.3588317036628723, 0.012455115094780922, -0.2910597324371338, 0.18517155945301056, -0.019681556150317192, -0.4295334219932556, -0.828765869140625, -0.0909700095653534, 0.35068565607070923, -0.1839095801115036, -0.0315727628767...
do is find the first peer through broadcasted messages and ultimately IP address scanning. The first approach is well-meaning but in at least 98% of cases won't yield any results. The later approach, of course, is abusing the internet, as well as illegal in most countries. I really would rethink having some kind of a ...
[ 0.5193231105804443, -0.09315413981676102, 0.20601430535316467, 0.08710014075040817, 0.14736944437026978, -0.5801635980606079, 0.23244881629943848, 0.0716070756316185, -0.003063392359763384, -0.23294612765312195, 0.2094745635986328, 0.41384023427963257, -0.6324830055236816, -0.0477724149823...
spam filters at the very least, would not work anyway).
[ 0.30285802483558655, -0.24039825797080994, 0.5012272000312805, 0.09741250425577164, 0.023731891065835953, -0.14380516111850739, 0.5544025897979736, 0.10670509189367294, -0.1871284395456314, -0.13011182844638824, -0.36341509222984314, 0.4685986340045929, -0.44299495220184326, 0.088375389575...
Has anyone used [Versions](http://versionsapp.com/) for OSX? I'm mainly wondering if it does everything [TortoiseSVN](http://tortoisesvn.tigris.org/) does and if you can use both with the same checkout repo? **Edit:** The one issue I found is the diff viewer. The OSX developer FileMerger is just not that great. Tortoi...
[ 0.20410431921482086, -0.08810137212276459, 0.6074245572090149, -0.11076653748750687, -0.0924810841679573, -0.15251174569129944, 0.15388008952140808, 0.5087614059448242, -0.5883873701095581, -0.6271658539772034, -0.08512494713068008, 0.7894658446311951, -0.26888376474380493, 0.1513355374336...
Can someone explain the main benefits of different types of references in C#? * Weak references * Soft references * Phantom references * Strong references. We have an application that is consuming a lot of memory and we are trying to determine if this is an area to focus on. Soft and phantom references come from Java...
[ 0.03978664427995682, -0.0429081916809082, 0.24917387962341309, 0.306281179189682, -0.19539335370063782, 0.0629982203245163, 0.04818432033061981, 0.13904541730880737, -0.23952172696590424, -0.4495914876461029, 0.24824856221675873, 0.7277206182479858, -0.1556982845067978, 0.0350024476647377,...
collected once all strong references have gone out of scope. They can be useful for holding on to large objects that are expensive to initialize, but should be available for garbage collection if they are not actively in use. Whether or not this will be useful in reducing the memory consumption of your application wi...
[ 0.04332160949707031, -0.19644658267498016, 0.17431534826755524, 0.5459981560707092, -0.12262023985385895, -0.13088510930538177, 0.44025149941444397, -0.11609060317277908, -0.5158835053443909, -0.4079757034778595, -0.24429836869239807, 0.37779152393341064, -0.2169467806816101, 0.06199182197...
app is working with a very large number of small objects, weak references will make the problem worse since the reference objects will take up as much or more memory.
[ -0.4486749768257141, 0.21346281468868256, 0.37723731994628906, 0.28708526492118835, 0.07622596621513367, 0.36804455518722534, 0.27871039509773254, 0.13670969009399414, -0.2598743438720703, -0.7587682604789734, -0.11763142049312592, 0.13474427163600922, -0.5450460910797119, -0.2234733253717...
I'm using Emma in my ant build to perform coverage reporting. For those that have used Emma, is there a way to get the build to fail if the line coverage (or any type of coverage stat) does not meet a particular threshold? e.g. if the line coverage is not 100% Not out of the box. However, the [`report.metrics`](http:/...
[ 0.28804120421409607, 0.0707651749253273, 0.1716926097869873, 0.0755665972828865, -0.1766059249639511, 0.17016592621803284, 0.5794229507446289, -0.5144542455673218, 0.0630444809794426, -0.7098064422607422, -0.12518219649791718, 0.2786917984485626, -0.265397846698761, -0.20506611466407776, ...
For loading time considerations I am using a runtime css file in my Flex Application. I am having a problem with a multi line text control : ``` <mx:Text id="txtDescription" selectable="false" styleName="imageRolloverButtonTextDark" width="100%" textAlign="center" text="{_rolloverText}"/> ``` When my CSS stylesheet...
[ 0.36599573493003845, -0.1777435839176178, 0.6242947578430176, -0.1042228415608406, -0.2179487645626068, 0.06693822890520096, 0.04667006433010101, -0.14995022118091583, -0.2723642885684967, -0.7190070152282715, -0.08286236971616745, 0.6566616892814636, -0.14289626479148865, -0.1196319833397...
has this problem, The solution I found was to create a custom component extending the mx.controls.Text and then override the styleChange() Method, and explicitly call the invalidateDisplayList() method for the text field once the style has been applied. It should be called automatically when the styleis changed but n...
[ 0.19537271559238434, -0.19395971298217773, 0.6823197603225708, -0.11826258152723312, 0.18117760121822357, -0.08703380823135376, 0.33565080165863037, -0.34454599022865295, -0.08381036669015884, -0.5258167386054993, 0.07717502862215042, 0.9371688365936279, -0.5148434042930603, -0.11251420527...
This one is a bit tedious in as far as explaining, so here goes. I'm essentially populating a tableView on the iPhone with multiple sections, and potentially multiple rows per section. To my understanding, it's best to have an array of arrays so that you can simply determine how many sections one has by sending a messa...
[ 0.11739476025104523, 0.19676436483860016, 0.43025100231170654, -0.09175113588571548, 0.02780953422188759, 0.52676922082901, -0.07154838740825653, 0.08152429759502411, -0.183505117893219, -0.619920015335083, 0.14978939294815063, 0.1579464077949524, -0.20626123249530792, -0.11692932993173599...
the tableView. An example is the following: ``` { name: "bob", location: 3 } { name: "jane", location: 50 } { name: "chris", location: 3 } ``` In this case I'd have an array with two subarrays. The first subarray would have two dictionaries containing bob and chris since they're both part of location 3....
[ 0.07642801105976105, 0.3314037322998047, 0.28611335158348083, 0.1542891263961792, 0.03903874754905701, 0.30091944336891174, 0.12985087931156158, 0.1518447995185852, -0.44560712575912476, -0.6697399616241455, -0.05574452877044678, 0.2443869709968567, -0.0714019164443016, 0.05492130294442177...
I need to further clarify. The following code works: (**edit:** added my initialization code) ``` NSArray * arrayOfRecords = [NSArray arrayWithObjects: [NSDictionary dictionaryWithObjectsAndKeys: @"bob", @"name", [NSNumber numberWithInt:3], @"location", nil], [NSDictionary dictionaryWithObjectsAn...
[ 0.15386931598186493, 0.2411833107471466, 0.37023091316223145, -0.22962141036987305, 0.08924207836389542, 0.15796002745628357, 0.5423207879066467, -0.3706962466239929, -0.20725117623806, -0.4891124665737152, -0.07472587376832962, 0.3961813449859619, -0.09472369402647018, 0.06579739600419998...
= [record valueForKey:@"location"]; NSMutableArray * rows = [sections objectForKey:key]; if (rows == nil) { [sections setObject:[NSMutableArray arrayWithObject:record] forKey:key]; } else { [rows addObject:record]; } } NSArray * sortedKeys = [[sections allKeys] sortedArrayU...
[ -0.15616582334041595, -0.33620309829711914, 0.1044570654630661, -0.15285459160804749, 0.08349312096834183, 0.03731021285057068, 0.23676609992980957, -0.2983015477657318, -0.6051966547966003, -0.1410365253686905, -0.4354571998119354, 0.1556689739227295, -0.23164883255958557, 0.4108086824417...
I am writing a multi-threaded Windows application in Microsoft Visual C# 2008 Express Edition. Recently, the debugger has been acting strangely. While I am Stepping Over lines of code using the F10, sometimes it will interpret my Step Over (F10) command just like a Continue command (F5) and then the program will resum...
[ -0.08719954639673233, 0.30663129687309265, 0.369304895401001, -0.06619026511907578, -0.22292162477970123, -0.09630822390317917, 0.6188222169876099, 0.0989726260304451, -0.10539491474628448, -0.39833369851112366, 0.021444210782647133, 0.5109864473342896, -0.21198958158493042, -0.02988634072...
line that is different each time I run the debugger. It's not a problem with my keyboard: the same thing happens when I just click Step Over in the Debug toolbar. It may be a problem with the other threads in my program. Maybe one of them is randomly doing something that has a side effect of interrupting the debugger...
[ 0.11484181880950928, -0.29548338055610657, 0.43471747636795044, 0.1540425419807434, -0.023413555696606636, 0.06331802904605865, 0.44155481457710266, 0.24627414345741272, -0.2572552263736725, -0.42636838555336, 0.08208569884300232, 0.3791787624359131, -0.3258790671825409, 0.331245481967926,...
main branch and VS2010 shipped with the exact same problems. This got corrected again by its Service Pack 1.
[ -0.08563218265771866, -0.6312456727027893, 0.349026620388031, 0.23073790967464447, -0.16079585254192352, 0.18075813353061676, 0.4654505252838135, 0.07962914556264877, -0.24979597330093384, -0.20038211345672607, -0.3546181917190552, 0.22577551007270813, -0.4014863073825836, -0.2710211277008...
I want to do this in Actionscript: ``` typeof(control1) != typeof(control2) ``` to test if two objects are of the same type. This would work just fine in C#, but in Actionscript it doesnt. In fact it returns `'object'` for both `typeof()` expressions because thats the way Actionscript works. I couldn't seem to find...
[ 0.1589387059211731, -0.07652320712804794, 0.09524353593587875, 0.0006494103581644595, -0.20456869900226593, -0.09746262431144714, 0.12744595110416412, -0.20794792473316193, 0.004608338698744774, -0.6508798003196716, 0.07819601893424988, 0.5780812501907349, -0.5415623188018799, -0.129726305...
I am building a small device with its own CPU (AVR Mega8) that is supposed to connect to a PC. Assuming that the physical connection and passing of bytes has been accomplished, what would be the best protocol to use on top of those bytes? The computer needs to be able to set certain voltages on the device, and read bac...
[ 0.33883872628211975, -0.1576615869998932, 0.41112831234931946, 0.4507526457309723, -0.01772971637547016, -0.1035642996430397, -0.00035117901279591024, 0.11888764798641205, -0.2975659966468811, -0.374224990606308, 0.05399201437830925, 0.7485049366950989, -0.30252182483673096, 0.145617738366...
you have. There is lots of code/tools out there and adherence to a standard could mean easy reuse later. It also support human readable ASCII so it is still easy to understand/test. See [FreeModBus](http://www.freemodbus.org/) for windows and embedded source.
[ 0.8095211982727051, 0.06767300516366959, -0.13116486370563507, 0.323329359292984, 0.28793713450431824, -0.9079259037971497, -0.08218346536159515, 0.11828994750976562, -0.19949021935462952, -0.6946592330932617, -0.25178787112236023, 0.6370764970779419, -0.13032323122024536, -0.0049247341230...
While accessing a webservice which is availbale at <http://recpushdata.cyndigo.com/jobs.asmx>, I am getting this Exception. "Remote name could not be resolved" Any Suggesytion..what to do.. The server error you got in the previous comment is good - it means your original problem, being unable to resolve the remote hos...
[ -0.20478522777557373, 0.01114112138748169, 0.23822841048240662, 0.14449256658554077, 0.1425085812807083, -0.2609935998916626, 0.4881425201892853, 0.4704512357711792, -0.5463666915893555, -0.8759920597076416, -0.2293316125869751, 0.4376536011695862, -0.01855533756315708, 0.2813895046710968,...
I'm converting some Actionscript code from AS2 tp AS3, and I've eventually managed to get most of it to work again (it's allmost a totally different language, sharing just a little syntax similarity). One of the last things that still doesn't work, is the code for loading an external image. Perhaps this has changed in...
[ 0.06033117324113846, 0.10496252030134201, 0.5090669989585876, 0.15417760610580444, -0.2884044349193573, -0.08588941395282745, 0.27428239583969116, 0.0965380147099495, -0.4335022270679474, -0.71261066198349, 0.0854259505867958, 0.5916905999183655, -0.17858748137950897, 0.1259099841117859, ...
what I've found is a pretty complex code that is said to replace this oneliner `imageholder.loadVideo(url);` is this: ``` var urlreq:URLRequest = new URLRequest(url); var theloader:Loader = new URLLoader(); theloader.load(urlreq); theloader.addEventListener(Event.COMPLETE, function(event:Event):void { imagehol...
[ 0.21696536242961884, 0.0036397746298462152, 0.7626040577888489, -0.1918904036283493, -0.10070943832397461, -0.24325810372829437, 0.2889890968799591, -0.32023635506629944, -0.06050053611397743, -0.7798902988433838, -0.22485317289829254, 0.8086305260658264, -0.30535903573036194, 0.1645372658...
needs to go... }); imageLoader.load(new URLRequest('yourImage.jpg')); ``` ... can you extrapolate from there to loading a list of images? Run that code in for-loop, each time assign a different variable (place in an array, perhaps, or property of an object) to your newly loaded e.target.content so you can access it o...
[ 0.1873718649148941, -0.3701861798763275, 0.5696964263916016, -0.044138211756944656, 0.08256607502698898, -0.14612361788749695, 0.18688195943832397, -0.07883908599615097, -0.11600029468536377, -0.759505569934845, -0.21785500645637512, 0.7062569856643677, -0.4870254099369049, 0.1576236188411...
This is pretty trivial, but I noticed on SO that instead of an offset they are using page numbers. I know the difference is minor (multiply the page number by rows on a page or divide offset by rows on a page), but I'm wondering if one is recommended over the other. Some sites, like Google, of course use a more compli...
[ 0.499846488237381, 0.02872573770582676, 0.21566183865070343, 0.3607026934623718, -0.058726754039525986, -0.2421935349702835, -0.26989415287971497, -0.0576087087392807, -0.43108025193214417, -0.627301812171936, 0.2796038091182709, 0.47180238366127014, -0.1499103605747223, -0.072310805320739...
coding is easy.
[ 0.6657425761222839, 0.20660798251628876, -0.3695160448551178, 0.1716785877943039, 0.13023051619529724, -0.20120330154895782, -0.11681486666202545, 0.33345794677734375, -0.07846544682979584, -0.6556275486946106, -0.3397775888442993, 0.42137181758880615, 0.015216278843581676, -0.370038032531...
How to filter my datagridview by the value of my label.text on click event? That value is from my linq query: ``` dataSet.Tables[0].AsEnumerable().Where(c => c.Field<int>("ageColumn") > 3 && c.Field<int>("ageColumn") < 5).Count(); ``` Let's just say the above query gives me 12 (label.text = 12), now when I clic...
[ 0.3204086124897003, -0.17291228473186493, 0.5024139285087585, -0.2221352756023407, 0.007728180382400751, 0.16073988378047943, 0.02747010625898838, -0.4573727250099182, -0.26456958055496216, -0.6969603896141052, 0.10421550273895264, 0.4961037337779999, -0.3388561010360718, 0.107488140463829...
= clause; ``` ... then re-evaluate your query when the label is clicked: ``` var clause = (sender as Label).Tag as Predicate<DataColumn>; myDataSource = dataSet.Tables[0].AsEnumerable().Where(clause); ``` I don't know if this would work, but at least it would let you "attach" a where-clause to various lables. I'...
[ 0.25782448053359985, -0.015505141578614712, 0.47807931900024414, -0.028274858370423317, -0.07944847643375397, -0.332670122385025, 0.39968329668045044, -0.3327709138393402, -0.1310187131166458, -0.4633801579475403, -0.39532020688056946, 0.411082923412323, -0.3971138298511505, 0.134467214345...
In my application I have a `Customer` class and an `Address` class. The `Customer` class has three instances of the `Address` class: `customerAddress`, `deliveryAddress`, `invoiceAddress`. **Whats the best way to reflect this structure in a database?** * The straightforward way would be a customer table and a separat...
[ 0.10413198173046112, 0.3416745662689209, 0.6268981099128723, -0.14589738845825195, 0.04005298763513565, 0.472239226102829, 0.058510977774858475, -0.10907404869794846, -0.004882862791419029, -0.8869886994361877, 0.058812957257032394, 0.42799776792526245, -0.2227308303117752, 0.2498601824045...
this is OK: ``` CREATE TABLE Customer ( ID int not null IDENTITY(1,1) PRIMARY KEY, Name varchar(60) not null, customerAddress int not null CONSTRAINT FK_Address1_AddressID FOREIGN KEY References Address(ID), deliveryAddress int null CONSTRAINT FK_Address2_AddressID FOREIGN KEY Refer...
[ -0.4344490170478821, 0.43788424134254456, 0.7279207110404968, -0.23378890752792358, -0.007163072936236858, 0.33431994915008545, -0.05722189322113991, -0.29047176241874695, -0.1457647979259491, -0.4951964020729065, -0.17585064470767975, 0.062415435910224915, -0.2571093738079071, 0.467579603...
not null IDENTITY(1,1) PRIMARY KEY, Street varchar(120) not null -- etc ) ``` Otherwise I would model like this: ``` CREATE TABLE Customer ( ID int not null IDENTITY(1,1) PRIMARY KEY, Name varchar(60) not null -- etc ) CREATE TABLE Address ( ID int not null IDENTITY(1,1) PRIMARY KEY, Cus...
[ -0.12472153455018997, 0.2278880923986435, 0.7188301682472229, 0.02907903864979744, -0.0903884693980217, 0.4982151389122009, -0.11444487422704697, -0.22797398269176483, -0.1026117354631424, -0.5000187158584595, -0.1112818568944931, 0.26227790117263794, -0.39247286319732666, 0.21806110441684...
I am working on an app with an NSTextView. When I paste random bytes into it (say, from a compiled C program) it displays gibberish, as it should. However, when I -setShowsControlCharacters:YES, the same causes a crash and gives the following error multiple times: `2008-11-22 00:27:22.671 MyAppName[6119:10b] *** -[NSB...
[ 0.13211333751678467, 0.44941648840904236, 0.10944749414920807, -0.033629171550273895, 0.014366090297698975, -0.057672806084156036, 0.6897217631340027, 0.2393837571144104, -0.22776220738887787, -0.7034323215484619, -0.10022080689668655, 0.6035868525505066, -0.2871725559234619, 0.16125471889...
familiar with the debugger built in to Xcode. If anyone could point me in the right direction in terms of how to track down such a bug I would be very grateful. Thanks. Another set of useful breakpoints to set when your debugging Cocoa apps are `objc_exception_throw` and `-[NSException raise]`. In 10.5, all exceptions ...
[ 0.08237338066101074, 0.24245190620422363, -0.06530054658651352, 0.024927768856287003, -0.32022398710250854, -0.15528053045272827, 0.5055449604988098, 0.369019478559494, -0.49899357557296753, -0.7710169553756714, -0.08664050698280334, 0.6371585130691528, -0.38489389419555664, -0.09313628077...
If I set the platform flags of MyApp.exe to be x64 I still can run the corflags utilty like this: corflags /32bit+ MyApp.exe corflags will happily set the 32bit flag to 1. Of course when I'll try to run the application I'll get an error: 0xC000007B = `STATUS_INVALID_IMAGE_FORMAT` My question is: Is there a way...
[ 0.09159072488546371, 0.25269895792007446, 0.4992082417011261, -0.12974391877651215, -0.06940252333879471, -0.0032733893021941185, 0.2804649770259857, -0.28552019596099854, -0.43637144565582275, -0.7908931374549866, 0.06391653418540955, 0.598250687122345, -0.35662728548049927, 0.03336292877...
by using the [Dependency Walker](http://www.dependencywalker.com/), for instance. Having a 64Bits PE header does seem to take precedence over the 32 bits only corflags. The win32 bootstrapper for .NET seems to see that the PE header is not compatible with the current system (64 bits on a 32 bits system). That prevents...
[ 0.3465486764907837, -0.04043097794055939, 0.062385644763708115, 0.03390597552061081, -0.06973228603601456, -0.34908342361450195, 0.3769271969795227, -0.1846732199192047, -0.13285382091999054, -0.8164145946502686, -0.061658553779125214, 0.7591423392295837, -0.4433724582195282, 0.04527228325...
blog post](http://blogs.msdn.com/kstanton/archive/2004/03/31/105060.aspx))
[ 0.012966805137693882, -0.13878777623176575, -0.0010536153567954898, 0.11543714255094528, -0.01514104288071394, -0.08370860666036606, 0.22620730102062225, 0.14455726742744446, -0.26673653721809387, -0.14072075486183167, -0.1875849813222885, 0.14380806684494019, -0.03754056245088577, 0.14874...
How can you convert a byte array to a hexadecimal string and vice versa? You can use [`Convert.ToHexString`](https://learn.microsoft.com/en-us/dotnet/api/system.convert.tohexstring) starting with .NET 5. There's also a method for the reverse operation: [`Convert.FromHexString`](https://learn.microsoft.com/en-us/dot...
[ -0.016731511801481247, -0.278072714805603, 0.48906800150871277, -0.21165642142295837, -0.12075275927782059, 0.018784042447805405, 0.2370290458202362, -0.41092830896377563, -0.39311957359313965, -0.5325760841369629, -0.23143497109413147, 0.5586366057395935, -0.38694873452186584, 0.067614920...
bytes = new byte[NumberChars / 2]; for (int i = 0; i < NumberChars; i += 2) bytes[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16); return bytes; } ``` --- Using `Substring` is the best option in combination with `Convert.ToByte`. See [this answer](https://stackoverflow.com/a/26304129) for more information. ...
[ -0.015917258337140083, -0.20079556107521057, 0.33587101101875305, -0.18521033227443695, -0.007850488647818565, 0.19865934550762177, 0.3930600583553314, -0.2819708287715912, -0.43026676774024963, -0.548317015171051, -0.33721891045570374, 0.7482465505599976, -0.3323846161365509, 0.2381861656...
When using the [pImpl idiom](http://en.wikipedia.org/wiki/Pimpl_idiom) is it preferable to use a `boost:shared_ptr` instead of a `std::auto_ptr`? I'm sure I once read that the boost version is more exception friendly? ``` class Foo { public: Foo(); private: struct impl; std::auto_ptr<impl> impl_; }; class...
[ -0.12353190034627914, 0.03420768678188324, 0.3829699456691742, -0.11953019350767136, -0.0683702826499939, 0.10559296607971191, 0.163793683052063, -0.17038576304912567, -0.21939732134342194, -0.13835491240024567, -0.24895738065242767, 0.8819040060043335, -0.6016916632652283, -0.336005598306...
be called properly. This is assuming that you are forward declaring your pImpl class, and creating the instance inside the constructor in another file. If you use [boost::scoped\_ptr](http://www.boost.org/doc/libs/1_37_0/libs/smart_ptr/scoped_ptr.htm) (no need for shared\_ptr here, you won't be sharing the pimpl with ...
[ 0.14900746941566467, -0.027974776923656464, 0.5993196964263916, -0.11972035467624664, -0.1880679726600647, -0.14022423326969147, 0.366798996925354, -0.42910248041152954, -0.15807409584522247, -0.5451565980911255, -0.24131737649440765, 0.834983766078949, -0.5034762620925903, -0.102921560406...
At the point where the auto\_ptr destructor is instantiated, Pimpl is an incomplete type. So in to the auto\_ptr destructor when it deletes the the Pimpl object, it won't know how to call the Pimpl destructor. boost::scoped\_ptr (and shared\_ptr) don't have this problem, because when you call the constructor of a scop...
[ -0.17911483347415924, -0.10528574883937836, 0.538879930973053, -0.16725698113441467, -0.31959450244903564, -0.18436957895755768, 0.17367561161518097, -0.4011708199977875, -0.3416738510131836, -0.3988403379917145, -0.1770179569721222, 0.581214189529419, -0.4845176637172699, 0.02816526778042...
you can use for it for things like GDI handles or whatever else you may want - but that's overkill for your needs here. If you really want to use std::auto\_ptr, then you need to take extra care by making sure you define your MyClass destructor in MyClass.cpp when Pimpl is fully defined. ``` // in MyClass.h class Pi...
[ -0.01582152582705021, -0.0107858432456851, 0.6104838252067566, 0.004466522950679064, -0.015693750232458115, 0.18643036484718323, 0.2558545470237732, -0.1210232600569725, -0.30455973744392395, -0.8304616808891296, -0.17400996387004852, 0.5848836302757263, -0.4205067455768585, -0.01191270351...
MyClass members effectively 'in' the empty destructor. So at the point the auto\_ptr destructor is instantiated, Pimpl is no longer incomplete and the compiler now knows how to call the destructor. Personally, I don't think it's worth the hassle of making sure everything is correct. There's also the risk that somebody...
[ 0.045589081943035126, 0.13746988773345947, 0.4696093499660492, -0.06404871493577957, -0.06798432022333145, 0.019567428156733513, 0.6303934454917908, 0.1908608227968216, -0.08119947463274002, -0.43196189403533936, -0.20519110560417175, 0.5218083262443542, 0.014877448789775372, 0.36328032612...
I'm looking for a production quality bloom filter implementation in Python to handle fairly large numbers of items (say 100M to 1B items with 0.01% false positive rate). [Pybloom](http://www.imperialviolet.org/pybloom.html) is one option but it seems to be showing its age as it throws DeprecationWarning errors on Pyt...
[ 0.119303859770298, -0.31377625465393066, 0.16994425654411316, 0.15020594000816345, -0.08994722366333008, 0.12151584029197693, 0.012298359535634518, 0.008852045983076096, -0.13203349709510803, -0.7044534087181091, 0.20486320555210114, 0.5023501515388489, -0.23587413132190704, -0.17808051407...
handle ~16E9 bits? Eventually I found [pybloomfiltermap](http://github.com/axiak/pybloomfiltermmap). I haven't used it, but it looks like it'd fit the bill.
[ 0.16076335310935974, 0.03304310888051987, 0.4768866300582886, 0.11465591937303543, -0.3626502752304077, 0.15827767550945282, 0.09546510875225067, -0.10455267876386642, -0.27672556042671204, -0.27745574712753296, 0.020363466814160347, 0.2020176351070404, 0.007498966995626688, 0.070395201444...
I have a Java application and I would like to make it extensible. To create an extension, developers within our company will write a Java class that implements a certain interface. They may also wish to write associated helper classes. I would like to load these extensions into the application without an outage. I wou...
[ 0.4485119581222534, 0.1558534950017929, 0.041731514036655426, -0.18011155724525452, 0.0515778511762619, -0.1187722310423851, 0.2094113528728485, -0.24106933176517487, -0.07204649597406387, -0.610948920249939, 0.00527976593002677, 0.5399607419967651, -0.42255744338035583, 0.0839895457029342...
get the job done). When the class is invoked the API object that is passed in will already have a "customer" defined and stored as a member variable. It will use this to limit access via the API to that customer's data. I do not want these classes doing things such as accessing the database, writing to disk, or other...
[ 0.5823042392730713, 0.00392328854650259, 0.2155945897102356, -0.10799598693847656, 0.14373420178890228, 0.03426602482795715, 0.4225849211215973, -0.3489755392074585, -0.24656516313552856, -0.5457358360290527, 0.015420334413647652, 0.7806949019432068, -0.21699665486812592, 0.022844277322292...
need to look for anything exotic. Handling this scenario is a fundamental feature of the Java security architecture. Every class has a "codebase", the location from which it was loaded. So if you package each extension in a separate JAR (or exploded in a separate directory), you'll be able tailor the permissions grant...
[ 0.33945783972740173, -0.14194604754447937, 0.1018158420920372, 0.016313986852765083, 0.33072006702423096, -0.3861009180545807, 0.10146951675415039, -0.2722978889942169, -0.2723647952079773, -0.6473913788795471, -0.27322518825531006, 0.3108431398868561, -0.3771584630012512, 0.34723219275474...
"/path/to/app/-", "read"; permission java.io.FilePermission "/path/to/app/data/-", "read,write,delete"; }; grant codeBase "file:/path/to/app/ext/*" { permission java.util.PropertyPermission "java.io.tmpdir", "read"; permission java.io.FilePermission "${java.io.tmpdir}/myapp/-", "read,write,delete"; }; ``` This...
[ 0.22382934391498566, 0.195424422621727, 0.6160415410995483, 0.05236721783876419, 0.18397097289562225, -0.3624333143234253, 0.4207361340522766, -0.5567591786384583, -0.2920039892196655, -0.29533880949020386, -0.6517521142959595, 0.3635016977787018, -0.09116934984922409, 0.11860784143209457,...
What are the hidden features of Maven2? You can use the settings.xml to force ALL maven builds running on your local machine to also use a locally installed maven proxy. Saving yourself and the network time. ``` <settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-insta...
[ -0.18684524297714233, -0.10110458731651306, 0.49600228667259216, -0.23300950229167938, 0.0069237095303833485, -0.067144975066185, 0.6086925268173218, -0.38749656081199646, -0.23759737610816956, -0.85539710521698, -0.02361241541802883, 0.6527020931243896, -0.34419283270835876, 0.03563340380...
</activation> <repositories> <repository> <id>localCacheProxy</id> <url>http://my-local-proxy.com/maven-proxy</url> </repository> </repositories> </profile> </profiles> ``` Note that the namespace headings in this settings.xml also gives a d...
[ -0.17436039447784424, -0.0387059822678566, 0.3963107764720917, 0.09124952554702759, 0.02447088062763214, -0.14856350421905518, 0.19655634462833405, 0.31274664402008057, -0.07590083032846451, -0.9226195812225342, -0.4112328290939331, 0.3354412019252777, 0.13648909330368042, 0.14825375378131...
here. (create in your home directory .m2 folder on windows, linux and mac and all os'es)
[ 0.1525973677635193, 0.06676095724105835, -0.027574965730309486, 0.012304640375077724, 0.3664764165878296, -0.07522855699062347, 0.14354729652404785, 0.3834114670753479, -0.4912019968032837, -1.0037672519683838, -0.30824047327041626, 0.3746430277824402, -0.17266644537448883, 0.2806585431098...
Okay, I have a FormView with a couple of child controls in an InsertItemTemplate. One of them is a DropDownList, called DdlAssigned. I reference it in the Page's OnLoad method like so: ``` protected void Page_Load(object sender, EventArgs e) { ((DropDownList)FrmAdd.FindControl("DdlAssigned")).SelectedValue = ...
[ 0.25830069184303284, -0.19653603434562683, 0.7842438220977783, -0.041351381689310074, 0.182053804397583, -0.024241792038083076, 0.037883833050727844, -0.0621090866625309, -0.16034480929374695, -0.8497159481048584, -0.020993242040276527, 0.5285521745681763, -0.14708222448825836, 0.208900868...
and done nothing's different on the page. I figured it out. I'm still missing exactly why it doesn't work just on FormLoad, but performing the change in the FormView's DataBound event does the trick. ``` protected void FrmAdd_DataBound(object sender, EventArgs e) { // This is the same code as before, but done in t...
[ 0.20042996108531952, -0.22066476941108704, 0.6710676550865173, -0.0793403685092926, 0.14636388421058655, -0.29238444566726685, 0.4266263544559479, -0.30729940533638, -0.4250839054584503, -0.631828248500824, -0.32474085688591003, 0.7547334432601929, -0.17388057708740234, 0.15148107707500458...
bound.
[ -0.04518473148345947, 0.24879854917526245, 0.22776919603347778, 0.2262607216835022, 0.0020826703403145075, -0.35697686672210693, 0.1145310327410698, -0.40363141894340515, -0.39063596725463867, -0.516542375087738, -0.4410030245780945, -0.14680132269859314, -0.3907761573791504, 0.28029251098...
I am trying to come up with a best practices on project directory structure. my latest thought is that there should be no classes in the root directory of a project. All classes must go under one of the following directories * UI * BusinessObjects * BusinessLogic * DataAccess i would like to hear other people though...
[ 0.6455287933349609, -0.005127237644046545, 0.16757570207118988, 0.23832866549491882, -0.05586616322398186, 0.07262078672647476, -0.047993503510951996, 0.17840413749217987, -0.21547488868236542, -0.6082836985588074, -0.0765356570482254, 0.2723069190979004, -0.14282183349132538, 0.3592460155...
to be inside of one of the projects. I've added an example: * Solution: ProjectName + Project: DAL (Namespace: ProjectName.DAL) - Folder: Repositories (Namespace: ProjectName.DAL.Repositories) - Folder: Contracts (Namespace: ProjectName.DAL.Contracts) - Files: Your Entity Mapping configuration + Project: BLL...
[ 0.09359735995531082, -0.15780696272850037, 0.4982934892177582, 0.1767042875289917, -0.045988764613866806, 0.13488851487636566, -0.16672509908676147, -0.34118354320526123, -0.28780752420425415, -0.6537622809410095, -0.342044472694397, -0.03276164084672928, 0.08851800858974457, -0.0358789116...
a name relative to your application.
[ 0.3152421712875366, 0.23667286336421967, 0.2387460619211197, 0.04242558032274246, -0.046176642179489136, -0.09611938148736954, -0.06774609535932541, -0.009059562347829342, -0.2954352796077728, -0.35648781061172485, -0.0791221559047699, 0.11088626831769943, 0.1637323498725891, 0.17245222628...
If have a set of classes that all implement an interface. ``` interface IMyinterface<T> { int foo(T Bar); } ``` I want to shove them all in a list and enumerate through them. ``` List<IMyinterface> list foreach(IMyinterface in list) // etc... ``` but the compiler wants to know what T is. Can I do this?...
[ 0.12006860226392746, 0.32232335209846497, 0.23724563419818878, -0.149145245552063, -0.37220320105552673, 0.10387690365314484, 0.1623353213071823, -0.6797410249710083, 0.23685605823993683, -0.7489413619041443, -0.06110899895429611, 0.47851765155792236, -0.9716012477874756, 0.257193714380264...
you would like to use in the foreach loop to the IMyinterface definition.
[ 0.24854739010334015, 0.2070932239294052, 0.09776219725608826, -0.04400046169757843, -0.05486876890063286, -0.005991965997964144, 0.03442664071917534, -0.006143647246062756, 0.10837458819150925, -0.6606791615486145, -0.01399066112935543, 0.4017608165740967, -0.1308852583169937, -0.034784771...
I need a fast container with only two operations. Inserting keys on from a very sparse domain (all 32bit integers, and approx. 100 are set at a given time), and iterating over the inserted keys. It should deal with *a lot of* insertions which hit the same entries (like, 500k, but only 100 different ones). Currently, I...
[ -0.13643990457057953, 0.06291934102773666, 0.33557358384132385, 0.1547241061925888, -0.0032305840868502855, -0.06212439760565758, 0.06121043860912323, -0.04746565222740173, -0.08612177520990372, -0.8728154301643372, 0.04782857000827789, 0.5259602069854736, -0.29705414175987244, -0.01076087...
you might be able to get some improvement without changing the structure. If you tend to get a lot of runs of a single value, then you can probably speed up insertions by keeping a record of the last value you inserted, and don't bother doing the insertion if it matches. It costs an extra comparison per input, but sav...
[ 0.6640568375587463, -0.22030283510684967, -0.17566648125648499, 0.36377501487731934, 0.15248125791549683, 0.2177736461162567, 0.05704571679234505, -0.3172995448112488, -0.45286795496940613, -0.4033639430999756, 0.21849146485328674, 0.42194435000419617, -0.16420197486877441, -0.046169470995...
but you tend to find that values aren't evenly distributed, then a splay tree makes accessing the most commonly-used elements cheaper. It works by creating a deliberately-unbalanced tree with the frequent elements near the top, like a Huffman code.
[ -0.013879649341106415, -0.17317752540111542, -0.020625729113817215, 0.4241502583026886, -0.009337393566966057, -0.10100670903921127, -0.014152692630887032, -0.25529155135154724, -0.20576442778110504, -0.32022473216056824, -0.0878748893737793, 0.2245127260684967, -0.4929104447364807, -0.124...
I need to extract multiple text/dropdown list fields from an asp.net form and format appropriately ready for sending to recipient via email. What's the best way of reading those fields without having to hard code each item such as: ``` item1 = InputField1.Text; item2 = InputField2.Text; ``` I will have about 10 ...
[ 0.4832901060581207, 0.08198899775743484, 0.5885728001594543, 0.1554403305053711, -0.0309214498847723, 0.25794944167137146, -0.01519628707319498, -0.3903132975101471, -0.2792107164859772, -0.6409590840339661, -0.07473010569810867, 0.37884053587913513, -0.10094977170228958, -0.08353871107101...
placed there for you by the framework. Perhaps use a naming scheme like "Email.FirstName", "Email.LastName", "Email.Address", then you can do: ``` foreach (string key in Request.Form.Keys) { if (key.StartsWith("Email.")) { ...Process this key... } } ``` Note: if the page u...
[ 0.11885269731283188, 0.05422331020236015, 0.4750426411628723, -0.026272550225257874, -0.2172292172908783, -0.22383815050125122, 0.4472518265247345, -0.15827031433582306, -0.14481976628303528, -0.8286066651344299, -0.08027652651071548, 0.32247358560562134, -0.38433724641799927, 0.3110489249...
Is there an alternative to history.go(-1) for FireFox and Safari. Any Help would be greatly appreciated. You can use `history.back()`.
[ 0.17681501805782318, -0.21407197415828705, -0.12217797338962555, 0.18625609576702118, 0.007750095799565315, -0.34249332547187805, 0.039045028388500214, 0.20175129175186157, -0.4296022355556488, -0.5937179327011108, -0.2184043824672699, 0.5722668170928955, -0.3854970932006836, -0.1136035248...
I'm assigned to a project where my code is supposed to perform uploads and downloads of some files on the same FTP or HTTP server simultaneously. The speed is measured and some conclusions are being made out of this. Now, the problem is that on high-speed connections we're getting pretty much expected results in terms...
[ 0.11374663561582565, 0.08832044899463654, 0.11298489570617676, 0.21785862743854523, 0.1700325906276703, -0.2633558511734009, -0.045975200831890106, -0.07324787229299545, -0.36522576212882996, -0.6915586590766907, -0.0005556463147513568, 0.5049237012863159, -0.11209215968847275, -0.02973274...
with equivalent speeds (~100 kbps in each direction) on this link. My measurements show that without heavy tweaking the code in terms of buffer sizes and data link throttling it's not possible to have same speeds in forementioned conditions. I tried both my multithreaded code and also created a simple batch file that ...
[ 0.08593150973320007, -0.11466193199157715, 0.4799855947494507, 0.30768272280693054, -0.008661167696118355, 0.1420925259590149, 0.1430560201406479, -0.08385206758975983, -0.3656664788722992, -0.8151741027832031, 0.0970880314707756, 0.7134237289428711, -0.0663711428642273, -0.131210252642631...
do with my code in order to achieve such throughput? PS. I completely re-wrote the question, so it would be obvious it belongs to this site. CDMA 1x consists of up to 15 channels of 9.6kbps traffic. This results in a total throughput of 144kbps. Two channels are used for command and control signals (talking to base s...
[ 0.4614959955215454, -0.24206267297267914, 0.4358648359775543, 0.26856398582458496, -0.22363075613975525, -0.06185740977525711, 0.1942451447248459, -0.09185867011547089, -0.326087087392807, -0.5676315426826477, -0.26392579078674316, 0.3815469443798065, -0.5357936024665833, -0.22639626264572...
than 120kbps total aggregate bandwidth. In practise, due to overhead of 1xRTT encoding, error correction, resends, etc, you'll typically experience between 60kbps and 90kbps even if you have all the channels possible. This means that you can probably only get 30kbps-60kbps of upload and download simultaneously. Furt...
[ 0.18615563213825226, -0.24653008580207825, 0.5381065011024475, 0.33991411328315735, -0.08844564110040665, -0.328055739402771, 0.3959280550479889, -0.21061596274375916, -0.342485249042511, -0.689233660697937, -0.19268710911273956, 0.6917026042938232, -0.14952363073825836, -0.057161197066307...
one way, but due to overhead, switching times, base station capacity, or the phone company simply limiting such connections for other reasons, you can't depend on a symmetrical link. NOTE: This will vary to some degree based on the provider and the modem. For instance, some modems have 16 channels, and some providers...
[ 0.3138800263404846, -0.1345539391040802, 0.5078274607658386, 0.4215368628501892, -0.035976942628622055, -0.016060661524534225, 0.3370398283004761, -0.19935226440429688, -0.5293021202087402, -0.7782208919525146, -0.30534982681274414, 0.26241958141326904, -0.21561594307422638, -0.03409000113...
overhead of the modem communications, then the overhead of PPP, then the overhead of IP, then the overhead of TCP, you're still looking at maybe 100-120kbps total bandwidth, both up and down. Lastly, no provider yet supports transparent transfer of IP traffic. In other words if you're modem is moving, the modem will s...
[ 0.0965467318892479, -0.283946692943573, 0.6482057571411133, 0.4914703369140625, -0.06340737640857697, -0.026655936613678932, -0.01808571070432663, 0.014296197332441807, -0.5511639714241028, -0.8700103759765625, -0.06794645637273788, 0.40566763281822205, -0.2678288519382477, 0.1741860061883...
twist is that this can happen even if you aren't moving. If one base station gets loaded down, you may be transferred to another base station if you are close enough - there are other things that may make your modem transfer even without you moving. So make sure you take this into account, since you seem to be keen on ...
[ 0.1809617131948471, -0.21710284054279327, 0.24737955629825592, 0.4508281350135803, 0.000058159028412774205, -0.24461938440799713, 0.1946377158164978, 0.0018708482384681702, -0.45183065533638, -0.2220059186220169, -0.056139957159757614, 0.23625491559505463, -0.10415089130401611, 0.270886600...
this - otherwise you won't get the documentation on how to control the modem chipset at the low level that you need. -Adam
[ 0.34315797686576843, 0.21719448268413544, 0.04665115103125572, 0.3568388819694519, 0.43061816692352295, 0.017775986343622208, -0.15199552476406097, -0.0050852661952376366, 0.00981849618256092, -0.1622183918952942, -0.27692702412605286, 0.5847762823104858, 0.1808648258447647, -0.00320708309...
Does anyone know where I can find an example of how to determine if the Maximize and/or Minimize buttons on a window are available and/or disabled? The window will not be in the same process as my application. I have the hWnd and I have tried using GetMenuItemInfo, but I can't find any good samples for how to do this....
[ 0.49712833762168884, 0.15285202860832214, 0.491158127784729, -0.17734798789024353, -0.12091077119112015, 0.02979469858109951, 0.0708816647529602, -0.19275790452957153, -0.05378805100917816, -0.8373095989227295, 0.18531668186187744, 0.807259738445282, -0.2507934272289276, -0.189188271760940...
I'm using hibernate 3 and want to stop it from dumping all the startup messages to the console. I tried commenting out the stdout lines in log4j.properties but no luck. I've pasted my log file below. Also I'm using eclipse with the standard project structure and have a copy of log4j.properties in both the root of the p...
[ 0.086871437728405, 0.18008609116077423, 0.5563535690307617, -0.17713473737239838, -0.5041463375091553, 0.12501536309719086, 0.6682611107826233, -0.33410510420799255, 0.09819630533456802, -0.7580376863479614, -0.15197618305683136, 0.7856152057647705, -0.3358827233314514, -0.0323705971240997...
parser activity #log4j.logger.org.hibernate.hql.ast.AST=debug ### log just the SQL #log4j.logger.org.hibernate.SQL=debug ### log JDBC bind parameters ### log4j.logger.org.hibernate.type=info #log4j.logger.org.hibernate.type=debug ### log schema export/update ### log4j.logger.org.hibernate.tool.hbm2ddl=debug ### log...
[ -0.20009231567382812, 0.5942227244377136, 0.3482236862182617, 0.04122995212674141, -0.224415585398674, 0.043382707983255386, 0.7036911845207214, -0.41105031967163086, -0.1266559362411499, -0.3844209611415863, -0.34863725304603577, 0.7002627849578857, -0.6334375739097595, -0.035952221602201...
I can follow most of Apple's WiTap sample, but am sort of stumped on this bit in the send method: ``` - (void) send:(const uint8_t)message { if (_outStream && [_outStream hasSpaceAvailable]) if([_outStream write:(const uint8_t *)&message maxLength:sizeof(const uint8_t)] == -1) [self _showAlert:@"Failed sen...
[ 0.002834308659657836, -0.09763165563344955, 0.7316890358924866, -0.3737851679325104, 0.03489657863974571, 0.2462785840034485, 0.6323525309562683, -0.33781057596206665, 0.0019500316120684147, -0.6804443597793579, -0.2675573527812958, 0.7722290754318237, -0.25594040751457214, -0.121545940637...
[self send:[view tag]]; } ``` Note that I have changed the send: argument to just the tag of the views, which are numbered 1-9. Originally the code had the bitwise AND and OR adjustments. WHY? I get the fact that the send method needs a `uint8_t`, but is that why the bitwise stuff is there? To turn a NSInteger in...
[ -0.028027718886733055, -0.10133316367864609, 0.5313692688941956, -0.0812019556760788, -0.304583877325058, 0.15846233069896698, 0.2510325312614441, -0.18157176673412323, -0.21496990323066711, -0.5695796012878418, 0.2530255615711212, 0.9547370076179504, -0.3838934302330017, 0.126127749681472...
doing? Or am I correct? Thanks! This is my first question to SO so please be kind. --- thanks for the response. I am still puzzled a bit. Get it? Basically, why? Is this just a geeky way of passing an identifier? Each of those views have a tag #, why not just pass that, and toggle the state (up/down) from the vie...
[ 0.6922256350517273, -0.03117365948855877, 0.015552992932498455, 0.4349052608013153, -0.25231194496154785, -0.16855496168136597, 0.18286046385765076, 0.21790899336338043, -0.015440331771969795, -0.2698890268802643, 0.18352551758289337, 0.2172084003686905, 0.20102086663246155, 0.068029679358...
to pass a tag # and then have that tag decide what to do in a clearly readable function like `toggleUpOrDownState` or something. This bitwise stuff always makes me feel stupid I guess, unless it is necessary, etc. Then I feel stupid but manage to muddle through somehow anyway. : ) Basically, `[view tag] | 0x80` is set...
[ 0.12479756772518158, -0.04692530259490013, 0.5009596347808838, 0.09613969922065735, 0.10096690058708191, -0.15374600887298584, 0.33715707063674927, -0.44141894578933716, 0.015418956987559795, -0.3073481619358063, -0.02263404056429863, 0.7393965125083923, -0.2376215010881424, -0.08038777858...
remote tap update, forward it to the appropriate view if(b & 0x80) [(TapView*)[_window viewWithTag:b & 0x7f] touchDown:YES]; else [(TapView*)[_window viewWithTag:b] touchUp:YES]; ``` So, the receiver of the stream is checking for that high bit.
[ -0.1759011298418045, -0.5482794046401978, 1.049420714378357, -0.05736741051077843, 0.10501544922590256, -0.23310783505439758, 0.2987307012081146, 0.02476673200726509, -0.011976775713264942, -0.5965679287910461, -0.222412109375, 0.7166298031806946, -0.23957398533821106, 0.06071191653609276,...
What is the difference between * A simple *fields-accesors-mutators* class * A rich-modeled class What constitutes rich modeling in business-domain classes? "Rich" as used here implies "rich behavior" (as opposed to state). There is technical behavior and domain behavior. *Accessors* and *mutators* are technical; th...
[ 0.2689429819583893, -0.34018248319625854, 0.38964080810546875, 0.4377591609954834, 0.26309895515441895, -0.09767685830593109, -0.139982208609581, -0.11777448654174805, -0.23718346655368805, -0.49619463086128235, -0.35601553320884705, 0.7090836763381958, -0.08661652356386185, 0.264935165643...
schedule and mark it. Model 1 is rich. The "why" (vacation time) encapsulates the "how" (marking the schedule). Model 2 relegates the manager to a simple property bag and leaks the scheduling abstraction.
[ 0.3970729112625122, -0.2727270722389221, 0.04410504922270775, 0.13385552167892456, 0.21759505569934845, -0.12624280154705048, -0.37508729100227356, -0.5198351740837097, -0.1504957526922226, -0.5143464207649231, -0.08370593935251236, 0.5303341746330261, -0.10610055178403854, 0.0658068209886...
This is my code: ``` import datetime today = datetime.date.today() print(today) ``` This prints: `2008-11-22` which is exactly what I want. But, I have a list I'm appending this to and then suddenly everything goes "wonky". Here is the code: ``` import datetime mylist = [] today = datetime.date.today() mylist.appe...
[ 0.18414349853992462, 0.09320523589849472, 0.6472283005714417, -0.17682549357414246, 0.05825626850128174, -0.2657145857810974, -0.23061688244342804, 0.12198343127965927, -0.3533255159854889, -0.37072327733039856, -0.10476263612508774, 0.5288306474685669, -0.30442988872528076, 0.112080633640...
time the most common human readable format and is used to ease display. So `str(datetime.datetime(2008, 11, 22, 19, 53, 42))` gives you `'2008-11-22 19:53:42'`. * The alternative representation that is used to represent the object nature (as a data). It can be get using the `repr()` function and is handy to know what k...
[ 0.1949377954006195, -0.052276261150836945, 0.7215846180915833, 0.09977434575557709, -0.05180777609348297, 0.09085250645875931, 0.010659917257726192, -0.052446600049734116, -0.5286630392074585, -0.7559113502502441, -0.22149503231048584, 0.39601340889930725, -0.2436172366142273, 0.3529720306...
when you have printed `mylist`, you have printed a list of objects and Python tried to represent the set of data, using `repr()`. The How: what do you want to do with that? ------------------------------------------ Well, when you manipulate dates, keep using the date objects all long the way. They got thousand of us...
[ 0.49578362703323364, 0.0289143156260252, 0.395734578371048, 0.0505245178937912, -0.13558782637119293, 0.0003324889694340527, -0.27884528040885925, 0.036567527800798416, -0.4715014696121216, -0.6191360950469971, 0.0968094915151596, 0.30650052428245544, -0.1198100745677948, 0.103573203086853...
tried to print the dates, you printed `mylist`. If you want to print a date, you must print the date objects, not their container (the list). E.G, you want to print all the date in a list : ``` for date in mylist : print str(date) ``` Note that ***in that specific case***, you can even omit `str()` because prin...
[ 0.24677300453186035, 0.1899845004081726, 0.8249430656433105, -0.13540147244930267, -0.06526684015989304, -0.1732795387506485, 0.12055616080760956, -0.11638445407152176, -0.5431402325630188, -0.4532926380634308, -0.17414967715740204, 0.42941388487815857, -0.2914349436759949, 0.2016443014144...
a new day : ", mylist[0] # will work >>> This is a new day : 2008-11-22 print "This is a new day : " + mylist[0] # will crash >>> cannot concatenate 'str' and 'datetime.date' objects print "This is a new day : " + str(mylist[0]) >>> This is a new day : 2008-11-22 ``` Advanced date formatting ----------------------...
[ 0.09344536066055298, -0.02629926986992359, 1.065085530281067, -0.032522790133953094, -0.06516449898481369, -0.13795241713523865, 0.05615318939089775, -0.12229865789413452, -0.16159294545650482, -0.7018356323242188, -0.21928557753562927, 0.5954474210739136, -0.328989714384079, 0.21591155230...
%Y') >>> 'We are the 22, Nov 2008' ``` All the letter after a `"%"` represent a format for something: * `%d` is the day number (2 digits, prefixed with leading zero's if necessary) * `%m` is the month number (2 digits, prefixed with leading zero's if necessary) * `%b` is the month abbreviation (3 letters) * `%B` is ...
[ 0.1946140080690384, 0.29177799820899963, 0.7083569169044495, -0.06500911712646484, -0.21964620053768158, 0.1534593105316162, 0.17713166773319244, 0.21418233215808868, -0.04856639355421066, -0.3325575590133667, -0.3052801787853241, 0.2214605063199997, 0.00901680439710617, 0.2181105762720108...
by the method format of any string. In the case of the datetime, the format is the same used in strftime. So you can do the same as above like this: ``` print "We are the {:%d, %b %Y}".format(today) >>> 'We are the 22, Nov 2008' ``` The advantage of this form is that you can also convert other objects at the same ti...
[ 0.388174831867218, -0.029617588967084885, 0.7965313792228699, -0.10093395411968231, -0.29674550890922546, -0.13811230659484863, 0.008745238184928894, 0.14506211876869202, -0.3125297427177429, -0.4746672213077545, -0.3053053319454193, 0.43793895840644836, -0.2731650173664093, 0.288691967725...
another question on SO(Stack Overflow) ;-)
[ -0.17704755067825317, -0.1031341403722763, 0.16777202486991882, 0.09435736387968063, 0.05830371752381325, -0.14926688373088837, 0.0536661259829998, -0.190364271402359, -0.28498777747154236, -0.33386531472206116, -0.2345142960548401, 0.3357437252998352, -0.28274595737457275, 0.0549689382314...
I'm loading an html snippet using ``` $("#TemplateDump").load("Themes/default.template", function() { processTemplate() }) ``` The html i am loading contains ``` <div> `hello ##name##, your age is ##age##. your page is <a href="##website##">here</a> </div> ``` I need to replace the ## placeholders with "joe","1...
[ 0.6348622441291809, 0.21110808849334717, 0.6081957221031189, -0.10712553560733795, 0.08817557245492935, -0.050137341022491455, 0.13925932347774506, -0.034615516662597656, -0.07582498341798782, -0.814450740814209, -0.006538738962262869, 0.21001100540161133, -0.15120269358158112, 0.153795614...
can be made internal to avoid consumers from interacting with it directly. ``` public class Foo { private IList<Bar> Bars {get;set;} public void AddBar(Bar bar) { Bars.Add(bar); bar.Foos.Add(this); } } public class Bar { internal IList<Foo> Foos {get;set;} } ```
[ 0.1173166036605835, 0.2871318459510803, 0.3878571391105652, -0.4875207841396332, 0.14737404882907867, 0.5403047800064087, 0.16950619220733643, -0.28036725521087646, -0.01199259702116251, -0.7313021421432495, -0.4345933198928833, 0.61540287733078, -0.8102177381515503, 0.10797680914402008, ...
I have a List< int[] > myList, where I know that all the int[] arrays are the same length - for the sake of argument, let us say I have 500 arrays, each is 2048 elements long. I'd like to sum all 500 of these arrays, to give me a single array, 2048 elements long, where each element is the sum of all the same positions ...
[ 0.0939725786447525, -0.03019283525645733, 0.5049581527709961, -0.24036327004432678, -0.032773226499557495, 0.3715697228908539, 0.14760452508926392, -0.9435378313064575, -0.5425748229026794, -0.46819254755973816, 0.07102048397064209, 0.18664105236530304, -0.12676510214805603, 0.014525751583...
sums[i] += array[i]; } } ``` But I was wondering if there was a nice Linq or Enumerable.xxx technique? Edit: Ouch...This became a bit harder while I wasn't looking. Changing requirements can be a real PITA. Okay, so take each position in the array, and sum it: ``` var sums = Enumerable.Range(0, myList[0].Length...
[ -0.05201013386249542, -0.11266321688890457, 0.6347955465316772, -0.2990906238555908, -0.18132314085960388, 0.21307040750980377, 0.01304614543914795, -0.8774160742759705, -0.31091031432151794, -0.3870295286178589, -0.06177689507603645, 0.30043914914131165, -0.2522036135196686, -0.0897080153...
).Sum() ); ``` That's kind of ugly...but I think the statement version would be even worse.
[ 0.16887547075748444, 0.37375155091285706, 0.07284057140350342, -0.28489696979522705, -0.46847817301750183, -0.2560798227787018, 0.4162718653678894, -0.023658202961087227, 0.23660102486610413, -0.306808739900589, -0.25418660044670105, 0.5328984260559082, -0.41254743933677673, 0.208803325891...