Blogging begets Tumbling

March 27, 2011
Tags: ,

sisyphus

I enjoyed Wordpress for a time. Then Twitter hit. Then Tumblr. These lighter, faster platforms get right to the point. Less rock, more roll.

David Karp has an incredible design aesthetic, the young Steve Jobs of digital media. His design chops and crisp coding leave me awestruck. Tumblr is, well, gorgeous. Over the next month I’ll be migrating the tastiest tidbits from here into tumbles.

Goodbye, Wordpress, you served me well. For many, you’re perfect, a robust, rich toolset of PHP topia, an instant publishing platform few can touch. You’ll continue to power millions.

Its just that I found someone new. She fits better with my ever-shrinking free time. Hello, Tumblr!.

0

Fixing Time Machine Permission Errors

January 29, 2011

This morning I inadvertently switched git repositories before committing my changes to git — several days of work were instantly wiped out. No problem, I told myself, I’ll use Time Machine on my Mac. I backup regularly. I launched the Star Wars view, selected my directory, and clicked the restore button.

It failed.

Time Machine complained about write permissions. Nothing was restored. My heart skipped a beat. After Googling around for a few hours and trying all sorts of things, I finally got it to work. The result is documented here just in case you run into the same issue. I hope it saves you time!

Fixing a busted Time Machine

First, go to the very top of your directory tree where all disks are mounted. Make sure your backup drive is attached and alive.

% cd /Volumes

Look for the volume that represents your backup drive. cd to that:

%cd ScottBackup
%cd Backups.backupdb

Now start looking through the mount point, shown here as /Volumes/ScottBackup/Backups.backupdb. You’ll notice that the directory tree begins with the name of your computer, followed by a set of directories, each of them named with a timestamp. Mine look like this:

2011-01-11-003733/            2011-01-29-030503/

These are in the format of YYYY-MM-DD-time. Pick one that you want to restore, and cd to that directory. Here I choose a backup at 3:05am on January 29th:

% cd 2011-01-29-030503

The top level directory should look like your hard drive:

% ls
Macintosh HD/

Surf through these directories. It should mirror your existing drive. Under the covers, however, Mac OS/X seems to be hacking the file system. The files don’t actually exist in multiple copies. Instead, they’re layered into a database and made to appear as though they’re in one piece. No matter.

Find the directory you want to restore. Now comes the tricky part.

First, create a tarball of your disk and place it on ~/Desktop. Let’s assume for this example that my directory is /Users/spenberthy/myapp/lostdir:

% cd Users/spenberthy/myapp
% tar cfvz ~/Desktop/lostdir.tar.gz lostdir

This will take a bit of time for a large directory. You’ll hear your backup disk grind as OS/X reassembles all the files, reads them, and stuffs them into the tarball.

Now get out of there. Move to your desktop:

% cd ~/Desktop

Decide where you want to restore the files, then move there:

% cd ~/myapp

For the first pass, unload the tarball onto your hard drive:

% tar xfvz ~/Desktop/lostdir.tar.gz

You’ll be greeted with numerous permission errors. Ignore them. We’re almost there. If you list the files that you restored using “ls -l”, you’ll notice something odd:

% ls -l
total 22800
-rw-r--r--+   1 spenberthy  staff    56B Aug  5 17:17 README
drwxr-xr-x+  10 spenberthy  staff   340B Jan 29 06:46 Reachability/
drwxr-xr-x+  14 spenberthy  staff   476B Jan 29 06:46 Twitter-OAuth-iPhone/
drwxr-xr-x+   8 spenberthy  staff   272B Jan 29 06:46 certs/

See those plus signs on the left? Well, they were new to me. These are called extended permissions and use an elaborate, English-like syntax. To see these use the command “ls -lE@”:

% ls -le@
total 22800
-rw-r--r--+   1 spenberthy  staff    56B Aug  5 17:17 README
 0: group:everyone deny write,delete,append,writeattr,writeextattr,chown
drwxr-xr-x+  10 spenberthy  staff   340B Jan 29 06:46 Reachability/
 0: group:everyone deny add_file,delete,add_subdirectory,delete_child,writeattr,writeextattr,chown
drwxr-xr-x+  14 spenberthy  staff   476B Jan 29 06:46 Twitter-OAuth-iPhone/
 0: group:everyone deny add_file,delete,add_subdirectory,delete_child,writeattr,writeextattr,chown
drwxr-xr-x+   8 spenberthy  staff   272B Jan 29 06:46 certs/

Those permissions are the problem. Let’s get rid of them.

% chmod -R -a# 0 *

If you list the contents again, your extended permissions should be gone, as well as that mysterious plus sign:

% ls -l
total 22800
-rw-r--r--    1 spenberthy  staff    56B Aug  5 17:17 README
drwxr-xr-x   10 spenberthy  staff   340B Jan 29 06:46 Reachability/
drwxr-xr-x   14 spenberthy  staff   476B Jan 29 06:46 Twitter-OAuth-iPhone/
drwxr-xr-x    8 spenberthy  staff   272B Jan 29 06:46 certs/

You’re done! In case you’re wondering, these files are for a new app I’m building with some friends and relatives at DX Agency. More on that later.

0

isli.de takes off!

January 5, 2011

A few months back I wrote about a side project, “isli.de

The general idea was to share pictures instantly. And I mean instantly. I wanted something so simple, that a single tap could take a picture, upload it, transmit it across the intertubes, and show up instantly an another device. Any device. No reloading necessary. When I tapped again, take and transmit another picture, forming a slideshow. Voila. Instant picture messaging, across phones and devices.

I wrote iSlide Camera back in April, finally breaking into the App store in June. It was free for a few months and then kicked up to $3.99 in September 2010. I left it alone. It made enough for a few nice dinners out.

Yesterday I logged in, changed it to free. Signups rocketed. I came home from a meeting today and my servers were swamped. Now I’m busy ramping up more EC2 instances. My favorite picture was taken a few hours ago, apparently by two guys who also like instant photos:


dave

Dave and Saeid, thanks for making my day. Its time to dust off the code and integrate several features that iSlide obviously needs. Coming soon…!

0

Interactive Earth for iPhone

December 22, 2010

earthviewcontroller

Today I was searching for code to create an interactive, 3D earth with a single UIViewController that reads from Geo RSS. It should work on an iPhone, IPod Touch, and an iPad. I need this for several apps we’re writing in 2011. The interface should be as simple as

EarthViewController *evc = [[EarthViewController alloc] initWithFeed: @"url"]

The controller handles OpenGL, animation, touch interaction, XML parsing, favorites, glowing dots, 3d pan and 3d zoom. The controller is fully interactive. Pinch to zoom out, pull to zoom in. Flick your finger and watch the globe spin. Hit play/pause to watch it rotate in real time, updating live with a Geo RSS feed. Make this configurable for every N seconds. When a dot is selected, return an NSDictionary with the contents of the selected GeoRSS entry.

I’m offering it for $499 to offset my costs. This includes a header file EarthViewController.h, a binary library EarthViewController.a, and a sample app with a stock RSS feed. The OpenGL interface uses OpenGL ES 2.0 with pixel shaders for a professional, high-end look and feel. Contact me if you need a controller like this, too!

0

Pixel Shaders on the iPhone

December 21, 2010
A mesh and Lomo filter on the iPhone

A mesh and Lomo filter on the iPhone

I recently “discovered” OpenGL Shading Language on the iPhone, or GLSL for short. Its incredible. The iPhone chipset compiles a C-like language on the fly, producing byte codes for the GPU. These in turn are processed in two phases at interactive frame rates:

  1. Vertex Shader – Compute where a pixel is drawn
  2. Fragment Shader – Compute what’s drawn for each pixel

Readers will recall my experiments with Milkdrop, flash visualization, and image morphing math. The OpenGL Shading Language takes it to a whole new level, stuffed into a large, orange, 740-page reference guide.

I wondered if I could build a real-time visualizer on the iPhone using GLSL, applying a surface mesh to a live data feed, all at interactive rates. This could be the groundwork for visualizing massive data clouds we’re all building these days.

Sure enough, you can.

I’m working on an app tentatively titled, “FunHouse Mirror.” That’s probably the best way to explain what happens. Yes, there are other copies in the App Store. What makes mine unique is that the filters are infinite and programmable.

Inspired by Milkdrop, I built an engine for morphing video instead of audio. Instead of presets, the app downloads shaders, compiles them, shows me the compiler & linker results in a popup window. If no errors are found, the engine installs the vertex and fragment shaders. Then the magic happens.

The engine senses the compass, accelerometer, orientation, GPS location and time. It computes several waveforms on demand. It grabs the raw bytes from the forward facing camera as a data feed. These are passed into the visualizer, which changes the visual effect like Milkdrop based on ever-changing data. It’s stunning.

The result is live, interactive, morphing video. I also find that it’s a wonderful tool for testing out shader ideas, learning how math shapes surfaces, figuring out the best way to visualize a data set. The engine takes care of all the headache of sampling data, working with OpenGL, compiling shaders, building a mesh, establishing textures, interacting with the user, displaying views, all that rot.

Instead, you can write a simple shader like this.

/*
 * Roaming fisheye effect
 *
 */

vec4 FishEye()
{
        float dt = (f_parms[TIME] - 0.0*floor(f_parms[TIME]))*3.14;
        float cx = 0.4+3.0*(f_parms[ROLL]-0.08);
        float cy = 0.4+6.0*(f_parms[PITCH]+0.85);
        vec2 ray = v_texCoord-vec2(cx,cy);
        float r = length(ray);
        float theta = atan(ray.y,ray.x);
        float rs = (r*r)/0.7;
        vec2 pixel = vec2(cx+rs*cos(theta), cy+rs*sin(theta+dt*0.0));

        return texture2D(campic, pixel);
}

void main()
{
        gl_FragColor = FishEye();
}

The shader is tested and installed with a single tap. I’m also building up a library of functions for representing Photoshop effects and convolutions, in real time, with shaders.

0

Android: To port or not to port

September 29, 2010
Apple's Barrel full of Apps

Apple's Barrel full of Apps

Well, that about says it.

My money says this chart will be dominated by Android in 3-5 years by volume.  Apple will dominate by revenue.   See the full story.

0

Google Instant Alphabet

September 8, 2010

Here’s what I get when I just type a given, single letter of the alphabet on Google’s new Google Instant search:

  • a – aol.com
  • b – Bank of America (!)
  • c – Craiglist
  • d – Dictionary
  • e – Ebay
  • f – Facebook
  • g – Gmail
  • h – Hotmail
  • i – Ikea
  • j – Jet Blue (!)
  • k – Kmart
  • l – MTA Long Island Railroad
  • m – Mapquest
  • n – NetFlix
  • o – Orbitz
  • p – Pandora (yay)
  • q – Quotes
  • r – Realtor.com
  • s – Staples
  • t – Target.com
  • u – UPS
  • v – Verizon
  • w – Weather in New York
  • x – Xbox
  • y – Yahoo
  • z – Z100
  • 0 – James Bond 007
  • 1 -Power 105.1 (huh?)
  • 2 – 2010 calendar
  • 3 – 311 Home in NYC
  • 4 – 4chan (ugh)
  • 5 – 50 Cent
  • 6 – 60 minutes
  • 7 – 7Zip open source zipping for Windows
  • 8 – 8 Mile movie
  • 9 – 92.3 NOW FM

My favorite is 0 for 007 Bond and W for weather.  Have we entered a new era of single-character SEO?

0

Was Justin Bieber from Mars?

September 3, 2010
Justin Bieber on Mars in 1976

Justin Bieber on Mars in 1976

Photos reveal that Justin Bieber was, in fact, born on Mars. Here we see him standing next to the Voyager 3 spacecraft which landed on Mars on September 3, 1976. I thought you’d appreciate this original photo on the anniversary of this important voyage to another planet.

Now I understand why my daughter is crazed for the teen’s music. His influence is truly out of this world.

0

Ask the Octopus

July 14, 2010

octopus

The pace of innovation in App land is incredible. Apps are appearing a week, or sometimes just a few days, after a story breaks. One of my favorites is “Ask the Octopus,” a comical take on the famous octopus that correctly guessed the outcome of the World Cup.

I’m equally amazed by the plethora of apps that control the flash on the iPhone 4, turning it into a powerful flashlight. My iPhone was barely out of the box with new developer certificates, loading my apps, when these iOS4 apps appeared in the store. Holy cow. What do these guys do? Code 24 hours a day, 7 days a week? Wild.

0

VuvuPhone: Vuvuzela Phone Calls

June 17, 2010
The Ingenious Vuvuphone

The Ingenious Vuvuphone

Thomas Edison is rolling over in his grave. Never before has the phone system been so abused. Welcome, Vuvuphone, the world’s first Vuvuzela Phone Call.

I’ve got about $30 of free credits on this thing. Click and send Vuvuzela’s to unwitting friends around the world. Squeal in delight as your friend hears an Italian sportscaster yell “Go-Go-Go-Goallllllllll!!!” followed by 30 seconds of the hideously addictive Vuvuzela.

0