<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nick Bennett</title>
	<atom:link href="http://www.nickbennett.co.uk/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.nickbennett.co.uk</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sat, 04 Sep 2010 17:00:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>dConstruct 2010</title>
		<link>http://www.nickbennett.co.uk/?p=471</link>
		<comments>http://www.nickbennett.co.uk/?p=471#comments</comments>
		<pubDate>Fri, 03 Sep 2010 19:20:51 +0000</pubDate>
		<dc:creator>Nick 'Lenny' Bennett</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[brendan]]></category>
		<category><![CDATA[bridle]]></category>
		<category><![CDATA[brighton]]></category>
		<category><![CDATA[coates]]></category>
		<category><![CDATA[collison]]></category>
		<category><![CDATA[david]]></category>
		<category><![CDATA[dawes]]></category>
		<category><![CDATA[dconstruct]]></category>
		<category><![CDATA[donovan]]></category>
		<category><![CDATA[gruber]]></category>
		<category><![CDATA[hannah]]></category>
		<category><![CDATA[james]]></category>
		<category><![CDATA[john]]></category>
		<category><![CDATA[mann]]></category>
		<category><![CDATA[marty]]></category>
		<category><![CDATA[mccandless]]></category>
		<category><![CDATA[merlin]]></category>
		<category><![CDATA[neumeier]]></category>
		<category><![CDATA[samantha]]></category>
		<category><![CDATA[simon]]></category>
		<category><![CDATA[tom]]></category>
		<category><![CDATA[warren]]></category>

		<guid isPermaLink="false">http://www.nickbennett.co.uk/?p=471</guid>
		<description><![CDATA[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 &#8216;no&#8217; response. However, I thought this would be good for me and would (if... <span><a href="http://www.nickbennett.co.uk/?p=471" title="dConstruct 2010" rel="bookmark">[+]</a></span>]]></description>
			<content:encoded><![CDATA[<p>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 <em>&#8216;no&#8217;</em> response. However, I thought this would be good for me and would (if nothing else) mean 2 days out the office.</p>
<p>Before I break down the event itself, I want to re-iterate a few things. I&#8217;m a developer NOT a designer. As much as i would love to be both, it just ain&#8217;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&#8217;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&#8217;t idolise other proficient developers/designers/gurus or wish to discuss developing down the pub with my mates.</p>
<p><strong>Day 1 &#8211; <a title="Flexible Process" href="http://2010.dconstruct.org/workshops#defining-a-flexible-process" target="_blank">Designing a Flexible Process with Simon Collison</a></strong></p>
<p><strong>My expectations</strong><br />
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 which I can adopt in the future and everything will be plain sailing.</p>
<p><strong>What happened</strong><br />
Simon was a nice and approachable chap with bags of enthusiasm and experience. We followed the processes for which he has adopted in the past with varying degrees of success. This doesn&#8217;t sound good <em>&#8216;varying&#8217;</em>. We were constantly reminded that every client is different and requires an agile approach. It doesn&#8217;t look like I&#8217;m going to get my <em>&#8216;perfect project process&#8217;</em> 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 <a title="Hipsters!" href="http://lookatthisfuckinhipster.com/" target="_blank">audience</a>.</p>
<p><strong>Relevance To Me &#8211; 3/10</strong></p>
<p><strong>Relevance To Designers &#8211; 8/10</strong></p>
<p><strong>Stuff Learnt</strong></p>
<ol>
<li>I need a new Macbook Pro (Everyone in there had a more recent model)</li>
<li>To start any project you need to consider all platforms (iPhone, iPad, Televisions)</li>
<li>I need to change my new site scripts to create media specifc CSS</li>
<li>I need to use the Javascript moderniser script to upgrade all browsers to be HTML5 and CSS3 compatible</li>
</ol>
<p><strong>Day 2 &#8211; <a title="dConstruct 2010" href="http://2010.dconstruct.org/" target="_blank">The Conference</a></strong></p>
<p><strong><a title="Marty Neumeier" href="http://2010.dconstruct.org/speakers/marty-neumeier" target="_blank">Marty Neumeier</a></strong></p>
<p>A good start. A really interesting talk regarding the history of businesses and how they&#8217;ve adapted. Also what role innovation plays in success and how it can go wrong.</p>
<p><strong>Stuff Learnt</strong></p>
<ol>
<li>Your product needs to be good and different</li>
<li>Innovation is the key to success</li>
<li>Businesses need to be constantly designing and taking risks</li>
</ol>
<p><strong>Score &#8211; 8/10</strong></p>
<p><strong><a title="Brendan Dawes" href="http://2010.dconstruct.org/speakers/brendan-dawes" target="_blank">Brendan Dawes</a></strong></p>
<p>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&#8217;m involved in but I&#8217;m sure this will be a useful approach for the designers.</p>
<p><strong>Stuff Learnt</strong></p>
<ol>
<li>Sometimes you shouldn&#8217;t need to explain design decisions, they should just happen</li>
<li>Don&#8217;t go to the Piccadilly area of Manchester</li>
</ol>
<p><strong>Score &#8211; 7/10</strong></p>
<p><strong><a title="David McCandless" href="http://2010.dconstruct.org/speakers/david-mccandless" target="_blank">David McCandless</a></strong></p>
<p>This talk was how information is beautiful. I did feel that this would be more for me. I wasn&#8217;t disappointed. He had some excellent examples of mis-leading information. And how that putting information in another context can create some compelling results.</p>
<p><strong>Stuff Learnt</strong></p>
<ol>
<li>Despite having quite a dry data set, it can be made more interesting</li>
<li>You can establish patterns more clearly once the information has been organised in a more visual manner</li>
<li>The media clearly have an Outlook reminder for scare mongering</li>
</ol>
<p><strong>Score &#8211; 10/10</strong></p>
<p><strong><a title="Samantha Warren" href="http://2010.dconstruct.org/speakers/samantha-warren" target="_blank">Samantha Warren</a></strong></p>
<p>This discussion was about Typography. A subject I have little knowledge on. She was very enthusiastic and clearly loves what she does. It was a mainly male audience so I wasn&#8217;t sure about the shoes analogy really worked for the audience. Give a girl a microphone and it won&#8217;t be long before they start banging on about shoes (sorry I couldn&#8217;t resist). To be fair the analogy did work quite well.</p>
<p><strong>Stuff Learnt</strong></p>
<ol>
<li>Legibility is vital in a font type</li>
<li>The character of the font should emote the context it sits in</li>
</ol>
<p><strong>Score &#8211; 7/10</strong></p>
<p><strong><a title="John Gruber" href="http://2010.dconstruct.org/speakers/john-gruber" target="_blank">John Gruber</a></strong></p>
<p>He opened by showing a tweet from one of the audience which was a picture of the guy outside the Brighton Dome stating &#8216;Only 16 hours until the Gruber!&#8217;. He asked the guy to raise his hand, and these really excited hands came up waving frantically. I turned to my colleague &#8216;what a douche&#8217;. 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 film making process.</p>
<p><strong>Stuff Learnt</strong></p>
<ol>
<li>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&#8217;ve worked under would have listened to)</li>
</ol>
<p><strong>Score &#8211; 7/10</strong></p>
<p><strong> </strong></p>
<div id="attachment_498" class="wp-caption alignright" style="width: 235px"><strong><strong><a href="http://www.nickbennett.co.uk/nick_bennett/wp-content/uploads/2010/09/IMG_0092.jpg"><img class="size-medium wp-image-498" title="Hannah Donovan" src="http://www.nickbennett.co.uk/nick_bennett/wp-content/uploads/2010/09/IMG_0092-225x300.jpg" alt="Hannah Donovan" width="225" height="300" /></a></strong></strong><p class="wp-caption-text">Hannah Donovan</p></div>
<p><strong> </strong></p>
<p><strong><a title="Hannah Donovan" href="http://2010.dconstruct.org/speakers/hannah-donovan" target="_blank">Hannah Donovan</a></strong></p>
<p>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.</p>
<p><strong>Stuff Learnt</strong></p>
<ol>
<li>To improv you need to be able to be awesome at the tools you use (basically I need to step up my Photoshop learning)</li>
</ol>
<p><strong>Score &#8211; 6/10</strong></p>
<p><strong><a title="James Bridle" href="http://2010.dconstruct.org/speakers/james-bridle" target="_blank">James Bridle</a></strong></p>
<p>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 <a title="Iraq War" href="http://en.wikipedia.org/wiki/Iraq_War" target="_blank">Iraq war Wiki</a> page. I won&#8217;t spoil it though in case he does another similar talk.</p>
<p><strong>Stuff Learnt</strong></p>
<ol>
<li>erm&#8230;..always back up your data?</li>
</ol>
<p><strong>Score &#8211; 5/10</strong></p>
<p><strong><a title="Tom Coates" href="http://2010.dconstruct.org/speakers/tom-coates" target="_blank">Tom Coates</a></strong></p>
<p>Probably the most visually stunning presentation. Some great video 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.</p>
<p><strong>Stuff Learnt</strong></p>
<ol>
<li>The future is bright</li>
<li>Eventually everything will be networked</li>
</ol>
<p><strong>Score &#8211; 8/10</strong></p>
<p><strong><a title="Merlin Mann" href="http://2010.dconstruct.org/speakers/merlin-mann" target="_blank">Merlin Mann</a></strong></p>
<p>A good one to end on, as definitely the most amusing of the speakers. He started by calling everyone &#8216;nerds&#8217; and then went in to the difference between &#8216;nerds&#8217; and &#8216;geeks&#8217;. A &#8216;geek&#8217; will come round and fix your PC for you, a &#8216;nerd&#8217; will want to talk about the PC for an hour before fixing it. A &#8216;nerd&#8217; is really obsessed with something.</p>
<p><strong>Stuff Learnt</strong></p>
<ol>
<li>I&#8217;m a geek and not a nerd</li>
<li>Don&#8217;t stay obsessed by just one thing (he gave an example of a Photoshop expert whose clients dried up)</li>
</ol>
<p><strong>Score &#8211; 7/10</strong></p>
<p><strong>Conclusion</strong></p>
<p>Overall, it was a great experience and I&#8217;m glad I went. I&#8217;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&#8217;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&#8217;t as good as previous years.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickbennett.co.uk/?feed=rss2&amp;p=471</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blogs are for Weirdos</title>
		<link>http://www.nickbennett.co.uk/?p=454</link>
		<comments>http://www.nickbennett.co.uk/?p=454#comments</comments>
		<pubDate>Thu, 26 Aug 2010 18:56:38 +0000</pubDate>
		<dc:creator>bobtall</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[earth]]></category>
		<category><![CDATA[family]]></category>
		<category><![CDATA[hell]]></category>
		<category><![CDATA[holiday]]></category>
		<category><![CDATA[on]]></category>
		<category><![CDATA[spain]]></category>

		<guid isPermaLink="false">http://www.nickbennett.co.uk/?p=454</guid>
		<description><![CDATA[Presumably you have already done so before arriving at this shit, but seeing as you are on the internet, the page you were initially looking for is www.lobstertube.com. See you in ten minutes.
Right, now that’s out of the way &#38; presuming you still have the... <span><a href="http://www.nickbennett.co.uk/?p=454" title="Blogs are for Weirdos" rel="bookmark">[+]</a></span>]]></description>
			<content:encoded><![CDATA[<p>Presumably you have already done so before arriving at this shit, but seeing as you are on the internet, the page you were initially looking for is www.lobstertube.com. See you in ten minutes.</p>
<p>Right, now that’s out of the way &amp; presuming you still have the power of sight &#8211; I’ve never written a blog before. I have, in the past, called more than one person a fucking weirdo for doing so. That said, I am nothing if not hypocritical so here goes. At the very least, I will display a working knowledge of the English language so far ambiguous in the content of this website.</p>
<p>I should say that 90% of what you are about to read/have already read is total lies and is for entertainment purposes only. The truth is much, much more harrowing.</p>
<p>Most of you reading this will already know me. For those of you that don’t, here’s a brief intro;</p>
<p>Married father of more than enough children (1), I know Lenny (Nick to those who don’t really know him) through a longstanding friendship and failed Eurovision entry, the entirely fairly-titled “Fuck France”. This blog may yet prove to be inspiration for my best-mans speech at his wedding which will never happen. A few of my</p>
<p>Likes: Football, Alcohol.</p>
<p>Hates: Football, Family (my own), Life (my own), Joy (other people’s), Public Transport, Jamie Cullum and Mushrooms.</p>
<p>I am not miserable, but it has taken me 30 years to realise/admit that everyone else is a cunt. I am not prejudiced in this view, however there are a few different types of cunt. Everyone in Asda? Inconsiderate, bottom-feeding, aisle-hogging, smelly, chav Cunts. Anyone who does weights in the gym? Self-centered, dull, heart-attack before you’re 40 Cunts. Everyone in any other part of the world? You get the point, but suffice to say that everyone is some sort of Cunt.</p>
<p>The straw that fucked the Camel’s arse came during my recent family holiday, a jaunty trip which began with a scheduled flight with Ryanair (robbing Cunts). Due to incomprehensible seating<br />
arrangements presumably devised during the dark ages, I was forced to sit next to a Scottish man (sweaty Cunt) and my 6-year-old son, a human who has yet to cease to amaze in his ability to be a constant source of crushing disappointment.</p>
<p>The next 4 hours 12 minutes and 37 seconds of my life were spent being asked if we were “there yet” and saying “I don’t know, why don’t you ask the nice young man in the Ben-10 Alien Force t-shirt sitting next to you, you sweaty Cunt”?</p>
<p>Everyone suitably offended by the amount of times I’ve used the word Cunt? Good, let’s move on.</p>
<p>We disembarked the surface-to-purgatory missile of melancholy to be greeted by the Spanish version of my mother-in-law and told to get on a coach. We commenced a journey so ugly and<br />
tedious that the only thing of any real value to be gleaned from it was the personal realisation that I am utterly indifferent to the use of wind-powered turbines as an alternative way of creating energy.</p>
<p>As you ask, other, duller Cunts on my journey interfering out-loud with my internal monologue thought they were “Unsightly” and “Fucking Pointless”. – both views that my son found very insightful.</p>
<p>I eventually arrived at the designated shit-pit that the she-devil of Abaddon had decided would be our abode for the next 6 days. Nothing wrong with said venue, only that apparently “Spacious, 2- bedroom” apparently means “The room is hotter than the sun, the bathroom is the size of a 5-pence piece, one of the ‘bedrooms’ is the lounge and there are no doors so any ideas you had of fucking your missus can be forgotten immediately”, thus negating the need to have brought her at all. I understand why they just put “Spacious, 2-bedroom”.</p>
<p>There was also the delightfully quaint feature of the air-conditioning unit only working when you are IN the room, meaning that when you walked in to go to bed the room was hotter than the fires of hell and, once you been asleep for an hour, colder than the icicles that form on the metaphor of my marriage.</p>
<p>I should point out at this stage that I am frequently labelled a “control-freak” by my missus. I am told that she is a ‘big-girl’ and ‘perfectly capable of arranging a holiday away’ from the house she insists on keeping as a pigsty. In an effort to do something that our guidance councillor called “compromise” I left the entire arrangement of this holiday to my wife – a woman so incompetent she burns vegetables when she ’cooks’.</p>
<p>Judging from the amount of times my head was metaphorically bitten off in the ensuing days , the fact that we were to spend the next few days co-habiting this shithole was entirely my fault because I didn’t help her book it.</p>
<p>To break the instant boredom that gripped everyone other than me, I was told I had to go on an excursion. To a water park. I should mention at this stage that I am an adult, and reiterate that I was to spend an entire day at a water park with “Fun Slides”.</p>
<p>The first obstacle to overcome on said excursion was a trip on public transport. Apparently something called a ‘bus’, with about 30-40 other ‘humans’. I insisted that this was nonsense and that we should get a taxi. “Let’s just go and see how much the bus costs, it will be a nice treat for little Fred”. When did travelling on what basically amounts to a moving concentration camp become a treat? Has this always been the case? I must’ve had a sheltered upbringing.</p>
<p>We found a moustachioed lady in something called a ‘ticket office’ and asked how much and which bus to Aqua Land. “Tree Uros eech, nummer 70” came the response. Nummer 70 found and boarded<br />
-“Ett uros person” was the grunted request for my hard-earned before I’d even told the driver where we were going. Presuming (1st mistake) that the driver had clocked us in our swimming shorts and assumed we wanted to go to Aqua Land we paid 24 euros and got on the bus (2nd mistake).</p>
<p>What followed is best described thusly; The single worst automotive experience of my entire life, on some of the highest, mountain-side roads, at the hands of the single worst driver I have ever experienced. I feel I should qualify that statement by saying that I used to be a driving instructor and have experienced complete novices on frequent occasion.</p>
<p>Further proof if further proof were needed that I am truly alone on this planet – During a particularly</p>
<p>hairy mountain-top bend I entered a ‘dream-like’ state. Whilst mentally preparing to meet the maker, the following daydream occurred;</p>
<p><strong>EXT. Mountain-side Road (Dusty) – Early Morning</strong></p>
<p>A seemingly out-of-control bus speeds around a narrow bend in the road, it skids and careers down a cliff side, spinning several times before coming to a stop at the bottom.</p>
<p><strong>EXT. Bottom of the mountain – Bright sunlight</strong></p>
<p>Miraculously, everyone has survived and has got out of the smashed bus. Inevitably, conversation turns to how the survivors will nourish themselves<br />
with no Nandos for 237 miles—</p>
<p><strong>RANDOM NORTHERN MONKEY #1</strong></p>
<p>Ear, what’s t’crack? I almost spilled me basturd Tennernts!</p>
<p><strong>A FEMALE</strong></p>
<p>I’ll make us some net curtains. Anyone got any food?</p>
<p><strong>ROBIN</strong></p>
<p>There’s an elephant in the room – not you love – let’s eat the fucking bus driver. He’s the Spanish cunt that got us in this fucking mess in the first place.</p>
<p><strong>Robin is cast out of the group and forced to wander the wilderness alone for being ‘Racist’ until he is pecked to death by a passing Fluffy-backed Tit Babbler (Google it, it’s a real bird).</strong></p>
<p>After the “ten-meenuit” journey had taken us 45, my wife thought it prudent to ask if we were on the correct bus. By this point, I had given up all hope. “You! Sit Down!” was the barked response. “You! Spanish Cunt!” was the retort I didn’t have the minerals to deliver.</p>
<p>By nothing short of a Jesuit-style miracle, we eventually arrived at Aqua Land. All blood had long-since drained from my face. Upon seeing the entry fare, it swiftly returned – boiling. “Seventy quid for 3 of us????? &#8211; He’ll have forgotten it by the morning, I’m not going on any water slides and you banished fun 5 years ago” That’s right dear readers, seventy-fucking-quid for the priviledge of spending the most miserable day of my life in a glorified public swimming bath.</p>
<p>Because I have no testicles, I had to pay the entry fee. Because I wanted to sit down, I had to pay 3 Euros for a chair. Because I didn’t want to burn, I had to pay 2 Euros for an umbrella. Because I wanted to inhale oxygen, I had to pay using the blood of the virgin Mary. Obviously the last one falls into the 90% of this blog that is complete bullshit but it could easily have fallen into the other 10%.</p>
<p>Upon entering the park, I am asked to pay 5 Euros to have my picture taken with what I’m told is a parrot. I mentally stab the man in the eye with a parrot before ignoring him, muttering something about robbing bastards. We arrive at the slides, and what we are greeted with is a sort of Utopian Nightmare where literally everybody apart from me is having the time if their ignorant, ill-read, sheltered lives.</p>
<p>Such is the outpouring of joy that I am lead to the conclusion that it must be fake. No-one has ever had that much fun getting burns off of 130-degree hot plastic whilst hurtling towards what basically amounts to a massive cocktail of 4-year-old human piss. Fucking sub-human scum. I manage to get away without going on any of the ‘fun’ slides and instead manage to blag my way onto the Lazy River (much more me) before having to deal with a screaming 6-year-old when it is then time to leave&#8230; in a taxi&#8230; that I had to direct back to our hotel.</p>
<p>The next few days passed pretty much without incident and, at the time of writing, everyone is still alive. Although if I hear another word about the beach ball we had to leave in the swimming pool I’m going to get punchy.</p>
<p>So, as Louie Spence drove us to the airport, I was led to summise thusly:</p>
<p>1) Never go on holiday with people you hate.</p>
<p>2) Always take charge of everything because everyone else is incompetent</p>
<p>3) Eating 16oz. Fillet Steak 3 days out of 5 will turn your shit black.</p>
<p>4) Spanish Taxi drivers haven’t got a fucking clue where they are.</p>
<p>And finally&#8230;</p>
<p>5) Blogs are for weirdos.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickbennett.co.uk/?feed=rss2&amp;p=454</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Marker Events</title>
		<link>http://www.nickbennett.co.uk/?p=462</link>
		<comments>http://www.nickbennett.co.uk/?p=462#comments</comments>
		<pubDate>Thu, 26 Aug 2010 07:01:20 +0000</pubDate>
		<dc:creator>Nick 'Lenny' Bennett</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[handler]]></category>
		<category><![CDATA[latitude]]></category>
		<category><![CDATA[longitude]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[marker]]></category>

		<guid isPermaLink="false">http://www.nickbennett.co.uk/?p=462</guid>
		<description><![CDATA[My latest project involves using google maps. So far I&#8217;ve been very impressed with the API. There are plenty of examples and explanations on how everything works. However, I came across a problem which seemed like a common enough scenario yet the answer could not... <span><a href="http://www.nickbennett.co.uk/?p=462" title="Google Marker Events" rel="bookmark">[+]</a></span>]]></description>
			<content:encoded><![CDATA[<p>My latest project involves using google maps. So far I&#8217;ve been very impressed with the API. There are plenty of examples and explanations on how everything works. However, I came across a problem which seemed like a common enough scenario yet the answer could not be found. Eventually I found this <a title="Google Marker Solution" href="http://you.arenot.me/2010/06/29/google-maps-api-v3-0-multiple-markers-multiple-infowindows/" target="_blank">post</a> which helped point me in the right direction.</p>
<p>I had a similar problem where I had an array of longitudes and latitudes that all required thier own events. For each marker I needed a mouseover, mouseout and click function. Again the issue was that the last array items were the values being used regardless of which marker&#8217;s event is fired. I needed a way to identity which marker the event was applicable to. The solution was found by using the &#8216;this&#8217; 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!</p>
<pre>
// Loop through our list of longs and lats
for (i=0;i&lt;initialMarkerHolder.length;i++) {
	google.maps.event.addListener(marker, 'click',function() {
		alert('log = ' + this.position.c);
		alert('lat = ' + this.position.b);
	});
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.nickbennett.co.uk/?feed=rss2&amp;p=462</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Citizenship Review</title>
		<link>http://www.nickbennett.co.uk/?p=413</link>
		<comments>http://www.nickbennett.co.uk/?p=413#comments</comments>
		<pubDate>Wed, 18 Aug 2010 17:35:38 +0000</pubDate>
		<dc:creator>Nick 'Lenny' Bennett</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[cameron]]></category>
		<category><![CDATA[citizenship]]></category>
		<category><![CDATA[david]]></category>
		<category><![CDATA[fairness]]></category>
		<category><![CDATA[left]]></category>
		<category><![CDATA[legislation]]></category>
		<category><![CDATA[politics]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[right]]></category>
		<category><![CDATA[rights]]></category>
		<category><![CDATA[wing]]></category>

		<guid isPermaLink="false">http://www.nickbennett.co.uk/?p=413</guid>
		<description><![CDATA[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 make any sense to me. It&#8217;s a simple fact of life that everyone... <span><a href="http://www.nickbennett.co.uk/?p=413" title="Citizenship Review" rel="bookmark">[+]</a></span>]]></description>
			<content:encoded><![CDATA[<p>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 make any sense to me. It&#8217;s a simple fact of life that everyone is different.</p>
<p>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&#8217;m not entitled to cheap alcohol. That&#8217;s hardly fair is it?</p>
<p>OK, I need a term for the people that ruin it for everyone else. I&#8217;m going to call them the <em>&#8216;idiots&#8217;</em>. Previous examples of right wing political groups have always persecuted the wrong people. Why go for the Jewish and African people when there are the <em>&#8216;idiots&#8217;</em> 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.</p>
<p>I&#8217;m proposing a new citizenship system which is <strong>actually</strong> <em>&#8216;fair</em>&#8216; and not the <strong>David Cameron</strong> definition of <em>&#8216;fair&#8217;</em>. You&#8217;ll have to excuse the lack of political lingo as this proposal won&#8217;t be hiding behind any blue sky management spiel but will be in plain and simple English. Are you ready for this? It&#8217;s good!</p>
<p>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 practise will be a little more complicated than this but for simplicity we&#8217;ll say that when you receive it the card has a <em>&#8216;green&#8217;</em> status. So to start with it&#8217;s a level playing field for <strong>everyone</strong>. Now as long as I&#8217;ve been a good boy, when I scan my card at the checkout for booze it sees it&#8217;s <em>&#8216;green&#8217;</em> and let&#8217;s 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<em> &#8216;amber&#8217;</em> 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 offences. He would have a <em>&#8216;red&#8217;</em> 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.</p>
<p>I understand that people can change so this will be a two way system. The Mayor of Idiotsville can get in the <em>&#8216;green&#8217;</em> again by being a good citizen. <a title="Big Society" href="http://www.bbc.co.uk/news/uk-10680062" target="_blank">Cameron</a> 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.</p>
<p>I would also give more powers to the Police by allowing them to punish citizens and brings them closer to the an <em>&#8216;amber&#8217; </em>or<em> &#8216;red&#8217;</em> status. This is where we would need to expand on the traffic light system, to a more granular point system. Perhaps something like this.</p>
<p><strong>Green</strong> &#8211; 100 &#8211; 75 points<br />
<strong>Amber</strong> &#8211; 75 &#8211; 50 points<br />
<strong>Red</strong> &#8211; 50 &#8211; 0 points</p>
<p>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.</p>
<p>There are a few holes in the proposal. A physical card based system will always have problems, just look at Labour identity card farce. So maybe some kind of thumb print scan? Getting it passed the loony left big brother fearing brigade would also hold this up.  I don&#8217;t think I&#8217;m suggesting anything too crazy though. I&#8217;m just sick to the teeth of the generic one rule for everyone approach. The majority of people aren&#8217;t complete imbeciles, so please please please give us the credit we deserve. I know a bag on nuts &#8216;contains nuts&#8217; , I know I shouldn&#8217;t drink bleach and that you shouldn&#8217;t allow children to play with paper shredders.</p>
<p>That&#8217;s it. Vote for me for PM. By the way I do not and have not ever read the <strong>Daily Mail</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickbennett.co.uk/?feed=rss2&amp;p=413</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Youth and Beauty</title>
		<link>http://www.nickbennett.co.uk/?p=398</link>
		<comments>http://www.nickbennett.co.uk/?p=398#comments</comments>
		<pubDate>Fri, 13 Aug 2010 17:09:43 +0000</pubDate>
		<dc:creator>Nick 'Lenny' Bennett</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[beauty]]></category>
		<category><![CDATA[children]]></category>
		<category><![CDATA[contests]]></category>
		<category><![CDATA[forced]]></category>
		<category><![CDATA[little]]></category>
		<category><![CDATA[miss]]></category>
		<category><![CDATA[mothers]]></category>
		<category><![CDATA[pageants]]></category>
		<category><![CDATA[psychotic]]></category>
		<category><![CDATA[surgery]]></category>

		<guid isPermaLink="false">http://www.nickbennett.co.uk/?p=398</guid>
		<description><![CDATA[The States has given us KFC and the Playboy channel, but like everything there needs to be complete equilibrium. So to bring balance to the force to go with our ridiculous litigation culture, Uncle Sam has inspired us to have our own Little Miss beauty... <span><a href="http://www.nickbennett.co.uk/?p=398" title="Youth and Beauty" rel="bookmark">[+]</a></span>]]></description>
			<content:encoded><![CDATA[<p>The States has given us <strong>KFC</strong> and the <strong>Playboy</strong> channel, but like everything there needs to be complete equilibrium. So to bring balance to the force to go with our ridiculous litigation culture, Uncle Sam has inspired us to have our own <a title="BBC 3 Documentary about it" href="http://www.bbc.co.uk/programmes/b00lvf60" target="_blank">Little Miss beauty pageants!</a> In case you&#8217;re not familiar with this concept, it&#8217;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.</p>
<p>Like little girls aren&#8217;t scary enough! With fake tan and too much rouge they look even more terrifying. What&#8217;s more terrifying is that these Mothers exist, and that there aren&#8217;t just a few of them there seems to be enough of them to warrant an entire pageant! I did a little research in what possible reasons could justify these contests.</p>
<ol>
<li>It&#8217;s a chance for our daughter to gain confidence</li>
<li>It&#8217;s a chance for Mother and Daughter to become closer</li>
<li>Sometime agents attend these events looking for the next child stars</li>
</ol>
<p>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? <em>I&#8217;m not beautiful enough <img src='http://www.nickbennett.co.uk/nick_bennett/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  I&#8217;m a loser <img src='http://www.nickbennett.co.uk/nick_bennett/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  I&#8217;m going to chop up anyone prettier than me with this blunt axe <img src='http://www.nickbennett.co.uk/nick_bennett/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </em></p>
<p>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 &#8216;I won little miss Southend in 2010 you know!&#8217; to anyone who&#8217;ll listen. Well, it might happen.</p>
<p>What&#8217;s already started to happen is mothers putting their daughters under the knife to achieve &#8216;Perfection&#8217;. How the hell did that conversation go?</p>
<p><strong>Mother</strong>:<em> &#8216;You are the most beautiful thing in the world to us!&#8217;</em></p>
<p><strong>Child</strong>: <em>&#8216;Thanks Mum&#8217;</em></p>
<p><strong>Mother</strong>: <em>&#8216;Although, your ears do stick out a little too far&#8217;</em></p>
<p><strong>Child</strong>:<em>&#8216;&#8230;Mum?&#8217;</em></p>
<p><strong>Mother</strong>: <em>&#8216;Your lips could be a little plumper&#8217;</em></p>
<p><strong>Child</strong>:<em>&#8216;&#8230;&#8230;MUM!&#8217;</em> (As the psychotic Mother drags her 8 year old to the surgeon)</p>
<p>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 show them that 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&#8217;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, <strong>being beautiful is not a hobby</strong> (it&#8217;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.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickbennett.co.uk/?feed=rss2&amp;p=398</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SVN Magic</title>
		<link>http://www.nickbennett.co.uk/?p=397</link>
		<comments>http://www.nickbennett.co.uk/?p=397#comments</comments>
		<pubDate>Thu, 12 Aug 2010 06:34:33 +0000</pubDate>
		<dc:creator>Nick 'Lenny' Bennett</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[alerts]]></category>
		<category><![CDATA[daily]]></category>
		<category><![CDATA[emails]]></category>
		<category><![CDATA[hooks]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[username]]></category>

		<guid isPermaLink="false">http://www.nickbennett.co.uk/?p=397</guid>
		<description><![CDATA[My company recently hired a new developer which brought the number of developers to&#8230;.(drum roll)&#8230;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... <span><a href="http://www.nickbennett.co.uk/?p=397" title="SVN Magic" rel="bookmark">[+]</a></span>]]></description>
			<content:encoded><![CDATA[<p>My company recently hired a new developer which brought the number of developers to&#8230;.(drum roll)&#8230;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 &#8230;</p>
<p><strong><em>A daily email 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 a HTML file containing a more detailed view of the changes made to each file.</em></strong></p>
<p>If you think this would be useful for you then continue reading. The first step was to store details of each SVN commit into a DB table. This was accomplished by creating a script that was called after every commit. <a title="SVN Details" href="http://en.wikipedia.org/wiki/SVN" target="_blank">SVN</a> comes with a selection of<a title="Read more about hooks" href="http://svnbook.red-bean.com/en/1.4/svn-book.html#svn.reposadmin.create.hooks" target="_self"> &#8216;hooks&#8217; </a>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 <strong>post-commit.tmpl </strong>as <strong>post-commit</strong>. Add the shell commands required to call you script and make it executable.</p>
<pre>chmod +x post-commit
</pre>
<p>My script uses the <strong>Repositary</strong> and <strong>Revision</strong> variables passed via SVN to carry out an <strong>svnlook</strong> on the repository for that revision. I use the PHP <strong>system</strong> call to store the output in a variable (use square quotes &#8220;). I then use the PHP <strong>explode</strong> 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 date time.</p>
<p>My second script does the main leg work. I firstly added the script to our <a title="Crontab" href="http://linux.about.com/od/commands/l/blcmdl5_crontab.htm" target="_blank">crontab</a> to run every morning. The first thing the script does is return all of the committals for the previous day. For each file it runs <strong>svn log</strong> 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 <strong>KEY</strong> of a large array we&#8217;ll use later. In the array we store all of the information we think that may be useful to include in our final email.</p>
<p>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.</p>
<pre>svn export --revision 120 file:///my_repos/blog.html temp/temp1.txt
svn export --revision 121 file:///my_repos/blog.html temp/temp2.txt
</pre>
<p>We use a 3rd party <strong>Pear</strong> 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 <a title="GeSHi Code Syntax Highlightor" href="http://qbnz.com/highlighter/" target="_self">syntax highlighting</a>.</p>
<p>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 a 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&#8217;re done.</p>
<p>Please let me know if you would like any further details on this and I&#8217;ll elaborate on those points. Good Luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickbennett.co.uk/?feed=rss2&amp;p=397</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>We&#8217;re all in the Gutter</title>
		<link>http://www.nickbennett.co.uk/?p=376</link>
		<comments>http://www.nickbennett.co.uk/?p=376#comments</comments>
		<pubDate>Wed, 04 Aug 2010 20:41:36 +0000</pubDate>
		<dc:creator>Nick 'Lenny' Bennett</dc:creator>
				<category><![CDATA[Football]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[Carlisle]]></category>
		<category><![CDATA[city]]></category>
		<category><![CDATA[HMRC]]></category>
		<category><![CDATA[man]]></category>
		<category><![CDATA[paul]]></category>
		<category><![CDATA[portsmouth]]></category>
		<category><![CDATA[season]]></category>
		<category><![CDATA[Southend]]></category>
		<category><![CDATA[sturrock]]></category>

		<guid isPermaLink="false">http://www.nickbennett.co.uk/?p=376</guid>
		<description><![CDATA[I&#8217;ve just read my prediction post for last season. &#8216;This season&#8217;s goal will be the same as last years&#8230;survival. Plain and  simple. Survival not just in footballing terms but also in financial  terms&#8217;. Well 1 out of 2  ain&#8217;t bad as Mr... <span><a href="http://www.nickbennett.co.uk/?p=376" title="We&#8217;re all in the Gutter" rel="bookmark">[+]</a></span>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just read my prediction post for last season. <em>&#8216;This season&#8217;s goal will be the same as last years&#8230;survival. Plain and  simple. Survival not just in footballing terms but also in financial  terms&#8217;</em>. Well 1 out of 2  ain&#8217;t bad as Mr Meatloaf might say. So my hopes for this season are  exactly the same. Boring eh, third season on the trot.</p>
<p>These recent months have been the hardest months to  endure as a football fan. I&#8217;ll take the Pepsi test with any other  football fan that reckons they&#8217;ve had it worse. <strong>Man City</strong> got  relegated years ago yet still gloat to this day at how hardcore they were when they  were in the second tier of english football&#8230;yawn! <strong>Portsmouth</strong> are  looking administration in the face&#8230;at least you got something for your  money. And finally <strong>Chester City</strong> who went completely out of business&#8230; erm  alright bad example. So to demonstrate the past few months in as brief  a way as possible&#8230;</p>
<p><strong>Southend relegated to league 2</strong><br />
<strong>Me</strong> : <em>&#8216;Still, at least it can&#8217;t get any worse&#8217;</em><br />
<strong>Southend release 90% of playing staff</strong><br />
<strong>Me</strong> :<em> &#8216;Erm now it can&#8217;t get any worse&#8217;</em><br />
<strong> Southend sack long serving manager Steve Tilson</strong><br />
<strong>Me</strong> : <em>&#8216;Ok, this is it now the lowest of the low&#8217;</em><br />
<strong>HMRC take Southend to high court for administration hearing</strong><br />
<strong>Me</strong>: <em>&#8216;Right, baring a Tsunami this truly cannot get any worse&#8217;</em><br />
<strong> Southend Chairman questioned on sexual assault charges</strong><br />
<strong>Me</strong> :<em> &#8216;Fine, I give up&#8217;</em></p>
<p>This week though something amazing happened. I actually received some  good news. The <strong>HMRC</strong> dropped their case against us after it was proven  that (with the help of Sainsburys) we were a viable business that could  meet all future tax bills. Hooray! I don&#8217;t know how we did it! We don&#8217;t (as  far as I can see) have any viable assets. Apparently even the programmes have  been sold off to another company.</p>
<p>Things may be bad at the moment but we&#8217;re  still alive&#8230;just. Our team is made up of all new faces and there is a  tried and tested manager at the helm in <strong>Paul Sturrock</strong>. So I&#8217;m making 2 predictions, my head prediction  says relegation and administration while my heart says playoffs and a lovely  new stadium for next year. So we may currently be in the gutter let&#8217;s just  hope we&#8217;re looking up at the stars!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickbennett.co.uk/?feed=rss2&amp;p=376</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RoR Active Records in PHP</title>
		<link>http://www.nickbennett.co.uk/?p=346</link>
		<comments>http://www.nickbennett.co.uk/?p=346#comments</comments>
		<pubDate>Sun, 01 Aug 2010 14:02:39 +0000</pubDate>
		<dc:creator>Nick 'Lenny' Bennett</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[active]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[objects]]></category>
		<category><![CDATA[on]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[record]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.nickbennett.co.uk/?p=346</guid>
		<description><![CDATA[As a developer you can become a little complacent with the framework and language you&#8217;re using. You&#8217;ve invested a lot of time in the getting yourself up and running so why look at other solutions to problems you&#8217;ve already solved? Well, there is more than... <span><a href="http://www.nickbennett.co.uk/?p=346" title="RoR Active Records in PHP" rel="bookmark">[+]</a></span>]]></description>
			<content:encoded><![CDATA[<p>As a developer you can become a little complacent with the framework and language you&#8217;re using. You&#8217;ve invested a lot of time in the getting yourself up and running so why look at other solutions to problems you&#8217;ve already solved? Well, there is more than 1 way to skin a cat and the other methods out there may mean you can skin 10 cats for every 1 of yours. OK, I&#8217;m going to stop with this horrible analogy. This post has come about because I was inspired by the Active Record methodology involved in Ruby on Rails and I wanted to create a PHP version.</p>
<p>Lets start with a few example of <a title="See Ruby on Rails API for more details" href="http://api.rubyonrails.org/classes/ActiveRecord/Base.html" target="_blank">active records</a> in <a title="Ruby on Rails" href="http://rubyonrails.org/" target="_blank">RoR</a>.</p>
<pre>user = User.find_user_by_email('myemail@gmail.com');

user.name; # Me
user.age; # Thirty (Just)

user.new(:name =&gt; "David", :surname =&gt; "Hasselhoff" : occupation =&gt; "Life Guard");
</pre>
<p>If you&#8217;re not familiar with RoR you will probably be impressed with how  easy it is to create new records and generate the setters and getters. If you are familiar with RoR please excuse any syntax errors as I don&#8217;t actually write in Ruby.</p>
<p>My current framework is a custom set up very similar to the <a title="CodeIgniter" href="http://codeigniter.com/" target="_blank">CodeIgniter</a> framework. All the data access is done via 2 files, the <strong>data access object</strong> and the <strong>access object</strong>. I have a script which is an automatic code generator that can create both of these files using the database and table names. The <strong>data access object</strong> is the parent of the <strong>access object</strong>, this allows any custom queries to be managed by the <strong>access object</strong> and direct table access to be carried out by the <strong>data access object</strong>. Therefore for each table in the database we need both of these files, this can start to add up fairly quickly. Just to highlight this set up&#8230;</p>
<p><strong>Data Access Object</strong></p>
<pre>&lt;?php

class DAO_User {

 // Private properties
 protected $db;
 protected $db_name        = "my_database";
 protected $table_name     = "user";

 // Table specific
 protected $first_name;
 protected $last_name;

 /*
 *    Constructor
 */
 public function __construct () {

 $this-&gt;db = new Database();

 }

 /*
 *    Getters
 */
 public function getFirstName(){
 return $this-&gt;first_name;
 }

 public function getLastName(){
 return $this-&gt;last_name;
 }

 /*
 *    Setters
 */
 public function setFirstName($val=''){
 $this-&gt;first_name = $val;
 }
 public function setLastName($val=''){
 $this-&gt;last_name = $val;
 }

 /*
 *    Processes
 */
 public function createRow () {

 # Insert code

 }

 public function updateRow () {

 # Update code

 }

 public function deleteRow() {

 # Delete code

 }

}

?&gt;</pre>
<p><strong>Access Object</strong></p>
<pre>&lt;?php

require_once('class.DAO.my_database.user.php');

class AO_User extends DAO_User {

 /*
 *    Return a list of values
 */
 public function findUserByName ($name="dave") {

 # Query code here

 }

}

?&gt;</pre>
<p>These classes are used by the <strong>Models</strong> for the framework to interact directly with the database. This is a very clean way of dealing with access to the database but the number of files can get quite large and the code in the model is quite clunky. Issues can also arise when the database is changed or when variables aren&#8217;t passed for certain fields (<em>Do we set it to blank or keep the existing value for this field?</em>). I decided to try and create a new PHP class based on the RoR active records approach.</p>
<p>A strange approach to some maybe, but I decided to write the code to use the class first and then tried to get the class functioning around it. Here is the code&#8230;</p>
<pre>&lt;?php

class data_access_test {

 public function index() {

 $ao = new DataAccess('my_database','user');

 print $ao-&gt;find('1')-&gt;first_name(); # Expected output dave

 }

}

?&gt;</pre>
<p>OK, so in case your not clear on what we are saying here. We start by initialising the class with 2 variables. The first is the name of the database and the second is the table we wish to access. We then call the <strong>find</strong> method and pass a specific id of a row in the table. By chaining the methods we are also able to call the <strong>first_name</strong> method which without a variable assumes we wish to get (if we passed a variable it would assume we wish to set). OK, so now it&#8217;s time to get started on the class itself.</p>
<pre>private $_dbl;                                    # You database class to actually talk to the DB
private $_database;                                # User defined var for the DB we need to look at
private $_table;                                # User defined var for the table we need to look at
private $_internal_errors        =    array();    # Store any errors in setting up object
private $_primary_key_fields    =    array();    # Primary key holder for $database.$table
private $_set_primary_key        =    false;         # False by default if 2 fields create key than we set to true
private $_fields;                                # Holder of the available fields in our table
private $_type;                                    # As above see desc query on your table for example of values
private $_null;                                    # See Above
private $_key;                                    # See Above
private $_default;                                # See Above
private $_extra;                                # See Above
private $_row_data;                                # Holder of all of this rows data</pre>
<p>To start with we define all of the variables that our class will need to function correctly. Read the comments for more detail on what each variable will be used for. Now, for the nitty gritty of the object which will happen at the point of initialisation.</p>
<pre>/*
* Set globals to define host user and password
*/
public function __construct ($database='',$table='') {

 $this-&gt;dbl = new Database;

 if ($database != '' &amp;&amp; $table != '') {

 $this-&gt;_database    =    $database;
 $this-&gt;_table        =    $table;

 if (!$this-&gt;setTableData()) {

 $this-&gt;_internal_errors[]        =    'Database and table not recognised';

 }

 } else {

 $this-&gt;_internal_errors[]        =    'Require database and table at initialisation';

 }

}

/*
*    General
*/
private function setTableData () {

 $sql = "SHOW COLUMNS FROM " . $this-&gt;dbl-&gt;mysqlEscape($this-&gt;_database) . "." . $this-&gt;dbl-&gt;mysqlEscape($this-&gt;_table);

 list(
 $this-&gt;_fields,
 $this-&gt;_type,
 $this-&gt;_null,
 $this-&gt;_key,
 $this-&gt;_default,
 $this-&gt;_extra,

 )    =    $this-&gt;dbl-&gt;returnRows($sql);

 if ($this-&gt;_fields) {

 $primary_count        =    0;

 // Set the primary keys
 foreach ($this-&gt;_fields as $key =&gt; $value) {

 if ($this-&gt;_key[$key] == 'PRI') {

 $this-&gt;_primary_key_fields[] = $value;

 $primary_count++;
 }

 }

 if ($primary_count &gt; 2 || !in_array('auto_increment',$this-&gt;_extra)) {

 $this-&gt;_set_primary_key = 'true';
 }

 return 1;

 }

}
</pre>
<p>The construct of the class sets up our database object so that we can talk to the database. We check that the user has passed the 2 required variables, if they haven&#8217;t we assign an error message to our internal errors variable. I find it useful to have an internal errors variable and that way if there are any issues you can simply check this variable to diagnose the problem. If we have both the <strong>database</strong> and <strong>table</strong> we can go about setting up our object, this is all done in the <strong>setTableData</strong> method.</p>
<p>This method begins by doing a DESC query on the table. We use the return variables to set our <strong>fields</strong>, <strong>type</strong>, <strong>null</strong>, <strong>key</strong>, <strong>default</strong> and <strong>extra</strong> properties. The final thing this method does is check the primary keys. I had a number of problems with my original DAO files when I tried to generate the files for a table with multiple primary keys. By setting our <strong>primary_key_fields</strong> variable we can make a decision as to whether to allow the user to set and get this variable. The decision I&#8217;ve made is you cannot set the primary field if there is only 1 primary key. If there are more primary keys then I set my <strong>set_primary_key</strong> flag to true to indicate that we can allow this field setting.</p>
<p>So how do we set and get variables on the fly when we don&#8217;t have the methods already set? Well we can do this by using the <strong>__call</strong> method.</p>
<pre>/*
*
*    Use name to check what field we are setting or getting
*
*/
public function __call ($name='',$arguments='') {

 // Only proceed if there are no internal errors
 if (count($this-&gt;_internal_errors) == 0) {

 // Check that this is a valid field
 if (in_array($name,$this-&gt;_fields)) {

 // We have an arguement so set otherwise get
 if ($arguments[0]) {

 if (!in_array($name,$_primary_key_fields) || $this-&gt;_set_primary_key = 'true') {

 if ($this-&gt;checkFieldDateType($name,$arguments[0]) == 1) {

 $this-&gt;setData($name,$arguments[0]);

 } else {

 $this-&gt;_internal_errors[]        =    $name . ' cannot be set as it fails the type check';

 }

 } else {

 $this-&gt;_internal_errors[]        =    $name . ' cannot be set as its a primary key';

 }

 } else {

 return $this-&gt;getData($name);

 }

 } else {

 $this-&gt;_internal_errors[]        =    $name . ' is not a recognised field in this table';

 }

 }

}</pre>
<p>I&#8217;ll now talk you through this method and then show you the <strong>get</strong> and <strong>set</strong> methods. The first thing this method does is to check the <strong>internal_errors</strong> property, we don&#8217;t want to try and set something if we&#8217;ve had a problem setting up the object. We then check to see if an argument has been passed, if it has then we can assume the user wants to set a variable. We check whether the method name is a primary key and whether we can set it. If allowed we finally check the argument against the data type set for this field (I won&#8217;t go into detail about this method but it&#8217;s a good way to ensure data integrity by ensuring it matches the type of data acceptable for that field) and then pass to our <strong>set</strong> method. If there are no arguments then we simply send it to the <strong>get</strong> method.</p>
<pre>private function getData ($key='') {

 return $this-&gt;_row_data[$key];

 }

 /*
 *    Setters
 */
 private function setData ($key='',$value='') {

 $this-&gt;_row_data[$key]    =    $value;

 return $this;

 }</pre>
<p>Fairly straight forward huh? Our <strong>set</strong> method simply uses the <strong>name</strong> passed to the <strong>__call</strong> method (aka table field) as the key for our internal variable <strong>_row_data</strong>. The return <strong>$this</strong> allows us to chain methods in this object. The <strong>get</strong> method is even more straight forward and just returns the value currently assigned to this key (aka table field). Ok, so if we look back at our original code we still need to define our <strong>find</strong> method.</p>
<pre>/*
*    Find record using unique id
*/
public function find ($record_id='') {

 if ($record_id != '' &amp;&amp; count($this-&gt;_primary_key_fields) == 1) {

 $sql = "SELECT         * 

 FROM         " . $this-&gt;dbl-&gt;mysqlEscape($this-&gt;_database) . "." . $this-&gt;dbl-&gt;mysqlEscape($this-&gt;_table) . " 

 WHERE         " . $this-&gt;_primary_key_fields[0] . " = '" . $record_id . "'";

 $results = $this-&gt;dbl-&gt;returnRows($sql,'non_list');

 foreach ($results[0] as $key =&gt; $value) {

 if (!is_numeric($key)) {

 $this-&gt;_row_data[$key] = $value;

 }

 }

 }

 return $this;

}</pre>
<p>Our <strong>find</strong> method checks that the record id is available and that there is only 1 primary key. A query is then generated to return all of the information in that table row. The columns of the rows are used as keys in our internal <strong>_row_data</strong> variable and the value is the cell data. When we now call a <strong>get</strong> on any of the columns we will get the data we require&#8230;bingo!</p>
<p>My class also has methods for creating new rows and updating rows. If you&#8217;ve come this far I&#8217;m sure you can figure these out these for yourself. This class is far from perfect but it&#8217;s a good start. One of the problems you may have already noted is what if we want to set an empty value? Also what if we want to return multiple rows? If you have any ideas on it please share them with me <img src='http://www.nickbennett.co.uk/nick_bennett/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickbennett.co.uk/?feed=rss2&amp;p=346</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Celeb-Pity</title>
		<link>http://www.nickbennett.co.uk/?p=322</link>
		<comments>http://www.nickbennett.co.uk/?p=322#comments</comments>
		<pubDate>Sat, 24 Jul 2010 09:55:54 +0000</pubDate>
		<dc:creator>Nick 'Lenny' Bennett</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[anna]]></category>
		<category><![CDATA[celebrity]]></category>
		<category><![CDATA[driving]]></category>
		<category><![CDATA[essex]]></category>
		<category><![CDATA[goody]]></category>
		<category><![CDATA[hathaway]]></category>
		<category><![CDATA[homes]]></category>
		<category><![CDATA[jade]]></category>
		<category><![CDATA[maureen]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[shallow]]></category>

		<guid isPermaLink="false">http://www.nickbennett.co.uk/?p=322</guid>
		<description><![CDATA[Sitting in the dentist waiting room I have a choice of Essex Homes or a  glossy celebrity magazine to browse through to kill time. In hindsight I  should have opted at looking at maisonettes in Ockenden. Flicking  through the pages of  &#8216;Empty... <span><a href="http://www.nickbennett.co.uk/?p=322" title="Celeb-Pity" rel="bookmark">[+]</a></span>]]></description>
			<content:encoded><![CDATA[<p>Sitting in the dentist waiting room I have a choice of <strong>Essex Homes </strong>or a  glossy celebrity magazine to browse through to kill time. In hindsight I  should have opted at looking at maisonettes in Ockenden. Flicking  through the pages of  <em>&#8216;Empty Monthly&#8217;</em> really brought home the point. What  a shallow world we live in! I became depressed. Of the 4 magazines I flicked through there  was not a single article of any worthiness. Not a single sentence worth reading. Not a single word over 3 syllables.</p>
<p>The focus of these magazines  seem to be on the latest 15-minute celebrities. <strong>Big Brother</strong> being the  theme of the more recent magazines. I kept asking myself <em>&#8216;Why do they  focus on THESE celebrities? Of all of the people in the World who have any distinguishable talent the editor has chosen to do a piece on Pixie Chantel Smith, the lesbian, skinhead, tourettes, nymph rocker from Skegness who has just been kicked out of the BB house&#8217;</em>. Is it because Pixie has as an in depth philosophical outlook on life and our existential existence?</p>
<p>Then I had an epiphany. No&#8230;..it&#8217;s because their fame is in the grasp of  everyone! You don&#8217;t need any concern-able talent to become part of THIS  celeb club. In fact talent would probably hold you back. <strong>Maureen</strong> from <strong>Driving School</strong> became a celeb because she couldn&#8217;t drive. <strong>Jade Goody</strong> became  famous as a ditsy blond who was slightly racist. These are hardly  attributes that should be desirable, they are however easily attainable. So we have no talent and we&#8217;ve changed our name to Starbustron3000&#8230;.what next?</p>
<p>Well the remaining padding on these  magazines are filled with pictures of gorgeous models to show us  how we should look. There are even tips on how to achieve these  glamorous looks. In case we were still in doubt about our credentials for becoming a celebrity the remaining sections are dedicated to making proper  celebrities looking rough. <em>&#8216;<strong>Anna Hathaway </strong>looks terrible here what a  crap celebrity&#8217;</em>&#8230;erm but isn&#8217;t she an actor with some discernible  talent? Now we&#8217;re thinking <em>&#8216;Wow they look like crap in the morning just like me! Ergo I can also be a  celebrity!&#8217;</em></p>
<p>How depressing is this! I mean seriously, are we really meant to look up to these people? Be envious of these beings that would do anything to be center of attention? I&#8217;m proposing a new magazine. It can still have the glossy model  pics, the make up and fashion tips. However, all irrelevant talentless  celebrity pieces will be replaced with actual celebrities giving  interviews on how they became a great musician, author,  artist&#8230;.zoo-ologist etc&#8230; Anything with some level of merit. Come on ladies  set your sights a little higher!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickbennett.co.uk/?feed=rss2&amp;p=322</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>England: The Solution</title>
		<link>http://www.nickbennett.co.uk/?p=316</link>
		<comments>http://www.nickbennett.co.uk/?p=316#comments</comments>
		<pubDate>Sat, 17 Jul 2010 13:54:21 +0000</pubDate>
		<dc:creator>Nick 'Lenny' Bennett</dc:creator>
				<category><![CDATA[Football]]></category>
		<category><![CDATA[66]]></category>
		<category><![CDATA[accadamies]]></category>
		<category><![CDATA[cruyff]]></category>
		<category><![CDATA[cup]]></category>
		<category><![CDATA[England]]></category>
		<category><![CDATA[FA]]></category>
		<category><![CDATA[final]]></category>
		<category><![CDATA[holland]]></category>
		<category><![CDATA[Johan]]></category>
		<category><![CDATA[Premiership]]></category>
		<category><![CDATA[spain]]></category>
		<category><![CDATA[tappy]]></category>
		<category><![CDATA[team]]></category>
		<category><![CDATA[tippy]]></category>
		<category><![CDATA[world]]></category>

		<guid isPermaLink="false">http://www.nickbennett.co.uk/?p=316</guid>
		<description><![CDATA[So we&#8217;ll be hanging on to the &#8216;66 victory for at least another 4 years. I  can see us hanging on to that for a lot longer though. My dad  reckons it&#8217;s because the schools are discouraging competitive  competition. I agree that... <span><a href="http://www.nickbennett.co.uk/?p=316" title="England: The Solution" rel="bookmark">[+]</a></span>]]></description>
			<content:encoded><![CDATA[<p>So we&#8217;ll be hanging on to the &#8216;66 victory for at least another 4 years. I  can see us hanging on to that for a lot longer though. My dad  reckons it&#8217;s because the schools are discouraging competitive  competition. I agree that this doesn&#8217;t help, however I think the England  team did at least try very hard. They just weren&#8217;t very good.</p>
<p>The more traditional football fan still believes you can win the  tournament playing a traditional 442 style. I&#8217;m not convinced. The game  has evolved so much in recent years. The win has become so important  that teams no longer seem to just <em>&#8216;go for it&#8217;</em>. The underdog will attempt to get every man behind the ball and hope for a something to happen on the counter. The Final itself was a clear  example of this. The Dutch game plan was to disrupt the Spanish, and it  almost worked. This made for a very poor game of football.</p>
<p>With our trusted 442 system it relies on there being space for the  wingers to get to the byline to cross. Against Algeria this wasn&#8217;t ever  going to be possible.<br />
So what system should we be playing? Well it&#8217;s up to the manager. What  no answers Len? Well until we have the players with the level of ability  required it&#8217;s irrelevant. There&#8217;s a serious lack of English talent at  the moment. You look at the world champions and you&#8217;ll note that the  majority of them play for <strong>Barcelona</strong> and <strong>Real Madrid</strong>. Our best players do  come from <strong>Chelsea</strong> and <strong>Manchester United</strong>, but where do the rest come  from <strong>Portsmouth</strong>, <strong>West Ham</strong> and <strong>Blackburn</strong>. You get the picture. We need to looks at the grass roots and adopt a model similar to the Spanish.</p>
<p><strong>Johan Cruyff</strong> introduced the total football theologies when he went to manage <strong>Barcelona</strong> and the Spanish style of play has also adopted this.  I&#8217;m not convinced that style of play is what the England game is all about. Instead of a slow <em>&#8216;tippy tappy&#8217;</em> approach we tend to play at a great intensity of physicality and speed. However, when we play at international level this approach never seems to be part of the game plan? Whether this is due to the foreign manager or whether our mentality suggests we should play in a <em>&#8216;continental&#8217;</em> manner I don&#8217;t know. I would like to see us look at our nationalistic strengths and build on these at a grass roots level.</p>
<p>Here is my 3 point plan to help build a World Cup winning side.</p>
<p>1. The  first is to<strong> limit the number of foreign players per team</strong> in the Premiership. This would force teams to invest in (and actually use) their  youth teams.</p>
<p>2. I would introduce <strong>football academies across the country</strong> funded by the FA. With the amount of money in the Premiership at the moment I&#8217;m sure  this shouldn&#8217;t be a problem.</p>
<p>3. <strong>A salary cap in the Premiership</strong> has to happen. It&#8217;s gone  far too far now. It&#8217;s time to make these spoilt children slightly more  humble. If they move abroad then so be it, they can still be picked for  England <img src='http://www.nickbennett.co.uk/nick_bennett/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>England for the cup in 2030!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickbennett.co.uk/?feed=rss2&amp;p=316</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
