Wednesday 29 May 2013

You know BS when...

You know you're in for a bullshit laden day when:

i) The website you're viewing only opens in IE.

ii) The guy you know is due to hand over his project - today - is off "ill".

iii) Your network NIC starts to fap instead of work.

iv) You're working through a coding project, with the distinct feeling you've already solved this same problem before - get the network NIC to work again and voila there's the same code written by you 5 years earlier.

v) The guy you were writing code for thinks it strange you could not remember the exact lines of code to solve his problems, despite there being five years between his first asking and his re-asking.

vi) A support worker is not returning you bug reports, but spelling corrections in variable names.

vii) Your DVD drive stops reading DVD's.

viii) Your DVD drive starts working - but the only media playing application you have is Windows Media player - and its in "Playlist" mode, denying all knowledge of how to access a DVD.

ix) You're reading a history of programming/computing with references to 1968, and the exact same shit is going wrong at your current company!

x) Its 24 minutes past midnight and you're writing this mediocre blog post.

Thursday 23 May 2013

The Agony of a Defensive Programmer

By nature I'm a defensive programmer, a good example is whenever I use C++ I want to force wrapping of my classes as smart pointers, by making the constructors private and only giving a static factory create function, which returns a smart pointer wrapped copy of the pointer to the new class each time...

So, when I'm left to pick up the pieces after a non-defensive programmer is pains me immensely... Not least when the situation is an obvious like a file load.. Here's the gist of the problem, I'm not being specific, but lets assume:


if ( File.Exists(m_Filename) )
{
Load();
}
else
{
Create();
Save();
}

Now, if the file isn't there, you make a copy... And save it, whenever you come back you load it... "What's wrong with that?"

Well, the load function, lets take a look:

void Load ()
{
DeserialiseFile(m_Filename);
}

So, it just tries to read and deserialise the whole file?... yeah... and still not seeing the problem?

If you don't see the problem, a small part of me weeps for you... For the problems are many, and annoying, and mine to fix when you stroll off and leave this code as acceptable.

i. What if the file is corrupt?
ii. What if the file format changes?
iii. What if someone has saved a file with the same name?
iv. What is some sneeky so-and-so has saved a fake file there to try and force your system to do something strange?

All these problems, cause a crash of the attempt to DeserialiseFile, and so bring the program to its knees...

So what would I, the defensive programmer done?  Well, how about:

void Load()
{
try
{
DeserialiseFile(m_Filename);
}
catch (Exception l_e)
{
Output/LogError(l_e);
}
}

So, now the program doesn't crash, and you can detect out of date formats, or erroneous files, or corruption...

There are better solutions than this, but this isn't even my code, so I'm forced to do the bare-minimum to "fix" it, and to fix it I'm literally just catching & logging the problem, and then carrying on.

Wednesday 22 May 2013

Hidden in Plain Sight (DLLs & Documents)


There seems to be a penchant from software to hide its true ability, to obfuscate the obvious and even publicly visible guts of itself, anyone whom has had to program - properly program - for the windows platform will know what I'm hinting at... All those little hidden nuances, undocumented features, or flat out bugs.

This isn't to say all of them are hidden, or secret, but lots of things are.  Either through being close source software, or whatever you want to call it, but point of fact is, if you publish an interface for people to use and in that interface they can see many many things, you need to document them, even if your document warns people off of them.

By not documenting them you're not going to keep people from seeing them, they're there, and you're not going to stop  people poking and prodding them.  So, what are you achieving by pretending these kinds of things are not available?  Or not there?

Lets look at a case study... You are working for "Software Matic Corporation" and you release the new "SMC Interface" as a dynamic link library, and in that library's documentation you list the calls you want people to use, and they are:

"Connect"
"Disconnect"
"GetStatus"

Three, pretty innocuous calls, and you document not to call "GetStatus" before "Connect" and not to call "Disconnect" too soon and all the other rules.  And you shuffle this out the door for release.

Then Mr Software user at the other end, opens your dynamic link library and takes a look and he see's other calls... like;

"TellSMCSecrets"
"FormatHarddrive"
"CrashSystem"

And he starts to poke and prod these calls you never mentioned, and never intended anyone to use, and what happens?... Well, at the worst case Mr Software guy crashes his software or ruins his machine.  But will he blame his software?  Or will be blame your DLL?...

After all YOUR software call caused the problem... YOU released software with that call in it... YOU put it in the public interface!

You never intended the calls to be used, so they should not have been exposed in the public interface, not simply omitted from the document, omitting from the document is just wrong, its the software equivalent of denying the sky is blue (note: the sky is blue folks).

And if you Do put something in an interface like this DO put it in the document, don't exercise this penchant for omitting things.  Even if you only give is cursory "PRIVATE FUNCTION DO NOT CALL" note, its better than risking the ire, or even bad PR which comes from not mentioning something which is sat right there begging to be used.

Tuesday 14 May 2013

Outlook mail is a joke

I've been sat waiting to try and read my mail for over 10 minutes, I can see the mails, see who they came from and their topics.  But can I read them?  Can I hell....

Whenever I click on a mail is just sits there, and if I try to change into any of my alias accounts linked into this one then they do nothing they just show me that damned annoying three white dots whizzing in from the left and out from the right at the top... and its doing nothing.

Surely the point of mail is to show me the fucking mail, but it seems not, not in Outlook world.  I in fact think it needs changing from Outlook to In fucking Look, cus the bastard thing can't do what I need it to do.

And what's worse is, I didn't choose this mail, they forced it on me, I chose MSN over a decade ago, and I then settled down to their enforced change into Hotmail, but at least MSN and Hotmail both worked, these Outlook servers are just rubbish.

I've tried lots of things to get this work, I've tried using Chrome, then used IE to pacify the system, then I've tried from work, from a mobile device, from home, from wired, from wireless, from Windows 7, from Vista, from XP, from Linux... None of it my end is wrong it all works, and all used to work with Hotmail, but this new server is for shits.

Is that George?

Is it me, or does the narrator of this really really sound like George Carlin?


Telephone Manner


Its not often I get to speak to suppliers or customers that often any more, I used to all the time, and I cut my teeth in IT talking to the lovely people at Sco and NCR and AT&T being nice to them to get what we needed on a shoe string budget.

Anyway, its been a while since I was in any such position, and so it was a happy moment today when I had to speak to a support operator (a quite senior chap) at 3M about a problem we had with a device we're interfacing with.  The essence of the problem was that we're using the off the shelf driver on Windows, and we need to make it do a none-standard operation, an operation which currently requires a reboot - we just want it to do this operation without needing to reboot the whole machine.

A nice chat of a few minutes and voila, he's on the case and he was lovely - 3M good on you!

The interesting thing however was, as I came off the phone, three different people were staring at me... "You sounded dead posh"... one of them said... "Professional"... said another... "Like you were so polite and nice".

This has me worried, I thought I was always like that, and always have been... But it seems my telephone manner has been missed around here, I might start to talk to everyone in my telephone voice, it got such a big reaction I might just act like I'm doing Shakespear at work. lol

Monday 13 May 2013

The Stink

Here it is, for days, weeks I've been sitting here in the office saying... "SOMETHING SMELLS OF FARTS"....

I've looked all around my desk, I've checked the air vents, I've checked the window seal... No idea what it is...

Just now, I had enough of it, I was alone in the working area, and I could smell it... No aircon, nothing... The airs getting thicker and thicker with it.  So I open the window, and take a fresh air break.  Close the window and turn around... WHAFT!

So I start going like a blood hound... and I'm going... Sniff sniff sniff....

Not my desk... Not the other desk, not the machines... not the bin... The desk by the window.. sniff sniff...

Not the chair, not the draws... Sniff... Retch, the fucking plant.

The potted plant was rotting away... The guy has not been in in a while, but we leave the desk alone... and... sniff... fucking hell.

I take it to the kitchenette and lift it out the pot, and there's dried black scum all over the inside of the china pot, and then no water... So I wash the pot, and wet the soil... Whaft... OH GOD.... The smell once water hit the soil, 100x worse... Which is a bit of a laugh because the poor schmucks sat closest the kitchenette can do nowt but smell it now...

Its a little pay back, I've had that smell for weeks...

I've sorted it, and sprayed the whole office with air freshener, but still... drama.

The ironic thing is, I often describe the atmosphere in here as "being like a used trainer"... but I'd have taken the smell of an old Nike over this stench any day.

She's Drunk

Sounds pretty drunk to me...


Pretty damn hammered, jolly hammered, not vomit in the tulips, "Giz a Kiss" hammered, more... bang my hands on the desk and present a shit show drunk.

I like my local radio, I enjoy BBC Radio Nottingham, but if this were local I'd be ashamed.

Sunday 12 May 2013

World of...

I bet a few people who know me expect me to say... "Warcraft" here... but I'm not, I'm going to talk World of Tanks.  I started to play World of Tanks when it first appeared - I remember obsessing over the PC Gamer special pull out whilst on holiday and the moment I got home I installed it and went from there.

I have a Tier 7 heavy crew - driving the iconic German Tiger I - and a bunch of other all German vehicles.

I started to play again mainly because of the coverage of the game by Jingles.  But I'm meeting with a very divisive problem, either we win or loose, there's no grey area, there's no good games we loose, there's no bad games we save, there's just instant death and destruction... Or a victory.

The reason seems to be the people driving along side me... For example I just took my tiger out for the first time this evening, I was the highest level tank on my team - the only heavy - against 3 heavy Russian IS tanks... and basically even with a fully pimped 88mm gun, I could only take one of them with me, the reason?

I got no help, nothing... One tank Destroyer came with me, and we're there holding off basically ALL the enemy heavies.  I'm also having to spot... Yes, spot, in a heavy Tiger... instead of taking a key position, bottling the enemy up and ticking them off... all our mediums and all the lights fucked off a different way, leaving the entire right flank to just me and the TD... and once we both died and the Russians popped around the corner to rape us in the ass... Then the fucking retards in the team started to spam "Xelous (Tiger) Help!"...

I'm already dead fucktard, you killed me by fucking making me stick my nose out around this shitty corner to try and spot for myself and the TD...

Its so annoying.

Friday 10 May 2013

Defeat from Victory

Today has been a day of crushing defeat in the face of victory.

Firstly in World of Tanks, I played WoT when it first came out, but I laid off playing after bad experiences with it in a clan back in 2009.  All these years later I decided to jump back into it and having installed it and checking through my garage I got my light tanks out and went scouting, then a medium then a heavy and finally even tried some artillery play... Snatching defeat from the jaws of victory each game were the team mates around me, either morons driving up mountain walls, or retards asking - nay screaming - for artillery fire and then driving over the spot where the enemy where so I end up hitting them.... The numpty fuck-wit dick head random matches I got put into paled into a mash up of the worst of the worst each time.  So, I stopped playing that and set about doing something constructive.

I set about researching something for work - if I say what it was people will work out why I'm moaning and probably get a bit pissy with me, but suffice to say I spent three hours reading some very old (2005) manuals for some systems and finding a potential solution to a problem at work.

When I arrived this morning, I set about turning things into code, and with a prototype working I added the feature to the main system and delivered a build... Only, the main system would not work... The prototype fine... Main system... nada...

"Have you tried this before - manually - before I wrote any software?" I asked.

"Yes"

"Right, well, its not working is it..." back to the drawing board I went, two more checks and multiple re-reading, it should work.  "You've tried that action on this software on this machine?"

"Oh, no, not on this machine on that one" Points to machine over the side of the room.

"So, the machine which is fitted with hardware from 2009, hardware running a different operating system and software system works - whilst this one you've never tried?"  I ask hoping they'd spot my worry.

"No, never done it on this" They're too chipper for my liking.

"I don't think you're grasping my drift here" I sit and explain "I only did this change as you told me that you needed it and had the rest of the system working on this old box, that was the only reason I did all this reading, and all this work this morning."

"Oh, well I never ran it on this machine" he's still smiling.

"Yes, but I thought you had, I asked if you had and you said 'yes'"

There you go, more defeat int he face of victory.  After a bit of cajoaling they're going to get a new piece which can test the feature required on the hardware, proving whether what they want is possible.  My code should work for them, but you know... Right now I'm so deflated.

From Hotmail to Outlook

Oh and on a side note, I spot this about Hotmail migration to Outlook, believe it or not my main e-mail address is (or was) a Hotmail address.  Its actually an Microsoft Network (MSN) address - pre-dating Hotmail - but they migrated me to Outlook, and yes yes I can attest using Outlook web mail is shite.

It looses mails, it can't deliver on time, lots of time it sits with the marquee progress whizzes dots at the top of the page but never completes the operation.

The completion of names in the address box is rubbish, and the lack of a definition between subject and mail body in the editor portion if inexcusable.

But, I've been using my msn address so long (over 14 years) its sort of stuck to me, migrating away to another of my mail addresses is going to take a LONG time, I may alter things slowly, but in essence the change to Outlook is utterly shite.

Tuesday 7 May 2013

The Server is wonky...


I'm back at work, first day back from being so ill, and it is nice to see a computer and keyboard free and clear of clutter for me to get working with.  However, I've run into that ethereal problem... something one the network is not playing ball.

The something today is the main source control server, which whilst I was checking out started to kick me off... Midstream, three attempts later and frustration mounting I e-mail IT.  I've not talked to the general server bod, because last time I asked him about this exact problem - Monday before last - he fobbed me off with a load of Windows Server gibberish which didn't wash with my informed self.

But, being a good boy, and ex-IT minion I did the leg work for them I pinged the server, checked my connection, rebooted all virtual and physical machines and tried from another machine first.

Turns out the problems, all of them, are real, I can't connect to the main source control server, the main server bod was not aware of the problems and indeed I could not connect to the server.  The reason being, on the first day of the week IT let themselves install all the Microsoft hot-fixes and patches to the server... without letting anyone know.

And, this being a Microsoft server, of course it doesn't tell any of its users - *cough* customers! - what its doing, it just reboots with installs and that's the end of that.

So that was why I've sat with my thumb in the air waiting for something useful to happen for the past hour... IT policy, sometimes a ball-ache, sometimes a balls up.

Sunday 5 May 2013

Coasting to a halt...

I have had a hell of a week, it started badly with a pressing feeling growing in my chest all last weekend, so much so that by Tuesday morning I had a boiling heavy feeling in my chest - which forced me to hassle my doc into seeing me last Tuesday afternoon and was promptly informed I was about an inch from major pneumonia in my left lung.

He gave me a shed load of drugs and I spent the next forty eight hours in agony, and let me tell you folks, it was agony, fluid in the lung made it so painful, and being the left lung I could not rest the weight of it pressing on my heart.  And if I lay flat the weight was on my spine, that was more agony.

A massive fever, which broke Friday morning around 4am has seen me slowly recover.  I even took a gentle walk this evening.  But I'm now awaiting the inevitable backlash of having used anti-biotics & pain killers... Basically I'm about a half day from shitting my arse out.

Apart from that I did do some coding, for work and for pleasure.

I took a look at the C++ tutorial from Linux Format - and then closed the magazine and sagely decided not to comment - as a professional programmer and C++ fan - could they have tried to present a more ugly disjointed unfavourable and plainly boring introduction to the language?... The chap writing it even commented there are no media libraries for the language... Dude, don't you know EVERY major game on nearly ever major platform has a beating heart written in C++ and has had since Half-Life!

I have also played a few rounds of War Thunder - and made a level in the Russian Tech tree - which cost a pretty penny to buy all the accompanying planes and upgrades.  But, they've still not fixes the earning ability, its all very well some commentators saying "you have to earn the cash for a new rank" and "it was too easy to earn cash before", but at a little under 3,000 cash for a mediocre game, 4,500 for a better game.  Its an utter ball ache - still - to gain over 100,000 just to buy a tier 7 plane, but then you get splashed for ammo wracks, robbed for putting the plane you just paid through the nose for into service and finally fucked over trying to earn anything with your first 10 free repair fly outs!