As many of you know, I moved to New Hampshire a couple years ago from Boston.
It’s not as big a move as it sounds. I can still get to Boston in 45 minutes if traffic permits me. Plus I have all the fresh air, hiking, biking, and great restaurants I want.
But it is a huge move in terms of developer community. I find myself routinely driving to Boston for the always great Boston PHP meetup but most other meetups I dropped entirely because I can’t justify the commute.
Update: added a benchmark for performance comparison and updated the code to no longer rely on a fatal error to exit.
It started with one question:
Print numbers from 1 to 1000 without using any loop or conditional statements. Don’t just write the printf() or cout statement 1000 times.
How would you do that using C or C++? Source: Stack Overflow
My favorite answer was an amazing example of obscure C. Using math to iterate between two function pointers (p
I’ve seen a number of blog posts floating around today about GMail Desktop Notifications (here, here, here, here and here — did I miss anyone?). I tried them out myself and they are very useful. Being a rich web applications developer I, of course, wanted to figure out how it works and how I could use it for my own apps. Here’s a quick overview of what I found.
There is a proposed web notification standard over at the W3C that Google submitted earlier this month (you can find it on th
I haven’t written a blog posts in a while so it figured a good start might be to make some resolutions for myself in the new year (yes, I know that January is almost over).
Here are few things I want to improve:
First, and I’ve been saying this for a while, I need to start blogging more. This post is a okay start but I want to finish my initiative that I start back in December. Which is to to break the site up into code in business and to post in each of those categories
Update: this article is mentioned in a few places as a practical example of using closures. Some languages pass variables into a closure automatically. In PHP it needs to be done explicitly using the use keyword. See line #6 of the code example.
I was inspired by a question that I was asked on Twitter to write a quick code snippet.
As you may know, set_error_handler can be used to set a custom error handler in PHP. It will catch any errors that happen in the script (with
I noticed a spike in my traffic which can only mean one thing: welcome, CakeFest attendees, to my home on the web!
When conference day two roles around you’ll be able to find all my presentation notes here and I will be uploading the slides as well.
As you may know, I will be talking on API Development with CakePHP. It is a complex topic so my presentation won’t be the end of it, I will be adding additional information over time. So I hope that you subscribe to me via RSS.
This seems like a no-brain-er but I have seen it more times than I can count and I have seen it happen to some very experienced developers. Put simply: authentication is not enough; you need to make sure that the authenticated user is actually authorized to perform an action. It is one thing to know who a user is and an entirely different — though equally important — thing to know what a user is allowed to do.
This article covers the concepts of authentication and authorization.
One of the things that separates a good web application from a great one is how gracefully they handle failures. One of the often overlooked cases is when a user attempts to upload a file that exceeds the set PHP upload file size. This article shows how to detect when the user tries to upload a file that is too large and display an appropriate message.
This article assumes that you have already set upload_max_filesize, post_max_size, and memory_limit in your php.ini file to appro
You are in for a headache if you have try to call a method or create a member variable with the name of a reserved word in Actionscript. It can lead to such fun situations as having variables called: insert; update; deleteSomething. Because calling the third variable “delete” may be logical but it is a reserved word so that is out of the question. It gets hairier when you don’t necessarily have control over the object format (such is often the case with remote calls). I ran into this today wh
Rest assured. Soon I will be writing “Things about PHP 5.3 that make me cringe” but for now I sing the praises of the latest release of PHP that that came out today. I’ve been playing with the new release for months and there are indeed many good things about it and many of them have been a long time coming.
The other day I was reading the release notes and I couldn’t help but smile. 1. New native MySQL driver
I’m saving the best for last. So bear with me. Lets get through the