Wolf Paulus

Journal

Navigation Menu

Installing / Updating Python on OS X

Posted by on Jan 28, 2013 in Mac OS X

While Python comes pre-installed on OS X, Apple doesn’t do a good job on keeping the Python runtime environment up to date. Currently, on Mac OS X 10.7.4 “Lion”, entering python -V returns Python 2.7.1. Even worse, Mac OS X 10.6 “Snow Leopard” is still on a Python 2.6 release.
While the latest Python releases are always available on http://www.python.org, updating a Mac isn’t a simple, straight forward process.

Follow along and update your Mac to Python 2.7.3, or 3.3.0 or whatever the newest 2.x and 3.x release might be, when you read this. To update your Mac to something like Python 2.7.3, I assume that

  • your Mac-User account is setup as an “Administrator” account.
  • your Mac already has this folder: /System/Library/Frameworks/Python.framework/Versions/

To read about how to upgrade to Python 3.3, jump to the very bottom of this post.

Read More

A Daunting Task – Tiffany goes to Cupertino

Posted by on Jan 20, 2013 in Java

TiffanyScreens in the Mac App Store

I never really liked going to “PowerPoint Meetings”, sharing the screen content with others during a meeting, usually requires to connect a projector to the presenter’s laptop. In a lengthy process, the laptop’s screen resolution and refresh-rate needed to be manually adjusted to synchronize with the projector. What follows is a lecture style presentation, featuring slides being projected, hugely magnified onto one of the meeting room’s walls; often, lights need to be dimmed, and listeners either doze off or start checking email.

A couple years back, I wrote TiffanyScreens, which allows you to share presentations (or any screen content), without requiring a projector.
Imagine a scenario, where every participant brought a laptop computer to a meeting and watched the presentation on that laptop’s display – participants sit on a table facing each other, instead of the wall. No adjustments are necessary; images are scaled automatically on arrival, to best match the receiver’s display-capability. To support lively meetings, everyone participating, can with a single button click, turn his computer into the presenting device.

tsp5

During the development, I had small engineering groups in mind, but it became more and more obvious that instructors, educators, and educational institutions would appreciate TiffanyScreens the most. Listening to users’ feedback, TiffanyScreens has been iteratively improved, refined, and optimized.

Read More

Accessing Raspberry Pi via Serial

Posted by on Aug 28, 2012 in Embedded

Using a serial connection to connect to a Raspbery Pi has many advantages. The boot process (Kernel boot messages go to the UART at 115,200 bit/s) can be monitored, without the need to hookup an HDMI-Monitor. Once booted, you can of course login through a serial terminal as well, i.e. the serial connection allows logging-in form a remote computer without running an SSH daemon on the Raspi.

UART TXD and RXD pins are easily accessible (GPIO 14 and 15), however, like for all GPIO pins, the voltage levels are 3.3 V and are not 5 V tolerant!

Since most of the desktop and laptop computers don’t come equipped with a serial port anymore, accessing the Raspberry Pi via a Serial Connection requires some requisites. I have recently connected to the Raspberry Pi using three different hardware setups ..

Read More

TiffanyScreens – Astoundingly Faster

Posted by on Oct 20, 2011 in Java

I never really liked those meetings, sitting in a room with slightly dimmed lights, participants facing a wall, watching power-point slides, and trying to follow a mostly boring presentation. A discussion – if at all – would most likely happen after the presentation. Changing laptops is too cumbersome with all the disconnecting and re-connecting of cables involved – not to talk about syncing the laptop to the projector’s max resolution.

Since most participants seem to bring a laptop, to those meetings to check Email, IM, etc. I had the idea to instead of the wall, use the laptops’ screens as a presentation canvas, i.e. we could all sit on a round table again, facing each other, instead of the wall.

I wrote a small self-contained (doesn’t use a server) multi-platform application a.k.a TiffanyScreens, to capture the presenter’s screen content and send it to the other participants. Best of all, with a simple push of a button, an observing meeting participant becomes a presenter, showing her screen’s content to the other team members.

Up to now, TiffanyScreens was implemented in pure Java. While the installer was implemented and compiled on the native platform, the application itself did not take advantage of OS native capabilities.

Read More

Android says:”Java 6 is not supported”

Posted by on Jun 6, 2010 in Android

“Don’t be too proud of this technological terror you’ve constructed. The ability to destroy a planet is insignificant next to the power of the Force.”

Because of annotation incompatibilities, Android cannot be built with Java 6.0 but requires the older Java SE 5.0. Kind of shameful, considering that J2SE 5.0 reached its end of service life (EOSL) on November 3, 2009, which is the date of the final publicly available update of version 5.0 (J2SE 5.0 Update 22). The Android document however states firmly:

“JDK 5.0, update 12 or higher. Java 6 is not supported, because of incompatibilities with @Override.”

Appropriately, Apple doesn’t include an end-of-life product in a current OS X release and therefore, Java 5.0 is absent on OS X 10.6 Snow Leopard. Still, if we want to build Android on a somewhat recent OS X version, we need Java 5. So here is how we can force this outdated Java version back into the current version of Mac OS X.

Step 1: Installing XCode

The XCode.mpkg is available on the SnowLeopard install DVD, in the Optional Installs folder. Installing, followed by an immediate Software Update, brings XCode to version 3.2.1., gcc to version 4.2.1 and Java to version 1.6.0_17. Anyway, we are currently more interested in Java 5 …

Step 2: Acquire Java 5.x for OS X

Java for Mac OS X 10.5 Update 6 can be downloaded from Apple’s support Web site here: http://support.apple.com/kb/DL971. This contains J2SE 5.0 to 1.5.0_22. The slightly newer Java for Mac OS X 10.5 Update 7, containing J2SE 5.0 to 1.5.0_24, is currently only available through the Apple’s developer site: http://developer.apple.com/technologies/xcode.html. Access is granted only to ADC member, but at its lowest level, membership is free.

Step 3: Deploying Java 5

No matter if you went with J2SE 1.5.0_22 or 1.5.0_24, deployment will works the same. First, we need to remove the Java 1.5 and 1.5.0 symbolic links, that currently still point to Java 6. With Finder, navigate to HD/System/Library/Frameworks/Java.VMframework/Versions, select 1.5 and 1.5.0 and drag both into the Trash; now empty the trash.

In a previous step we downloaded JavaForMacOSX10.5Update6.dmg or java_for_mac_os_x_10.5_update_7__9m3144.dmg and we now need to extract and deploy Java 1.5. from that diskimage, which can be most conveniently be done with a tool like Charlessoft’s Pacifist (available here: http://www.charlessoft.com).
Open the diskimage (dmg) with Pacifist and inside that diskimage navigate to: Contents of JavaFor MacOSX10.5Update7.pkg/System/Libarary/Frameworks/JavaVM.Frameworks/Versions Now right-click on 1.5.0 and select “Install to Default Location” and do the same for 1.5.

With Java 1.5 now deployed, we still need to fix the disk permissions, which can easily be done in Terminal, like so:
sudo chown -R root:wheel /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0 and
sudo chown -R root:wheel /System/Library/Frameworks/JavaVM.framework/Versions/1.5

Now with Java 5 forced back into OS X 10.6 we can open the Java Preferences application in /Applications/Utilities, which immediately recognizes Java 5 and allows us to give it precedence or even make it the only JavaVM available. In previous OS X 10.6 point releases, the command line tools java and javac didn’t honor settings entered through the Java Preferences app. However, this seems to be fixed in OS X 10.6.3.

Java on OSX SL

Read More