Browsing 7239 questions and answers with Jon Skeet
It looks like this is just a matter of getting the ID out of the truck - after all, your oddly-named AddJobOrder variable is presumably of type Truck or something similar. I suspect you just need something like: truck_no =... more 9/3/2015 6:08:23 AM
The a + b expression is using your custom operator - so it's as if you'd written (module constness - I'm just trying to get the flavour of what's going on): B c = a + b; cout << c; That doesn't work because the compiler can't find... more 9/3/2015 6:03:50 AM
The problem is that the binder will use the static type of the value you're trying to assign to the property - whereas you want to do this dynamically. All you need to do is change the variables to be of type dynamic and it works: dynamic... more 9/1/2015 4:40:48 PM
The problem is that you're testing against different IDs each time you evaluate the predicate. You don't need foos at all for this. You can just have: var bar = bars.First(b => b.ID == rng.Next(5) + 1); That will execute the... more 9/1/2015 3:07:18 PM
Type.GetField(string) only returns public fields. I suspect you want: FieldInfo fieldInfo = editorGUIType.GetField( "s_RecycledEditor", BindingFlags.NonPublic | BindingFlags.Static); more 9/1/2015 1:28:30 PM
You can import all the methods in Math: import static java.lang.Math.*; or just the one method you want: import static java.lang.Math.abs; Normal imports just import classes, making that class available via its short name. more 9/1/2015 1:14:37 PM
You can't handle the exception generated from one catch block in a catch block associated with the same try/catch statement. Instead, you need an extra one: catch (DivideByZeroException ext) { try { FileStream fs = new... more 9/1/2015 8:46:20 AM
I suspect it's feasible for a custom Chronology to return 0, but none of the "built-in" chronologies will do so, and certainly the common Gregorian/ISO chronologies won't. In other words, you'd only need to worry about this if you're... more 9/1/2015 8:37:51 AM
You're incrementing x twice, but on different dogs. Look at this code: public static void foo(Dog d) { ++d.x; d = new Dog("Taz"); ++d.x; } Initially, d refers to the dog with a name of Tom, with x=100. That isn't a copy of... more 9/1/2015 6:09:35 AM
You've got quotes round most of your parameters in the SQL, which means the other parameters won't be where you expect them to be. Your SQL should be: UPDATE Loads SET Customer=?, FinishTime=?, Carrier=?, Reference=?, Tags=?,... more 9/1/2015 6:00:12 AM