Blog

  • Letter to the Chairman

    Dear Ron Martin, Have you heard this one? A guy walks into a bar and asks the barmaid for a pint of bitter. ‘Sure’ she replies. ‘With every pint of bitter we are giving away a free bottle of champagne and a full steak meal!’ ‘Wow’ replies the startled man ‘..and how much is that?’ ‘That’ll be 50p’ replies the barmaid. ‘I need to come here more often, so are you the landlady?’  asks the man ‘No, I’m the land lords wife. The landlord is upstairs doing to the barmaid what I’m doing to his business’

    The question is Ron, who is upstairs with your wife?

    This can be the only reason why you are dealing with our finances in such a nonchalantly inept way. Our club is haemorrhaging money. The current figure is a staggering £100k a month. A £100k A MONTH LOSS? To run a league 2 football team? It sounds like a task that even Richard Prior in Brewster’s Millions would turn down. Yet you manage it on a monthly basis. Impressive!

    Here are a few starters for you to perhaps plug the holes in this sinking ship. You’ve managed to sell off the programme vendors for what I can only assume is a quick short-term financial gain. Why would any 3rd party want to take up this venture unless they’d worked out that in the long run there’s money to be made? While we are on the subject of a quick buck the brewery-run bars in the ground should also be run in-house. With a bit of imagination, I’m sure we could work out a way of monetising a bar in a football ground. Currently to ensure you receive a pint before the end of the season you have to head to the bar 15 minutes before the end of the 1st half. If you are unlucky you may get the sweet but slightly senile barmaid. Who even with the aid of the calculator and an epoch of time, will try to fleece you out of change. Here’s an idea, tills and more bar staff! Speculate to accumulate Ronald.

    Hospitality: Cordial and generous reception of or disposition toward guests.

    Maybe you should explain this definition to the staff in ‘hospitality’. David Crown does a fantastic job comparing the day but is let down by the rude and obnoxious staff that surrounds him. On the LAST occasion in ‘hospitality’, my friend asked the woman carving the meat if he could have a bit more. He didn’t ask if he could shove his fist in her arse which the look she gave him would suggest. She proceeded to turn the meat around so she could trim the arsehole off and put it on his plate. This with the constant bickering of the bar staff took the gloss, the undercoat and the wood off an otherwise lovely day. Repeat custom unlikely.

    This is the big one Ron so listen and listen hard. Don’t let people in for FREE for months. I know, pretty drastic huh! It turns out some season card holders’ Direct Debits haven’t gone through. Surely some kind of clerical error? OK, so you’d think the best way to sort this would be to ring the cardholders immediately to get this resolved?  Apparently not. I’ll tell you what we’ll do instead, we’ll wait until midway through the season and then demand £300 by confiscating their season card! I can only assume that the meat carving lady is also in charge of customer relations.

    Ron, treat people in this way and they won’t be coming back and more importantly, they won’t be paying the £300 we so desperately need. The Direct Debit debacle happened to my mate although they actually tried to charge him £305 as there was a £5 admin fee. A fee they were willing to waver if he settled up there and then. How preposterous is this! Just when I think nothing could surprise me anymore the club manages to pull another outrageous stunt. It’s almost a test to see ‘how much they’ll put up with’. Not much more I’m afraid Ron. Until you buck up your ideas you’re going to be a very lonely man sitting in an empty new stadium staring out at fields where the main stand should be.

    Kindest regards,

    Len

    P.S. please please please stop!

  • HTML5 Dynamic Charting

    I recently attended an HTML5 workshop held by
    Mr Remy Sharp. I was the only honest schmo in the room to admit to having already
    purchased the HTML5 book on offer. I was waiting for the free T-shirt that
    never transpired 🙁 The workshop itself was really interesting and I left with
    the usual ‘I’m going to change the world with this new knowledge’ excitement.
    A few months have passed and I’ve finally got around to writing this blog (the
    changing the world part will have to wait).

    The part of the day that really got my juices flowing was the Canvas tag
    stuff. It’s perhaps embarrassing to admit but I’d not had any dealings with it
    beforehand. The bit that really blew my top was the traversing through each
    pixel of a transposed image on the canvas and altering each one. Simply
    amazing. During my lunch hours at work, I wanted to investigate the Canvas tag
    in more depth. I wanted to create a simple table of data, that using
    JavaScript, could be used to generate a simple line graph. I wasn’t even sure
    if it was possible.

    Just a quick mention of
    Zen-Coding
    which I was also introduced to at the Workshop. Imagine being able to write
    entire blocks of HTML shorthand and then convert them at the press of a
    button. So

    div.class-name becomes
    <div class="class-name"></div>and

    ul>li*3 becomes
    <ul><li></li><li></li><li></li></ul>
    (Tabbed in reality)Back to the point…

    Generating a line graph on the fly

    The final example can be seen
    here. I started off with a basic table of data within my HTML5 document.

    Day Jokes Learnt Girls Numbers
    Day 1 5 1
    Day 2 7 1
    Day 3 10 3
    Day 4 20 4
    Day 5 40 7

    Here we are studying the highly scientific effect of comedy on the fairer sex.
    The next thing I added was the container for my X and Y labels and a key
    holder which explained what the line represented.

    
      <div id="y-axis">
        <ul id="y-axis"> 
          <li id="label-1"></li> 
          <li id="label-2"></li> 
          <li id="label-3"></li> 
          <li id="label-4"></li> 
        </ul>
      </div> 
        <div id="canvas-holder"></div> 
        <div id="key-holder"> 
          <table id="key"> 
            <tbody> 
              <tr>
                <th>
                  Key
                </th> 
                <th>
                  Value
                </th> 
              </tr> 
            </tbody>
          </table> 
        </div>
      <div id="x-axis"> </div>
    
    

    I learnt at the workshop about document.querySelector and
    document.querySelectorAll. Both return the corresponding DOM
    elements of the queried parameters. I wanted this HTML file to be
    self-sufficient and not require any 3rd party JavaScript libraries. So using
    these DOM selectors I did the following.

      
        var can = document.querySelector('canvas'); 
        
        // Traverse each header to work out the keys required
        var thList = document.querySelector('#data').querySelectorAll('th');
        var dataKey = new Array();
        // Start count at 1 to avoid our blank cell
        for (i = 1; i < thList.length; i++) {
          dataKey[i] = thList[i].innerHTML;
        }
      
    

    The first line assigns our canvas element to the variable
    can. Next up we use the headers to define the number of lines
    we need on our graph and what they represent. Notice that the count starts at
    1 to ignore the first th cell which is empty. We assign these
    variables to an array (dataKey).

      
    // Use the td content to derive the data array
    var tdList = document.querySelector('#data').querySelectorAll('td');
    var dataArray = {};
    var dataCount = 0;
    var currentKey = '';
    
    // Variables for our X and Y labels
    var smallestFigure = 0;
    var largestFigure = 0;
    var xLabels = [];
    var xlableCnt = 0;
    
    // Traverse the td to derive our data array
    for (i = 0; i < tdList.length; i++) {
      // Set smallest/largest if value is a number
      if (!isNaN(tdList[i].innerHTML)) {
        var testNumber = parseFloat(tdList[i].innerHTML);
        if (!smallestFigure && !largestFigure) {
          smallestFigure = testNumber;
          largestFigure = testNumber;
        } else {
          if (testNumber < smallestFigure) {
            smallestFigure = testNumber;
          }
          if (testNumber > largestFigure) {
            largestFigure = testNumber;
          }
        }
      }
    
      // Col 1 is the key for this row
      if (dataCount == 0) {
        currentKey = tdList[i].innerHTML;
        dataArray[currentKey] = {};
        xLabels[xlableCnt] = tdList[i].innerHTML;
        xlableCnt++;
      } else {
        dataArray[currentKey][dataKey[dataCount]] = tdList[i].innerHTML;
      }
    
      // Count starts at zero
      if (dataCount == (dataKey.length - 1)) {
        dataCount = 0;
      } else {
        dataCount++;
      }
    }
    
    

    OK, this may look slightly overwhelming. Just take some deep breaths and I'll
    talk you through it. What this code is trying to do is to use the content of
    the table to form a data array. Firstly the tdList becomes a
    holder for all of the content within the td tags. Next, we
    define all of the variables we are going to require to get our array. We loop
    through all of the td DOM elements. For each
    td element, we check whether the content is a valid number.
    If it is we check the value against previous values to determine the largest
    and smallest numbers. This will be used to determine our Y axis range. Our X
    axis labels use the first (vertical) column in our table. Each label will also
    be used as our array key to determine the values plotted on the canvas.

    
      // Each value will be worth a units worth of pixel
      var unit = can.height / largestFigure;
    
      // Lets now get our side label
      document.querySelector('#label-1').innerHTML = largestFigure;
      document.querySelector('#label-2').innerHTML = (largestFigure / 4) * 3;
      document.querySelector('#label-3').innerHTML = (largestFigure / 4) * 2;
      document.querySelector('#label-4').innerHTML = (largestFigure / 4) * 1;
    
      // Our bottom label
      var xWidth = can.width / xLabels.length;
    
      // Lets fill our x labels
      for (i = 0; i < xLabels.length; i++) {
        xSpan = document.createElement('span');
        xSpan.innerHTML = xLabels[i];
        xSpan.className = 'spanBlock';
        xSpan.style.width = xWidth + 'px';
        document.querySelector('#ul-x-axis').appendChild(xSpan);
      }
    
    

    Next up we use our assigned variables to determine the X and Y axis labels. We
    find our unit (what each value is in pixels) by taking the length of the
    canvas and dividing it by the largest figure we have. The Y axis is split into
    4 so is not very dynamic, I'm sure you can do better. Also, you may have noted
    I've picked some nice round numbers in this example, barely the case in
    reality! Our X-axis uses the xLabels variable we assigned to
    early. We create a new span DOM element and set the inner HTML to match the
    value of the label. Now for the fun part...

    
      // Check whether we can use the canvas 
      if (can.getContext){ 
        // Get our object
        var ctx = can.getContext('2d');
        
        // Black out back ground 
        ctx.fillStyle = '#000'; 
        ctx.fillRect(0,0, ctx.canvas.width, ctx.canvas.height); 
        ctx.fillStyle = '#fff'; 
        ctx.strokeStyle = '#fff'; 
        
        // default drawing style 
        ctx.lineWidth = 5; 
        ctx.lineCap = 'round'; 
        ctx.save(); 
        
        // Define array of fill colours first element is 
        // blank so that our keys can be used 
        strokeArr =new Array('','#fff','#0000FF');
        
    

    The first line checks that we can actually use the
    getContext method of the object. We set up our ctx object
    which allows us to draw on our canvas tag. We create our black rectangle which
    covers the canvas, this is the base for our chart. The
    lineWidth and lineCap set up how our line
    graph will look on the canvas. Our strokeArr sets the colours
    for each of our lines. This isn't at all dynamic. You may ask
    'why is the first element blank' and
    'what if someone adds another column'. To which my response will be
    'Shut the hell up!'. Anyway, we are now ready to start drawing our
    lines.

    
      for (i=0;i<dataKey.length;i++) { 
        if (dataKey[i] != undefined) { 
          // Set Starting point 
          ctx.strokeStyle = strokeArr[i]; 
          ctx.beginPath(); 
          ctx.moveTo(0,500); 
          
          // Set defualt points 
          xPoint = 0; 
          yPoint = 500; 
          
          // Item in object
          xCount = 0; 
          
          // Loop through items 
          for (o in dataArray) { 
            // X point moves along with the count 
            xPoint  = xCount * xWidth; 
            
            // Use the unit calculated earlier to calc the y point 
            if (dataArray[o][dataKey[i]]) {
              yPoint = 500 - (dataArray[o][dataKey[i]] * unit); 
            } else { 
              yPoint = 500;
            } 
            
            // Start new line or join existing 
            if (xCount == 0) { 
              ctx.moveTo(xPoint,yPoint); 
            } else { 
              ctx.lineTo(xPoint, yPoint);
            } 
            
            xCount++; 
          } 
          
        // Add stroke
        ctx.stroke(); 
        
        // Add this row to key 
        keyTr = document.createElement('tr');
        keyTd = document.createElement('td'); 
        keyTd.style.backgroundColor = strokeArr[i]; 
        keyTr.appendChild(keyTd); 
        keyTd2 = document.createElement('td'); 
        keyTd2.innerHTML = dataKey[i];
        keyTr.appendChild(keyTd2);
        document.querySelector('#keytbody').appendChild(keyTr);
      } 
    }
    
    

    We are now ready to use our data array which we generated earlier. We loop
    through each item (line on the chart) which contains an object of points on
    the map. The strokeArr value is the colour of the line. The
    beginPath method is the equivalent of taking your pen off of
    the canvas. The moveTo method puts the pen back on the canvas
    at the correct point, in this case where the X and Y axis meet. We start
    looping the points on the canvas we need to draw.

    The xPoint (where on the X axis we need to plot our point) is
    calculated by using the xCount (number of iterations through
    our X-axis) times the xWidth (number of pixels between each X
    label). The Y axis is a little more complicated as the lowest Y point isn't 0
    it's 500 (because the canvas start at the top left not the bottom left). We
    use our data value and times it by the unit which gives us the number of
    pixels up we need to be. We have our X and Y points so we now just need to set
    them. We check whether this is a new line or an existing line and plot the
    point accordingly. The ctx.stroke() fills the line for us.
    Now we have our line we need to create a record in our key table. The first
    td is filled with the same colour of the line while the
    second td holds the label for that line. We append the new
    table row to the key table.

    And that's that. I was very impressed with the ease with which we can do this
    funky stuff and look forward to more of the same!

  • Obsession

    Our bundle of joy is going to be a boy! For me this is awesome for many reasons but mainly because it means I have someone to…

    1. Play football with
    2. Have a beer with
    3. Buy violent toys for
    4. Take to Roots Hall
    5. Play practical jokes against the Mrs with

    There is a certain degree of pride in producing an heir to the Bennett empire. An empire which currently consists of a few guitars and a Ford Fiesta. I can envisage a trip in Brenda (the name for the Ford Encore) saying ‘One day Son, all this will be yours!’. Another benefit of not having a daughter is the awkward interrogation of the potential boyfriends and subsequent financing of the Wedding. Instead, I’ll be giving the boy advice on how to win over the Dads and then make the appropriate dash for it. I was thinking though, the only downside to having a boy is the pressure we may inadvertently put on him. As a boy, you automatically think of the possibilities of a Nobel prize winner, an author or a musician. This got me thinking about my own short fallings as a human. And you know what? I couldn’t find a single thing (just kidding).

    My main problem, which I don’t think is that uncommon is wanting what the Jones have. I often look at the successful people in life and I wonder how they’re any different to me. Apart from the obvious gulf in talent, these people have one thing that makes them particularly different from me. Obsession. A real single-mindedness to accomplish what they need to. Bill Gates’s obsession with getting computers into every home, Warren Buffett’s obsession with mastering the markets and Lionel Messi’s obsession to become the world’s second greatest football player (me obviously being number 1, a career blighted with injury). The self-control to spend every living moment of your life dedicated to achieving your goal. Simply amazing and commendable.

    I’ve met a few people in life that seem to have this obsession. Their complete ‘I don’t give a fuck what you think’ attitude is for me the most impressive trait. When I start to look at what these people have, I have to remind myself that it’s because when I’m playing FIFA they’re working hard. A lot of people expect success just to fall in their lap. Why should it? You’ve done absolutely nothing to deserve it! Maybe this is down to the sense of entitlement we have in this country. Why the dribbling heathens turn up on X Factor expecting to become the next Rick Astley. Why Dave and Tracy expect the state to move them to a nicer house after Tracy popped out baby number 8. Just because you aspire to be as useless as Jade Goody doesn’t mean you’ll reap the same rewards. The only REAL thing I feel entitled to in life is fairness. Even that seems like too much at times. If I say my P’s and Q’s so should you, you ignorant peasant. I pay my fair share into the system so when I need something back shouldn’t I have the same entitlement as everyone else?

    I think you cannot force obsession. If you don’t want something badly enough you’ll never get to the levels of obsessions you need to accomplish it. So for Junior, I’ll love him and guide him as best as I can. I’ll be proud of him regardless of which life path he decides to take. Having never had an obsession before I can’t wait for him to be my first!

  • Fatherhood

    Sleepless nights, tantrums, and strange coloured pooh. These are just some of the side effects of being told you’re going to be a father. The fundamental fact of things is that we men, by our very nature, aren’t built for this. We are built like a B52 squadron. Deliver the package and get the hell outta there. Women, on the other hand, have a natural instinct to have kids by the time they hit puberty. A lot of girls in my school needed no further encouragement.

    Society has drilled into us what a stable family looks like. We’ve all seen The Waltons. Although, how many sodding kids do you need. I know it was set in the 30s before the ‘ribbed for her pleasure’ prophylactics but I’m sure the Dad could of put a sock on it? Any hoot, back to my point. The image of this family life is a portrayal and it isn’t natural, so for us men, it takes a lot for us to fight off the urge to get the hell out of dodge. It’s pathetic and don’t you think we know this. We’d never envisioned it to be like this. We had it all planned. The platinum albums, the World Cup winner’s medal, and the Nobel prizes. By accepting fatherhood, it’s like you’re accepting defeat the dream is OFFICIALLY over.

    So 3 months or so back Hannah tells me the news! Still a shock at the best of times let alone on day one of a ‘month off the booze’. For some reason, my logic assumed it would take a lot longer. Hannah had been on the pill since she was 17 so to conceive within 3 months was a shock. It all seemed surreal until our first scan. It left me breathless. There was our little dude/dudette. It hit me for 6. Time to man up Len! We cleared the spare room (nursery) which involved boxing up my songbooks, guitars, and football memorabilia. No bitterness just a slight sadness that I hadn’t seen through these hobbies to their fullness. I hope that one day I’ll open up these boxes and have someone to share these past times with. So a new chapter in this saga I call life. As one door closes another opens and all that jazz. I get the butterfly feeling of excitement when I think about what’s behind door number 1.

  • Religion – The Answer

    With the Pope’s visit this week I thought it was about time to get religious. Normally this conversation takes place after about 7 pints. So writing this with a sober head is refreshing and hopefully quite coherent. When asked what religious persuasion I am, I say the most ‘sitting on the fence’ answer there is. ‘I’m agnostic’. In other words, I’m saying I’m a man of science but I don’t want to write off completely the prospect of an afterlife. One of my favourite comedy lines of recent years is from the BBC3 sitcom ‘Hyperdrive’ where one of the agnostic characters is reunited with a former love. It went along the lines of …

    Agnostic: ‘Since you left I’ve given up my religion’

    Former Lover: ‘You should never give up your belief that there may, or may not, be a God’

    I’m a fairly cynical person, who believes, that the origin of religion was a primitive form of law. It plays on a fear of the unknown that we all share ‘what happens when you die?’. We’ve made such huge advancements in science that we now believe we have all the answers. This is surely getting ahead of ourselves? There’s still so much to be discovered. I’m not making my bed until I’m absolutely convinced. And even then there will be some small room for the thought of a magical land called heaven.

    Frankie Boyle: ‘Nothing matters. We’re essentially all highly evolved monkeys clinging to a rock that’s falling through space and the rock itself is dying.’

    What’s worrying me at the moment is this current wave of anti-religious feeling. I think the press (again) has to take some responsibility for it. The recent Pope aide story was made out to suggest that Cardinal Walter Kasper thought our atheist nature made us a 3rd world nation. That’s not entirely accurate. He stated that flying into Heathrow (shit hole) sometimes gave you the impression of flying into a 3rd world country. Also that there is a worrying wave of atheism. I couldn’t agree more. I’m not anti-atheism but with any wave of media frenzy, there may be consequences. We’re currently lucky enough to live in a multi-cultural and TOLERANT society. The more stories bashing religion the more this tolerance is under threat.

    I’ve just realised the title of this post has ‘Answer’ in it. Unfortunately, as I’m a mere mortal I have no answers for you..sorry. I think no matter what beliefs you have, you have to follow your OWN moral compass. Too often people hide behind things to defend their own actions. It’s the old Nazi argument of ‘I was just following orders’. The Catholic priests could argue perhaps that the 10 commandments doesn’t specifically mention anything about whether you can or can’t abuse kids. I think the most important thing is CONSIDERATION. Put yourself in the other person’s shoes but remember that they aren’t you so accept their differences. Stick by that and everything else will be cream cheese.

  • dConstruct 2010

    So on Wednesday I get asked if I would like to attend dConstruct at the Brighton Dome. My normal reaction to anything not predetermined within the last month gets an automatic ‘no’ response. However, I thought this would be good for me and would (if nothing else) mean 2 days out of the office.

    Before I break down the event itself, I want to reiterate a few things. I’m a developer NOT a designer. As much as I would love to be both, it just ain’t gonna happen. You are talking about someone whose art teacher laughed at one of his projects to his face. Someone who by stage 5 of every single Photoshop tutorial gives up as the piece of shit on his screen looks nothing like the example. I really enjoy my job as a Software Engineer for a private investment company. We deal with the company’s portal which is only ever seen by a small number of clients. I develop in my spare time and am a keen learner of any new technologies. I don’t idolise other proficient developers/designers/gurus or wish to discuss developing down the pub with my mates.

    Day 1 – Designing a Flexible Process with Simon Collison

    My expectations
    I am a man of logic and reason. I have never been involved with a project that has run perfectly. This should be ideal as it will show me an approach that I can adopt in the future and everything will be plain sailing.

    What happened
    Simon was a nice and approachable chap with bags of enthusiasm and experience. We followed the processes which he has adopted in the past with varying degrees of success. This doesn’t sound good ‘varying’. We were constantly reminded that every client is different and requires an agile approach. It doesn’t look like I’m not going to get the ‘perfect project process’ formula I was after. The team exercises were really good fun and reminded me of the initial excitement you get when starting any new project. Overall it was aimed predominantly at design agency-esq businesses. Which was probably right looking at the rest of the audience.

    Relevance To Me – 3/10

    Relevance To Designers – 8/10

    Stuff Learnt

    1. I need a new Macbook Pro (Everyone in there had a more recent model)
    2. To start any project you need to consider all platforms (iPhone, iPad, Televisions)
    3. I need to change my new site scripts to create media specific CSS
    4. I need to use the Javascript moderniser script to upgrade all browsers to be HTML5 and CSS3 compatible

    Day 2 – The Conference

    Marty Neumeier

    A good start. A really interesting talk regarding the history of businesses and how they’ve adapted. Also what role innovation plays in success and how it can go wrong.

    Stuff Learnt

    1. Your product needs to be good and different
    2. Innovation is the key to success
    3. Businesses need to be constantly designing and taking risks

    Score – 8/10

    Brendan Dawes

    A humorous talk with some visually amazing slides. It was all about gathering as much inspiration as possible, considering what you have, and then reducing it to perfection. Unfortunately not relevant to anything I’m involved in but I’m sure this will be a useful approach for the designers.

    Stuff Learnt

    1. Sometimes you shouldn’t need to explain design decisions, they should just happen
    2. Don’t go to the Piccadilly area of Manchester

    Score – 7/10

    David McCandless

    This talk was about how information is beautiful. I did feel that this would be more for me. I wasn’t disappointed. He had some excellent examples of misleading information. And how that putting information in another context can create some compelling results.

    Stuff Learnt

    1. Despite having quite a dry data set, it can be made more interesting
    2. You can establish patterns more clearly once the information has been organised in a more visual manner
    3. The media clearly have an Outlook reminder for scaremongering

    Score – 10/10

    Samantha Warren

    This discussion was about Typography. A subject I have little knowledge of. She was very enthusiastic and clearly loves what she does. It was a mainly male audience so I wasn’t sure about the shoe analogy really worked for the audience. Give a girl a microphone and it won’t be long before they start banging on about shoes (sorry I couldn’t resist). To be fair the analogy did work quite well.

    Stuff Learnt

    1. Legibility is vital in a font type
    2. The character of the font should emote the context it sits in

    Score – 7/10

    John Gruber

    He opened by showing a tweet from one of the audience which was a picture of the guy outside the Brighton Dome stating ‘Only 16 hours until the Gruber!’. He asked the guy to raise his hand, and these really excited hands came up waving frantically. I turned to my colleague ‘what a douche’. He discussed that any project is only going to be good as the controlling force behind it. The analogy he used was that of film directors, particularly Stanley Kubrick. Who took control of every single aspect of the filmmaking process.

    Stuff Learnt

    1. If you are in charge ensure you listen to the people with more talent than you (a key lesson I wish some previous project managers I’ve worked under would have listened to)

    Score – 7/10

    Live music at dConstruct
    Live music at dConstruct

    Hannah Donovan

    Hannah started with some improv live music which was awesome. That was until the dick whose phone rang mid-way through. Hannah discussed the importance of improvisation in design teams. She mentioned the developer fort where a team of techies go to a castle and have to build something from scratch with no Internet. Sounds like a great team-building and inspirational exercise.

    Stuff Learnt

    1. To improv you need to be able to be awesome at the tools you use (basically I need to step up my Photoshop learning)

    Score – 6/10

    James Bridle

    An interesting (if not depressing) look at how historically we have managed to lose so much interesting data. That we are at a frontier of information and should therefore ensure that we keep everything. A really great example was used regarding the Iraq war Wiki page. I won’t spoil it though in case he does another similar talk.

    Stuff Learnt

    1. erm…..always back up your data?

    Score – 5/10

    Tom Coates

    Probably the most visually stunning presentation. Some great videos and animations. The talk did get me excited about the prospect of household items all being plugged into the Internet. I found the boundaries on ownership particularly interesting. Basically, because our stuff would be wired into the network we would know where it was via geolocation. So no matter where it was or who had it we would still know it belonged to us.

    Stuff Learnt

    1. The future is bright
    2. Eventually, everything will be networked

    Score – 8/10

    Merlin Mann

    A good one to end on, as definitely the most amusing of the speakers. He started by calling everyone ‘nerds’ and then went into the difference between ‘nerds’ and ‘geeks’. A ‘geek’ will come around and fix your PC for you, and a ‘nerd’ will want to talk about the PC for an hour before fixing it. A ‘nerd’ is really obsessed with something.

    Stuff Learnt

    1. I’m a geek and not a nerd
    2. Don’t stay obsessed with just one thing (he gave an example of a Photoshop expert whose clients dried up)

    Score – 7/10

    Conclusion

    Overall, it was a great experience and I’m glad I went. I’m too logical in my approach to things to get enough out of the 2 days. I was getting fed up with the analogies by the end of it all. I’m sure for the designers this would have been perfect. I did actually speak to a couple of people who had attended previous events and they all suggested that it wasn’t as good as previous years.

  • Google Marker Events

    My latest project involves using google maps. So far I’ve been very impressed with the API. There are plenty of examples and explanations of how everything works. However, I came across a problem that seemed like a common enough scenario yet the answer could not be found. Eventually, I found this post which helped point me in the right direction.

    I had a similar problem where I had an array of longitudes and latitudes that all required their own events. For each marker, I needed a mouseover and mouseout click function. Again the issue was that the last array items were the values being used regardless of which marker’s event is fired. I needed a way to identify which marker the event was applicable to. The solution was found by using the ‘this’ variable within the event function. From ‘this’ you can use the this.position.c  to find the longitude and the this.position.b to find the latitude of that particular marker. Hope this helps!

      
    // Loop through our list of longs and lats
    for (i=0;i<initialMarkerHolder.length;i++) {
    	google.maps.event.addListener(marker, 'click',function() {
    		alert('log = ' + this.position.c);
    		alert('lat = ' + this.position.b);
    	});
    }
    
    
  • Citizenship Review

    Why is everything in life so black and white. Governments through history have either adopted a treat, everyone, the same policy or a more extreme right-wing policy. Neither of these really makes any sense to me. It’s a simple fact of life that everyone is different.

    The thing that has sparked this particular rant off is that we are currently living in an environment where punishing everyone for the sins of the few seems to be how we now legislate for things in this country. A great example is alcohol. I enjoy a good old knees up but according to the law because some people enjoy tearing up the high street on a weekend I’m not entitled to cheap alcohol. That’s hardly fair, is it?

    OK, I need a term for the people that ruin it for everyone else. I’m going to call them the ‘idiots’. Previous examples of right-wing political groups have always persecuted the wrong people. Why go for the Jewish or specific African tribes when there are the ‘idiots’ amongst us. Idiots exist in every walk of life. They can be any age, any colour, any religion, and any class. People should only ever be judged by their actions.

    I’m proposing a new citizenship system that is actually ‘fair‘ and not the David Cameron definition of ‘fair’. You’ll have to excuse the lack of political lingo as this proposal won’t be hiding behind any blue sky management spiel but will be in plain and simple English. Are you ready for this? It’s good!

    When you are born in this country everyone is given a card. If you come here from abroad and pass our citizenship criteria then you also receive a card. The card in practice will be a little more complicated than this but for simplicity, we’ll say that when you receive it the card has a ‘green’ status. So to start with it’s a level playing field for everyone. Now, as long as I’ve been a good boy when I scan my card at the checkout for booze it sees it’s ‘green’ and lets me have the discount. Now, for the medium idiot (a bit of a wally) who maybe has an ASBO and a history of violence would have an ‘amber’ status. Unfortunately for him, due to his previous misdemeanours would pay a higher levy on his alcohol. You can probably work out what comes next. The big idiot (Mayor of Idiotsville) who has spent time in prison for repeated offenses. He would have a ‘red’ status on his citizenship card which would prohibit him from buying booze completely. This example is specific to booze, I like booze, but it could be used for other luxury items.

    I understand that people can change so this will be a two-way system. The Mayor of Idiotsville can get in the ‘green’ again by being a good citizen. Cameron is currently promoting a scheme to keep the local services running on a voluntary basis. This would be a perfect way to gain points and become a good citizen again.

    I would also give more powers to the Police by allowing them to punish citizens by having the authority to set ‘amber’ or ‘red’ statuses. This is where we would need to expand upon the traffic light system, to a more granular point system. Perhaps something like this.

    Green – 100 – 75 points
    Amber – 75 – 50 points
    Red – 50 – 0 points

    The High Courts would have the authority to give 0-100 point reductions. The Police would be able to give up to 10-point fines on the spot. These on-the-spot fines would need to be authorised by two Officers.

    There are a few holes in the proposal. A physical card-based system will always have problems, just look at the Labour identity card farce. So maybe some kind of thumbprint scan? Getting it passed the loony left big brother-fearing brigade would also hold this up.  I don’t think I’m suggesting anything too crazy though. I’m just sick to the teeth of the generic one rule for everyone approach. The majority of people aren’t complete imbeciles, so please please please give us the credit we deserve. I know a bag of nuts ‘contains nuts’, I know I shouldn’t drink bleach, and that you shouldn’t allow children to play with paper shredders.

    That’s it. Vote for me for PM. By the way, I do not and have not ever read the Daily Mail.

  • Youth and Beauty

    The States has given us KFC and the Playboy channel, but like everything, there needs to be complete equilibrium. So to weigh down the negative side of the see-saw they’ve also given us a ridiculous litigation culture. Also, Uncle Sam has inspired us to have our own Little Miss beauty pageants! In case you’re not familiar with this concept, it’s where mentally unstable Mothers (the ones that put silly coats on dogs) dress their young daughters up like high-class escorts and parade them in front of everyone.

    Like little girls aren’t scary enough! With the fake tan and too much rouge, they look even more terrifying. What’s more terrifying is that these Mothers exist and that there aren’t just a few of them there seems to be enough of them to warrant an entire pageant! I did a little research into what possible reasons could justify these contests.

    1. It’s a chance for our daughter to gain confidence
    2. It’s a chance for Mother and Daughter to become closer
    3. Sometimes agents attend these events looking for the next child stars

    What a load of Bollocks! There are a million and one things out there that parents can do with their kids. What lessons can these kids possibly be learning from these contests? Psychology 101 tells us that what happens to a person in their childhood affects them in later years. So how will the losers of these contests be affected? I’m not beautiful enough 🙁 I’m a loser 🙁 I’m going to chop up anyone prettier than me with this blunt axe 🙂

    Even the winner will be under the impression that beauty alone makes you a success in life. OK, maybe not a complete falsehood but I imagine in 40 years’ time when the looks have faded the high streets will be awash with drunk middle age women screaming ‘I won little miss Southend in 2010 you know!’ to anyone who’ll listen. Well, it might happen.

    What’s already started to happen is mothers putting their daughters under the knife to achieve ‘Perfection’. How the hell did that conversation go?

    Mother: ‘You are the most beautiful thing in the world to us!’

    Child: ‘Thanks Mum’

    Mother: ‘Although, your ears do stick out a little too far’

    Child: ‘…Mum?’

    Mother: ‘Your lips could be a little plumper’

    Child: ‘……MUM!’ (As the psychotic Mother drags her 8-year-old to the surgeon)

    The idea of this really turns my stomach. Kids are meant to be kids. Let them grow up before forcing this shit on them. Unfortunately, we do live in a very shallow world but why let them suffer this fact now? Let them live in their imaginations where everything is perfect for a while before letting reality destroy their dreams. Parents should praise and encourage their children on what they are good at. Even if they aren’t particularly good at it, if they enjoy it, it should be encouraged (within reason, no angry emails about little Tommy who enjoys dissecting cats). Anything that requires some kind of thought and movement, being beautiful is not a hobby (it’s hard work). And besides your child should be the most beautiful thing in the world to you, even if he/she looks like a slapped arse.

  • SVN Magic

    My company recently hired a new developer which brought the number of developers to….(drum roll)…Four! OK, not a really significant amount but enough for us to need a more effective code change reporting system. We needed a way to alert developers of any changes made to their files. The system I managed to put in place has been running for about a week and I thought I would do a blog post to maybe help other small development teams to introduce something similar. The solution I set out to achieve was this …

    A daily email is sent to every developer with a list of files that have been changed the previous day. The list will only include files that this particular developer had previously added or changed. Attached to the email is an HTML file containing a more detailed view of the changes made to each file.

    If you think this would be useful for you then continue reading. The first step was to store the details of each SVN commit in a DB table. This was accomplished by creating a script that was called after every commit. SVN comes with a selection of ‘hooks’ which are executable bash scripts that run after (or before ) a specific SVN event occurs. Simply go to your SVN hooks directory and copy the template file post-commit.tmpl as post-commit. Add the shell commands required to call your script and make it executable.

    chmod +x post-commit
    

    My script uses the Repository and Revision variables passed via SVN to carry out an svnlook on the repository for that revision. I use the PHP system call to store the output in a variable (use square quotes “). I then use the PHP explode on the new lines (n) to generate a nice neat array of variables. I simply store each of the files involved in the commit in my DB table along with the revision number, the author, the comment, and the DateTime.

    My second script does the main leg work. I firstly added the script to our crontab to run every morning. The first thing the script does is return all of the commits for the previous day. For each file, it runs svn log and stores the output in a variable. By using some exploding and other PHP string functions the scripts gets the output into a manageable format. From this information, we determine who previously changed this particular file. We use the author name as the main KEY of a large array we’ll use later. In the array, we store all of the information we think may be useful to include in our final email.

    Now for the cool part. We export the previous revision of this particular file to a temporary directory and also the latest version of this file.

    svn export --revision 120 file:///my_repos/blog.html temp/temp1.txt
    svn export --revision 121 file:///my_repos/blog.html temp/temp2.txt
    

    We use a 3rd party Pear class to give us a comparison array of the two files (showing new code snippets, changed code snippets, and deleted code snippets). We add some final gloss to our email by using some 3rd party syntax highlighting.

    OK, at this point we should have our enormous array of SVN usernames and file details. All we need to do now is loop through each SVN username key and create our email. I have a template system in place that takes care of displaying the diffs between the files. I simply write this to an HTML file and attach it to the email. I have a list of email addresses in the database assigned to each SVN username. And you’re done.

    Please let me know if you would like any further details on this and I’ll elaborate on those points. Good Luck!