Archive for October, 2007
I’m going old school a little bit for this pick. It’s a good old fashioned text editor. Notepad++ is an excellent editor, and the latest version added a hex editor. Quite frankly, that’s what put it on my FLOSS list. I can use one app for hex and text editing. I use it for writing quick and dirty scripts, batch files, and as my default viewer when I “View Source” from a browser window. It’s got syntax highlighting, tabs, and loads of other features. It loads very fast and does what I want. My only wish is for a diff tool.
Here’s a couple screen shots:

You still aren’t using notepad are you?
Tags: FLOSS
First thing. Is your resume up-to-date? If not, close this browser window, go update your resume and come back later. If you’re still reading, then I’ll assume you’ve got an updated resume. It might be current, but is it any good? I read this Justin James post on TechRepublic today about how to write a resume that will help land you a programming job. The point that Justin makes that I most agree with is that you should should stress your skills, particularly how they apply to the job you’re seeking.
I don’t expect your employment history to include a list of all your skills. But if you are looking for work as a .Net developer, show me that you have done some .Net work. If you do not list that experience, I am going to assume that you have little or no experience with it — even if it is on your skill list. If you have large amounts of experience outside of the workforce, find a way to show that on your resume.
That’s great advice. The point of your resume is to get your foot in the door for an interview, so make sure you include relevant experience. Just like Kramer says, “You don’t sell the steak, you sell the sizzle.” You’ll have plenty of chance to sell the “steak” at the interview.
Tags: Career Development
Like most good developers, I always take precautions to prevent SQL injection. We’ve also got to worry about cross-site scripting, but now cross-build injection is becoming a concern. Apparently an attacker compromises a server that houses a build component or the DNS server used to find that server. The attacker can then take control of the build machine and inject code into an application while its being built. Am I the only one this frightens? I don’t work on any projects where I’m using a remote server for builds or dependency tracking, but I do use quite a bit of software that’s built on them.
Let’s think of a scenario such as this: I’m using an open source library to handle zipping and unzipping of files in an application I’m deploying to multiple servers in my corporate network. Now let’s say the build or dependency server of the open source library I’m using has been compromised and a trojan has been inserted into the library. Now I’ve unknowingly introduced that trojan to several production servers on my corporate network. Developers and IT departments are obsessed with securing their networks and operating systems, the development stack must secured as well.
It seems the main culprit is automated dependency management system. According to Brian Chess of Fortify Software:
The first and simplest is to refrain from adopting automated dependency management systems altogether. Managing dependencies manually eliminates the potential for unexpected behavior caused by the build system.
While I haven’t heard of an open source project being compromised yet, I don’t think it’s unreasonable to say that the possibility is there. Here’s a link (pdf) to the Fortify Software report detailing the topic.
Tags: Security
It’s easy to find examples of bad design. Especially when we’re talking about websites. As developers we want people to use our software. The easier a system is to use, the more it’s going to be going to be used. It’s particularly important for an e-commerce site. If it’s difficult for your customers to get things done, it’s going to affect your sales. Instead of pointing out bad design, I want to highlight a simple design decision that makes the Old Navy web site so much easier to use.

As a customer I only want to see items they’ve got in my size. Why make your customer sort through items that don’t fit? The developers of the Old Navy site did this by simply allowing you to display only clothes of a certain size. I can’t tell you how easy it is for me to find what I want, add it to my shopping cart and check out. I don’t even go to their brick and mortar stores anymore because it’s so easy for me to find what I want online.
I think this helps show the value of making your software simple and easy to use. Good design makes you wantto use it. As a developer, I can’t think of anything more fulfilling than people using the software I develop.
Dim, ReDim, ReDim Preseve, Repeat. Sound familiar? If so, maybe you want to look into generic collections. In the System.Collections namespace the ArrayList class will give you a dynamically allocated list of objects that’s easy to use. You won’t need to worry about ReDim’ing the array if you need to add items, and you won’t have to deal with array indexing issues when adding/removing items.
Example using an array.
‘create the string array with an initial size
Dim values As String(1)
‘add a value
values(0) = “test 1″
‘…. do some work ….
‘now we need to add another value to the array,
’so we need to do a ReDim
ReDim Preserve values(2)
values(1) = “test 2″
Now let’s rewrite the example using an ArrayList
‘create the arraylist
Dim values As New ArrayList()
‘add a value
values.Add(”test 1″)
‘…. do some work ….
‘now add another value, but there’s no need to ReDim
values.Add(”test 2″)
For me, there’s one drawback to ArrayList. Type safety. If you want compile time checking of the object types you’re adding to a collection, look at the generic List(Of Object) class in the System.Collections.Generic namespace. You’ll get type safety and a performance boost by using the generic List object, not to mention Intellisense support.
‘create the list
Dim values As New List(Of String)
values.Add(”test 1″)
You aren’t limited to a simple list either. There’s a sorted list, a dictionary, and a sorted dictionary. For me, the choice is easy. I use generic collections where I might have used an array before. That’s not saying I never use a simple array any more, but generic collections are definitely a good addition to my toolkit.
Tags: Generics, VB.NET
Finally! Google is offering free IMAP for GMail. Now I can have my email “up in the cloud” and still use Outlook 2007.
Now if only Yahoo will follow suit…
Nostalgia is defined as a longing for the past. Many things give me a feeling of nostalgia: old pictures, 80’s music, Robert Aspirin books. The list goes on. It’s just not my development environment, and it better not be for you either. As developers we should be moving forward with not just with our technologies, but our tools as well. I remember writing Java code using the Programmer’s File Editor and compiling at the command line. No debugger. No forms designer. I used good old System.out.println. Not exactly the most efficient use of my time. Today I wouldn’t think about writing code without a good IDE. With features such as Intellisense, modern IDEs are a godsend. There are plenty of good, free development environments available. Here’s a few:
Tags: Opinion, Programming
My next FLOSS pick is something I’ve begun using for creating documentation at work. Sandcastle is tool for creating MSDN style documentation for .NET projects. If you’ve ever used NDOC, then you’ll love Sandcastle. It looks very similar, but it actually works! I’ve used it to document several VB.NET libraries. You can create chm help files, or html help files. Very cool!
You’ll need a couple of things to get going:
Tags: FLOSS
In part one of my series on scripting iTunes using C# I showed you how to remove dead tracks from your iTunes library. Now let’s take it one step further and get rid of all those duplicate tracks you might have. For my purposes, I determined a duplicate track to be any track that has the same artist, album and track name as another track in the library. When I find a duplicate, I want to keep the track with a higher bitrate. iTunes will show you a list of the duplicates in your library, but I’m much to lazy to sort out what should be deleted and what shouldn’t.
I used a Dictionary object to store the tracks I checked with the key being the track name. If a matching name is found, then I dig a little deeper to verify that a duplicate has actually been found, then I keep the one with a higher bitrate.
Download the VS2008 C# Express project here.
Here’s a code sample:
//create a reference to iTunes
iTunesAppClass iTunes = new iTunesAppClass();
//get a reference to the collection of all tracks
IITTrackCollection tracks = iTunes.LibraryPlaylist.Tracks;
int trackCount = tracks.Count;
Dictionary<string, IITTrack> trackCollection = new Dictionary<string, IITTrack>();
ArrayList tracksToRemove = new ArrayList();
for (int i = trackCount; i > 0; i–)
{
if (tracks[i].Kind == ITTrackKind.ITTrackKindFile)
{
string trackKey = tracks[i].Name + tracks[i].Artist + tracks[i].Album;
if (!trackCollection.ContainsKey(trackKey))
{
trackCollection.Add(trackKey, tracks[i]);
}
else
{
if (trackCollection[trackKey].Album != tracks[i].Album ||
trackCollection[trackKey].Artist != tracks[i].Artist)
{
trackCollection.Add(trackKey, tracks[i]);
}
else if (trackCollection[trackKey].BitRate > tracks[i].BitRate)
{
tracksToRemove.Add(tracks[i]);
}
else
{
tracksToRemove.Add(tracks[i]);
}
}
}
}
//now remove all duplicates
for (int i = 0; i < tracksToRemove.Count; i++)
{
tracksToRemove[i].Delete();
}
Tags: C#, iTunes
It seems like virtualization is all the rage these days, and my second FLOSS pick is no different. A co-worker suggested I take a look at VirtualBox, and it’s a good thing. It’s fast, free, and supports Windows, Linux and BSD guest operating systems. It runs on Windows, Linux and the Mac version is in beta. Virturalization is great for testing code against different OS versions and patch levels. One of the really cool features is the ability to run seamless Windows apps in Linux. This means you can run Windows apps outside a virtual machine. As far as I know you can’t do this with VMWare, but I believe it is supported in Parallels.
VirtualBox is developed by a software company named innotek located in Stuttgart Germany (which happens to be where the HQ of the company I work for is located).
There’s a great review here, and the download can be found here.