Google’s charting API has been around for quite a while now, but I’ve only just needed to actually look at it. It became immediately obvious that I needed a PHP encoding function, so off to google I went. Though I found several implementations, they were all incomplete or deficient in one way or another (and it didn’t help that there was an error in google’s extended encoding docs), so I’ve written my own based on several different ones. Both simple and extended encoders support automatic scaling, inflated maximum and lower-bound truncation, so you can pretty much stuff whatever data you like in, with no particular regard for pre-scaling and you’ll get a usable result out. They have an identical interface, so you can use either encoding interchangeably according to the output resolution you need (contrary to popular belief, the encoding to use has very little to do with the range of values you need to graph). By default, the full range of possible values is used as it just seems silly not to. I deliberately omit the ‘s:’ and ‘e:’ prefixes so that you can call these functions for multiple data series, and I include a function that does just that. You still need to generate your own URLs and other formatting, but that’s a different problem. Read on for the code… Continue reading “Google Charts API Simple and Extended Encoders in PHP”
When you’re developing web stuff, working with projects in path names (i.e. not at the top level of a domain) can be difficult (gets in the way of absolute links, rewrite rules etc), so you often need to set up a local apache virtual host, stick an entry in DNS and create an SSL certificate before you can get on with the serious business of doing some real work. This can get to be a drag when you do it a lot, but there is an extremely elegant solution that means you’ll never have to do it again…
Continue reading “The web developer’s holy vhost trinity”
From this truly excellent conference, I took away some good memories, some new ideas and a nasty bout of conference flu. There’s nothing quite like being in close proximity to a few hundred people to really spread things around…
Highlight for me was Aral Balkan‘s keynote. It’s always nice to see someone showing plain enthusiasm, and I couldn’t agree more with him about the “lost magic” of computing. Had a chat with him afterwards about AMEE and other things. He also seems to have put together some odd but dull things that I had noticed a need for – EU VAT codings and ISO language references as web services!
I didn’t really enjoy David Soria Parra’s talk on sharding. It all came across as very negative and many of the ways of doing it and coping with the fallout were not really discussed. No mention of MySQL 5.1’s partitioning (which is limited, but is at least a start), or more radical approaches like Sequoia.
David Axmark’s talk on Drizzle was more interesting than I expected, nice to see effort being put into this direction.
Microsoft really does seem to be trying a bit harder these days – their CSS test suite for IE8 is very welcome, and the effort they are putting into PHP, apache and other projects benefits many people. It has to be said that while it’s not a mainstream product, Surface is really pretty cool to play with.
Chris Shiflett’s talk was excellent too; his demos and examples were particularly good, and entertaining.
The post-conference social was great fun, I met lots of nice new people. After our move to France I suspect it will be harder to get to events like this, so I should make the most of them while I can!
I’ve had several ideas for talks that I’d like to do (I get sick of email sometimes!), so I guess I need to get a bit more proactive on actually submitting them to a call for papers.