Archive

Archive for the ‘Programming’ Category

Adobe Browser Labs – Better than Microsoft Expression

October 28th, 2009 Wade No comments

I’ve been stumbling around for new stuff to use in the world of webmastery this morning and stumbled across this rather useful tool.

A few weeks ago I attended PHPNW along with some guys from work, one of the talks at the end of the day was by a Microsoft guy who was trying to flog their latest set of tools, Expression Studio. One of the tools he wanted to demo was a browser preview tool – of course, in typical demo fashion, it failed to load the page.

Adobe Browser Labs (free at the moment with a free registration) allows you to preview websites across several popular browsers (including the dreaded IE6) without having to install anything, it all works in the comfort of your preferred browser using Flash.

browser-comparison-adobe-labsWhat makes it so cool is the fact it has 2 great features, 1) side by side view of two different browsers and 2) “onion skin” mode – browsers overlayed so you can see the difference between two browsers per pixel. This gives immediate feedback as to how good your site works across browsers if you’ve been focused on one browser so far.

All in all, a great tool from Adobe that beats the pants off Microsoft’s tool (which isn’t free as far as I know.)

Categories: Programming Tags:

Link Checker – Free Tool Launched on Site

October 22nd, 2009 Wade No comments

I’ve just finished writing version one of my link checker tool and have now launched it on my site. The tool will parse a given  URL, extract all links on that page that point to the same domain and follow them, and keep doing that until it’s finished. It will then show you the results of the crawl (page details), along with any 404’s and redirects it encountered on the way.

Of course there are limits (which I don’t intend to expose), and you’ll know if you hit them as the app will fail. They’re pretty high though and I will leave them that way so long as the tool isn’t abused. Every use is tracked so if you abuse it, I’ll know! In the mean time, I hope some of you find it useful. And if you fancy helping me out by checking out the Google Ads, that’d be appreciated :o )

Free link checker tool.

Categories: News, Programming, SEO Tags:

PHPNW 09 – Food and Optimising front end performance

October 10th, 2009 Wade 2 comments

So lunch was ’so-so’ – the dauphinoise were undercooked,  the duck sauce was too strong and overpowered the duck (probably good as they were rather cheap legs.)

“Optimising your front end performance” was a very mixed talk. There were some generalisations that were seriously poor such as “80% of access to sites by end users is spent on the front end” – both vague and unfounded. However things like CSS/JS optimisation – specifically 304 Not-Modified headers and forcing caching but needed more expansion – this is a PHP conference afterall so implementation methods would be useful – so I’m going to blog about that later based on my personal experience. It’s something I’m rather passionate about and have wrote scripts to deal with this type of stuff that have worked extremely well.

The entire room seemed to be very much “uum” -ing and “aah” -ing about the whole talk, he did something that turns every programmers head in the other direction – talked from his experience without considering other situations that arise, the “I’ve not seem that problem so it can’t be a problem” situation.

Categories: Programming Tags:

PHPNW09 – PHP North-West 09 Conference

October 10th, 2009 Wade No comments

Just started in the 3rd talk today by a guy called Rowan Merewood (twitter link). I had no idea he worked at Plus.net – for those of you who don’t know me, just take a look on Google for wade womersley plus.net. Unfortunately  that means I’m biased to this talk as he’s talking about a company that I know has a very sworded past with its customers and while I’m sure as a developer he’s very competent, his choice in company leaves something to be desired. He’s a good guy so far, talking with some level of comedic intent while making valid points.

The previous talk was by a lady from phpwomen and was titled Passing the Joel Test in the PHP World. Apparently, Microsoft is “infamous” for getting 12/12 – although considering Joel worked at Microsoft, this was hardly suprising. For anyone at Stickyeyes reading this, we’re about 3 to 5…which is actually OK because at the end she said “I don’t think the Joel test really applies to PHP” – a point I agree. There are a few relevant tests there but overall, it’s not the most appropriate.

More to come later in the day.

Categories: Programming Tags:

Linux RAID, MySQL

September 10th, 2009 Wade 2 comments

Ubuntu…it’s a great Linux OS to use on servers due to its speed and simplicity – personal preference based on no statistics, only personal use. However, one thing Linux drives me mad with is software RAID. It’s taken me the better part of a day to set up a few RAID partitions, two of which are joined via LVM (2 lots of mirrored disks, one big “partition” to store stuff on across all 4 disks). Persuading a developer in our office at work that Whitespace is better than PHP or persuading Ben that all graphs are excellent, informative tools would be easier tasks.

It seems that today we’ve managed to solve most of our current MySQL database issues are fixed now too with one very simple change to our Master->Slaves setup – use ROW based binary logging only, not statement. The slaves are now never lagging more than 2-3 seconds behind the master even with thousands of writes per second across around 100 connections.

Categories: Programming, Software Tags:

InnoISAM / District 9

September 7th, 2009 Wade 1 comment

InnoISAM is what I need, a happy medium between InnoDB and MyISAM. I need the speed of inserts of InnoDB with the speed of selects of MyISAM – no HEAP will not work because the JOIN that I do results in the HEAP table being converted into MyISAM. You get two tables that deal with 2 extreme’s but not good happy medium table.

Monday also became MarketDefender day today, a website I don’t like working on because the work I do on it involves working with a payment gateway – something I have never enjoyed but roped myself into technically before I even started working at StickyEyes. The reason for this being my CV states I have worked with payment gateways in the past, so lucky me gets to work on them more now! It’s one of those websites where you hope it will end, but it never does, like cancer, but maybe not quite so severe or deadly.

Oh yeah, Dan broke more things today :) However today he also fixed a few things too so equilibrium returned; until tomorrow.

After work, it was straight to the gym, working on my chest again with a new programme that was done for me on Saturday; it aches a LOT so it’s great! Certainly doing the right thing as there’s no injury, just a lot of muscle fatigue. He put me on a system that involves doing some bench presses and lifts, pull-ups and then finishing off with reducing sets of chest curls so by the end of it, lifting 7kg feels like a tonne. Pyramid sets I think they’re called, would be upside down though as you start with a high weight and work down…I don’t always get the naming conventions used for weight training. If anyone is interested in some new ideas for the gym, I’d be happy to give you a few ideas from what I’ve been told.

District9Poster265_000Over the weekend I went to see District 9 at the cinema. It’s a neat idea for a film, rather than do the now over-used shaky camera a la Cloverfield or a full on documentary style movie; District 9 takes on a mixed approach and does it extremely well – think the War of the Worlds radio broadcast of 1938. The film starts out with interviews of people discussing the main character after all the events had happened (that the film shows) – of course they say it in such an ambiguous way that it gives nothing away about the film coming other than “some guy did something unexpected but we don’t blame him.”

Throughout the film you get short documentary clips that cut down towards the action climax and then peak at the end again so you notice them but they really do add to the film.

It’s a film I’d highly recommend seeing, even for none sci-fi fans because it “feels real” – as much as a film can like this – it’s guaranteed to pull you in and get your emotions flowing.

Clinton Shorter - District 9 (Original Motion Picture Soundtrack) - District 9 Buy the District 9 Official Soundtrack

Categories: Films, Gym, Programming Tags:

Hidden things, lack of fries and pointless data

September 4th, 2009 Wade 1 comment

Ah Friday’s, it’s always a good day in the office, everyone (at least in the dev team) know it’s Friday, and most weeks, Dan’s behaviour is a tell tale sign. Friday also means pub lunch day, something to look forward to…usually – however today was a sad day, our usual pub, the Wellington, let us all down. The waiting time for our fries was going to be at least 45 minutes, and I do mean just fries, chips, potato cuts, whatever you want to call them. It was almost enough to ruin the day, almost! However the pint went down well and I watched a bit of Bruno which helped…but still, no fries… Dan decided that to entertain himself (I can only assume it was due to the lack of fries on the couch of happiness*) he’d take Ben’s cigarettes off him and not give them back, and then hide them in the office allowing an honest “I don’t have them” statement. Deep down, Ben was happy about this, he said he wasn’t, but he did it with a smile :)

Now the important rant is over, databases! We have a collective big one so to speak, it’s huge (for what it stores.) We’ve known all along a lot of data is pointlessly duplicated and indeed some of it is pointless (invalid); however the extent of that was found out today – an estimate anyway. I wrote a script to de-dupe one of our tables, a table that contains hundreds of millions of rows, at the moment, we stand to loose 1,000,000 rows that are completely useless. We also have almost 16,000,000 rows that are duplicates and can be removed and that’s before the data is normalised (the normalisation process is affecting about 16% of the data [yes really, 16% of hundreds of millions]). Once that is done, I am anticipating the duplicate row count to go up to more like 25-30 million. The best thing about all of this though, was the resulting conversation, the same conversation half of the dev team have pretty much weekly that begins with one member saying “We only have that much data because we’re storing it wrong” – you know who you are! It then moves into sharding (nothing to do with a toilet) and archiving. Dan also broke one of our jobs even more than he did yesterday but that’s a daily expected situation so isn’t worth more than this one sentence.

And because it’s Friday, here’s a cat, thanks to icanhascheezburger.com

funny-pictures-cat-builds-mouse-furniture

*the couch of happiness is opposite the couch of joy in the pub. Not that it helps you in any way for me to drag your eyes down here to know that, but now you do and can scroll back up, more confused than you already were.

Categories: Programming, Random Stuff Tags:

Today’s musings

September 3rd, 2009 Wade No comments

Today’s work was a standard day, well except for the morning, actually no, that was a standard morning too, things didn’t work too well, they needed fixing, during which there were random jokes at Ben’s expense due to his pure love of graphs. With some help from Remo (my team manager) though, we did manage to work out some confusing MySQL queries – which as always, were actually remarkably simple, but until you see it, it’s harder than Michael Jackson visiting a pre-school (did I say this blog was probably bad for kids, fans of MJ and anyone who gets offended too easily?)

One thing I am still happy about today though is the re-write of our current tools into a tidier, faster, more usable fashion. I got more code nailed down today and the big jobs still work on a “insert only” principle with the database: there’s only one select at the start then the rest of the script does a few big inserts to do all it needs to do – and it still provides us with all the data we need for post-processing and lovely graphs (all for you Ben, all for you!)

In other news, I’ve been working for a client on RentACoder recently that has been superb for two reasons:

1) He always is clear about his needs with great spec docs, even down to the tables in MySQL to use;
2) He pays well, repeatedly.

However…the two recent jobs with him are not so smooth, I’m still not sure if it’s just me being overly blonde or he thinks I know the system far better than I do based on what I’ve worked on so far. But these two jobs are pretty much not moving as I allocated time for them tonight only to start work on them both and stop 1 hour later after spending most of that hour trying to understand both jobs. In the end though, even if the specs are lacking, I’ve only got myself to blame, I keenly accepted the jobs before checking the spec and now I’m confused and obliged to do them at a time that doesn’t suite me. Once again a case of “do as I say, not as I do” – many people will attest to my emphatic desire for very detailed spec documents before starting a job.

Categories: Ego-centric, Programming Tags:

Another day, another group of PHP “funness”

September 2nd, 2009 Wade No comments

PHP and Serializing…don’t try and store the result in a plain text file, there’s just a chance you may end up storing NUL so when you go to read a line, you’ll end up only reading part of it (the serialized object had a stack trace in it from an exception.)

Incidentally, don’t try and debug code that works – it’s always a good idea to read the code that is storing the data you think is wrong before trying to debug the output, I couldn’t work out why I wasn’t logging somethin only for certain exceptions, then eventually I checked the logging line and realised, for that particular exception I had decided to do a manual log entry rather than throw and catch an exception.

And now here’s a cat:

funny-pictures-cat-is-a-gargoyle

Courtesy of ICanHazCheezburger

Categories: Programming, Random Stuff Tags:

PHP FUNdamentals

September 1st, 2009 Wade No comments

The title isn’t really correct as, well, they’re not fundamentals…however they’re not fun so that was my best effort to get sarcasm into the title.

I love programming in PHP, and I must admit, I do enjoy finding solutions to problems that most people would probably tear their hair out over; but from time-to-time, PHP throws me a curve ball covered in shards of glass with a label attached that says “from PHP with love.”

I’ve been working on some new classes and functions at work to make our web applications work faster and better and part of that involves parsing HTML to extra information.  You’d think in PHP overall this is a relatively easy task, as always you’ve got several ways to accomplish the same task. The method we use for this is DOMDocument as it allows you to use XPath to query for the stuff you want. The problem I had was to do with language; even though I was running all incoming text through iconv to ensure it was UTF-8, DOMDocument often turned the text into complete garbage – it was ignoring my declaration that it is UTF-8 text and trying to autodetect it, resulting in nonsense.

After severak hours of trying to work out why DOMDocument was about as obedient as a 16 year old emo suffering from ADHD, I found a solution – and the best bit of all is the fact it is painfully simple but not at all obvious (like all PHP bugs that drag on.)

If you ever want to pass a valid xHTML document into DOMDocument and you’re sure of the encoding, add an XML declaration to the very top of the HTML if there isn’t one. So if you’re document begins:

<html><head><title>….

Change it to this:

<?xml version=”1.0″ encoding=”utf-8″?><html>head><title>

Then ask no questions, smile and make the dev team a coffee :)

Categories: Programming Tags: