Technology

iPhone Dev Camp NYC

I’m at Apple’s iPhone Tech Talk in New York today. Info is flowing like water through a firehose, so I’m not going to attempt live blogging, but here are their suggested ingredients for a successful iPhone app: Delightful Innovative Designed Integrated Optimized Connected Localized The picture is of the main theater for the event. It’s […] » about 200 words

Peephole DIY Fisheye Lens

Flickr blog I discovered the Peephole fish eye group. The idea is simple: us a $5 door peephole to give your camera a fisheye lens. Here are the instructions:

  1. Hold peephole against rim of camera lens.
  2. Set camera to “macro”. (the image is actually displayed on the inside face of the convex lens of the peephole. The camera must focus on the foreground image rather than the background image.)
  3. Zoom in to the point that the viewable “circle” is framed almost evenly.
  4. For best results, brighter lighting will avoid unwanted noise (grain)
  5. Enjoy and have fun.

You can buy a pricier model with the Lomo label on it (and if you go looking, you’ll find a “peephole reverser” which is probably useless for your photography…probably). Henry Gordon Dietz offers a lot more info.

Above is my first experiment with a peephole fisheye and my cheap video camera.

Amazon’s Content Delivery Network Launches In Beta

Amazon calls it CloudFront, and it costs $0.17 – $0.22 per GB at the lowest usage tiers. It seems that you simply put your files in an S3 container, make an API call to share them, then let your users enjoy the lower-latency, higher performance service.

Their domestic locations include sites in Virginia, Texas, California, Florida, New Jersey, Washington, and Missouri. Internationally, they’ve got Amsterdam, Dublin, Frankfurt, London, Hong Kong, and Tokyo covered.

Web Search Re-Imagined: Searchme iPhone App

Re-imagined a bit, anyway. Why browse a vertical list of results when you can flip through them like pages in a book (or album covers in iTunes). Searchme on the iPhone and iPod touch does just that. As you type your search term, icons representing rough categories appear, allowing you to target your search and […] » about 300 words

Video DRM Hammering Legal Consumers

Nobody but the studios seem happy about Apple’s implementation of HDCP on its recent laptops. The situation leaves people who legally purchased movies unable to play them on external displays (yeah, that means you can’t watch movies on the video projector you borrowed from the office). A related story may reveal the extent of the […] » about 300 words

Fiddling With Open Source Software for Libraries Theme

I generally liked CommentPress, but when the Institute for the Future of the Book website went down recently, it started throwing errors in the dashboard. So I decided to re-do the Open Source Software For Libraries website using Derek Powazek’s DePo Masthead. I think it’s a beautifully readable theme, and I only had to make […] » about 200 words

Tricky Uses of bSuite

After writing the project page for wpSMS I didn’t have much more to say in a blog post announcing it. The cool thing about writing Pages in WordPress is that I can create a taxonomy like /projects/wpsms/ to place them in. The downside is that new pages never appear in the RSS feed.

So I need both the page and a blog post to announce it. I could have simply copied the content from the wpSMS page into a blog post, but that creates confusion and splits the audience between the two pages. Instead, I’m using two bSuite features: the [inclu``de] shortcode and the post redirection support.

  1. Create the page.
  2. Start a new post.
    1. In the post body put the include shortcode like this: [inclu``de post_id="123" field="post_content"].
    2. In the custom fields put an entry with the key: “redirect” and the full URL to to your page.
  3. Relax, you’re done.

The include shortcode will copy all the content from the page (so you don’t have to manage it twice), and the redirect custom field will tell bSuite to redirect anybody trying to read that post to your page.

Using WordPress With External SMTP Server

I really don’t like having sendmail running on a webserver, but some features of WordPress just don’t work if it can’t send email (user registration, for example). Still, WordPress offers support to send email through external SMTP servers instead if a local mailer.

In <a href="http://trac.wordpress.org/browser/tags/2.6.3/wp-includes/pluggable.php">/wp-includes/pluggable.php</a> around line 377, change

``` $phpmailer->isMail(); ```

to

``` $phpmailer->isSMTP(); ```

Then, in <a title="/tags/2.6.3/wp-includes/class-phpmailer.php - WordPress Trac - Trac" href="http://trac.wordpress.org/browser/tags/2.6.3/wp-includes/class-phpmailer.php">/wp-includes/class-phpmailer.php</a> around line 155, set your SMTP host:

``` var $Host = "my.smtphost.com"; ```

You may also need to set a username and password, and tell WP to attempt authentication. You’ll see those in the lines below the hostname variable.

``` var $SMTPAuth = true; var $Username = "username"; var $Password = "password"; ```

On the other hand, you could do this via a plugin, perhaps even Callum McDonald’s WP Mail SMTP.

Uploading .docx Files In WordPress

It may be a sign that none of the core WordPress developers much likes or uses Microsoft Office, but the core code hasn’t been updated to recognize the Office 2007 file extensions like .docx, .pptx, or .xlsx. It’s no criticism, wouldn’t have discovered it if a user hadn’t complained, and I stewed a bit before deciding it was a bug.

It’s now ticket #8194 in the WordPress.org Trac. It only affects my MU users now, though, and the same patch works there.

You’ll find a few mentions of doc, ppt, and xls in wp-includes/functions.php (around lines 1613-1615 and 1651-1654 in 2.6.3). Once corrected, those lines should look something like this:

``` 'document' => array('doc','docx','pages','odt','rtf','pdf'), 'spreadsheet' => array('xls','xlsx','numbers','ods'), 'interactive' => array('ppt','pptx','key','odp','swf'), ```
``` 'doc|docx' => 'application/msword', 'pot|pps|ppt|pptx' => 'application/vnd.ms-powerpoint', 'wri' => 'application/vnd.ms-write', 'xla|xls|xlsx|xlt|xlw' => 'application/vnd.ms-excel', ```

Update: Sweet! It’s been accepted and should be in the WP2.7 release.

World Usability Day Today

The Usability Professionals’ Association says “a cell phone should be as easy to access as a doorknob.” And since 2005 they’ve been organizing World Usability Day to help make that happen. Locally the UPA Boston chapter is holding events at the Boston Museum of Science (in Cambridge, actually) that explore the clues we use to […] » about 200 words

Apache Virtual Hosting Black Magic

I’ve configured Apache for virtual hosting on more sites than I can count, but I’ve always just kind of stumbled through until now. What’s changed? The Apache 2.2 documentation is worlds better than the old 1.3 docs (even though the old docs rank highest in Google). So here they are: name-based virtual hosts, plus virtual host configuration examples (including an example mixed name and IP virtual hosting, which is what I needed), and some tips on dynamically configured mass virtual hosting.

Determining Paths and URLs In WordPress 2.6+

WP 2.6 allows sites to move the wp-content directory around, so plugin developers like me can’t depend on them being in a predictable location. We can look to the WP_CONTENT_DIR and WP_PLUGIN_DIR constants for answers, but a better solution is likely to use the X_url() functions. The most useful of those is likely to be plugins_url(). Even better, you can give these functions a relative path and they’ll return a fully qualified URL to the item.

WordPress Bug: Duplicate post_meta Entries

I just submitted a trac ticket about this:

The update_post_meta() and delete_post_meta() functions don’t know how to deal with post revision IDs. add_post_meta() does, it uses the following block of code to make sure the passed $post_id is a real post, not a revision:

``` if ( $the_post = wp_is_post_revision($post_id) ) $post_id = $the_post; ```

This is important because the global $post_id when a post is being saved is for the revision, not the real post. If you pass that to these functions, update_post_meta() and delete_post_meta() will try to update or delete the records related to the revision. When update_post_meta() fails to find any records for the post_id you submitted, it calls add_post_meta(). Each attempt at updating the meta will actually create a new row in the table.

For now I’m checking with wp_is_post_revision() before making any calls to the post_meta functions.

Updated: Mark Jaquith committed the patch less than two hours after I submitted it! I love WP.