I admit I’m not the first to suffer from development crawlitis. You start the project faster than Usain Bolt out of the blocks and you know for sure your schedule is over-estimated.
A week later and you’ve already slipped behind schedule by half a day. “No worries” you say because you know you and/or your team will make up that half day with coffee and enthusiasm alone.
Several months later your 30 day schedule is now a piece of paper nobody wants to take owenership of. The poor orphan in all your majestically titled Project Documents folder.
So where did it all go so awfully wrong?
I don’t think one brief blog post will enlighten anyone but from my own anecdotal evidence, the sins go something like this:
Thou shall not covet thy neighbours wife.
People like building things. But they like coming up with ideas more. Once the project starts its become “old hat” and new, sexier projects start catching your eye. Your imagination drifts and you wonder how great it would be to be the architect coming up with that cool new spec. It’s 5 o’clock and you realise you’ve just spent 4 hours imagining how you would architect wordpress if you were given the opportunity.
Thou shall not commit adultery
Once you start a project your project manager comes along and says “Hey, the man, we’re trying to get these funky new clients into bed with us, we need you to come up with a quick demo in your spare time”. Being the good boy or girl you are you say “Yes”. You’ve still only ever got past the first few pages of “How to say no without feeling guilty“. You know your schedule is tight and you know you don’t have any of this mythical spare time. But there seems to be a chasm and a disconnect between your brain and your mouth. The numskulls aren’t doing their jobs properly. Faster than you can say “productivity suffers when context switching” you’re now heavily involved in more projects than P Diddy. Next time you won’t make the same mistake you promise yourself.
Thou shall not make wrongful use of the name of thy God
You’re already behind schedule and your team cry salty tears over their latest sprint. The false prophet that was agile has revealed his true colours. Rapid Development was but a cruel prank by the devil. The fabled waterfall was just an illusion. Your architecture in hindsight turns out to be a contradicting piece of convoluted pipework that ends up dumping raw sewage straight into the sea. It all seemed stunningly obvious when you were drawing out the squares in MS Word. It looked even more solid when you applied that shadow effect underneath the yellow barrel that was supposed to represent what turned out to be several master-slave databases. It’s been written about for decades but it still doesn’t seep into our collectively thick skulls. Without gathering requirements and taking time to develop a prototype or carry out proper in depth research your project is doomed.
Thou shalt remember the Sabbath and keep it holy
Everybody needs a break. DHH reckons we can only program effectively for 5 hours a day. Once projects start slipping panic mode sets in. You try and hack your day to contain 48 hours but it just doesn’t seem to work no matter how many redbull-coffee-sugar concoctions you invent. Your body gives up and your brain seems to have seeped out with that 8th trip to the loo. Sometimes you have to admit you’re just a human. Ain’t no red cape gonna change that.
So then?
I don’t have any answers – but maybe realising that software development and systems building is a human endeavour that is prone to all the weaknesses of being human – will help us leave our pride at the door and stop believing in our own super-human abilities.
Islamikah (apparently, you can find your perfect muslim partner there) is back on the agenda after a slight lull in the development schedule. Ok completely ignored it is a better description.
Having decided to use the seemingly very useful and bordering on lovely Community Engine in place of a custom solution, the next step was testing it out in a live site. You can of course use your shell to install the plugins or you can cheat like me and ftp them on. It all depends how many cups of coffee you want to get through.
Right, so everything running like clockwork that is until you decide to break into the virgin home page and give the commnity aspect of the engine a good workout. Kabooom! Oh dear “image_science” caused the kind of mischief only a rails app can. Proudly crowning the top of my page was the following statement of error:
Define INLINEDIR or HOME in your environment and try again
Blimey, you were only supposed to blow the bloody doors off!
After a bit of digging and coming across this post I made the following changes to my setup:
- In my hosting user area created a new folder “islamikah.inlinedir” with permission 755
- In config/production.rb added the line ENV['INLINEDIR'] = ‘/path/to/islamikah.inlinedir/’
- Restart your server, or with fcgi kill any dispatch.fcgi processes (on hosting rails do $ killall -u user_name dispatch.fcgi). Your host may have different arrangements for restarting fcgi.
And all was well again in the land.
Ok, so finally the medixbox menus are coming together, they slide up, slide down, show the right state and all the other nitty gritty associated with prettiness. Quick launch IE tester. KAbbooom!!! “(‘background-position’) is undefined” or some other useful crap is spouted forth.
Now I am in love with JQuery, like everyone else. I’ve had my fair share of JavaScript woes over the years and using JQuery is like putting lipstick on a pig and actually looking nice.
Several coffees and expletives later it turns out Internet Explorer in all its reincarnations doesn’t seem to know what “background-position” is and instead retrieves its own “background-position-x” and “background-position-y” css rule. That’s all very nice and good but it means my code now has to have this:
function determine_x_pos(obj){
//parameter obj is something like $('#my-div')
var pos = $(obj).css("background-position");
if (pos == 'undefined' || pos == null) {
pos = $(obj).css("background-position-x"); //die in hell
} else {
pos = pos.split(" ")[0];
}
return pos || 0; //yes returning a 0 on fail is bad but its for demo!
}
In true NastyHabit fashion, the code is shit. Nevertheless, it works a treat!
The paranoid guy in me believes this cursed issue only afflicts me. Please check if you too have been burdened by the beast of redmond and help a fellow man feel less picked on by the curse of IE.
I needed to make a set of url slugs from the description column in our MedixBox database so knocked up a MySql function to perform the task. Needless to say the code is rubbish but it does the trick. Any funny characters are replaced by a ‘-’ and any ampersends replaced by the word ‘and’.
Enjoy at your own peril *I claim NO RESPONSIBILITY whatsoever if you cock up your database using this function*.
DROP FUNCTION IF EXISTS `slugify`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost`
FUNCTION `slugify`(dirty_string varchar(200))
RETURNS varchar(200) CHARSET latin1
DETERMINISTIC
BEGIN
DECLARE x, y , z Int;
Declare temp_string, allowed_chars, new_string VarChar(200);
Declare is_allowed Bool;
Declare c, check_char VarChar(1);
set allowed_chars = "abcdefghijklmnopqrstuvwxyz0123456789-";
set temp_string = dirty_string;
Select temp_string Regexp('&') Into x;
If x = 1 Then
Set temp_string = replace(temp_string, '&', ' and ');
End If;
Select temp_string Regexp('[^a-z0-9]+') into x;
If x = 1 then
set z = 1;
While z <= Char_length(temp_string) Do
Set c = Substring(temp_string, z, 1);
Set is_allowed = False;
Set y = 1;
Inner_Check: While y <= Char_length(allowed_chars) Do
If (strCmp(ascii(Substring(allowed_chars,y,1)), Ascii(c)) = 0) Then
Set is_allowed = True;
Leave Inner_Check;
End If;
Set y = y + 1;
End While;
If is_allowed = False Then
Set temp_string = Replace(temp_string, c, '-');
End If;
set z = z + 1;
End While;
End If;
Select temp_string Regexp("^-|-$|'") into x;
If x = 1 Then
Set temp_string = Replace(temp_string, "'", '');
Set z = Char_length(temp_string);
Set y = Char_length(temp_string);
Dash_check: While z > 1 Do
If Strcmp(SubString(temp_string, -1, 1), '-') = 0 Then
Set temp_string = Substring(temp_string,1, y-1);
Set y = y - 1;
Else
Leave Dash_check;
End If;
Set z = z - 1;
End While;
End If;
Repeat
Select temp_string Regexp("--") into x;
If x = 1 Then
Set temp_string = Replace(temp_string, "--", "-");
End If;
Until x <> 1 End Repeat;
Return temp_string;
END;;
DELIMITER ;
A second “boy” has been sentenced for the murder of the Goth Girlfriend, Sophie Lancaster. The vicious and senseless attack caused much soul-searching in the UK as to why their has been a gradual increase in the Yob and ”Chav” culture.
I’m more interested in the identity protection of “juvenile” criminals tried in “adult” courts for “adult” crimes. The disturbing murder of Sophie Lancaster came hot on the heels of another wolf-pack-murder this time of Ernest Norton, a pensioner playing cricket with his son. And if you think these are isolated cases causing mass panic for no apparent reason then shed a tear or two for Alan Fessey, Gary Newlove and others in Liverpool and plenty of other unfortunate victims of the drunken juvenile hordes.
Back to the Goth murder. The attacker was either 15 at the time of the attack or he is 15 now. Regardless, I want to know:
- His name
- Where he lives
- His face
If at the age of 15 he decided (as did his mates) that killing somebody because they dress slightly differently from the norm is quite funny, then I believe it is my right to swear at him and curse his face to eternal damnation. Or at least a few years in the slammer.
I do not want to be presented with an anonymous “boy A” banner scrolling across the bottom of my screen. No. I want a full scale 32” face menacingly peering at m. His eyes telling me he believes doing it for “a bit of a larf because they are Goths” is OK. It’s YouTube material. It’s an act just long enough to fit in his 5 minutes of mobile video recording time which he could Bluetooth to his equally Neanderthal school mates. I don’t want to understand what led him to becoming such a thoughtless moron. Right now I want him to be hung, drawn and quartered. I want the worst possible punishment under British law tripled especially for him. I want revenge on behalf of the public.
Because as morbid as it sounds, I want to feel like a good, law abiding citizen. I need “boy A” to make me feel morally superior. “Boy A” is my moral ruler. I want to feel I am contributing to this country even as a small cog in a huge machine in a positive way. I want confirmation my morals are superior to his. I want to know that good prevails over evil. I want to know there is some sort of deterrent to drunken moron teenagers going on the rampage. I want to know this country is becoming safer not more dangerous. I want to be part of a moral public victory against this juvenile monster. I need justice.
Saying all that a life sentence will be just fine Mr Judge Sir.
EDIT: The judge has lifted the ban on concealing their identities. Thank you. I feel slightly better. Rot in hell Brendan Harris and Ryan Herbert. At least the Judge seems to feel similar sentiments to the public, which is a step in the right direction.The Goth murderers of Baccup are finally brought to justice. This should be the beginning of a wider crackdown on this dangerously virulent form of juvenile entertainment.
Right, here we go. I’m sitting on the sofa, Homer like indentations have formed and I need money. My credit card companies love me because at this rate my childrens children will be paying my bills. My car is in need of various repairs and after the weekends drive past a gritting machine at 80Mph a new coat of paint. My woman is still not divorced so technically I’m a wife stealer. I have been fined twice for not sending my tax return. Woe betide me.
I’ve got to the point where I find solace in watching Steve Wilkos Show and Maury so my self-esteem lives on another day. My hopes for the next Web 2.0 web-app died with my hard drive, leaving me in good preparation for Web 3.0 (or if Microsoft have anything to do with it Web 2.5). And as each day passes my pre-mid-life-crisis plan of jetting off to India and Morrocco for some spiritual awakening has slowly frittered away via my wallet into the hands of the Kebab Shop. I live with my mum (and the rest of the animal clan). To add insult to injury Leicester are about to plummet into the 3rd division for the first time ever.
Just incase you didn’t understand my sorry plight – I live at home, I have no money and no job, my team are shit and I’m with a woman belonging to someone else. Allah Jesus Krishna Budha lords of the sky which wrong corner did I take to arrive at this fate?
Some days I wish I lived in Bridgend.
And so the obvious solution to these problems is to stop wallowing in self pity start a blog. A problem shared is a problem halved. And just like the mind numbing popcorn fodder “Untraceable” the more people that visit me, the faster my problems will die. Or as the great man himself would say – “Just Like That”.