muse-ings

where great ideas come together

Great Intro to jQuery Mobile

jQuery Mobile is the latest addition to the reliable and popular jQuery framework family. It's rapidly evolving - just entering 1.0 beta2 as I write this post. It's not a huge book - just 6 chapters - but covers the main points:

1. overview
2. paging, dialogs, ajax and history
3. core UI elements - toolbars, buttons, lists, forms, grids
4. theming
5. the new jQM events and methods, and customisation
6. putting it all together by building a twitter app from scratch

There are some good quick tips thrown in throughout the book, bringing some practical experience to help newcomers, and a few bones for more experienced people as well. The first third (paging, dialogs, ajax and history) are straightforwards and anybody already familiar with HTML of any era, and basic jQuery syntax, should eat this up. At this point a basic jQM web app is easily within reach of most people, as the author provides plenty of examples with code and screenshots.

The latter stages of the book pick up the pace quickly, and requires more than a cursory understanding of HTML and Javascript/jQuery. A number of tips focus on the underlying event model & while this is of interest, it is also well covered on the official jQM website now. The author takes the docs further and shows how to integrate these models into useful code such as handling changed orientation, or enabling swiping to produce page transitions. He finishes up with a sample Twitter app, pulling what was covered in the book nicely.

Overall: If you are not a full-time mobile developer, or have intermediate HTML and Javascript, ideally jQuery, experience, this book will both get you started, and give you a head start on applying core mobile jQuery functionality. It's a practical book representing good value at its price point, and seems to have survived the pre-1.0 changes in jQM well, and will be something I refer back to for a refresher each time I pull a new mobile app together.

I review for the O'Reilly Blogger Review Program

Filed under  //   O'Reilly   jQuery   mobile   reviews  

ubuntu saves the day

My work laptop had a BSOD today, which looks like it was caused by bit rot
on the root partition. While everything's backed up onto S3, restores from NZ
of 20GiB of data take a while, so I was kinda hoping to recover smoothly
without getting the IT guys to visit, who probably will just rebuild it. I'm
pretty sure that's fair payment for getting chocolate inside my laptop's fan.

It was a good opportunity to give ubuntu maverick a spinup before it goes
on the big iMac at home as dual-boot. The install is slowly tweaked each time,
and it's really clean. I am pretty sure my mum could do this without any
help now, and the fresh look is nice - it's truly a class act OS now.

One workaround was needed to resolve what is probably a stuck trackpad
on the loan laptop
http://xpapad.wordpress.com/2009/09/09/dealing-with-mouse-and-touchpad-freeze...
with a 'rmmod psmouse' and then it was all go. Everything works which
really is an impressive step forward for Canonical, with strong OEM relations
clearly now paying off. Hats off guys!

Anyway long story short, nautilus and brasero to the rescue, and I now have
a bunch of md5 checksummed DVDs stashed before the hired goons come
tomorrow to blow it away. I love the ntfs integration in linux, and the new
maverick Ubuntu gets thumbs up all round - especially as it's now got
CouchDB 1.0.1 included - yay!

LHC meets your hand

love it - http://kottke.org/10/09/putting-your-hand-in-the-large-hadron-collider
responses from the quite reasonable through to the delightfully
absurd. Does help if you have some physics background.

Here’s the first post of a series on getting CouchDB built from source on Windows. This one focuses on getting all the compilers sorted out – the most cumbersome part of the process. Let’s start with Erlang as it’s the core of CouchDB.

  • Building Erlang & CouchDB on Windows requires a custom build environment, which is very sensitive to path order amongst the three different compilers used to build wxWidgets, Erlang, JavaScript, and CouchDB.

  • This is further complicated by different install locations on 32 vs 64 bit windows versions, and which Microsoft C compiler and Windows SDKs are installed.

  • Each component is described via Makefiles in the Cygwin unix/posix emulation layer, and then handed over to the appropriate compiler to run.

Cygwin

The full Cygwin install comprises several GiB of data. Run cygwin’s setup.exe using defaults, optionally installing all components if you have the bandwidth, or alternatively with the following additional modules at a minimum:

  • devel: ALL
  • editors: vim
  • utils: file

We’ll be using the new shell icon on a regular basis from here on in.

Mozilla Build

  • The mozilla build toolchain is needed solely for building our javascript engine.

  • download it from mozbuild and install per defaults

Microsoft Visual C++

  • Erlang and CouchDB can be built using the free VS2008 Express C++ edition from MSDN if you don’t already have a full VS2008 commercial released install.
  • You’ll only need to install Visual C++ 9 only, to the default locations, either using the DVD ISO msvc++, or the smaller [msvc++webstart]. You can exclude the optional MSSSQL & Silverlight components.

  • I’ve not tried compiling CouchDB + components using Visual Studio 2010 yet as the project formats have changed again – but feel free to let me know if you get it working.

Windows 7 SDK

  • The (free) windows 7 SDK is required, as the free VS2008 install is missing the message compiler. Download one of the following version per your requirements & install.
  • win7sdk_32bit
  • win7sdk_64bit

Getting the environment right

  • after installing VC++ 2008 Express, there is a new batch file which correctly sets up the environment for you. So "%vs90comntools%\..\..\vc\vcvarsall.bat" x86 will automatically find the correct path, and set up our 32-bit build environment correctly, independently if you have installed on 32 or 64bit windows. I set up a script to do this for me, & then launch a cygwin shell directly:

    @echo off
          call "%vs90comntools%\..\..\vc\vcvarsall.bat" x86
          pushd C:\cygwin\bin
          bash --login -i
  • In your new cygwin prompt look at your path echo $PATH | sed 's/:/\n/g' and check there’s nothing missing or unexpected.

  • In the next post, I’ll include getting Erlang/OTP set up ready for compilation

Filed under  //   CouchDB   Erlang/OTP  

coloured git console on windows

Tired of plain text output running git on Windows? Missing your unix coloured command-line fu? add two more environment variables:

LESS=FSRX
    TERM=cygwin

thanks http://asimilatorul.com/index.php/2009/09/20/git-on-windows-with-msysgit/

cygwin dumps core on Windows 2008 R1SP2 on EC2

I have been trying to speed up the process of building CouchDB on Windows by having a high-speed pre-prepared Amazon EC2 image. Microsoft’s VC++, mozilla-build with msys, and cygwin tools are required to build erlang and then later on, CouchDB which also uses erlang. So, no cygwin = no erlang = no couchdb = showstopper!

If you are trying to install cygwin or similar tools on Windows 2008 R1SP2 Datacenter Edition, either 32 or 64-bit images, you’ll likely not even be able to complete the installation. bash dies regularly, the cygwin installer spits out errors faster than an uncapped BP oil well. This bug affects mozilla build tools, cygwin bash and other tools, such as the msys/mingw compiler as well. Apply the reg fix in KB956607, reboot and re-install any tools to ensure their final installation tweaks complete successfully. This still hasn’t been sufficient for me but I am getting further than before, YMMV as always.

Corinna on the cygwin list has confirmed that this issue does not recur on a physical install – thanks! So this is either an EC2 tweak or a Xen bug. While I’ve not tested this, it is possible that the older AMD chipset Xen hosts will run successfully, vs the newer Intel x86_64 chips which don’t.

I will be following this up with Amazon AWS.

Filed under  //   aws   cygwin   ec2   tweaks  

Getting started with CouchDB on Windows in 4 easy steps

Not only is CouchDB fun & relaxing, it’s also really easy to get started. Those nice CouchIO guys are providing free couch hosting to help you get started at http://couch.io/get

Getting into CouchDB on Windows

So you just can’t wait to relax can you? The fastest route is just 4 easy steps to CouchDB zen:

Install the bits – 32-bit versions only

relax!

Filed under  //   CouchApp   CouchDB  

Shared folders using Mac OS X extended ACLs

You want to set up a shared folder on the same Mac, like iTunes or Aperture, so your family can share the same files. Let’s assume you have a group called “staff” which everybody is already in, and a folder called “common”. This is a mac, this should be simple, right – well.. almost with a bit of terminal-fu:

FOLDER=common
GROUP=staff
mkdir $FOLDER
chown -R $USER $FOLDER
chown -R :$GROUP $FOLDER
chmod -R g+rw $FOLDER
chmod -RN $FOLDER
chmod -RI $FOLDER
chmod -R +a "$GROUP allow list,add_file,search,delete,\
  add_subdirectory,delete_child,file_inherit,directory_inherit" \
  $FOLDER
ls -lde $FOLDER

You can use the slightly more permissive “$GROUP allow list,add_file,search, \ delete,add_subdirectory,delete_child,readattr,writeattr,readextattr, \ writeextattr,readsecurity,file_inherit,directory_inherit” which allows that group to change permissions and ACLs as well.

By explanation;

  • chown -R :staff — changes the standard unix group
  • chmod -RN and -RI — remove any inherited and initial ACLs; this is not needed for new folders but if you are converting an existing folder, this helps a lot to clean up crap
  • chmod -R +a — this is the permissions-mojo being applied
  • ls -lde displays the extended permissions for a folder
  • note that the ACLs must not have spaces in them if you are pasting code from above

Further reading:

http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPage...

http://sage.ucsc.edu/~wgscott/xtal/wiki/index.php/ACL:_Access_Control_Lists

http://arstechnica.com/apple/reviews/2005/04/macosx-10-4.ars/8

http://www.ideocentric.com/matt/technology/osx-acl/

Filed under  //   macosx  
Posted July 31, 2010

Aperture 3.03 unsupported image format

A3_unsupported_image_format_er

After losing my hard drive on my iMac I had a fresh install of Snow
Leopard & a spanking new disk too. I installed AP3.03 & opened my old
library. The most recent photo shoot, from our trip to Rarotonga, is
now reporting "Unsupported Image Format" for over 180 jpegs. You can
see them on disk, the preview.app can read them -- just AP3.03. Crap.
If I export as a new library, then duplicate, they come right - but I
need a better solution for the remaining 73000 photos. Apple your
premier photo product has had a bad run - is AP3 worm-ridden to the
core?

Posted July 10, 2010