Have you tried copying python code yet? They used tabs but you've got spaces and now there's red squiggles everywhere telling you really weird things about incomplete methods. It looks like it all lines up and you're not sure who had the tabs and who had the spaces so you're not sure what to change what to.
Wearwolf
Posts
-
Python is EVIL.... -
Design change...so just move the washer/dryer to the other wall?Programming is a good way to prove to yourself that everything you think you know about the universe is wrong. You think shifts are contiguous? Someone out there disagrees. The company I work for tracks vehicles and as part of that we record the VIN of the vehicle. The program was originally written to require VINs be unique but then we ran into a set of vehicles that lie and always say their VIN is 00000. So we had to go and remove the requirement that VINs be unique.
-
reading the threading chapter C# 7.0Does it talk about how to create an Asynchronous method using tasks? Most information I've found about async/await is about the caller, "You mark a method as async and then use await to call asynchronous methods". I haven't been able to find a lot on how one would actually go about writing an asynchronous method to be called by await.
-
Who vs WhomeI believe it's correct because it's a part of a noun phrase. "Those who code" is the object of the sentence but "who" isn't the object of the phrase.
-
Thanks for nothing Visual StudioThat's not that terrible of an error message. It's trying to tell you what you need to do to fix the issue. Although if I remember correctly they changed what level of logging was required to get the assembly load information. I got this exception the other day "Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints" from calling "EndLoadData" on a DataTable. Which constraint caused an issue? Which column? Which row? Who knows. The exception was coming from DataSet.EnableConstraints() which gets called by DataTable.EndLoadData(). I tried to use .NET source stepping but it wouldn't load DataSet.cs for some reason. Looking up the function in the .NET reference source I saw that the function loops through all constraints on a table and tries to enable them. Instead of throwing an exception when it found a constraint it couldn't enable it just kept a flag saying that one of the constraints had an error and then at the end it checks that flag and throws an exception if its true. At that point it no longer knows what constraint caused an issue. I ended up copying code out of the reference source to recreate the function and using reflection to call internal methods so I could find out which constraint and which column had the error. After that it was easy to fix.
-
And the prize for the most stupid error messages goes to....Run this code
if (ReferenceEquals(string.Empty, ""))
{
Console.WriteLine("\"\" is the same as String.Empty");
}String.Empty and "" are likely to reference the same memory location so they are effectively the same (There's a name for this combining of string resources but I forget what it is). The problem with using String.Empty as a default value for a function parameter is that it's not a COMPILE time constant. The value stored in String.Empty is a reference to the string "" stored in memory and that reference doesn't get set until the program starts and the string "" gets loaded into memory. Because how can you have a reference to a memory location before the program has started? So basically this error message is 100% accurate. It wanted a compile time constant but was given a runtime constant and it said "That's not good enough, mate".
-
Am I the only C# develeoper who HATES web config files....? -
Who moved the Start Page?Build Solution is Ctrl+Shift+B in 2015 and 2017 for me. Check your "Additional Keyboard mapping scheme" option under Options/Environment/Keyboard. If I have Visual C# 2005 selected it adds F6 If I have Visual C++ 2 selected it adds Shift+F8 Visual C++ 6 adds F7
-
A common language to divide usI tend to use "Center" as in "The center of a circle" and "Centre" as in "The Transit Centre".
-
Good grief MS, why?Put your mouse on the edge of the window then click and drag. Boom, small calculator.