Blog News

SVN checkout depth of two levels

A strategy I found to get the first two levels of files of an SVN repository.

  1. Start by checking out only root and 1st level of folders
mkdir temp
cd temp
svn co . --depth immediates

2. Checkout content 1st level of folders

find ./ -type d ! -path "./.svn*" ! -path "./" -exec svn up --set-depth files {} \;

I guess it could also be used to go deeper if you use this version and run it more then once?

find ./ -type d ! -path "./.svn*" ! -path "./" -exec svn up --set-depth immediates {} \;
Blog News

Add WPML language switch without current language

This is a convenient way to add a link in the main menu to switch languages without including the active language. You’d figure this would be included in WPML but this doesn’t seem to be very high on their priority list.

Blog News Project Management

Three point estimation

As it happens, I often have to do estimates for small to kind of large projects. As most developers will know, estimating is not as easy as you think. It is even harder to guess-timate something you have never done before. During my project management classes, I did learn about three point estimation, a pretty useful tool which can help anyone get a more balanced estimate of how long the task or activity is likely to take.

Gantt Chart

As for all estimations, we need to first break down the project into individual tasks or activities. Once that is done, we need to decide on the time it will take to complete each task. However, rather than using a ballpark estimate, we can use three point estimating to get a more accurate idea. To do a three point estimation for a particular task or activity we need to get three different numbers: the most optimistic estimate, the most pessimistic estimate and the most likely estimate. Once we have these numbers, its possible to calculate the real value based on the three point formula. Start by adding your optimistic time to your your pessismistic time and then add four times the most likely time. Take the total and divide it by six. This will give us a result which is more likely to tell us exactly how long completing the task or activity is going to take.

The three point estimation formula

E = (O + P + 4 * L) / 6
O = most optimistic estimate
P = most pessimistic estimate
L = most likely estimate

For example, to write a blog post I could say that

O = 10 minutes
P = 60 minutes
L = 20 minutes

Thus my estimate is: (10+60+4*20)/6 = 25 minutes

Blog News Computers Mac OS X

Disable mouse acceleration on Mac OS X

The most annoying thing I encounter when occasionnaly working on a Mac is the mouse acceleration. I found a command line that will disable it but you need to relog after executing it:

defaults write -g -1

Note: Don’t touch the mouse settings in Preferences or it will override the above change.

Blog News Magento PHP Programming

Updating Magento code to be compatible with PHP 5.3

Even tough PHP 5.3 has been out for quite a while, there is still lots of old code out there that will not run correctly when moved from 5.2 to 5.3. In my case I had to move a 2 year old Magento website to a new server and ran into problems as the default version of PHP on the new server was setup as PHP 5.3. Altough PHP 5.3 is a “minor” version, there is quite a few “deprecated” core functions and severak little things that just dont work the same anymore. So in this post I will explain specifically what functions I had to update and a couple of examples of how I did it in each case.