Safe and Sound
I love the dev community for this reason:
July 2009
One of the reasons I've always enjoyed being part of the web is the fantastic people it attracts. Rarely have I met someone in the industry that I couldn't get on with on some level... and today that view was reinforced.
Anyways on with the story... as with many others, when I first left University I signed up to a bunch of recruitment sites, as well as applying to companies direct (in classic 'keep as many options open as possible stylé'). When doing so, I signed up to the unwritten law that I would thereafter receive more spam than actual e-mail - I was once even berated by some crazy recruiter for telling him I had a job (after he'd ran through a minute long rant about a job opportunity without stopping for breath).
Therefore I'm quite used to deleting a lot of e-mails from my inbox on a daily basis. So much so that I didn't stop to think about it until I saw that a couple of e-mails had the same subject line with 'RE:'...
It started with:
Good evening,
I specialise in placing IT Contractors across the UK and Europe and I have the following vacancy that you may be interested...
Addressed to a company address and copied to well over 500 possible applicants. This was then succinctly followed by the first reply...
"This e-mail is confidential and is intended solely for the use of the individual or entity to whom it is addressed"
so that's all fucking 640 of us then?
Marked as spam for sharing people's email addresses and possibly breaking some sort of data protection law, though how you got these email addresses is questionable to begin with as I have never given mine to you.
and this...
This amuses me.
Recruitment FAIL.
I’m sure if you’d like help developing a mail distribution system though Mr [.....], there’s 640 of us that could potentially help you.
and finally...
Dude - that was magnificent! I've never heard of [.....], [.....] and I've certainly never given anyone permission to give my email to them either.
Now it might just be me in a late Monday night computer stupor but that definately cheered up my day! I must then add (personal ad stylé) 'GSOH' as an extra point for Paul's recent post.
Cheers to the guys who I've quoted here!
10 Things I learnt from Glasto '09
July 2009
Back from glasto.. after getting tired/wet/sunburnt all at once I've made a list of ten... exciting huh...
- I can stop myself mid-sneeze with only an odd squeeky noise emanating out instead
- I don't enjoy beard rubbing as a salutation
- I should definitely stick to seeing bands I want to see, rather than bands I think I 'should' see
- If I leave anything around the campsite I should expect it to be taken from me - but probably not too far from me
- Extended time away from computers is definitely a good thing
- If you eat too much junk food from the same vendor he will begin to learn your 'usual'
- If a guy standing next to you dancing manically asks for a sip of your drink - it may not be to help a paracetamol go down
- Feeling bad for someone can make you sit through something you really probably shouldn't
- Leaving a gap in the middle of your tents, but not putting a gazebo in it will ultimately lead to someone else putting their tents in it
- Wearing wellies in the sun, although stylish, is actually painful
Pick of the weekend? dan le sac Vs Scroobius Pip. So glad I finally got to see them.
MVC is finally installed on my home PC!
June 2009
For those intrigued by my twitter activity tonight (OK, it was just Dave and I've already told him anyway), but still, I ambiguously cried out:
OMFG really was it that simple? I hate everything right now
http://twitter.com/cargowire/status/2034102008
As a .NET developer who likes to complain about webforms I was pretty keen to get to grips with the MVC framework when it was available. So, so I could play about with it at leisure I began a two step process:
- Step 1: Install on work laptop - Done in seconds
- Step 2: Install on home PC - Massive Fail
Thus began a process of occasionally coming back to it, searching for a solution, failing to find it then giving up again for a bit.
The majority of sources refer to uninstalling VS addins, ensuring you have 3.5 SP1, ensuring you uninstall any betas etc. I tried these things and failed... Eventually it was this post by Phil Haack that was the spur that led me to the solution. As you'll see I even got to the point of commenting on the poor mans blog.
Several posts, including a response to another request I'd made on the asp.net forums, were even suggesting I reinstall everything, including windows, and start from scratch. Now I really didn't want to do that, and to be honest, thought that should never be necessary to get something to install (imagine having to do that for every installation you undertake on your system).
Having attempted some of the ngen related activities proposed by Phil Haack without success I dug a little deeper into the log I was getting:
ExecNetFx: Error compiling System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089: Could not find or load a type. (Exception from HRESULT: 0x80131522)
Now without really having any prior experience with these kind of problems I was perhaps naively believing that the MVC install would have catered for dependencies and that if I was getting this error clearly there was some kind of conflict or problem (the whole uninstall-reinstall stuff scenario). This was reinforced by my attempts to run ngen ExecuteQueuedItems and ngen Update (and even an ngen delete at one point) all failing. However tonight I seemingly lucked upon the answer.
Having already previously identified I had the System.Data.Entity library sitting in the GAC (C:\Windows\Assembly) and the dll itself in C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.Entity.dll I was still looking for some other kind of problem. However I tried, virtually on the off chance, to directly ngen the dll myself rather than rely on the MVC installer to do everything for me.
C:\Windows\Framework\v2.0.50727\ngen install "C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.Entity.dll"
Immediately after doing this I started an MVC install - it worked.
And so retrospectively I was annoyed as the action I took in relation to the error I was seeing seems pretty obvious!
Anyway it's all over, I'm off to reinstall my addins. The nice thing about it though was I ended up getting a response from an asp.net team member on forums.asp.net, which reminded me how much I like the openness of Microsofts team i.e. bloggers, forum posters etc.
To save the jump heres some interesting info from Jacques:
In the Beta we only added support to the installer to GAC the assemblies, but starting with the RCs we began to create native images as well.
When the MVC installer runs it automatically performs an ngen update and compiles any assembly that might be deemed to be out of date. Any failure during the ngen process is reported back and the installation will initiate a rollback.
Jacques Eloff
Further Reading for the Interested Reader
- Global Assembly Cache - Shared store for libraries
- Ngen.exe - Generates native processor specific machine code to avoid JITing the original assembly
New article posted! (don't hate me for my .net)
May 2009
Yesterday I Posted a new article covering some of my thoughts on .NET (check it out over in the articles section). It's in response to the many conversations I seem to have with people who are on the verge of being shocked and appalled that I use .NET. So I decided to get some of that discussion down on paper. It's not an intro to .NET or a comparison between .NET and the rest although aspects of both can be found in my rambling, and I certainly don't think everyone views .NET in that way.
You really should know and use these... seriously...
April 2009
Simple things apparently annoy me a great deal...
.NET Developers should be aware of, and use, .NET constructs that have been around for ages:
- String.Empty - avoid creation of empty string references ("") use this built in single reference and the String.IsNullOrEmpty() method too.. the framework is there to help you!
- String.Format - avoid concatenation using + or &. Use string.format with the objects you intend to concatenate, it will also do the ToString for you and has formatting abilities.
- StringBuilder - strings are immutable. String builders avoid the creation of new strings each time you do a & or + concatenation.
- Using - Wrapping IDisposable instances in Using statements will automatically call dispose immediately on End Using. Additionally, implement IDisposable on heavy classes so that your own code can be consumed this way.
- Try Catch Finally - No catch should be empty, either decorate the exception with an appropriate wrapper before throwing again or remedy whatever the problem was because just plain eating exceptions makes debugging particularly crappy. Also use Finally to ensure that even when exceptions are thrown references are disposed of appropriately.
- 'As' (TryCast in VB) - Should be used where appropriate to cast and return null if the cast fails (rather than throw a cast exception).
- TryParse - Should be used instead of Try Catch blocks i.e. Integer.TryParse will return false if the parse failed, rather than throwing an exception.
- Nullable Types should be used for primitive types that can also be null i.e. int? or Nullable(Of Integer). This struct has a 'hasValue' property that can be accessed rather than building your own constructs such as -1 means no value, or 0 means no value etc.
- Generics - Do not use classes such as ArrayList or SortedList as they are object based and have the overhead of casting to and from object as well as forcing the user to do these casts. Compile time checking is also hindered. Instead use Generic Collections so that typing can be enforced i.e. Generic.SortedList<int, MyClass> or Generic.SortedList(Of Integer, MyClass). Additionally look to use generics to create generalised code (avoid similar operations being redone in multiple specialised classes). Generics is not just applicable to classes. You can, and should if necessary, create Generic Methods e.g. ConfigurationSettings.GetValue<int>("keyName") allows casting and other checking to be encapsulated away from consuming code.
Obviously it's up to you in the context of each situation you encounter, but to never use these at all is surely madness.


