Posts from the Web Development category

Install libjpeg and PIL on OS X Leopard

You will need these if you're working with ImageFields in Django.

I have been building my first site using the Python-based development framework Django and it is really fantastic! I am picking up some of it very fast (the concept of templates and template tags, for example) because of my experience with the PHP-based CMS ExpressionEngine, and some of it is totally foreign to me... but as I muddle through it, I can tell that I've begun to learn some very powerful tools, especially once I got Django working with the jQuery javascript library.

When working with images such as profile avatars, you need to have the Python Imaging Library installed, which also means installing the libjpeg library to compile PIL. I found a couple articles here and here but it seemed that only part of each worked for me. Last night I installed everything again on my PowerBook running Mac OS X Leopard 10.5.4, so I recorded the combination that worked for me:

1. If you haven't already, you must install the Apple Development Tools (XCode).
2. Download and install the Unix software installer Fink. The binary installers for the Mac worked great, both on my Intel and PowerPC machines.
3. Open a Terminal window and type:
  1. fink install libjpeg
  2. curl -O
  3. tar -xzf Imaging-1.1.6.tar.gz
  4. cd Imaging-1.1.6
  5. sudo python install
And that's it!
Technorati Tags: , , , , , , , , , ,

Comments →

Speedy SquirrelFish on Safari

WebKit's new JavaScript interpreter may improve performance for the iPhone.

The Surfin' Safari blog announced SquirrelFish today, a new javascript interpreter for WebKit that is 1.6 times faster than the current interpreter. This is incredible, as Safari is already a super-fast browser, but as John Gruber points out in Daring Fireball, it may mean improved JavaScript support for the iPhone. If you've read much of this blog, you already know my opinion about the whole "JavaScript on the iPhone really sucks" thing. I was recently reminded of this when translating some jQuery/JSON scripting from the Web to the iPhone. What ran as a fairly simple and speedy app on the Web became unusable on the iPhone, and I had to strip out tons of code to get even basic functions up to speed. Keep your fingers crossed that SquirrelFish makes it to the iPhone, and soon!  I'm not sure if its release so close to the WWDC conference means it won't be making it to the upgraded "iPhone 2" that everyone is expecting to be announced, or if an iPhone software update will be released after the new iPhones hit the market.  The sooner the better! The creators of SquirrelFish say this is just the beginning of new breakthroughs in compile times, and it sounds like they've done some very intensive and boring research to create their mutant aquatic rodent.  Thank goodness for the brilliant and patient minds (read: obsessives) who sort these complicated things out so the rest of us can have a better Web experience. Oh, and yes... as everyone seems to notice, the SquirrelFish logo is way badass. It looks like it may evolve into a StimpyFish in a later release. Leave comments on this blog, or let's talk on Twitter or Facebook.

Tags: , , , ,

Comments →

Flash & iPhone Workaround

Use swfObject to "hide" accessible content behind your site's Flash pieces.

swfObjectI recently had a client ask me to adjust her site to be iPhone-compatible.  The navigation of this site uses Flash to apply a cosmetic animation on the text, so her site wasn't navigable via iPhone or any other non-Flash equipped device. At first I thought I would advise her to forget about the slight effect that the Flash provided and change to a non-animated, but fully accessible navigation system.  But I knew she really liked this small detail of the site, so I thought I would try another way. ...are you using swfObject to embed your Flash content, anyway? Because you probably should be.  swfObject is an  XHTML-valid javascript  method of displaying Flash content without using unwieldy <embed> tags.  The script will fill any old <div> with your Flash, and changing the layout is as simple as adjusting the <div> with your style sheet.  It detects Flash player versions and will help a user upgrade or install the Flash player "in-window" if necessary.  It is a fantastic workaround for the annoying IE "Eolas patent dispute" requirement to "activate" Flash content by clicking it once before any buttons are active. And -- thanks to the way that it degrades gracefully -- swfObject lets you "hide" accessible content behind your Flash.  I often use text describing the Flash content to boost a page's search engine indexability. Though this text is visually replaced by swfobject.js, it remains in the source code when the page renders. In the case of the iPhone, the Flash is simply not displayed, and whatever originally was in the swfObject-specified <div> shows through. This is where you put a static but more-accessible version of the Flash image. You can include any kind of xhtml, links, images, or even embedded swfs. In this case I simply made an html-friendly version of the client's site navigation, placed it in the navigation <div> and specified that swfObject would replace that content with the Flash nav where possible.  Voila!  The client sees her subtle Flash nav effect on her home computer, and can use her site from her iPhone as well (with minimal visible difference, as the Flash effect was a rollover effect anyway). I have also used this trick to "hide" a jpg of a site's logo or header behind a Flash version... this way when viewing on the iPhone, that most important piece of your site (your identity) isn't lost! swfObject was created by Geoff Stearns. Click here to download the project from Google Code.

Tags: , , , , ,

Comments →

iTweet Facebook Page

My first foray into Facebook's new advertising model.

I made my first Facebook product page today, for my project The process was quite simple, and I can see some useful possibilities already in using the Discussion Boards as a place to handle feature requests and bug reports. I'll be making another FB product page for The Illusion Factory soon as well, and perhaps I'll dig into the paid-push types of advertising they have available. Stay tuned...and meanwhile, please add my iTweet Facebook page to your Products list!

Comments →


Come and celebrate in San Francisco by raising money for The Hope Flight Foundation.

As some of you know, my daughter Evie was born with a heart defect. We spent the first few weeks of her life in the hospital at UCSF where the specialists there performed open heart surgery on her when she was less than two weeks old. The excellent neonatal cardio team at UCSF saved her life, but if she hadn't been in an area where we had specialists readily available it might have been a different story. This is a fund-raising event for a charity that helps families less fortunate than mine. If you live in the San Francisco area, come down and support this organization, it ought to be a great time! -Colby Palmer
The Hope Flight Foundation is a an organization that flies terminally ill children and their families to hospitals and treatment centers around the country so they are able to get the best care, even if it is far from home. The organization also does "make a wish" flights so sick children are able to go to Disneyland, etc... This is a wonderful cause!

Sunday, November 11 from 6pm-12am

111 Minna Gallery (San Francisco)

  • Admission: Donations at the door
  • 100% of the proceeds will go to Hope Flight Foundation
  • 21+ ID
Food by:
Oola Restaurant, Tamarindo Antojeria, Blowfish Sushi, Brick, Solstice Lounge Music by:
Jefrodisisac aka Jeffrey Paradise, Didje Kelli, Dirtyhertz, DJ M3, DJ Taj, Laron, DJ Linden, KrisX, Russell Vargas, Dave Madix, LaNiche, Chickenskratch and more Sponsored by SF Station. Also win a gift certificate for Market Street Grill, Lettus Restaurant, Sausalito Taco Shop and other surprises. Silent auction with some of the most amazing Bay Area artists and fashion designers.

Comments →