Working successfully from home


We all dream of working from home. Well, maybe not everyone but I like to think most people do. What’s not appealing about starting your day at 10:00am in your pjs @ your home desk, taking a walk when you feel like it, ¬†firing up the Xbox to kill a few zombies around 2:30pm, catching up on Dexter at 6:12pm and so on. Yes, I know. It sounds like vacation right?¬†Nooootttttttt!

Working from home effectively can be very difficult if you don’t have a good amount of self discipline. It took me about 1-2 weeks to get it right and I assume it will vary for others. We all have our temptations and some people have more self control and discipline than others. ¬†Here are a few things that should help you get started with your journey to an effective home office.

Know your value vs time

Unless you are a¬†millionaire or expect a rain fall of cash from your parent, working from home needs to translate into revenue or something of value. Figure out what that value is so you know what you are loosing when you are not really working. An easier way to figure out the ¬†monetary¬†value of your time is to ask yourself what you are worth in the corporate world. If your rate is $48/ h, then that’s your value per hour. Anytime you find yourself doing something not considered work, remind yourself you are loosing that value which should give you the motivation you need to get back on track.

Get in a daily routine

Having a ¬†productivity¬†routine increases your¬†disciplinary bar. ¬†Productive routines are different for everyone so you will need to discover yours. Figure our what time slots within a day you are most productive and make sure your routine has you working during those slots. ¬†Make sure you also get the rest your body needs to be fully productive when you are awake. Lets¬†sprinkle¬†a “couple” of short rewarding time slots that takes your mind of work but keeps you in a “go-to” productive ¬†mode like brewing coffee in the morning, reading the new papers or your favorite blogs, checking your email/mailbox, taking a short walk/30 min workout etc. Put all these time slots together to form your routine and stick with it. You will be amazed how well having a routine works.

Dress the part

Working in your pj’s is fun but it also sets your mental mode to relaxed, which is not what you want when you are working. Yes, you want to be comfortable but you also don’t want to be too relaxed to the point of wanting to take a 2-3 hrs nap or sitting on the couch with your favorite bag of chips. In the name of productive routine, dress the part. Dress like you are going to work and your mind will stay in that mode till you are ready to mentally go home. That will help separate your work persona from your home persona and increase your productivity.

Inform potential external forces about your work routine

Having a¬†productive¬†routine is not enough if you have external forces try to blow it away. Identify those external forces and let them know of your routine so they don’t¬†distract you. If you have kids, try to communicate that you need to get work done so you can have time to play with them when you don’t have to work. If you have friends that tend to call on you during your productive time slots to go hang out, let them know about your routine so they don’t¬†distract¬†you.

With the above steps and some luck, you should be able to work successfully from home and over come the urge to slack off. I’m also a member of a co-working space so when I want to work away from home, I have somewhere to go. That allows me to¬†fulfill¬†my office mate requirement. You don’t need it to successfully work from home but I find it very effective to connect with peers of the same mindset.

Credit: Featured  image by Shogo at

We Have Lift Off! part 2


Per part 1, I have still be working at EBC 2 days/week till…today. I’m excited to say today is my last and finally day at my corporate job. It is a happy and sad day for me. ¬†Happy because its the day I’m being unleashed into the make-it-or-break-it world¬†to see what I’m really made of¬†and sad, because I wont be seeing the great many peers at EBC on a ¬†daily bases anymore. ¬†Thanks again, to all those who made this possible. See you on Monday @ my home office.

Storage usage stats by SpaceSniffer


If you are an engineer like myself, you end up accumulating tools that make your working life easier over the cause of  the years. Yesterday, I spend sometime cleaning up my laptop and was shocked to discover the amounts of tools I have accumulated in my toolbox so I thought it would be great to blog about these tools for they might be useful to someone as well.

We all clean our computing machine (laptop, desktop etc) once in a while and sometime you like to know which folder/program is taking up space. There are a few tools to sniff out the space consumption on your machine but I have see or used any better than SpaceSniffer. SpaceSniffer cruises through your machine in a few min and shows a graphical representation of your space usage. The good guys at Uderzo Software have been kind enough to give this away for free so click the link above and get sniffing.

Credit: Featured  image by nordhell at

Evolution of how we consume music


I’m a very big fun of music and when I say big, I’m not talking about having background music when drinking at the bar or listening to music in the car when you have nothing else to do but enjoy rows and rows of corn fields¬†whisking¬†by. I’m talking about have an intimate¬†quality¬†session with your music setup, soaking in a good hour or so of music. For people like me, discovering new artist/sounds is of great delight and it’s amazing how that discovery has¬†evolved¬†as the years go by.

Rewind to 1999, zoom in on the young me, and you will see me spending hours download musics from Napster, Kaza and the likes until these sources where place in¬†shackles by the media piracy¬†laws.¬†¬†Then came the Ipod and Itunes which helped us discover and buy music for a reasonable price. That made a big impact on how people consumed music as they could just buy what they wanted while browsing a sea of music collection. I never owned an Ipod but did enjoy its huge collection of artists/music through Jennie’s account. I believe the rise of internet radios such as pandora, lastfm etc is what expanded my collection of artists and music alike. The discovery through internet radio was so good, at least for me, that I never found myself wanting. Then Spotify show up and added icing on to cake. With Spotify, I find myself discovering music with the help of friends and family linked to my account. I think Spotify is “currently” the most innovative ways for music lovers to discover and enjoy music and the best part, you wont be doing it along.


Credit: Featured  image by Pcataldi at Odosketch.

Routing with crossroads.js + browser history(from backbone.js)


It’s a very exciting time for developers, especially web developers. There has been a blow out of great cutting-edge web application thanks to the many javascript frameworks and plugins springing up. This is very good because as an engineer, you get to pick and choose what framework/plugin you want to use and the ability to extend it to fit your needs. Per last past, I started work on a personal project. One of my projects required a client-side routing engine. I looked at Backbone.js for its routing api which was great but it come with all the other api I didn’t wont/need.I looked at ¬†Crossroads.js¬† and was just perfect because it did exactly what I was looking for -routing, and no more that that. Apart from client-side routing, I also need a navigation engine to allowing for routing to bookmarks and application states. Backbone.js comes with a supporting api called History. Since I wanted crossroads.js routing but Backbone.js¬†implementation¬†of ¬†application navigation mechanism, I got hacking and in 10 min, had an extended crossroad.js with history support by porting over the implementation from Backbone. You can find and grab the code from github. You will need jquery to use this extension. Another thing you need to know is during hash navigation, crossroads is called with the relative path of the page and not just the hash. Thus if you navigate to “#3:edit” using crossroads.navigator at “”, you will be navigated to “” and the request passed to crossroads for routing will be “people#3:edit”.


Credit: Feature sketch by ekubochan at Odosketch

We Have Lift Off! part 1


¬†14th of July,2011 was/and will be a very special day for me. NASA took it’s last near-orbit flight on 14th of July,2011 which was both a joyful and sad moment all together. NASA has absorbed the majority of space exploration expenses from the first shuttle lift off and just like how the government thought the internet was ready to live in our homes and businesses (after many years in research at government institutions including NASA & US military), the US government feels near space exploration is ready for private businesses to takeover. I will like to say cheers to NASA for all the work the have done for mankind and looking forward to their next chapter – deep space exploration. I know there are people out there who are not very happy about this but the processes has worked before – the internet; and there is no reason it believe it wont work again if done right.

14th of July,2011 also marked my first flight at a series of personal projects. It was my first day off my corporate job; part of a gradual transition process to getting started on my personal projects. It’s been a great ride in the corporate world, working for both big and small software companies. This is by no means my declaration of¬† a complete departure from corporate world. In fact, I am still an employee of Employee Benefit Corporation(EBC), with a sweat working schedule for which I’m very thankful. It’s really an exciting time for me because I get to try something new and personal.¬† Thanks to the lady of the house – Jennie, my family and my friends for their support. I will also like to thank EBC’s CIO, James Lyerly for all his support.

So what are my personal projects all about? Stay tuned.

Credit: Featured  image by hebertkozu at Odosketch.

Conditional Validation in ASP.NET MVC – RangeIf


Simon Ince made a great post about conditional validation in mvc which he extended in his post conditional validation in mvc 3. mvc validation is one of mvc’s great extensible points . The framework comes with a decent amount of validations attribute such as range, stringlength etc but sometimes we find ourselves wanting to perform a specify type of validation that the framework doesn’t support and conditional validation is a perfectly good example. This is one of those validation types that most people feel the mvc team should have included in the framework but hey, they cannot do it all,¬† so we look to ourselves and to good people like Simon to the rescue.

Simon goes into details on how to create a RequiredIf validation so I wont elaborate on that (just dive into the links above for info on RequiredIf validation). In using Simon Requiredif validation, I decided its would be great to build on it to be applicable to other rules like Rangeif, StringLenghtIf, etc, starting with RangeIf. The first thing I needed to do was define the signature of the validation attribute. To keep things consistent with Simon’s, I decided to go with the signature as follows for an age property on the person class-

[RangeIf(11, 25, "IsUKResident", false, ErrorMessage = "If you are not a UK  resident, your age has to be between 11 and 25")]

The next thing to do was to define the RangIf attribute class below , inheriting from RangAttribute
public class RangeIfAttribute : RangeAttribute , IClientValidatable
public string DependentProperty { get; set; }
public object TargetValue { get; set; }

public RangeIfAttribute(int minimum, int maximum, string dependentProperty

, object targetValue): base(minimum, maximum)
this.DependentProperty = dependentProperty;
this.TargetValue = targetValue;

protected override ValidationResult IsValid(object value,

ValidationContext validationContext)
// get a reference to the property this validation depends upon
var containerType = validationContext.ObjectInstance.GetType();
var field = containerType.GetProperty(this.DependentProperty);

if (field != null)
// get the value of the dependent property
var dependentvalue = field.GetValue(validationContext.ObjectInstance, null);

// compare the value against the target value
if ((dependentvalue == null && this.TargetValue == null) ||
(dependentvalue != null && dependentvalue.Equals(this.TargetValue)))
// match => means we should try validating this field
if (!base.IsValid(value))
// validation failed - return an error
return new ValidationResult(this.ErrorMessage, new[]

{ validationContext.MemberName });

return ValidationResult.Success;

public IEnumerable<ModelClientValidationRule> GetClientValidationRules

(ModelMetadata metadata, ControllerContext context)
var rule = new ModelClientValidationRule()
ErrorMessage = FormatErrorMessage(metadata.GetDisplayName()),
ValidationType = "propertydependencyrule",

string depProp = BuildDependentPropertyId(metadata, context as ViewContext);
string targetValue = (this.TargetValue ?? "").ToString();
if (this.TargetValue.GetType() == typeof(bool))
targetValue = targetValue.ToLower();


rule.ValidationParameters.Add("dependentproperty", depProp);
rule.ValidationParameters.Add("targetvalue", targetValue);
rule.ValidationParameters.Add("rule", "range");

yield return rule;


private string BuildDependentPropertyId(ModelMetadata metadata,

ViewContext viewContext)
// build the ID of the property
string depProp = viewContext.ViewData.TemplateInfo.GetFullHtmlFieldId

// unfortunately this will have the name of the current field appended to the beginning,
// because the TemplateInfo's context has had this fieldname appended to it. Instead, we
// want to get the context as though it was one level higher (i.e. outside the current property,
// which is the containing object (our Person), and hence the same level as the dependent property.
var thisField = metadata.PropertyName + "_";
if (depProp.StartsWith(thisField))
// strip it off again
depProp = depProp.Substring(thisField.Length);
return depProp;

The code above is self explanatory so I wont elaborate. Note that we pass on the client rule and its parameters through rule.ValidationParameters in the GetClientValidationRules method. The next thing to do was create my client script (unobtrusive adapter) below
function (value, element, parameters) {
var id = '#' + parameters['dependentproperty'];

// get the target value (as a string,
// as that's what actual value will be)
var targetvalue = parameters['targetvalue'];
targetvalue =
(targetvalue == null ? '' : targetvalue).toString();

// get the actual value of the target control
// note - this probably needs to cater for more
// control types, e.g. radios
var control = $(id);
var controltype = control.attr('type');
var actualvalue = "";

case 'checkbox' :
actualvalue = control.attr('checked').toString(); break;
case 'select' :
actualvalue = $('option:selected',control).text(); break;
actualvalue = control.val(); break;

// if the condition is true, reuse the existing
// required field validator functionality
var rule = parameters['rule']
var ruleparam = parameters['ruleparam']
if (targetvalue === actualvalue)
return $.validator.methods[rule].call(
this, value, element, ruleparam);

return true;

['dependentproperty', 'targetvalue', 'rule', 'ruleparam'],
function (options) {


options.rules['propertydependencyrule'] = {
dependentproperty: options.params['dependentproperty'],
targetvalue: options.params['targetvalue'],
rule: options.params['rule'],
ruleparam: eval(options.params['ruleparam']),
options.messages['propertydependencyrule'] = options.message;

That’s it. We now have our RangeIf validation attribute. Notice I modified Simon’s client side code to a generic propertydependencyrule so you can use propertydependencyrule for other propertydependency validation attributes like StringLenghtIf by passing along the max jquery.validator¬† rule and its parameters. In my next post, I will extend this to RegularExpressionIf, StringLenghtIf, and more. Stay tuned.