1 | 2 | 3

1 - 5   [13]

New Surfing World Record

Relates to Surf and Travel

Rumour of another distance world record for bore surfing - this time smashing the 10 mile barrier on the Qiantang Dragon in China.

Posted on Oct 30, 2007 at 16:37:57.

iPod Touch E-book Reader

Relates to Apache and iPod Touch

No, don't get excited as this is not a blog about a great new e-book reader application for the iPod Touch post jailbreak. It simply outlines how I organised my e-books on my local network so I could access them efficiently from Safari on the Touch.

Currently I have chosen not to jailbreak my iPod Touch since it will invariably lead to far too much time preoccupied with installing and testing 3rd party applications! After all it is an MP3 player not a phone so do I really need all those extra applications?

But the one thing I do really need is an e-book reader and this was one of my main reasons behind investing in an iPod Touch to allow me to read my e-book collection on a more portable device than my iBook. Accessing PDF files on the Touch is simply a case of visiting the PDF URI in Safari. This is fine for my purposes and the clarity and sharpness of the screen make reading PDFs very enjoyable. A few important features such as bookmarking are absent but this serves as an adequate stop-gap for me at present. So I just had to find a simple way to access all my PDF files from my iMac harddrive. Fortunately this wasn't too hard since I have recently been test driving the excellent Papers for archiving all my e-books and journals and have them indexed in a library directory with sub-folders for each year of release.

So, I just needed to configure Apache to access that directory so I could load up my e-books in Safari on my iPod Touch. Since my apache server also serves my sandbox for web development I wanted to keep access to my e-books separate. The normal approach to this would be to create a new name-based virtual host and update the machine entries in NetInfo Manager. But without jailbreaking my iPod Touch there is no way to override the local DNS (i.e. lack of a NetInfo Manager and shell access to lookupd).

Instead, the best solution was to enable another port in the apache configuration, and then all requests on this port can redirect to the e-book directory:


Listen 192.168.1.65:99

Port 99 seemed like a nice easy number to remember. So after enabling port access in the firewall and a little bit of Apache virtual host configuration later:


NameVirtualHost *:99
<VirtualHost *:99>
        DocumentRoot /Path-to-Papers-Library

        <Directory /Path-to-Papers-Library>
          Allow from all        
          Options FollowSymLinks Indexes
          IndexOptions +SuppressHTMLPreamble +FancyIndexing +NameWidth=* +SuppressDescription
          IndexIgnore *.papers* Unknown .svn ._* .DS* Spotlight
        </Directory>
        
</VirtualHost>

The virtual host is enabled on port 99 and the root directory for this site will point to the Papers library. I then just used a few rules from the mod_autoindex module to make the directory index available in a simple to browse layout.

Screen capture of the browser window with index of year folders

And there it is. I can now load up Safari on my iPod Touch and browse to http://192.168.1.65:99 on my local network and have ready access to all my e-books. Of course this requires I am within range of my local network. Taking my e-books away with me would require hosting on a network available outside my LAN.

Posted on Oct 30, 2007 at 13:43:10.

Where Have My WiFi Music Store Tunes Gone?

Relates to iPod Touch

Total respect to Apple's iTunes Store support team since in just less than 24 hours since I lost my song and posted this blog they have made the song available to me again via the Check for purchases in the Store menu. In hindsight I realise that allowing users the ability to download songs multiple times could affect the DRM of the files so perhaps it is right that download is one time only. Anyway, not many support teams that I have dealt with that are that efficient! Thankyou.

The iPod Touch is great. The iTunes WiFi music store is great. But do not reset your iPod Touch if you have manual syncing and have not manually transferred (is that even possible?) your purchases to your iTunes library!

Yes I have just kissed good bye to my first purchase from the iTunes WiFi store - fortunately only one song. My iTunes library is way too large to utilise automatic syncing with my iPod Touch (as I am sure is the case for most people). But with manual syncing set-up it would appear that any music purchased through the iTunes WiFi store on the iPod Touch is not transferred to the iTunes library automatically. I assume (and hope!) there is a way to drag and drop instead - I cannot try this since there is no way for me to reacquire the song I have lost from my iTunes account. So will have to buy some more music first.

Anyway this is an unfortunate flaw in the iPod Touch integration and will more than likely deter me from using the WiFi store for anything other than just listening to previews of new releases. After all it is just a simple one click Restore to again kiss good bye to all those purchases.

I also think it is wrong that I cannot download the songs I have purchased a second time. It is my account, no-one else has access to it, so how can this breach any legalities (other than affecting the download count at the store - a little bit of code perhaps). It is not often I am disgruntled with Apple but this sucks a little…

Posted on Oct 30, 2007 at 13:21:39.

PHP Function: array_merge_assoc

Relates to PHP

Doing lots of PHP coding at the moment to upgrade my code base for a server migration. One routine I regularly run into is merging data from one array into a map of predefined indexes. For example when POST data is submitted by a form a will fill a map with this data using predefined indexes to ensure no unexpected keys are passed in to exploit the application. The normal approach to this being a foreach loop through the POST data filling in keys that exist as I go. In streamlining my code to use PHP's inbuilt functions I decided to simplify this to a couple of calls to the array function library as follows:


function array_merge_assoc($map, $data) {
  $data_clean = array_intersect_key($data, $map);
  return array_merge($map, $data_clean);
}

The first call to array_intersect_key strips any invalid keys from the $data array hence making it safe to then merge the two arrays in the second function call.

Posted on Oct 30, 2007 at 12:07:06.

Leopard - a beautiful upgrade?

Relates to OSX

Apple OS X Leopard is coming to a computer near you soon!

Personally I will be jumping on the Leopard train as soon as I have invested in a reliable backup solution to boot my older Tiger off an external drive if I so wish.

Finally, a PC Unix that everyone can love. OS X Leopard is a triumph of customer-focused engineering Apple OS X Leopard: A beautiful upgrade. Tom Yager

Posted on Oct 25, 2007 at 10:09:39.

Breadcrumbs Trail

[ Home ] -> TW Blog -> Archives for October 2007
Site Map

The Severn Solutions website achieves the following standards:

[ XHTML 1.0 ] [ CSS 2 ] [ WAI AA ] [ Bobby AA ]

Page compiled in 0.011 seconds