Contents tagged with Code
-
Generating Images With .Net Part 1
I’ve recently had a project that required a great deal of image generation and manipulation. Not having done image manipulation in a good long while I thought it would be good to capture some of the “tricks of the trade”. One of the things I noticed in my searching for information on generating images in .Net is how bad variables were named. Hungarian notation or single letter names. This is not cool so I’m going to be trying to use descriptive names for all of my variables.
-
Preventing simple errors with the null coalescing operator
How often have you seen code like this?
-
Visual Basic.Net ain't half bad
There I said it.
-
Visual Basic.Net and NUnit Gotcha
I like the NUnit 2.4 Constraint based syntax. So In my new role I am having to implement Unit Testing so I decided on going with NUnit to begin with despite my preference for MbUnit. But once I got started writing my tests, I discover Is is a keyword in VB (I'm more of a C# person, but hey I'm no language bigot). I kinda freak out a little. Did I do something wrong? Forget to add something? Google a bit and still no joy. Then I remember the code examples installed with NUnit and have a look and what do you know? Is is now Iz in VB. Not exactly as clear as Is but you gotta do what you gotta do. So now in VB a Unit Test looks like this
-
Sorting a generic list
One of the nice features of System.Collection.Generics.List is it is able to sort on the go with a IComparable, and you can do that simply with an anonomous method
This is simply done like so.