13th December, 2009

Book Review: jQuery 1.3 with PHP

jQuery 1.3 with PHP

jQuery 1.3 with PHP

Before I start this review proper, I need to disclose one nugget of information first: The author, Kae Verens, and I are both currently serving as members of the Irish PHP Users Group Committee and have known each other for quite a few years. If you believe I can remain impartial and objective (as I hope you do – because I am), read on:

This is the first book sent to me from Packt where I wasn’t left dizzy from trying to understand just what it is the author was trying to get across. It looks like their proof-reader was awake for this one – totally awesome.

jQuery, as the vast majority of us already know, is a JavaScript library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. In other words it does all the heavy lifting and takes care of cross-browser compatibility issues so you don’t have to and thus allows you to focus on the work that you need to do without all those distractions.

“jQuery 1.3 with PHP” is aimed “for PHP application developers who want to improve their user interfaces through jQuery’s capabilities and responsiveness”. Over the course of ten chapters Verens starts the off with an introduction, then a series of ‘Quick Tricks’ that almost immediately help you add some measure of “Web 2.0″ functionality to what I’d term a “web 0.2 application” rather sharply.
The book ends with a chapter on Optimization – some of which you are bound to already know and some which are complete gems.

In the middle are chapters with mini-projects on tabs and accordians, forms and form validation, file management, calendars (and how to make your own google-calendar-like application), image manipulation, drag and drop and data tables.
In each case, projects are analysed and the required steps for each are outlined in the simplest terms – no extraneous buzzwords are used or are the projects over-analysed for the sake of pedantry.

I was a little surprised in some places where, for example, the json encoded output was not created via json_encode; but then thought not everyone is going to have PHP 5.2 or greater installed. Thumb forward a few pages and this is mentioned. So all’s o k.

It was good to see Kae suggesting use of the PEAR Validate package (or similar) in the Forms and Forms Validation chapter (chapter 4). I had to wonder if there was a PEAR package for creating and shunting down jQuery validation rules to the client – and found that there isn’t. That’s something to consider for later on, I guess.

The rest of the book is similarly both easy to read and easy to understand – my first port of call for learning how to do something that I’d almost term exotic with jQuery and with PHP in the background is usually Google but that is going to change (actually it already has).

Honestly, I wouldn’t be surprised if this books working title was “JQuery and PHP: The HowTo” – it is that good.
Now, this book is not for learning jQuery – that is not within its remit, but I would heartily recomend “jQuery 1.3 with PHP” by Kae Verens to anyone wanting to utilise jQuery from a PHP background.

Posted at 11:46 pm | Comments Off

16th June, 2009

OpenStreetMapping Nenagh

So yesterday I had a quick interview with a journalist from the Nenagh Guardian – my local paper – about this OpenStreetMap (OSM) mapping malarky.

As most of you will probably know OSM is to printed atlases from AA, Ordnance Survery etc, as wikipedia is to encyclopedias. People can contribute data to the project through a variety of activities: going out and actually mapping an area with a sat nav or gps unit [even a mobile phone with GPS in it such as an iphone, nokia n95 or whatever], tracing data off Yahoo [and other] aerial imagery, filing bugs on the openstreetbugs website or literally drawing in information via the walking papers map making website. And better again, this is about providing free geographic data such as street maps to anyone who wants them.

Anyway…I mentioned how the OpenStreetMap map of Nenagh is more complete than even the latest commercially available maps for Garmin and Google Maps and listed off a few ways how OSM could be used commercially: by real estate agents, courier companies, how being able to pin-point where all the amenities are would be useful for tourists, and so on.

Compare the Open Street Map of Nenagh with the Google Map of the area – as you can see, there’s still quite a bit of work to be done – Millers Brook needs to be marked as such along with the various groves, avenues etc that comprise that estate. Plus all the amenities, shops [perhaps even their opening hours] and the Shannon Development Industrial Centre still need to be added – as I’m sure are some other small portions of the town that I’ve unknowingly neglected.

It’s fair to say that this will never be finished – existing housing estates will be extended, there will always be urban development plans that when implemented would also need to be included on the map.

It would also be cool to have the new “Nenagh Cycling Hub” rendered on the opencyclemap.org website.

I discovered the OpenStreetBrowser site to be a great test of the data that myself and others have entered – it’s also a great way of demonstrating just what can be done with OSM data.

If you happen to spot something that I’ve missed please either drop me a comment or use the openstreetbugs website.

On a related note: it would be good to see a PEAR/PHP based client/component for interfacing with the OpenStreetMap server so that interesting apps utilising that data could be implemented on the LAMP stack – something to go alongside the Services_GeoNames package from pear ;-)

Posted at 11:38 pm | Comments Off

31st January, 2009

Save Nenagh Hospital

I’m back home from a “Save Nenagh Hospital” rally earlier on today – I estimated the number of people there to be at least two thousand.

As you might infer, this is quite serious – the Health Service Executive in Ireland have already made the first steps in downgrading and then closing the General Hospital in Nenagh. Already there are plans for numerous cuts, including a proposal to remove 24-hour accident and emergency services at the hospital in favour of the introduction of advance paramedics to partly replace the present service.

The only numbers important to the HSE, it seems, are those balanced on their accounts sheets – not the number of lives that will be lost, the number of minutes late that ambulances will arrive to road accidents, the ill and those in need.

Representatives of the HSE were invited to attend but did not – most likely because they know no matter how they try they can not make sense of their own arguments. In short, they can not justify what they are proposing.

Google for phrases such as “save nenagh hospital” and “friends of nenagh hospital” to see just how serious and important this is – you’ll find links such as this article in the Irish Times (Doctors to fight cuts at Nenagh hospital).

Please add your voice by joining the Save Nenagh Hospital group on facebook, by writing to your political representatives and by writing to the papers.

Don’t let Nenagh become the next Monaghan.

Posted at 11:24 pm | Comments Off

14th January, 2009

7 things…

I got tagged by Chuck for this “7 Things” meme. So here are 7 things you may not know about me:

  1. I first met my wife at her house warming party seven years ago – it took four years for anything to happen though! I’m so happy it finally did though!
  2. My first computer was a ZX Spectrum 48K that was bought when I was seven years old – I’ve since progressed through BBC computers, Apple Macs and then onto PCs. I also had a accounts on the WRTC vax – VMS and OSF/1.
  3. I’ve similarly gone through a number of differing computer languages: Basic in various incarnations (ZX Basic, BBC Basic, VB), Z80 Assembler, HyperCard (yes, really), C, C++, JavaScript, Perl, PHP, Python, ColdFusion, Java.
  4. I might be Irish but my surname isn’t.
  5. I read a lot of fantasy: Gemmell, Eddings, Tolkien, Pratchett; though I also enjoy Tom Clancy and Dale Brown novels.
  6. I’m long-sighted in one eye and short-sighted in the other: one good reason why I’ve never been that good at sports.
  7. I am an active PEAR developer.

Tagging Others

I’m supposed to tag 7 other people who then repeat the whole process:

Rules

Posted at 8:57 pm | Comments Off

8th January, 2009

PHP for Enterprise/Business Whitepaper

I’m very proud to have been involved as an editor and help with the translation and update of the AFUP’s PHP en Enterprise livre blanc into the PHP for Enterprise/Business Whitepaper: as far as I know this is the first full English language translation and update of the work done by the Association Française des Utilisateurs de PHP (French PHP Users Group). Also there is a lot of new content in the Whitepaper that with regards to how PHP is now utilised in Enterprise. Figures have been updated and techniques available in later versions of PHP have been referenced.

We’ve had an interesting time translating and updating the content – especially as I don’t know French let alone their idioms. Many thanks to Stéphane Lambert for his boundless energy and devotion to getting us this far!

Thanks also to PEAR President and fellow IPUG member David Coallier who also helped with the translation work and not forgetting Derick Rethans and Peter Keung who also assisted in fine-tuning our work into something a bit more fluent and graceful ;-)

I would be remiss to not mention Blacknight who have sponsored the IPUG from the start – without them there truly would not be a php.ie!

If I’ve left anybody out – please remind me!

All in all, as Chairman of the Irish PHP Users Group, I can say this is an exciting moment for us to have achieved – we’ve given something tangible back to the PHP Community as a whole and to top things off we’ve published the Whitepaper under the Open Licence Content – you may
freely use it if you clearly acknowledge the Irish PHP Users Group and if you retain the Open Content Licence. This means you can localise the Whitepaper to your own language and national figures if you so desire.

Posted at 7:43 pm | Comments Off

26th August, 2008

Is PHP vulnerable software?

Thanks to Ivo Jansch, I spotted Matt Assay mentioning in his article on cnet that PHP headlines in IBM’s list of most vulnerable software and I have to say this is complete balderdash on the part of IBM.

He quotes from the report:

Another commonality between these three vendors is that they are all written in PHP. If we look back over last year’s disclosures and apply the new CPE methodology to them, we would uncover another newcomer to the top five list, PHP itself, which would rank number four in the 2007 top five vendor list.

What are featuring in IBM’s top ten of vulnerable that makes the report insinuate that the PHP language is a security risk are Jooma, WordPress and Drupal. How PHP would feature in a list of “vendors” is beside the point – if a construction company were to build a house where the windows don’t close fully, the security alarm doesn’t work and where bare wires are exposed you don’t “blame” the windows, alarm system and cabling. The responsibility rests with the construction company and/or the individual contractors hired by that company. Similarly, we can’t “blame” PHP for bad software architecture and security risks present in Joomla, WordPress or Drupal – the onus is on the software developers and architects to design secure [web] applications.

They should, at the least, ensure input data is of the expected type, of certain values; handle uploaded files in a secure and cautious manner that they don’t overwrite files crucial to the health/security of the system running the application or the application itself; use an audit trail for checking against attacks, ensure security in depth against SQL injections, Cross Site Vulnerabilities, Command Injection and … I could go on but won’t – search for php security best practices, get the Zend PHP 5 Certification Study Guide, check out the library resource at the PHP Security Consortium.

Now where’s ruby, cobol, C, and z80A assembly language on that list? And why is Linux mentioned there as a vendor?

Posted at 12:47 pm | Comment (0)