Deprecated Methods in Pecl_Http

I’m a big fan of pecl_http, which I use quite often as I work so regularly with APIs and on systems where I can get it installed, it’s much nicer than PHP’s curl extension. Recently though I’ve been often seeing output which reads:

Function HttpRequest::addRawPostData() is deprecated

It isn’t obvious from the PHP manual page what I ought to do instead, however further inspection shows that it is recommended to use setBody() instead. This can be used in exactly the same way, and my code seems to work perfectly well with this substitution. If you have any more information about this change, leave me a comment – I’d be interested to hear it.

Advice To Another Blogger

Recently I was approached by a friend of mine looking to start his own technical blog. I’ve been blogging here for some years, and he wrote to ask my advice. I replied to him, but thought that the ideas could be useful to others in the same position, so here’s that email, published here for anyone else who wants to see it:
Continue reading

Three Months In: The (Ad)Venture Continues

It’s three months since I gave up the day job and so many people have asked me how it’s going, that I thought I’d give a quick round up!

I am a statistics nut so it will surprise nobody that I track my time religiously (using harvest, which I’ll post about some day soon). From this I can tell you that I spend about 40% of my time working for other people, and the rest doing things like writing, preparing talks, accounts, meetings, or whatever. I’ve also taken 14 days off, which has been absolutely fabulous after a decidedly work-heavy first half of 2010. The biggest change is that I’ve only worked one weekend day. One.

Continue reading

Is Enum Evil?

When I work on database designs, either on my own projects or as advisor to others, I often find people very reluctant to use an enum type for any columns. Now, I’m not about to advocate the gratuitous use of an enum column, they definitely have some pitfalls, but I think it is important to understand these rather than just shouting “enum evil!” if anyone should mention them.

There are cases where an enum is the correct choice for a particular type of data, so let’s look at what an enum type actually is and does.

Continue reading

My Talk Filing System

Three years ago, I had never spoken in public (I have video of that first attempt and all I can say is that I’ve come a long, long way!). Since then, I’ve done rather a lot of it. I’ve submitted countless conference talks, had the minority of those accepted, and prepared and delivered those that were. Not many talks have been given twice, but some have, and now some are getting rebranded since I am working for myself and can choose my own slide branding these days. All this adds up to a lot of content to keep track of!

Continue reading

Best Practices in API Design: Audio and Slides

Earlier in the year I gave a talk at PHP UK in London entitled “Best Practice for API Design”. I really enjoyed giving this talk, since I work so much with APIs and enjoy sharing my ideas. The audio is now online so if you missed the talk, feel free to have a listen. You can also see the slides (on slideshare) and also read the series of blog posts I wrote on this topic which originally inspired the talk.

Return on Investment: Example

I gave a talk at the weekend which talked in outline terms about Return on Investment or ROI. It was a keynote so I skated over the details, but I wanted to include a specific example to illustrate what I meant.

Imagine the scenario where, given 3 days to work on it, a developer can get the deployment time for their code down from 3 hours to 20 minutes. This company does, on average, 42 deployments per year (you can guess these numbers are totally imaginary).

So 3 days at 7.5 hours per day means we are investing 22.5 hours on this.

The return is the difference between the deployments, multiplied by the number of deployments that are needed. So 3 hours is 180 minutes – so we save (180 – 20) = 160 minutes with each deploy. We do that 42 times in a year so we’ve saved 6720 minutes (per year) which is 112 hours or 14.9 days.

Project managers might not like to lose 3 days from their schedule but how do they feel about having a spare 3 weeks each year?

PHPNW10: Teach a Man to Fish

Last weekend I gave a talk at PHPNW10 in Manchester, entitled “Teach a Man to Fish”. This is a keynote about teams and how to use the resources around you to create a team where individuals and the whole team continues to learn and develop. The slides are not very detailed, but I’ll be blogging some of the items I mentioned (requests welcome, if you saw it and would like to see any of it written down then just leave me a comment!). Slides:

Two-Strand Crochet Ripple

If you’re reading my main blog feed, this post may take you by surprise – however at one time I enjoyed crafting and blogged about it often. Recently I’ve been finding more time for this, helped by the inspiring news of pregnant friends, so hopefully this is the first in a resurgence of craft-related articles. There are category-specific feeds if you’d rather only read the tech and/or php content.

So, I crocheted a blanket for my friend’s baby (welcome, Benjamin!)

DSCF2981.JPG
Continue reading

My Three Favourite Opera Features

I’m an Opera user, and one of the reasons I am is that I can control my browser entirely from the keyboard. I think everyone uses browser keyboard shortcuts, and in a lot of ways Opera has similar functionality to other browsers, but it also has keyboard spatial navigation, meaning I can jump to the next element in whichever direction I choose. Opera also has per-site preferences, which actually make the web usable for me.

Continue reading