Bookmark this site!

2010-08-26

SPSS 17 on Snow Leopard

Follow the suggestions at the this link – but then also create a symbolic link CurrentJDK -> 1.5 in directory /System/Library/Frameworks/JavaVM.framework/Versions
By running sudo rm CurrentJDK, then sudo ln -s 1.5 CurrentJDK
Clearly this leaves your Java installation broken for anything requiring 1.6!

2010-07-27

iOS 4 Sync Videos

Summary: Import videos taken on your iPhone into iPhoto just as you import photos. To include the videos when you sync the iPhone, check Include Videos in the Photos tab of the iTunes Device page.
It took me ages to find this as I was looking for iTunes to sync videos taken on the phone – so I looked under the Films tab of the Devices page on iTunes (I guess this will be Movies if you set en-US as your language; I have en-gb). (Connect your iPhone and select it in iTunes under Devices to see this page.)
When you sync, iPhoto asks whether to import photos – and will import videos also if you've taken any. Just as with photos, you can then delete them from the camera roll. To get them to reappear on your phone, you just need to check Include Videos in the Photos tab of the Device page, then sync.
So, photos are dealt with by iPhoto; tunes are dealt with by iTunes.
—and videos?
Some videos are dealt with by iTunes; others are dealt with by iPhoto.

2010-01-06

Python and UTF-8 on OSX: UnicodeEncodeError

an acute problem

UnicodeEncodeError:
'ascii' codec can't encode character u'\xe9'

I'm on a Mac Air with the latest Snow Leopard (10.6.2). I'm using Python 2.6.4 with unicode strings. I can't print appliqué !?

I tried adding
# -*- coding: utf-8 -*-
at the head of my Python script, but I still get this complaint.

Solution

The encoding used for standard input, output, and standard error can be specified by setting the PYTHONIOENCODING environment variable before running the interpreter.

The value should be a string in the form <encoding> or <encoding>:<errorhandler>. The encoding part specifies the encoding’s name, e.g. utf-8 or latin-1; the optional errorhandler part specifies what to do with characters that can’t be handled by the encoding, and should be one of “error”, “ignore”, or “replace”.

export PYTHONIOENCODING=utf-8

does the trick.

– or you could just add this setting to your environment file: ~/.MacOSX/environment.plist