lang="en-US"> Dave Stockton's Official Blog
<1> <1>

Latest Entries »

Happy 20th Birthday PHP

Twenty years ago today, Rasmus Lerdorf, the creator of PHP announced to the world the release of a collection of scripts to help developers build web pages that do more than HMTL can do on its own. Here we are, 20 years later and PHP is running something like 80% of the web. That’s pretty impressive! I’ve been working with PHP for most of that time but haven’t ever written down how that came to be. I started working on PHP back in the late 90’s, probably 1998 based on what I remember. I’ve thought it was 1997 but based on the timeframe, I don’t think that is right. I remember working with PHP 3 and then shortly afterwards upgrading to PHP 4.elephpants

My start with PHP happened back in college. One of my professors had some NSF (National Science Foundation) money for the ACM-W (Association of Computing Machinery’s Women in Computing) to build something that would allow you to more easily find articles about women in computing/technology. At this time, Google was basically a twinkle in the eye of Page and Brin. So I did some research about how I could get something on the web. I think ASP was there but that came with licensing. I stumbled on PHP and a few tutorials from I’m certain this was not great code and the site I produced was likely jammed full of SQL injection and XSS issues and some terrible database design (model tables after Excel spreadsheets anyone?). But we had a working interactive site that allowed users to search and find articles about women in tech and computing. You could search by author, title, publication, year, etc. It was AMAZING. Much of it was extremely procedural and definitely mixed PHP with HTML. I built, ran and tested it on a server called OmniHTTP because it was available for free on windows and I could hook PHP into it.

View full article »

The following letter is not mine. It was written by a coworker who gave me permission to post it. We had so much fun reading this in all sorts of different accents, I may try recording and posting that later as well, but for now, here’s the text of the letter.


Dear Einstein Bros,

Office workers across the country rely on the small sense of smug, self-satisfaction when providing your products to their colleagues. Something speaks to our innate hunter-gatherer nature whenever we bring a selection of cheesy, bready foods to a group of tired, cranky people.

For a short time, in our boring, wasted days, we feel like heroes.

That short time lasts approximately eight minutes, which is how long it takes for the poorly-constructed paper handle on the bagel box to completely disintegrate and send your product crashing to the floor.

We are busy people. We are forever burdened with smart phones, coffee cups, car keys and stylish laptop bags. Our one free finger grips feebly to the bagels as we try to get the office door open, but it is of no use. Fate has spoken. The die is cast. No person shall ever reach their desk or break-room with an intact box.

To make matters worse, the handles are also the part that holds the box closed, and if they break, [Spoiler Alert: they will!], then the box is now on the floor, upside down, and open.

The trail of tears and poppy seeds shall lead all to our shame.

Proposed Solutions

1) Make better handles – Bigger, wider, thicker cardboard, whatever works!

2) Add a layer of tape to one side of the handle, so that if catastrophic cardboard separation occurs, you have another layer holding everything together!

3) Test. Test. Test – This is the easiest part. 13 bagels plus two tubs of cream cheese is going to have a fairly standard weight. Try loading up a couple boxes and getting into and out of a car. After you’ve picked up everything off the parking lot, go back and repeat step 1!

4) Remove the handles altogether. You are not Louis Vuitton. We are not shopping at a designer boutique. We do not need to primly clasp our purchases by dainty handles. Remove the fickle temptation of handles and we will hold the boxes by the bottom and the problem is solved!

Yours Sincerely,


Office Workers Everywhere


Loudness Wars cover

Kevin Schroeder's new album, "Loudness Wars"

If you’ve listened to the previews of Kevin Schroeder’s new album “Loudness Wars” or perhaps you’ve found it on Spotify, and you either didn’t listen with a huge subwoofer or at the very least a set of good headphones, you really need to stop reading this, find a subwoofer or good headphones and listen again.

Long-time PHP advocate and technology evangelist Kevin Schroeder recently released his latest album entitled “Loudness Wars” on May 1, 2012. Kevin has made the claim that he guarantees this is good music to code by and I’d have to agree, especially when listening on headphones. Kevin’s put 10 tracks of instrumental good-times in this album which ranges from power guitar ballads to piano pieces and more than a few that brought back specific memories of some particular video games.

Again, I want to re-emphasize the importance of enjoying the album on a decent sound system. My first few listens were on my MacBook Pro through the built-in speakers and I felt like something was “off” or wrong and was dreading writing the review. It turns out that the built-in speakers just don’t let you hear all of the subtleties and layers that are in most of the songs. I feel in some cases I really was missing out on about half of the song. As I am writing this, I’m listening on a nice home theatre system with Bose speakers.

The album opens with “Premonitions”, bringing in an epic movie opening sound with piano, strings and a resonating bass line. Three minutes in, a crunchy guitar joins in the melee. The sound is somewhat similar to some tracks from the Blue Man Group.

The second track, “Lutetium” starts off with the drums, quickly brings in a synth and then some more rock guitar on overdrive. All three instruments jump around and intertwine. The track would make an excellent soundtrack for a top-down shooter. The track ends with some chimes mirroring the chorus line of the guitars and synth.

Track three, one of my favorites, “Steam Punk Roller Derby” has a great sci-fi feel opening which quickly transitions to some great bass drum, synth with some guitar behind all of it. Throughout the song the drums are quick and manic with a nice slow synth in the front rounding everything out. The song finishes out with all elements speeding up to nearly match the drums. It reminds me quite a lot of the MechWarrior (game) sound track.

In track four, “Crisp Licks” has a lot of spacey sounding synthesizer, and lots of low-end bass which meant I actually had to cut the equalizer down a bit. The guitar returns in a couple of different areas, bringing in some rhythm and the occasional high solo elements. It wraps up with the synth organ and the guitar with the drums and bass dropping out almost entirely.

“Frenetic Waltz” follows with another spacey opening, more crunchy guitar and high chorus. The first bridge has something with the single key plunking that reminds me a bit of parts of the “Fable” video game series. Definitely an enjoyable track.

Another favorite, “A Voice in the Wilderness” and the longest track on the album begins with some sustained chords over some lower elements. Piano, organ? and more strings round out the intro. The guitar here reminds me of TSO with drums in the front, quickly cycling synth and guitar in the background and lead guitar just behind the drums.

Track seven, entitled “Sauntering with an Alien” starts by smacking you around a bit with the slap bass and then bringing in the synthesizer and guitar. The song is heavy on the synth and crunch with the drums pretty much just providing a bit of timing and rhythm.

Placing somewhere in my top three on the album, “From the Deep” starts with booming low bass drums and electric synth. This is the only song on the album that has vocals of any kind and they are pretty much shouts. Images of Skyrim come to mind, at least in the beginning of the track. The guitar makes a return as well with some lead guitar tweedling (yes, I made that up, I’m not a music reviewer) over the synth and finishing out with some crunchy rhythm.

Domo Arigato, Kevin, for “Moderato Guitarato” which begins with the crunchy guitar and some slow synthesizer organs. This song has a lot of strings including what sounds like violin and something lower (cello, perhaps?) and even some horns. This one really sounds like a modern movie soundtrack for a King Arthur era movie.

Finishing up the album with “Approaching the Light”, the piano starts us out solo and carries through with no other instruments joining in. This one has elements familiar to anyone who has played probably any JRPG. It a quiet and calm tune that nicely rounds out and brings the album to a close.

Overall, Kevin’s latest release is a lot of fun to listen to and as a developer, I’d say it works quite well as coding music. There are no distracting lyrics or grating sounds which means before long you’ll be cranking out code and bobbing your head at the same time.

Kevin’s album is available on iTunes, Amazon and Spotify and other places. If you decide to listen via the last link and you like it, please consider purchasing a copy from iTunes or Amazon. You’d need to listen to the songs ~3454 times for Kevin to make the same amount as a single album purchase from Amazon or iTunes.

If you’re reading this to figure out how to do the hard drive upgrade on a MacBook Pro that came with Lion installed, I’d recommend either reading all the way through before starting since it will save you some time, or skip to the bottom as it will save you time. If you follow along, you’ll end up doing the same stuff I did which will make your upgrade take longer than it should.

Last weekend (10/2/2011) I picked up a brand new 13″ MacBook Pro (Dual-Core Core i7) from the Apple store. I also picked up 8GB of RAM and an OCZ Agility 3 120GB SSD to upgrade it with.

Both of these upgrades are within allowable modifications for the MacBook Pro without compromising your warranty. Also, for the most part, they are pretty easy upgrades, especially the RAM upgrade. I did, however run into some issues with the HDD –> SSD upgrade which is why I am writing this.

View full article »

Just in case anyone is reading this, I will be presenting twice next week on integrating Zend Framework and Flex together. I’ll be presenting at the Front Range PHP User group on Tuesday, July 13 from 7:00-9:00 at the Big Game Restaurant in downtown Denver.  More information can be found on the meetings page.  After that I’ll be presenting at the Denver RIA Developer’s Group on Thursday, July 15, from 6:00-7:00. More information can be found on their events page.

In both cases, I’ll be co-presenting with Jay Whipple of 111ELM Design.  Each presentation will be similar but we’ll be emphasizing different things for each group.  For instance, the Front Range PHP User group likely won’t need much if any background on PHP and Zend Framework, so the presentation will concentrate more on the Flex side of things and how to integrate Flex and Zend Framework from the Flex side of things while the Denver RIA developer presentation will go more in depth on the Zend Framework and PHP side since most of the attendees will likely already know how to integrate into server-side services, but not necessarily how to create them in PHP with Zend Framework.

To give a brief overview, it’s ridiculously simple to use Flash Builder to consume a PHP class as a service using Flex’s built in Data Services.  However, to use these, Flash Builder requires that you place your class in the web root of your web server which is not a very good practice and really runs quite contrary to best practices. In this presentation we’ll show you how to expose services using Zend Framework’s MVC and Zend_AMF while still maintaining a good structure and keeping your classes out of your web root. In reality, it’s only a little bit more work to hook Flex into your PHP application.

If you’re planning on coming to either presentation please follow the links and RSVP as there will be food and beverages provided at both.



This is the final tutorial in getting your child’s artwork into Flash Catalyst and turning it into a working Twitter search application.  In Tutorial 1 you learned how to get your artwork into Photoshop and get everything all set up for Flash Catalyst.  Then you learned how to import the .psd into Flash Catalyst and turn the artwork into working components.  In the Tutorial 2, you learned how to build the various states your application will need and to use Flash Catalyst to create animations when then application switches between states.

In this tutorial you’ll learn how to move from Flash Catalyst into Flash Builder 4 and hook your application into the Twitter search API.  Before you proceed make sure that you are happy with how your application looks and behaves.  Currently Adobe’s Flash Catalyst -> Flash Builder work flow is one-way only.  There’s not really any way to move backwards from Flash Builder into Flash Catalyst.  You can do all the stuff you do in Flash Catalyst in Flash Builder 4, but for what we’re dealing with here, many of the steps are easier in Flash Catalyst.

View full article »

In case you missed it, here’s part 1. In part 1 I showed you how to take your child’s artwork into Photoshop, chop, layer and label it, import that into Flash Catalyst and turn all that artwork into working components. If you follow all the way through these tutorials, you should have a working twitter search application built with your child’s (or your) artwork.

The final apps can be seen at the following links:  Joey Twitter and Ana Twitter.

And now on to part 2.

Flash Catalyst Interface

We’re going to now build the application states and transitions within Flash Catalyst. If you haven’t created all your components yet or are not sure how to do that please check out the first part of the tutorial. For this application, we’ll have 3 states: start, searchPage and searchResults. The idea is that the start page will show the Start button.  When that is clicked, the application will transition to the searchPage state where the user can enter their search terms to search Twitter.  When the user searches for something and clicks the search button, the application will transition to the searchResults page and display the results of the search. For fun, we’ll also hook up the signature button.  If it is clicked on the searchResults page, the application will transition back to the searchPage state. If it is clicked on the searchPage state, it will transition back to the start state.

View full article »

The other day I decided to have my two daughters draw what they think a computer program should look like.  I sketched out a few key components so they’d know what I needed.  I drew a search button, a search box, a start button, a scroll bar, a scroll bar thumb, an area to put data in, and a repeating data item.  The idea was that I’d take their drawings and turn them into working Twitter search programs using Flash Catalyst to build the interface and then dropping that project into Flash Builder 4 and hooking it all into Twitter.

The final apps can be seen at the following links:  Joey Twitter and Ana Twitter.

As it turns out, doing all of this with absolutely no Flash Catalyst experience and basically no Flex experience was pretty simple and the girls love it.  So without further adieu, here’s the tutorial.

View full article »

Kelley’s Doves

Turtle dove keeping its babies warm in the nest made of shredded paper.

Turtle dove keeping babies warm in homemade nest.

Last year we had a bird create a nest in the fence around our deck in the backyard.  I think squirrels got to it or something but the nest and the bird wasn’t there long.  This year we had a turtle dove build a nest in the other corner of our deck.

A couple of days ago there was a huge windstorm and my wife found that the nest had been blown away.  She looked around and found the babies had hatched but had been blown into and dropped on the grass.  She picked them up and brought them inside and made a nest in a shoe box for them out of shredded paper.  She then fed them baby food with an eye dropper.  Things were not looking so good for them though, and we knew the babies needed their mommy.  Kelley saw later that day the mom came back and was looking all over for her babies.  My wife took the birds outside to give to the mommy but she was scared away and didn’t return for awhile.

Baby dove being fed

One of the baby doves goes after breakfast

The doves working on improving the nest

Dad dove returns from the Home Depot

My wife tried this a couple more times and then created a new nest out of half a ferret ball and shredded paper and waited for the wind to die down a little and then she put the plastic ball nest back on the fence and waited, hoping the mommy dove would return.  It was still pretty windy and cold so she and the girls were worried that the babies were not going to make it.  A little while later the mommy did return and cautiously approached the nest.  Eventually she made her way over and sat on the nest and warmed up and fed her babies.  We’ve been keeping track of the birds since then and I’ve taken a few pictures.

Dove parents taking shifts watching the little ones

Mom and dad take turns watching out for the babies

Each day the babies get larger and stronger.  This morning my wife was able to sneak over when the mom and the dad were gone and take some pictures of the babies.

It’s really cool to see these guys growing and getting stronger every day, especially when just two days ago we weren’t even sure if they would survive.

I also didn’t know until today that there were two parents that take care of the babies.

The mom and dad dove really seem to work well as a team to keep their babies safe, warm and fed.

A close-up of the babies

Back in March, I participated in a photography workshop with Exposure Denver about lighting with models.  I think over the course of 2.5 hours I shot about 550 shots.  We covered using natural light and augmenting with reflectors and diffusers as well as using hot-shoe sync’d lights.  It was a lot of fun and I learned a lot, although I am hoping I’ll be able to do something like that again.  I could definitely use the practice since I tend to mainly take picture of cake.

I was pretty nervous in my pathetic attempts to direct the models.  I think that’s something I could definitely learn to do better.

In any case, here’s a couple of the pictures that I think came out pretty well.  Looking at them now, about 2 months later, I think I could probably go back today and process them a little different to come out with an even better result.  I may have to look at doing that.

You can click through each of the images below to see a larger version and a little bit about each shot and my experience from the shoot.