Browsing 7239 questions and answers with Jon Skeet
Basically, TotalPrice should be a Dictionary<string, Availability> or similar. It's not clear what list you'd have, but that's naturally a dictionary. That's then nested within a dictionary at the top level. Sample code: using... more 2/28/2017 11:32:49 AM
Look at the syntax for RaiseEvent: RaiseEvent eventname[( argumentlist )] It's not that RaiseEvent just accepts any arbitrary expression - you have to specify the name of an event. You'll just need to use a regular If statement: If... more 2/27/2017 2:42:02 PM
I'd be slightly surprised if the first version worked in C or C++, but then it does surprise me quite often. The reason it doesn't work in C# is that the left-hand side of the %= operator has to be a variable, and the expression ++index... more 2/25/2017 5:31:00 PM
I have already converted the above to hashmap. I would suggest you don't do that. I suggest you convert it to a List<Person> where each Person has a name, date and ID. (If not Person then some other class.) It makes more sense... more 2/25/2017 5:25:13 PM
You've got one directory too far when adding the library to the build path. The library should be showing up as TIJ4Code, in the Java directory. (Or in other words, when you choose "Add class folder" you should be choosing TIJ4Code, not... more 2/25/2017 12:53:58 PM
Yes, "the file designated by filename will be truncated" means that any data that previously existed in the file will be gone. This is a more general concept than just logging. Suppose you have a file initially containing the data... more 2/23/2017 10:29:22 AM
You're calling AbstractDuration.toPeriod: Converts this duration to a Period instance using the standard period type and the ISO chronology. Only precise fields in the period type will be used. Thus, only the hour, minute, second... more 2/22/2017 4:21:09 PM
It's just a keyword, the same as all the others. I don't think you can tell VS to highlight it differently to other keywords. more 2/21/2017 3:53:24 PM
The Where is lazily evaluated - you're never using the result of it, so the predicates are never being evaluated. You could force iteration by counting the results or similar: var ignored steps.Where(f => (x =... more 2/21/2017 3:36:25 PM
Is 1 too big to be stored in 2 bytes ? Well, an int is... putInt always writes 4 bytes. From the documentation for ByteBuffer.putInt Throws: BufferOverflowException - If there are fewer than four bytes remaining in this... more 2/21/2017 10:25:29 AM