Persistence of Vision Framerate

Here’s an article about the frame rate for television and movies.

http://www.economicexpert.com/a/Persistence:of:vision.html

Sounds like the preferred frame rate for persistence-of-vision applications is 16-24 frames/sec.

Accelerometer on the iPhone Simulator

The iPhone simulator doesn’t support accelerometer data. But this fellow wrote a nice iPhone app which broadcasts the accelerometer data via UDP to whatever is running on the simulator!

http://code.google.com/p/accelerometer-simulator/wiki/Home

7 Rules of Managing Memory in iPhone Apps

I like Lou Franco’s 7 Rules of Managing Memory in iPhone applications:

  1. Declare all of your object pointer @properties as retain unless you have a really good reason not to. Then the setter that is generated will automatically call retain when you assign. When you reassign, it knows to call release on the old value.
  2. In your dealloc, assign all of your @properties to nil. This has the effect of calling release on the current values if they are not already nil.
  3. alloc returns an object with a reference count of 1 — so you have to balance with a release.
  4. If you alloc, then you should try to release in that same function. To retain the value, assign it to something that retains. Exceptions are if you are a factory function that is returning a value up to be retained by the caller.
  5. Obviously, each retain call needs a release.
  6. Built-in convenience functions return objects that are autoreleased. That means you shouldn’t call release on them — the framework will call release at some point (they are registered in an autorelease pool that that is serviced when you return back to the framework). If you created the object without an alloc/init pair, you don’t need to call release unless the docs say you do (but they probably don’t)
  7. Check all of your work with the leak detector. Also, if you crash, you’re probably doing it wrong — I will have more to say on that soon.

iPhone-related Stuff to Read

Just a list of iPhone-related articles and posts I need to read:

I got many of these links from this article:

on hold

Well, I’ve temporarily suspended all work on my project while I juggle career and taxes.

From the Interview Question Archive

One train leaves Los Angeles at 15 mph heading for New York.  Another train leaves from New York at 20 mph heading for Los Angeles on the same track.  If a bird, flying at 25 mph, leaves from Los Angeles at the same time as the train and flies back and forth between the two trains until they collide, how far will the bird have travelled?

django versus joomla?

I’ve slowly been gaining a feel for how to build a website in Django, and I thought the implementation path to my finished website was pretty clear.  But at lunch today, Caleb mentioned Joomla, a PHP-based content management system which seems quite popular.    Why don’t I implement my website with Joomla?  That threw me for a loop.

What is the difference anyways between web frameworks, like Django or Rails, and CMSs, like Joomla or Drupal?  Having no experience with the latter, I really can’t say.  From looking at teh interwebs, I get the impression that with the web frameworks, you have more flexibility and power–especially with regards to data models and database integration.    I intend to stuff all kinds of crap into a database, just for the practice, so I’m going to need power and flexibility.   The price of this flexibility is a steeper learning curve.  This is all conjecture, though.

I’m going to stick with Django for now, but I’ll revisit Joomla later.

Ubuntu: permanently mounting a Windows share

My networked storage (a Synology box) makes its directories visible over the network.  I wanted my Ubuntu box to automatically mount the directories when it boots up.

There is a GUI app to view the directories (Places > Network), but it won’t actually mount the directories.  What’s the point?  Once again, I need to ditch the Ubuntu/gnome solution and do it the old-fashioned way, wading into /etc files with emacs.  Does anybody else detect a trend here?

This page explains how to do it by modifying /etc/fstab:

MountWindowsSharesPermanently

First Django Impressions

I’ve finished working my way through the django tutorial.   Django is a python-based web framework.   I’m happy to see that the parts of Ruby-on-Rails which made sense are also present in django (e.g. ActiveRecord, Model-View-Controller, URL mapping), while also shedding the ridiculous bits ( Ruby).

Ubuntu Annoyance: Remote Desktop

As I mentioned in a previous post, I’m operating Percy as a headless PC:  no keyboard, no monitor.  The only way to talk to it is via the network.  I can ssh to Percy, but I would prefer to use VNC so I can use the desktop environment.

Ubuntu comes with an ubuntu-ish (gnome-ish?) VNC server, available under System>Preferences>Remote Desktop.  Unlike the “normal” VNC server, however, the desktop size (or in X11 parlance, the “geometry”) is always the same as the attached monitor.

That might work for some people, but what if the PC doesn’t have a monitor? In Percy’s case, Ubuntu boots up into a weird desktop configuration which is completely unusable:  the desktop is small, and launched applications never appear.   It’s a fiasco.

Once again, the solution is to ditch the Ubuntu solution and do it the old-fashioned way.  I installed tightvnc:

apt-get install tightvncserver

And then in my .bashrc:

alias vncserver1=’vncserver :1 -geometry 1280×920′

Now from my Windows machine, I ssh into Percy and start the VNC desktop with the command “vncserver1″.  Then I start a Windows version of vncviewer and attach to Percy:1.