Careful With Those Cookies

When doing testing, you might find yourself wanting to delete cookies for some URLs on your development machine.

Now, you need to be careful about how you delete these cookies, because Microsoft decided to pull a little trick on you.  They created a folder:

C:Documents and Settings[user]Cookies

This folder seems to contain all your cookies!  But, actually it doesn’t.  Deleting these cookies really doesn’t clear out the cookies you think you are deleting because the REAL cookies are stored in:

C:Documents and Settings[user]Local SettingsTemporary Internet Files

This folder contains cookies and other temporary internet files, but of the most importance here is that THIS is where you need to clear your cookies from.

I came across another thing on a recent project is that you can’t test for the existance of an outbound cookie.

If Response.Cookies.Item("ASDFA") Is Nothing Then
     Response.Write("This Will Never Execute")
End If

Why is this?  It is because with the Response.Cookies collection (but not on the Request’s cookies collection) when you request an item from the collection that doesn’t exist it CREATES it, with a value of an empty string.


DOs and DONTs of getting a development job

I have been accepting resumes for a while now trying to find developers for a client of mine.

I will be updating this article from time to time with new stuff.

DO have someone proofread your resume, cover letter, and email body.  Espically if you are not a native english speaker.  If you want your resume to go directly into the trash, then please, write your email with lots of grammer and spelling problems.

DON’T write in your cover letter that, while you don’t have the skills/experience they are looking for, you DO have the skills/experience that really matters.  You have just managed to tell the person reading your resume that a) you don’t have the skills they need, b) you think you are smarter than the person who came up with the needed skills/experience, and c) you are probably not easy to get along with.  All in the first sentence of your cover letter: BRAVO!

DON’T send a 9 page resume including every project you have ever worked on and details about said project.  I remember when I was told that resumes should be 1 page long (2 at the most) and I thought how wrong that was.  “My resme will be so awesome, 2 pages can’t contain it!”  I realized very quickly how wrong I was.  I don’t need to know the specifics of some project you worked on for 3 months back in 2002, and I don’t need to know a list of every programming langauge, technique, or technology that you have ever touched. 

DO supply a cover letter, or at least turn your email into your cover letter.  It will get you bonus points.

DON’T include a stupid signature on your emails.  I actually received a resume that was signed like this:

If fishes could talk they’d ask for legs

Ok I guess that is somewhat funny in a Jack Handy kinda way, but it really doesn’t belong on an job application email.

DON’T list “Internet Connection Technologies” that you have experience with.  I swear I got a resume with this as the 2nd heading (after education).  It listed “AOL Dial Up, AOL High Speed DSL, SBC DSL”.  Before you start thinking, ok well maybe these were projects they worked on, you know, like working on the team to create AOL’s dial up service… no this was not what they meant, it was clear from the rest of the resume.

DON’T just make up stuff if you don’t know the answer to a question.  This isn’t the ACT: there are penalities for guessing (it makes you look really stupid).  Now clearly there is a difference between making an educated guess (or talking in generalities instead of specifics) and trying to totally pull something out of thin air.  I recently interviewed a candidate who said he didn’t have any project experience using AJAX but was aware of AJAX technologies.  So I asked him, can you explain how AJAX works?  I wasn’t expecting much, just something about using client side script to make calls to the server w/o reloading the entire page.  Instead the answer we got back was “It’s like JAVA running on top of Microsoft.”  Up until that point I hadn’t decided if this guy was qualified, and had he simply said “No, I am sorry I am not that familiar with AJAX” I probably would have still been considering him, but his terrible attempt at an answer removed all doubt that he was not qualified.

Validating Enum Values

You were a good developer and created an enum to represent the integer values that are being passed into your method.

It makes life easy for everyone.  Good job.

But now you realize that ANY integer can be passed into your function, even though your type only defines a handful of values.

Well, you need to validate the enum values that are coming into your method.

This can be done quickly with the following code snippet:

If Not [Enum].IsDefined(localId.GetType, localId) Then
    Throw New System.ComponentModel.InvalidEnumArgumentException("Invalid local value.")
End If

In this example localId is the variable name of type LocalType.

Shocking: My Interest Continues!

As I have grown older, I have learned to understand some of the quirks in my personality, and adjust my expectations accordingly.

For example, my whole life I have always had periods of intense interest in some subject only to lose interested after a couple months.  Various video games, RC Car building and racing, drawing, electric guitar, etc.

So now when I get older and I get ultra interested in some new subject, in the back of my mind I say “Ok, I know this seems like the most important thing right now, but in 6 months you will proably not be THAT interested anymore.”

I would have bet you money that would have been the case with my most recent endevor, trying to learn spanish.  But here I am, listening (even paying for) podcasts, buying iPhone translation software (this software is really great), taking Spanish lessons twice a week with an instructor from Peru, and even booking a vacation to mexico to get 6 hrs of Spanish instruction a day.

I guess in my old age I am growing my attention span :).

10 Concepts You Need To Know As A Developer

This article: 10 Concepts Every Software Engineer Should Know, is worth taking a look at if you are a developer.

I thought about it for a minute, trying to think of something important that they didn’t touch on in this article, and I think the only major thing I would argue for would be entity relationship diagramming: the ability to turn a problem domain into a set of entities and relationships.

Other topics I would have considered: Regular Expressions, code documentation, project estimation, and maybe unit testing.

Generating Resx Files For Globalization and Localization

Using resource files (resx files) for globalization is a standard technicque.  ASP.NET allows you to create 1 resx file per page to help you manage your content.

But when it is time to convert those files into the correctly named localized version to send to the translator, you might find yourself doing a lot of copying and renaming.

So I wrote a little script that does this for you:

Imports System.IO
Module Module1

    Sub Main()
        Dim languages() As String = {"es", "pl", "de", "fr"}
        For Each filepath As String In Directory.GetFiles("C:translationTest")
            If filepath.Contains("x.resx") Then
                For i As Integer = 0 To languages.Length - 1
                    File.Copy(filepath, filepath.Replace(".resx", "." & languages(i) & ".resx"))
            End If
    End Sub

End Module

This will generate all the files for you, and then all you need to do is send the off and wait for the translator to do the REAL work :).