Blog

During the course of the day I encounter lots of challenges, some of which take minutes to solve and others that take much longer. My goal for this section is to keep track of these challenges and their solutions. I will turn the longer ones into articles, while the shorter ones will stay as blog entries. You can expect topics to range from very specific programming challenges to broader topics like life.

Below is a list of the recent blog entries. You can also browse the blog by using the tags on the right side, or if you know what you are looking for then you can use the search box at the top right.

Microsoft Launches the Zune!

Microsoft Zune

Yesterday Microsoft launched their first version of the “MP3 player,” Zune. Microsoft has made a fairly late entry in this market considering that the Apple iPod has been in the market for a few generations! There are gazillions of a accessories for the iPod, including integration in higher end cars. Add to that Creative’s entry into this market with their Zen Vision:M in the last few months, and you get a fairly competitive market.

Zune Desktop Theme

Apple started it’s iPods at $399 price tag, Creative started it’s Vision:M’s at $320, and guess where Microsoft landed? $249! I think that is an awesome price for a 30 gig MP3 player with FM tuner, and supports WiFi! Microsoft doesn’t need much press for their launch because Zune has been hyped on gadget websites for a while now, getting labeled as the iPod killer. Zune does look pretty exciting but I personally think that the coolest part if the WiFi.

To add to the excitement, Microsoft has also introduced a new Windows theme that matches the Zune’s default color scheme. Obviously I had to try it out! Check out this screenshot.

Let’s see if it can really grab a chunk of the MP3 market, and if really is an iPod killer!

Previous reviews have been imported

I am proud to announce that I have implemented the reviews section and the imported the previous reviews, with all the images! So go check them out!

Once I am done with the GMAT, I am planning on posting a review for the Creative Zen Vision:M, which I have owned since they were introduced. My preparation for GMAT is going a little slow and I was a little disappointed with my performance on the data sufficiency section, it looks like I have got some work to do on that specific section. Wish me luck!

What’s up with all the warnings?

Does anyone know what’s up with all the warnings I get when running rake?

Rails Warnings

Why Contact Information is Important!

I was trying to post a comment to http://rails.co.za but for some reason I get a message saying “Ip blocked by SpamProtection.” So I start looking for contact information so I can see why this is the case, but guess what, there is NO contact information for the web masters! Its possible that I missed the contact info but I doubt it because I have looked all over.

I decided to see how many comments these guys get by looking at the comment feed, and there is only one comment! My guess is that this is because the comment module is probably bombed, but there is no way I can tell them to look into it, because there is no contact information! Make sure you always put some sort of contact information so people can contact you.

Indexes

The data structure used at my work is fairly low level and it is amazing how much difference that makes in the performance. If you were to talk to an average web programmer about what an index was, most probably, they would have a very vague idea. This is because they can easily write statements like SELECT * FROM mytable WHERE mycolumn = 123 without much concern, and then move on. With the data structure at work it becomes apparent why this is a bad idea and why indexes are important. Without the index we have to manually step through each row and look for whatever the WHERE part of the query specifies. Just to give you an idea about what I mean, look at the SELECT statement, if mycolumn wasn’t the primary key then it probably wouldn’t be indexed by default; which would mean that you will end up iterating through all of the rows in that table!

I am guilty of not using indexes but as soon as I was exposed to indexes (before this job) I realized how important they were and quickly caught up to speed. I remember taking over for a project at my previous job where we had minimal number of indexes. The difference before and after the indexes was almost a ten folds! If indexes are always good then why not index every column? You have to be careful with indexes because just like everything else, indexes have good and bad parts. Every index adds to the time that it takes that database server to do an insert and some times updates because the database server has to do the extra step of actually indexing the column. Bottom line, make sure you know what indexes and use them when appropriate.

This and this pages are some further readings about indexes.

Search and RSS Feeds Added

Over the last weekend I spent some time implementing the atom feed (see the “blog feed” icon on the left) and searching capability. Why these two specific features? As I was going through and updating the content from the previous site I found a need for searching, plus with for a blog to be useful, you pretty much have to have searching capability because very few people are going to sit and page through the past entries. Similarly, a blog feed is important for those people who prefer using an aggregator.

Since I have the basic functionality for the site in place now, I am thinking of switching gears and concentrating on GMAT preparation, which I am planning on taking towards the end of November. My goal is to at least have a masters degree before concentrating on the job/business world. Who knows, maybe if I get bored studying for GMAT, I will implement the article and review sections.

Microsoft Word’s Insufficient Memory Error

As a side project I have been working on a Microsoft Word document concordance generator. The goal of the application is to loop through each word of all documents in a given directory and compose a concordance list. Obviously there is more to it, but that should give you the gist of it. I am using the Microsoft Word API and .Net 2.0 to implement the solution. The Word API is great because it pretty much exposes everything that you can normally do in Word but through an API. Everything has good and bad parts, that was the good part, the bad part is the speed. The API is slow, which is understandable especially considering that I have a special layer between (the .Net wrapper) so I have had to come up with alternatives. One of the problems that I encountered right away was the “Insufficient Memory Error”. The problem with this was the actual physical dialog box asking the user to confirm that they want to continue.

Word has insufficient memory. You will not be able to undo this action once it is completed. Do you want to continue?

To get around this I had to clear out the undo history manually, at regular intervals. To do this you have to call the ClearUndo function

wdDoc.ClearUndo()   // wdDoc is the Word.Document object

This was my first .Net 2.0 project and I was amazed the data structures that .Net 2.0 provides; things like the templated list and dictionaries. Additionally, I really enjoyed how easy it was to created a threaded application where the thread can report back on it’s progress. Threading is a whole beast that probably deserves an article. If you are interested check out the BackgroundWorker class.

New Site is Ready!

I am proud to anounce to that after spending long hard hours, I have a beta version of the new site. With the new site, also comes the new host, new content, and new identity: The Bit Guru! That’s right!

From now on I am the bit guru 🙂 I thought of the new identity after I had done the site design so you can expect the logos and a few things to change in the near future. Some things that you can expect after I have taken my GMAT:

  • Run From Clipboard (RFC) will be published. RFC is another small .Net based utility that basically does exactly what it says, runs the contents of the clipboard. There a few added spins; like removing new lines, you konw for the times when the URL or URI spans multiple lines in an e-mail.
  • Review of the Creative Zen Vision:M
  • More product reviews
  • I am debating getting a Tablet PC, so discussions about that will also be coming up.

Some minor things on the technical side:

  • The site is valid XHTML 1.0
  • The site is valid CSS with some warnings that I haven’t had time to eliminate

Awesome Article

Here is an excellent article about some things that most of us (i.e. Rails programmers) don’t know about. “How did I end up at that page?” you ask. Well, as I was working on my new site and I noticed the acts_as_nested_set function, and started looking around; guess where I ended up? That page!

Changing Directories in Cygwin

Below are two very useful bash functions if you use cygwin:


ccd() { cd “`cygpath \”$1\”`”
}

explore() { explorer.exe `cygpath -d “\`pwd\`”`
}

Add these to your .bashrc file, and either restart bash or just run source ~/.bashrc

The first function ccd can be used to “cd” into a given Windows path. For example doing ccd "C:\Documents and Settings\All Users\Application Data" will figure out the equivalent cygwin based path and cd to it. Note that you have to have the double quotes around the path, otherwise bash will think of the slashes as escape characters.

The second function ‘explore’ basically opens the current working directory in Windows Explorer.

2007-2-20 Update: Added double quotes around the pwd command in explore function; without the quotes paths with spaces will not work.