Sunday, March 18, 2012

Funny job scams

I have plans to visit friends on Aruba this summer and usually wherever I go I check Internet for the area’s IT background - user groups, interesting IT events and job postings. I am yet to discover and attend a meeting somewhere exotic but job postings are always fun – and Arubian weren’t a disappointment. Look at this top three list:

D… Consulting Limited., Lagos, Nigeria. We require reputable persons having prime experience and capable of providing Information Technology and others Service (as individuals or in a team). Salary indication (individual) – US $15,000 – 20,000 per month. All relevant information/ notification / CV/ Resume should be forwarded via word document attachment to the below email as follows for immediate consideration.

Kind of disappointing that position does not promise an adoption into a royal family..

Hardy Oil and Gas PLC, Korūna, Pakistan requires the services of reputable and devoted workers for the under listed job positions. Qualified persons should contact us immediately for job placement. Application process-please send us your documents by email: 1). Resume 2). Recent photo 3). Passport Copy. Email: info_hardyoilgas@yahoo.com

The list includes 20 professions, from cooks and cleaners to language teachers, nurses and Internet experts (probably to move the oil company corporate mail system out of yahoo). Surprisingly drill masters or geologists are not required. The Hardy Oil and Gas actually exists, registered in Great Britain and of course owns first-level “com” and “in” domains.

The last one is the only which looks legitimate (no word “reputable” in the description) – and I totally see Paul Rudd in this role:

The C… Hotel urgently needs the services of devoted and hardworking workers, who are ready to work after undergoing enlistment training: INTERNET SERVICE EXPERT,COMPUTER OPERATOR,CAFÉ MANAGER

Now this is a dream IT job – computers and coffee!

Saturday, March 17, 2012

Worktime music

Friday, March 16, 2012

Working Effectively with Legacy Code by Michael Feathers

Nice classic book, which I glanced through long time ago, but dealing extensively with 9-year old code base made reading it again much more insightful.
A lot of useful patterns to break down nasty 600 lines methods and copy-pasted classes. Java examples will not stop C# developers from fully understanding the ideas but C++ examples are not that easy to grasp – in my opinion most of the techniques deal with limitations of the language and patterns so they don’t seem that universal.

Saturday, March 03, 2012

KnockoutJS validation (and more)

If earn money doing web development and haven’t yet heard of KnockoutJS – you should probably find out sooner than later. It’s a powerful and yet surprisingly intuitive MVVM framework implemented in pure Java Script (meaning - it will work in any browser!). The author’s  KnockoutJS.com is a good place to start and when you are ready for a deeper dive – check the Knockmeout.net.
While building my first form with Knockout, which quickly got over-engineered beyond the concepts described in the documentation, I found that the ability to add some validation or allow user to confirm the action is sorely missed. Knockmeout.net gave me a good start in a right direction and I ended up with this observable:

ko.smartObservable = function (initialValue, functions) {
var _temp = initialValue;
var _value = ko.observable(initialValue);

var result = ko.computed({
read: function () { return _value(); },
write: function (newValue) {
var shouldUpdate = true;
_temp = newValue;
if (functions) {
for (var i = 0; i < functions.length; i++) {
if (shouldUpdate && typeof (functions[i]) == "function")
shouldUpdate = functions[i](newValue, this.parent);
if (!shouldUpdate) break;
}
}
if (shouldUpdate) {
if (_temp !== _value()) _value(_temp);
}
else {
_value.valueHasMutated();
_temp = _value();
}
}
});
return result;
};



You need to supply an optional list of functions, each accepting a single value parameter and returning true or false, and the observable will execute them one after another until the list is over or until one of the functions returns false.

This is a working code (the example is based on a simple tutorial model):





This observable works perfectly with a brilliant Matthew Schnikel’s dirty flag extender – combined together they will arm you with really powerful input fields.



But the best thing about KnockoutJS is that it made me rethink my disposition towards Java Script. How Melvin Udall would put it:



KnockoutNicholson


© 2008-2013 Michael Goldobin. All rights reserved