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

My bag of Development Tools

Posted by on May 28, 2012 in Software

Besides a select few (you know the “I’m only using *”, where * is either emacs or vi) most developers I know have a number of tools, they cannot live/work without. The set of development tools I’m using is ever changing, but a favorite of them all remains IntelliJ IDEA, an unbelievably smart IDE for Java and Android as well.
I might be a little biased; way back in 1999, I was working for Artificial Life in St. Petersburg, Russia and after they closed their offices there, some of the best engineers moved on to Jetbrains, starting to work on IntelliJ – and that’s what they are still doing. If you happen to work with Eclipse a lot, you may want to give IntelliJ a try.
Anyway, I thought I’d share, what’s in my bag of tools today ..

Read More

Building PhoneME for Mac OSX

Posted by on Jan 19, 2009 in Embedded

A few days ago, I wrote here about how the PhoneME JavaVM can be built with and integrated into OpenWrt, the Linux distribution optimized for WiFi routers or any device that connects over Wifi. However, even with a powerful Java runtime environment available on the target hardware platform, we still need to develop and simulate/test on a development workstation, which may very well be a Mac.
Developing for the PhoneME JavaVM becomes much easier and more fun, if you have the same VM available on your development platform; so here is what I did to get the PhoneME VM build for OS X 10.5 (Intel).

Again, we need to get the sources from the SVN server on java.net here: https://phoneme.dev.java.net/svn/phoneme. Don’t get everything, just the trunk (i.e. phoneme/components/cdc/trunk) and tools (i.e. phoneme/components/tools) folder. However, trunk and tools need to end up on the same level (like siblings) on the build machine.

Unfortunately, the currently available trunk only builds on older Macs that is Macs built on the Power-PC architecture. For newer Macs, i.e. Intel based machines, a patch needs to be installed into the just created trunk folder.
Markus Heberling has made this patch available here: http://markus.heberling.net/wp-uploads/2008/04/phoneme-cdc-darwin-x86.zip. The three folders in this patch just need to be added into the source tree in trunk:

  • patch cdc/src/darwin-x86 becomes trunk/src/darwin-x86
  • patch cdc/src/darwin-x86 becomes trunk/src/darwin-x86
  • patch cdc/buld/darwin-x86-mac becomes trunk/build/darwin-x86-mac

All ducks are in a row now to kick-off the PhoneME build. But there is still one final decision to be made, what kind of PhoneME runtime should be built?
The J2ME_CLASSLIB argument provided to Make, defines what class library will eventually be created:

  • cdc – (default) will create a limited class library (cdc.jar 884 KBytes) that is meant for testing purposes only.
  • foundation – creates the full Foundation Profile class library (foundation.jar 1.475 KBytes).
  • personal – creates the full Personal Profile class library (personal.jar 2.047 KBytes).

Just like you would expect, compared to the Personal ProfileFoundation is missing java.applet.* and java.awt.*. And compared to the Foundation Profile, the cdc.jar is missing some of the networking and security related classes.
Running Java applications on a Mac that depend on the Personal Profile, also require The X Window System (available athttp://xquartz.macosforge.org/trac/wiki) and QT3, the Cross-Platform GUI application framework, installed. QT3 is best installed using FINK and Fink Commander. I usually prefer Porticus but even after several attempts could not make Personal Profile depending Java Apps run. Only after installing QT3 using Fink, did they work flawlessly.

cd trunk/build/darwin-x86-mac
make J2ME_CLASSLIB=foundation

With the Java Runtime Environment built, we can now either use and ANT script like this, to build (and deploy) a Java app:


<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2009 Wolf Paulus - http://wolfpaulus.com
OpenWrt / PhoneME / Java Project build.xml
-->
<project name="fon" default="deploy" basedir=".">

<!-- =================================================================== -->
<!-- Initialization target -->
<!-- =================================================================== -->
<target name="init" description="initialize properties and folder variables">
<tstamp/>
<!-- remote target information -->
<property name="remote.addr" value="192.168.1.1"/>
<property name="remote.uid" value="root"/>
<property name="remote.pw" value="admin"/>
<property name="remote.dir" value="/usr/java"/>

<!-- Project Attributes -->
<property name="build.id" value="1001"/>
<property name="version" value="1.0 (#${build.id})"/>
<property name="year" value="2009"/>
<property name="packages" value="com.carlsbadcubes.*"/>

<!-- Folders -->
<property name="src.dir" location="src"/>
<property name="build.dir" location="build"/>
<property name="build.src" location="build/src"/>
<property name="build.dest" location="build/classes"/>
<property name="build.javadocs" location="build/apidocs"/>

<!-- Replace tokens in source code before compilation -->
<filter token="year" value="${year}"/>
<filter token="version" value="${version}"/>
<filter token="date" value="${TODAY}"/>
<filter token="log" value="true"/>
<filter token="verbose" value="true"/>

<!-- Complier Settings -->
<property name="compile.source" value="1.4"/>
<property name="compile.target" value="1.4"/>
<property name="compile.compiler" value="modern"/>
<property name="compile.debug" value="true"/>
<property name="compile.optimize" value="true"/>
<property name="compile.deprecation" value="true"/>

<property name="JSDK.home" location="/Users/wolf/Work/Embedded/phoneme-advanced/OSX/phoneme-x86"/>
<!-- Compilation class path -->
<path id="compile.classpath">
<pathelement location="${JSDK.home}/btclasses.zip"/>
<pathelement location="${JSDK.home}/lib/foundation.jar"/>
</path>
</target>

<!-- =================================================================== -->
<!-- Clean up -->
<!-- =================================================================== -->
<target name="clean" depends="init" description="Removes build the distribution files">
<delete dir="${build.dir}"/>
</target>

<!-- =================================================================== -->
<!-- Prepares the build directories and souce -->
<!-- =================================================================== -->
<target name="prepare" depends="clean,init" description="Creates build folder(s) and copies sources">
<mkdir dir="${build.dir}"/>

<!-- create directories -->
<mkdir dir="${build.src}"/>
<mkdir dir="${build.dest}"/>

<!-- copy src files -->
<copy todir="${build.src}" filtering="yes">
<fileset dir="${src.dir}" excludes="**/*.png"/>
</copy>

<!-- copy doc images (e.g. uml diagrams)-->
<copy todir="${build.src}" filtering="no">
<fileset dir="${src.dir}" includes="**/*.png"/>
</copy>
</target>

<!-- =================================================================== -->
<!-- Compiles the source directory -->
<!-- =================================================================== -->
<target name="compile" depends="prepare" description="Compiles the source code">
<javac
srcdir="${build.src}"
destdir="${build.dest}"
debug="${compile.debug}"
optimize="${compile.optimize}"
deprecation="${compile.deprecation}"
compiler="${compile.compiler}"
target="${compile.target}"
source="${compile.source}">
<classpath refid="compile.classpath"/>
</javac>
</target>

<!-- =================================================================== -->
<!-- Package Classes into JAR -->
<!-- =================================================================== -->
<target name="package" depends="compile" description="Package Classes into JAR">

<jar destfile="${ant.project.name}.jar">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Implementation-Vendor" value="Carlsbad Cubes."/>
<attribute name="Implementation-Title" value="${ant.project.name}.jar"/>
<attribute name="Implementation-Version" value="${version}"/>
</manifest>
<fileset dir="${build.dest}"/>
</jar>
</target>

<!-- =================================================================== -->
<!-- Deploy to target (opt ant task, http://www.jcraft.com/jsch/) -->
<!-- =================================================================== -->
<taskdef name="scp" classname="org.apache.tools.ant.taskdefs.optional.ssh.Scp"/>
<target name="deploy" depends="package" description="Deploy on to target hardware">
<scp file="${ant.project.name}.jar" todir="${remote.uid}:${remote.pw}@${remote.addr}:${remote.dir}"/>
</target>

</project>

.. or create a new JSDK in an IDE, like IntelliJ IDEA
you may have to rename the trunk/build/darwin-x86-mac/cvm into trunk/build/darwin-x86-mac/java

As of Snow Leopard 10.6.2, I had to add -m32 to these settings in cdc/build/darwin-x86-mac/GNUmakefile:
ASM_ARCH_FLAGS = -m32 -march=i686
CC_ARCH_FLAGS = -m32 -march=i686
LINK_ARCH_FLAGS = -m32

Read More

WWDC 2008 – Final Thoughts

Posted by on Jun 16, 2008 in Life

I was in NYC, seeing the long lines going around the block the 5th Ave. Apple store, when the iPhone was launched in June 2007. People couldn’t wait, getting their hands on the beautiful mobile phone, the one with the best user interface, and the only one with a useable Web browser. This year I was in San Fran. at Apple’s worldwide developers conference, WWDC 2008, when the iPhone 3G was announced.
In 2007 Apple launched a new product-line. In 2008, a new platform was born, already used by several hundreds of companies, with the help of several thousands of software developers, all creating custom applications running on that new platform.
The first computer I ever came in contact with was a Commodore PET. Later on, I still had to deal with terminals, hosts, and even punchcards, but since my 1st experience was on a PET, I never really appreciated the paradigm shift that had happened back then. I can only imaging that the guys that were programming those huge mainframes must have felt like the .net and Java EJB guys feel today, rejecting the new mobile platform as a toy, or a small niche market at best – they will probably never know what hit them.
Everyone at this year’s WWDC felt it: a new age has begun – this will be the moment we will be looking back to, the moment the new platform was born, once again changing the information technology landscape forever.
Admittedly, attempts were made before. There was the Palm OS, Pocket PC, then came Qualcomm’s Brew, and also Sun’s Java MIDlets looked promising for a little while. All this has totally been overshadowed by the iPhone SDK and its capabilities, allowing developers to write iPhone native applications and putting them over the air on the device. The iPhone’s hardware capabilities combined with the software SDK and the App-Store is putting the iPhone-platform years ahead of anything we have seen so far, including Google’s Android initiative.

Unfortunately, there were also those rumors again, concerning Steve Jobs’ heath, driving the AAPL stock significantly down. He did look thinner, more skinny, compared to the last couple of appearances and I have to admit that when seeing him on stage during Monday’s keynote speech, I was concerned about his well being as well. On the other hand, even if he had to resign the CEO position tomorrow, the mobile revolution led by the iPhone seems very much unstoppable now. Over the last couple of years, all the pieces have carefully been put into play, and with Jonathan Ive, Phil Schiller, Apple’s vice president of marketing, Bertrand Serlet, Apple’s senior vice president of Software Engineering, and of course Scott Forstall, formally the vice president of platform experience, who was very recently promoted to Senior Vice President of iPhone Software, very capable people have been established to built-on and continue the legacy.
I have once experienced this myself, working for a company whose CEO I highly regarded and who was killed in a tragic airplane accident. His legacy and values however lived on even stronger in the people he had influenced and put into the right positions and who were leading the company for several years to come. For as long as those guys who have worked with Jobs for the last couple of years stay at Apple, I wouldn’t worry – only after that core team vanishes, will the company lose its focus, importance, and value.

Read More