Camping in the Santa Monicas – La Jolla Valley


I was chatting about local camping the other day, and realized there really wasn’t any good documentation on where you can camp in the Santa Monica mountains. Here’s the only official list I could find, but it doesn’t have much information on the different site. We’ve got some amazing trails, but there is a shortage of overnight spots. There are a few options though, so I’ll try and cover the ones I know about over the next few days.

First up is the La Jolla Valley. It’s on the west side of the Santa Monicas, past Malibu and Sycamore Canyon if you’re driving along the PCH from LA. What’s really special is that there’s a hike-in campground here, with no reservation required, and it’s not usually too heavily used. It’s primitive, without much in the way of facilities, and a friend using it complained about the coyotes sniffing around his tent at night, but for a last-minute get-away it’s hard to beat. Being no reservations, it’s first-come, first-served, so you don’t have a guarantee that you’ll be able to camp of course! The two mile hike in tends to keep numbers down though. I recommend giving the State Park Service a call before making a trip, to make sure it’s not closed because of fire danger, and to hear any advice they might have about using the site.

I’ve prepared a google map showing the campground and how to get to it.  I’ve done it from memory, make sure you’ve got a good local trail map like the Tom Harrison or National Geographic ones, since there’s a couple of forks in the trail that can lead you astray.

There’s also a group campground by the parking lot, which I’ve had some great times at. It looks out over the beach, with the sound of breakers alternating with coyote howls most evenings. I won’t be spending too much time on the group campgrounds though, since they usually require a minimum of between ten and twenty people to book, which is hard to arrange for most people. If you can gather that many folks, they can be a good option though, since there are a lot more group campgrounds than individual ones, and they never seem to be as heavily used.

In my next post, I’ll cover Sycamore Canyon’s camping options.

Funhouse Photo User Count: 617 total, 75 active. It definitely looks like growth has slowed since I implemented the server changes. It’s good to have such instant feedback, but it’s a shame I’ll need to wait until the weekend to try to improve the user experience.

Better ways to manage server load, and keep a nice user experience


One thing I’ve lost with my load-balancing changes is the fast display of pictures when a prospective user first clicks on the app. One of my goals with the app was to provide instant fun, to give people something cool within five seconds of clicking. The multiple page reloads that happen bug me, and will put off people checking it out for the first time. I’m looking at a few approaches:

  • Go back to the old method that created all the portraits synchronously within the PHP script. This meant you’d see a page full of images as the first result, and it normally only took around five or ten seconds to load. The downside was, if the machine was busy with another request, you’d see nothing, just an error message, since if you don’t respond with some content quickly enough, Facebooks gives up! This seemed to be happening more and more frequently…
  • Try to improve the current system of multiple page reloads, maybe by cutting down the number of intermediate stages from two to one by synchronously grabbing the user’s portrait as part of the page generation. Then I could at least display something interesting on the first page, rather than a blank page of text.
  • Write some smarter client-side code to grab the images when they’re ready. It’s been nice sticking to server-side coding for the app, since it’s a lot easier thant testing client-side code on all the possible user configurations.

I think I’ll end up doing a combination of the last two. As a quick stop-gap measure trying to cut down the pain of the multiple reloads, but on the weekend spending a bit more time sorting out something more ajax-y.

Funhouse Photo User Count: 573, 116 active. Still growing, but there does seem to be a slowdown in growth since I implemented the new load balancing.

Asynchronous image loading

After my cousin Roz reported she had trouble getting the app to load, I decided to add some very basic asynchronous image generation logic to Funhouse Photo. I found it was possible to get PHP exec() to run commands in the background if you piped stdout to /dev/null, so I set up a system that fired off all the image generation commands using that method, and returned a loading screen immediately.

That loading screen contains a setTimeout() javascript call that reloads the current page after five seconds, on the assumption that the images will have been created by then. If they aren’t, then another reload is caused.

There’s one big reason I chose to implement the loading this way; it’s very simple. It does have some disadvantages:

  • There’s the risk of infinitely reloading the page if an image command fails.
  • The user experience is pretty grotty. The redirect seems to take a very long time to complete, on the order of ten seconds or so. I’m not sure if this is Facebook doing something whacky, or me. Using top on my server shows a lot of idle time during these pauses, so I’m not sure where the delay is coming from.
  • You see a blank screen while the redirect is occurring, rather than anything a bit more compelling.

One idea I’m thinking about is pre-generating all possible images for all your friends when you first add the app, or at least for yourself. That seems like it could make the server load a bit less ‘peaky’, and spread the work out a bit. It would definitely require some kind of queuing/batch system though, and I haven’t made any progress on that.

I’m also looking into a more fine-grained and sophisticated lazy image generation method, like the one suggested by Stephen. It’s somewhat tricky on Facebook since all the image tags are rewritten, but I definitely think it’s the right direction to go in.

Funhouse Photo User Count: 507 total, 64 active daily. A great day of growth, with more than 100 new users since yesterday. I’m glad to see the growth accelerating a bit, though I don’t know how much of that was due to bored folks on Labor day! We’ll see what it looks like tomorrow. The active count was low. Hopefully adding in some new effects, now I’m done with foundation stuff, will help that out.

How to add new effects to ImageMagick


ImageMagick isn’t focused on artistic effects, so I’ve had to port over some of my work from PetesPlugins to give Funhouse Photo a bit more flair. So far I’ve added distortion maps, erode and dilate operators, and scaling an image to the size of another image. I will eventually try and merge what I can into the main branch, but for now my current source code is up at

The first hurdle is compiling the stock ImageMagick code base. You can either download the source as a tar, or grab it from subversion. I very strongly recommend you stick to Linux, I didn’t have much luck with either the Windows or OS X versions I attempted. The source didn’t contain the VisualMagick folder that I needed for Windows compilation, and once I’d found that in a special WIndows version of the source tree, it turned out that they don’t ship any workspace files, but instead require the compilation of a utility to produce the project files. Since this utility requires MFC, it won’t work with Visual Studio Express, so I had to abandon Windows.

My next shot was on OS X, and I was anticipating a smooth Unix ride. Unfortunately, getting the libjpeg, libtiff and libpng libraries set up quickly turned into yak-shaving. I was several levels of recursion deep (using fink to grab the dependent libraries failed to persuade configure to find their headers, building them myself on OS X turned out to need obscure hand-hacking of libpng’s make files, which required strange changes to the IM code, etc), that I decided to give up on building locally, and stick to building remotely on my server, despite the long turnaround time on compiler errors.

Building IM on my Red Hat Fedora Linux server was super smooth. I just grabbed the source, ran yum install libjpeg-devel, etc to install the libraries I needed, and I was building in no time.

The architecture is split up into several different layers. I’ll cover the changes I needed to make to put in the erode and dilate operators. The lowest level is the base magick directory, and effect.c holds most of the base effect methods. There’s two versions of each method, one of which applies to all color channels, and is a stub passing in an ‘all channels’ flag as the channel mask to the second workhorse processing function that does all the actual work.

Once you’ve got methods in there, you need to let the interface layers know. There’s a lot of different interfaces to the base processing layer, including scripting, C++, Perl and a direct GUI, but I’m mostly interested in the command-line tools. Here’s the places I found I needed to add references to any new function, to make it visible to convert:

  • magick/methods.h : Not sure about this one, but adding the declaration here didn’t hurt.
  • wand/convert.c : You need to add an if (LocalCompare(<command name>)… clause into the massive ConvertImageCommand() function here, to make sure the argument is accepted by convert. You don’t actually do any work here, apart from validating the arguments.
  • wand/mogrify.c : The actual image processing for convert is handled by mogrify, which focuses on dealing with a single image. You’ll need to add another string compare here in MogrifyImage(), and actually call the image processing commands on a match.

There’s other interfaces to IM that also need to be notified of any new operators, but since I don’t use them, and couldn’t test any changes, I’ve not looked into how to do that. You also need to do things a bit differently if you’re adding a composite operation, or an image sequence command, but I’ll cover those in a future article. I’ll also be asking the IM folks to look over this all, since I’m new to the code base.

Funhouse Photo User Count: 401 total, 116 active. Another steady day of growth, with 30% of the users active. I also had a sweet review from JasMine olMO, "i love this!! this is like the best mood app out there"!

New effects for Funhouse Photo


I’ve added some new effects to Funhouse Photo, taking the total up to 40. One thing I discovered was that the fx operator in ImageMagick is really slow, as in seconds for a 256×256 image with a fairly small expression. I was using this in some of my custom effects, so to avoid the performance hit I started a custom branch of ImageMagick, with some of the features I need compiled in. For example, I’ve added a new composite mode that distorts the base image, so I can create custom distortions in Photoshop as images.

As my next step I’m going to examine the database, and figure out which effects are most popular. Knowing how people are using the app will help me improve it, maybe removing some effects and replacing them with types that are more popular, and tweaking the captions. I also want to add in some feed notifications, and maybe an easy way for people to link to their photos from external sites, like their blogs.

Funhouse Photo User Count: 359, 72 active daily. The growth’s as before, but there’s quite a drop-off in the proportion of people active, though it’s pretty steady in absolute terms. I wonder if there’s something I can offer to make it more fun to keep playing with…

The joy of localization


One of the under-appreciated trends of the last few years is the internationalization of the web. Looking through today’s logs for GoogleHotKeys, I see India, Australia, Brazil, Portugal, Russia, Poland, the Czech Republic, Romania, Hungary, and a few more top-level-domains I don’t even recognize. In total, these usually outnumber the plain-old US hits.

The localization in GHK is rudimentary, I don’t even have the help translated yet, but it does recognize and work with around 80 different localized Google search sites (including the Dominican Republic in the next release, thanks Omar). But it’s still doubled my user-base!

Now I just need to figure out how to properly translate and encode the right characters to support Chinese…

Funhouse Photo User Count: 306, 114 active. This is pretty much in line with growth over the last few days, with the number of active users remaining steady at around 40% (since the active count is against the previous day’s total).