Sunday, 23 September 2012

Dashlane to the rescue...

So my poor old work laptop was feeling the strain and work decided that I needed a desktop which could cope with all the development work we're doing at the minute. I'm not a huge fan of big old clunkers but on this instance I thought I'd give it a whirl... WOW! Peter specced and built it and it's the bees knees, he only sniggered a little when I said that I'd like to try Windows 8 but he did check that I was joking, Gawd bless him!

Anyway, I've not long been through the whole Windows re-install procedure so I had a little idea of just what was entailed in transfering all my stuff. There's the huge music library managed by MediaMonkey and then the eBook collection manged by Calibre and synced across various machines with AVGs Live-Kive. But then there's all the little things that need passwords and such-like. Chrome is lovely and manages to remember everything but what with being a development team I test everything on other browsers. There's Chrome, Firefox, Opera, Internet Explorer and (if I'm feeling brave) Safari too!

I need to remember the log-ins I've got for all those little services too, thankfully most of them have a web front-end so it's just a matter of logging in and downloading the installer but then I need to remember the password I used as well for the client application. That's where Dashlane comes in so useful. The link will to Dashlane will credit me but will offer no financial gain but I'm putting it there anyway as I trust that you'll love it too!

It was pretty much the first thing I installed on the machine so that I didn't need to worry about remembering all those passwords and log-ins. I have at least two browsers open at any one time - one for development (Firefox with Firebug) and one for GMail and Google Reader (Chrome usually). Dashlane syncs my credentials between these two browsers beautifully so taht I only ever have to remember the Dashlane password. Utterly brilliant! It's nice that things just work, especially at the minute.

But hey, don't just take my word for it, give it a try! There're apps for Android and iPad too - you wouldn't believe how useful they are too. Just fire them up and I can get access to my credentials without having to boot a big machine!

Saturday, 22 September 2012

Flirting with Catholicism



I've been polishing this anecdote for a while so I thought I'd best share it.

I've been going through the mill over the past two or three weeks and last Thursday (13th September, 2012) I couldn't sleep. I was well into my cups at this point and just not able to turn my brain off, not even Tesco's value whiskey was working - though I kept trying and purposefully ignoring the head-ache I knew I'd have in the morning.

I got to thinking about all the lovely people I knew who were getting some measure of comfort from their faith. One of my mates at school was one a Catholic, a good friend from work is one. One of people who's been phoning regularly in order to insult me and who's helped me ever so much is one. The lady up the road is one and, shock and horror, I discovered that I would've been one if my Grandma hadn't lost her faith. Most of my extended family are Catholics and they, as well as the people I've already mentioned are lovely, bright and sincere people. I felt that I simply must join their ranks! I'm re-reading this now and realising that the list of lovely people I know who are Catholics is staggering!

It all made perfect sense to me - I've always felt guilty of something or other: I've always felt as if I was to blame! Goodness knows I've an awful lot to feel guilty for, but even when I was too young to remember having done anything wrong I felt guilty. Perhaps a little confession would help ease that...? But without that feeling of original sin (whether it was real or imagined) what would I be left with? If I were washed clean of all my previous sins what'd be left? Would I be reborn as a psychopath? Without all the anxieties I have about doing right would I feel able to do what's wrong? All these questions and so many more were whirling around in my head lubricated by the ever so gritty whiskey - so I decided to do what every good geek does - I looked online.

I picked up the iPad and started up Chrome and entered "convert to Catholicism Cambridge UK". The number of results returned was just staggering but eventually I found a link which had a list and not just blah blah blah words. Ahh, a list, something I can work down and check I can fulfil the requirements.
  1. These was something about taking communion... I'd been to one when I did some voluntary work in a hotel for the disabled as a teenager in Southport and a lady needed an escort but the staff had been lovely about me not having to take the bread and wine. My old history teacher at school had talked for ages about Transubstantiation and the idea of mystic cannibalism had me thinking of all sorts of things like developing some sort of kuru. If I ignored the possibility of divine Mad Cow disease then I guess the option of a bit of plonk and a biscuit on a Sunday morning wouldn't be too bad - though with my propensity for strong drink the afternoon service might be better: at least the sun'd be o'er the yard arm! Tick!
  2. There was something about leading a good and moral life. Please refer to my rant about guilt! The load I carry is so huge that I really can't face adding to it so I try to lead as good a life as possible. I don't even kill bugs or anything like that. That crunch you hear when you accidentally stand on a snail in the dark means that I have to turn around and apologise. If I were anymore twitched I'd end up being a Jain! Tick!
  3. Confession? Hell yes! That's what I want. Feeling unguilty (should that be innocent?) for at least a little while (until I stood on a snail on the way out of the church or something) would be lovely. Perhaps my back would miraculously unkink and I might be able to stand up straight (Having said that I think I stoop because I was a tall kid and I didn't want others to feel intimidated by my height - of course I'm no longer tall what with diets improving over the last few years and me hitting 40 a month or so back (aren't you suppossed to loose an inch in height for each decade over the age of 40 you hit)). Perhaps I'd be able to do something immoral without fear of being crushed by guilt? Tick!
  4. There were ever so many other things, things that looked just strange and ridiculous but things that I felt I could do. Tick, Tick and Tick!
  5. Then there was the one about believing in Jesus as my lord and saviour (I'm pretty sure I should've capitalised that lord before?). Arse! Busted! That'll be a big fat angry red Cross!
At that point my crushing disappointment was met by the accumulated alcohol and I was able to retire with some hope of oblivion so I went and cuddled up with 'er indoors, sniggering at her groan and shiver when I placed my cold legs against the back of hers. Ohh goodness, more guilt ;-)

Perhaps though, I already am, my ex-wifes Grandmother was suspicious of me for ages because of my name. It took ever such a long time for her to be convinced that I was called Dominic because my Ma had high-church leanings rather than because I was a Tim. Things like that seemed to make a difference in Birkenhead in the 90s... If that's the case and I have some measure of genetic Catholicism then I've lost out on the redeeming bit. All I want is a little absolution.

Tuesday, 11 September 2012

17:00hrs Tuesday

In work at 6:00hrs, as is my want anyway, but really couldn't leave until after 4. It's a Tuesday see. Pie might have come after school with it being a Tuesday... he more often than not hadn't over the last few months, but he might've.

Sunday, 22 July 2012

JavaScript Unit Testing.

(Thanks Mrs Pop for the image, would've asked first but then you wouldn't have seen it in context. If you want I'll take it down?)
My Coding is, if I do say so myself, bloody brilliant. I test and test and test but that testing isn't done in a formal manner and I'm coming to realise that this has got to change. I've been doing the odd bit of unit testing in SalesForce and Andy at work mentioned JsUnit last week when he suggested I write the coding standards for JavaScript, so I guessed I should learn a little about what it means.
I did a little unit testing whilst doing my Java course at the OU so I knew a little bit about the whole Test Driven Development thing. I also use the jQuery JavaScript extensively and I guess that that has already been tested extensively - at least I hope it has. So the only things left to test are the functions I write myself and JsUnit is perfect for that.
For a friend who lives and works in France I'm developing an invoicing system which has to read and write out French currency formats. For those that don't know: the French use a space for a thousand separator and a comma rather than a full stop for the decimal separator, they also have the Euro symbol at the end rather than at the beginning of the amount. So a million Euros and twenty-five Cents would be written out as “1 000 000,25 €". Complicated ehh?
So I've two functions: one which take a float and outputs it as a French formatted currency string and another that takes a French currency string and returns a float.
I won't bore you with the functions, needless to say they involve shed loads of conversions between numbers and string s and then splits etc...
I will bore you with how I tested them using JsUnit though.
I downloaded JsUnit from github and placed the extracted folder on my server. I then created the following file:
<!DOCTYPE HTML>
<html>
  <head>
    <title>Unit Tests for my Functions</title>
    <script src="./resources/jsunit/app/jsUnitCore.js"></script>
    <script src="./resources/js/toEuro.js"></script>
  </head>
  <body>
    <script>
      function testToFloat() {
        assertEquals("0,50 € should result in 0.5", 0.5, toFloat("0,50 €"));
        assertEquals("1 000 000,25 € should result in 1000000.25", 1000000.25, toFloat("1 000 000,25 €"));
      }
      function testToEuro() {
        assertEquals("0.5 should result in '0,50 €'", "0,50 €", toEuro(0.5));
        assertEquals("1000000.25 should result in '1 000 000,25 €'", "1 000 000,25 €", toEuro(1000000.25));
      }
    </script>
  </body>
</html>
I then opened up the included testRunner.html using my browser and pointed it at the file I created above and, after a little playing with the functions, managed to get the tests to pass.
It's an interesting approach to coding TBH but one that I think I could get used to it!
The people behind JsUnit now no longer use it but prefer Jasmine. I've had a wee squint but really don't have time to investigate it further this weekend. I code all week at work and most of the weekend at home and really need to do something else this afternoon. I'm 40% through Gary Gibson's The Thousand Emperors and can't justify buying Neal Asher's Zero Point until I'm done... and browsing for SodaStreams is doing my poor nut in.

Sunday, 15 July 2012

Are The Archer's Anti-Traveler?

Caravan Boat image

There's reckoned to be a natural progression on BBC radio, You're supposed to start your listening experience with Radio 1 and then, as you mature, make your way up to Radio 4. I started with Radio 4 and had my choice confirmed for me when a nursing tutor suggested that if I wanted to be informed about what was happening in the world I should at least listen to Today every day.

I don't do this as much as I used to though as I'm no longer a nurse and I prefer to get my news either online via Reader or by listening to the No Agenda Podcast. That's not to say that I've totally given up on Radio 4. I turn it on when I'm cooking or eating and always first thing in the morning for a little fix of News. I even listen to The Archers, not religiously like. Just often enough to keep up with what's happening in Ambridge. I'll get lost every now and then though but I can always rely on my Ma to tell me what's been happening.

As an intermittent listener then I've been keeping abreast of the recent problems on Brookfield Farm (Have a wee squint 'ere: #farmageddon). I'm not totally up there with what's happening but I'm getting the gist and it's a wee bit concerning. David Archer is due to give evidence against a group of people who assaulted Adam Macy and left him in a coma after he tried to stop them stealing something from a farm...

That's all well and good and a reasonable attempt to liven up a show that's described as like real life - but more boring. But I'm not sure it's only me that sees this group of white van driving thugs as being an allegory for the problems faced by rural communities from Irish Travelers (Tony Martin anyone?). I've not heard an Irish twang in the threatening phone calls yet but I'm waiting.

What's more, I'm still not overly sure how I feel about it, that's if it isn't all in my head TBH. I've watched a couple of episodes of My Big Fat Gipsy Wedding, and I'm not sure how I feel about that either (I do watch an awful lot of TV for someone without a TV). I'm just not sure and I vacillate between how I feel about Irish Travelers but I'm conscious that they are in a vulnerable position in terms of the bigotry that's always just bubbling under the surface in the UK.

As an aside: I loved The Riches and would advise everyone to watch it.

As a second generation lapsed Catholic and a Bargee I'm even more conflicted. I'd have thought that the similarity of life-styles between Travelers and Bargees would've meant that we shared something but I think that I might be mistaken. I guess the enemy of your enemy isn't necessarily your friend - not that I see people in houses as the enemy. I've been called a "Water Gypsy" before and, while I was away with the fairies pondering the bucolic lifestyle of a boater with a nice camp-fire going in the twilight in a meadow beside a gentle canal, the chap hastily retracted it thinking I was away with the demons pondering GBH after being so insulted. Before I moved aboard there were some problems with Travelers and the boating community at Midsummer Fair. Even now there is a mass exodus of boats from Midsummer Common when the fair is due. I still remember seeing boats with wooden covers over their windows to protect the glass from projectiles.

This conflict is only exacerbated by a close run in I had with being a New Age Traveler in my youth. If my Ma hadn't put her foot down with such a firm hand I would have been on my way down to Glastonbury in the back of a smelly truck and sleeping in a Bender. The call of the road was loud but the fear of my Ma was ever so much greater ;-).

Interesting ehh? But like some sort of grotesque icing on the cake there is the issue of slavery. The case is interesting in that the people enslaved were "recruited" from the streets... some in the media were outraged but not so much that they could think of ways of providing homes for the homeless. So yeah, I'm conflicted, I'm also aware that one really shouldn't tar every member of a minority with the same brush - á la the "Water Gypsy" comment above. Indeed, so reticent am I to acknowledge membership of any other minority other than Yorkshireman I'm wary of even saying that I'm a Bargee. I know what happens to minorities historically and I don't want to be herded into a cattle-truck any time soon.

So what's to do? We go France at least annually (How very middle-class of us ehh?) and they've taken a rather drastic approach to the issue of Travelers, they've ejected them! I'm not sure that that approach is possible and I'm certainly sure that it's not one I'd suggest. There does seem to be animosity bubbling under the surface though and I'm pondering how long it'll be before Cameron et al decides that their campaign to make the poor the villains in the current economic crisis is a wash-out and decide to alter their focus to a target even more hated by the middle-class of middle England. A minority that is insular and doesn't pay taxes and has little or no respect for the laws-of-the-land perhaps shouldn't be tolerated in that land? That was ironic by the way; I'm more than sensitive to allegations of racism. I guess that's the joy of being a Yorkshireman, we hate everyone equally and don't discriminate, the only exception being that the only people we hate more than everyone else is each other or ourselves!

Is #farmageddon the opening salvo in a pseudo class war? And it could be that the animosity has always been there, I admit. Being a Yorkshireman I only ever heard the word "Pikey" when I was visiting relatives down South in my youth. I had absolutely no idea what the word meant and it was only when I moved down here that I clocked the sheer level of animosity. I guess there must have been reason for the animosity but I'll be blown if I know what the cause was, it seems to be just that way. I hear all sorts of stories but apart from the odd run-in with Traveler youth - no more than run-ins with non-traveler youths TBH - I'm unsure as to the rationale for the animosity - unless it's just the English animosity to the strange?

Goodness me this is a long post! I beg forgiveness but this is an issue that's been percolating for a while and I've got all sorts of conflicted feelings about it. I'm glad to have this forum in which the air them though so I'd welcome your thoughts/comments.

Thursday, 5 July 2012

JSRender Rocks!

var newCustomer = $("<div></div>", {"class": "customer row-fluid", "data-id": data.msg}).appendTo($("#customers"));
var newName = $("<div></div>", {"class": "row-fluid thingTop"}).appendTo(newCustomer);
newName.append($("<div></div>", {"class": "span6"}).html("<strong>Name:</strong>"));
newName.append($("<div></div>", {"class": "span6 name", "text": data.name}));
var newCompany = $("<div></div>", {"class": "row-fluid thing"}).appendTo(newCustomer);
newCompany.append($("<div></div>", {"class": "span6"}).html("<strong>Company:</strong>"));
newCompany.append($("<div></div>", {"class": "span6 company", "text": data.company}));
var newStreet = $("<div></div>", {"class": "row-fluid thing"}).appendTo(newCustomer);
newStreet.append($("<div></div>", {"class": "span6"}).html("<strong>Street:</strong>"));
newStreet.append($("<div></div>", {"class": "span6 street", "text": data.street}));
var newTown = $("<div></div>", {"class": "row-fluid thing"}).appendTo(newCustomer);
newTown.append($("<div></div>", {"class": "span6"}).html("<strong>Town:</strong>"));
newTown.append($("<div></div>", {"class": "span6 town", "text": data.town}));
var newPhone = $("<div></div>", {"class": "row-fluid thingBottom"}).appendTo(newCustomer);
newPhone.append($("<div></div>", {"class": "span6"}).html("<strong>Phone:</strong>"));
newPhone.append($("<div></div>", {"class": "span6 phone", "text": data.phone}));

So the above is what I used to do on a mates web application when she entered a new user to her system. I just knew there must be a better way though so I got to looking and looking and looking and saw something about jQuery Templates but then saw that they'd fallen out of favour. I think that that is a shame but they've been replaced with JsRender - which just rocks!

All of the code above ended up being replaced with this:

$("#customers").append(
    $("#addCustomer").render(data)
);

Of course I had to add this to the base page:

<script id="addCustomer" type="text/x-render">
    <div class="row-fluid customer" data-id="{{>id}}">
        <div class="row-fluid thingTop">
            <div class="span6"><strong>Name:</strong></div>
            <div class="span6 name">{{>name}}</div>
        </div>
        <div class="row-fluid thing">
            <div class="span6"><strong>Company:</strong></div>
            <div class="span6 company">{{>company}}</div>
        </div>
        <div class="row-fluid thing">
            <div class="span6"><strong>Street:</strong></div>
            <div class="span6 street">{{>street}}</div>
        </div>
        <div class="row-fluid thing">
            <div class="span6"><strong>Town:</strong></div>
            <div class="span6 town">{{>town}}</div>
        </div>
        <div class="row-fluid thingBottom">
            <div class="span6"><strong>Phone:</strong></div>
            <div class="span6 phone">{{>phone}}</div>
        </div>
    </div>
</script>

But what the hey, at least I'm keeping my markup where it needs to be, on the page. Who cares if it's something of a fudge...? I dare say I will soon, but it'll do for now ;-)

Monday, 2 July 2012

Android Emulator for Development with Arcus Global

At work we've been doing a fair bit of Android development of late at work and I was right naffed off with waiting for the Android Emulator to boot up each and every time I needed to test something (I do so wish I could sort out in my head what I need to do in one fell swoop but I generally plan like a loon and then implement a little bit at a time).

I installed BlueStacks and tried that and it was bloody brilliant, but I hadn't checked that it was great before-hand so I had to justify my choice (I'd tried it before you see at home) so I went through a process defined by a colleague and I documented the result on the work blog. I think it's well worth a read...

I hope you like the picture on the blog, it was taken on the way back from getting the boat blacked at the Lazy Otter on the 18th of June, 2012.