Wednesday, May 13, 2009 at 06:02
· Filed under os x ·Tagged apple, dvorak, eclipse, os x
Last December Apple introduced the OS X 10.5.6 update. With it a serious regression for users of the Dvorak Simplified keyboard layout. This regression broke many keyboard shortcuts under Carbon based applications. A number of bug reports by different users were raised with Apple and an active thread on Apple’s forum started.
Despite the impact for affected users Apple (typically) never communicated anything else then that they were aware of the issue and working on a fix. They did not bother giving these users, their customers, a timeline in which to expect a fix. Nor did they bother releasing a hot fix to remedy the issue. No these customers had to wait five months till the release of OS X 10.5.7 for the regression to be supposedly fixed.
I say supposedly as I won’t be upgrading to OS X 10.5.7 immediately. I have learned my lesson. I know Apple’s disregard for its customers. I know the time I have spent on finding a workaround and I don’t want to be pulled through something like that again. I depend on my Apple computers to get my work done and I have learned that that dependancy is an unreliable one. I have learned that Apple doesn’t take regressions seriously. Because that’s what this was; a regression. Not some bug introduced in a newly released feature. No they broke something that used to be working and that I was depending on for my day-to-day work and they didn’t take it seriously.
So I leave it up to other Apple users to try out OS X 10.5.7 and to report any regressions they might find. I leave it up to Apple to not take these users seriously. In the mean time I’ll stay on OS X 10.5.6 with my workaround and keep wondering what I’m given Apple my money for.
Permalink
Tuesday, April 7, 2009 at 18:30
· Filed under python, web2py ·Tagged python, eclipse, web2py, pydev
Recently I have started developing an application using the excellent Python web framework web2py. Web2py comes with its own a web-based integrated development environment that makes it easy to write small web based applications from within your browser. However once you start developing something bigger you will want the convenience of a real IDE. Code completion, multiple open files and a debugger will all make the experience more comfortable. However due to web2py’s mode of operation your IDE will require some additional help from you to allow its full powers to blossom.
Web2py’s mode of operation
Contrary to other Python web frameworks, such a Django, web2py doesn’t use Python’s import statement to load your code. Instead it executes your code using Python’s built in function execfile and supplies it with a prepared environment that contains a number of global objects that are central to web2py’s programming model (e.g. request, response, session objects, HTML helper functions, etc). This also means that your IDE has no knowledge of these objects and functions unless you explicitly tell it about them.
Informing your IDE about web2py’s prepared environment
Even though I use Eclipse/PyDev, the trick to let any Python aware IDE know about these objects is the same. In fact I got the idea from the How-To Using Wing IDE with web2py.
From the IDE’s point of view there are two types of files that it requires additional information about:
Simply adding import statements for the global objects and functions web2py is going to provide us with at runtime might cause unforeseen problems. Hence we need to import them conditionally.
For models adding the following snippet of code at the top will suffice:
if 0:
from gluon.sql import *
from gluon.validators import *
For controllers the following will do:
if 0:
from gluon.globals import *
from gluon.html import *
from gluon.http import *
from gluon.sqlhtml import SQLFORM, SQLTABLE, form_factory
session = Session()
request = Request()
response = Response()
How does this work? The conditional 0 will always evaluate to False. This means that at run-time the statements following the if statement will never be executed. It’s dead code and hence will never interfere with whatever web2py has setup for us in its prepared environment.
It’s different for the IDE. The Python parser that’s part of your preferred Python IDE only parses your code. It does not evaluate it as Python does. As such it has to take the possibility into account that it might be executed at some point in time and that other code might depend on it. It has to read in the imports and consequently has all the information needed for code completion. Your IDE is now aware of web2py’s prepared environment
Permalink
Thursday, January 15, 2009 at 23:57
· Filed under os x ·Tagged dvorak, eclipse, os x
I think I have found a solution to the serious regression with regards to Dvorak keyboard shortcuts in Carbon based applications that Apple introduced with the OS X 10.5.6 update. This weekend I might follow up with a more thorough write up. For now just the solution will have to do as I am short on time.
Unfortunately the solution requires you to have access to an OS X 10.5.5 installation which not everyone might have at their disposal. It basically boils down to replacing the 10.5.6 installation’s /System/Library/Frameworks/Carbon.framework with that of the 10.5.5 version. I haven’t tested it extensively. In fact I have only confirmed that cmd-c and cmd-v finally work again in Eclipse.
The 10.5.6 installation lives in:
/System/Library/Frameworks/Carbon.framework
The 10.5.5 installation is mounted from an external hard drive at:
/Volumes/Bak MacBook/System/Library/Frameworks/Carbon.framework
These are the steps I performed:
$ cd /System/Library/Frameworks
$ sudo cp -Rpv Carbon.framework ~/Temp/
$ sudo rm -rf Carbon.framework
$ sudo cp -Rpv /Volumes/Bak MacBook/System/Library/
Frameworks/Carbon.framework .
BTW the 10.5.6 installation is a PPC one and the 10.5.5 is an Intel one. That doesn’t seem to matter as, as far as I can tell, all the files in the Carbon.framework directory are resource files which are platform independent.
Be careful though. I have barely tested this and hence it might have serious unwanted side effects.
Update: As it turns out some things do break when reverting to the 10.5.5 version of the Carbon.framework. For instance pressing ENTER in Finder does not allow you to rename a file or directory anymore. And according to Apple forum user LEgregius it also breaks something in iPhoto. To work around these issues LEgregius has a short shell script that switches between the two versions of Carbon.framework when starting Eclipse. I have adjusted this script slightly to make the switch conditional:
#!/bin/sh
FRMW_DIR=/System/Library/Frameworks
CARBON_FRMW=${FRMW_DIR}/Carbon.framework
if [ -e $CARBON_FRMW -a -e ${CARBON_FRMW}.1055 ]
then
sudo mv $CARBON_FRMW ${CARBON_FRMW}.1056 &&
sudo mv ${CARBON_FRMW}.1055 $CARBON_FRMW &&
echo "Switched Carbon.framework 10.5.6 -> 10.5.5"
fi
open -W /Applications/eclipse/Eclipse.app
if [ -e $CARBON_FRMW -a -e ${CARBON_FRMW}.1056 ]
then
sudo mv $CARBON_FRMW ${CARBON_FRMW}.1055 &&
sudo mv ${CARBON_FRMW}.1056 $CARBON_FRMW &&
echo "Switched Carbon.framework 10.5.5 -> 10.5.6"
fi
Permalink
Thursday, January 8, 2009 at 07:43
· Filed under os x ·Tagged dvorak, eclipse, os x
Finally got a response from Apple in response to my bug report. According to Apple:
This is a known issue, which is currently being investigated by engineering.
No hint as to when we can expect a fix though.
Permalink
Tuesday, December 30, 2008 at 17:56
· Filed under pda ·Tagged apple, iphone, palm, pda
I have been a happy user of a Palm m500 for seven years or so. I loved its simplicity and the efficiency by which appointments, ToDo items and short memos could be entered into it. It served me extremely well. However a couple of years ago it started acting up, ocassionally not responding to screen input anymore. It took me a while to find out that it was the battery that was the culprit. For some reason it had swollen up, putting additional pressure on the touch sensitive screen. I ordered a replacement battery from somewhere and things were okay again. Until a couple of weeks ago, when the same problem resurfaced. So I picked up a second hand Palm T|X and I love it! I did need to patch the Palm T|X to support the old and trusted Graffiti instead of the newer Graffiti 2 as the latter requires more strokes to enter data. But with this patch it works beautifully.
I did consider buying an iPhone 3G as the combination of a phone together with a good calendar application that easily syncs with my Mac is very compelling. However having played a bit with both the iPhone 3G of my brother and a friend of mine I find it to be too slow to be practical. There’s is a noticeable delay switching between one application and another. Enough of a delay to annoy me, and that’s when playing with it, let alone when using it in anger. I need my PDA to be fast. When I need to enter an appointment I must be able to do that instantaneously and effectively. The iPhone 3G’s slowness and the onscreen keyboard prevent that.
Another serious concern I had was Apple’s ambiguous policy regarding certain applications for its App Store. As a developer myself it pained me to see independent and ambitious developers financially hurt due to Apple’s whimsical and unmotivated decisions. Nor do I like Apple to decide for me what applications I can and cannot use; Nullriver’s Netshare being the prime example.
Another concern, or actually an issue, with the iPhone is that Apple limits my choice of a telecom provider in The Netherlands to one! As it turns out that one is not my current provider.
Last but not least is the price. What is the sense in throwing away a perfectly good phone, switch telecom providers, get a ridiculously expensive subscription plan for two years, while I can get all I need for fraction of the price by buying a second hand Palm T|X? Well there isn’t!
Permalink
Tuesday, December 30, 2008 at 11:26
· Filed under os x ·Tagged dvorak, eclipse, os x
Almost two weeks after the release of the OS X 10.5.6 update Apple still hasn’t provided a fix for the serious regression with regards to Dvorak keyboard shortcuts in Carbon based applications. Worse they haven’t even indicated that they’re working on it or provided a timeline for a fix or temporary workaround. I did open a bug report with Apple on https://bugreport.apple.com. However as these bug reports are not public it is impossible for others that have been affected by this bug to subscribe to it. Furthermore it arguably makes it difficult for Apple to track how many people have been affected by this issue. Although the thread 10.5.6 breaks Dvorak keyboard shortcuts in Eclipse on the Apple Support Forums makes it clear this issue is causing problems for many people using just as many different applications.
With Apple not taking their responsibilities I figured I’d give it another try to find a workaround. Problem is that I am no OS X developer and though I do know the basic difference between Carbon and Cocoa applications I know next to nothing on OS X application development. So all I have to go on is my intuition and hints I find on the Web.
With some of the keyboard shortcuts working (cmd-s) and others not (cmd-c, cmd-v) I still suspect the culprit to be with an incorrect keyboard mapping instead of some logic error in a piece framework code. I my previous post I created a new Dvorak mapping and installed it. This didn’t solve the problem as it didn’t change any of the mappings specified in the Carbon Framework. At least that’s what I suspect the reason to be.
So is there a way to adjust the mappings in the Carbon Framework? It seems there is. Hinted by references to HIToolbox in the Eclipse bug report on this issue, and a path to this part of the Carbon Framework mentioned on http://wordherd.com/keyboards/ I figured I had to replace the Dvorak mapping in:
/System/Library/Frameworks/Carbon.framework/Frameworks\
/HIToolbox.framework/Resources/English.lproj/Localized.rsrc
Using ResKnife, an open source resource editor, I had a look in Localized.rsrc and did indeed found a Dvorak KCHR resource (with ID 16300). With the form on http://wordherd.com/keyboards/ I created a layout.r using the following settings:

In the resulting layout.r file I changed the type “uchr” to “KCHR” and its ID to 16300. Then I made a backup copy of Localized.rsrc and executed:
gkoller@Kardamom (593) $ /Developer/Tools/Rez -append -useDF -o \
/System/Library/Frameworks/Carbon.framework/Frameworks\
/HIToolbox.framework/Resources/English.lproj/Localized.rsrc \
layout.r
Another look with RezKnife revealed that the old Dvorak mapping had indeed been replaced with the new one. I restarted my computer, fired up Eclipse, and …. *damn* it still did not work.
For all I know my attempts to find a workaround are completely misdirected and naive, but I just had to try as this issue is driving me nuts. Maybe this post might give others a few hints and put them on the right track to find a solution, or more likely prevent them from wasting time on similar futile attempt. However it would be much better for Apple to step in and take their responsibility in fixing this regression!
Permalink
Friday, December 26, 2008 at 20:46
· Filed under os x ·Tagged dvorak, eclipse, os x
Tried to find a workaround for the nasty Dvorak keyboard mapping bug introduced by Apple with their 10.5.6 update of OS X. I had the idea that if I could create a keyboard mapping for Dvorak myself, this might ‘trick’ OS X accepting the proper keyboard shortcuts for Carbon based apps. Looking for a tool to create such a mapping I came across the following website:
http://wordherd.com/keyboards/
Using the standard settings it was easy to create a new Dvorak layout, save it as “Dvorak Workaround.keylayout” in my Library/Keyboard Layouts directory, and select it from the Input Menu in the International System Preferences menu. Alas, this did not resolve the problem.
This might have worked if problem was in the Apple default Dvorak keyboard layout itself. However if that was the case keyboard shortcuts would have been messed up in Cocoa based applications as well. It was a long shot to begin with, but I had to try something as it is really impacting my ability to do any programming in Eclipse on my Mac.
It might be due to the holidays or the relatively low number of users impacted by this bug (who uses Dvorak?), but I find Apple slow to respond to this serious regression.
Permalink
Thursday, December 18, 2008 at 21:24
· Filed under java, os x, python ·Tagged dvorak, eclipse, os x
This evening I installed the PyDev plugin for Eclipse to write a little Python code. Seemed to go well until I noticed that some of my keyboard shortcuts didn’t work anymore in Eclipse. Most notably copy and paste (CMD-C and CMD-V). As this was working before I figured the PyDev plugin to be the culprit. However, in a version of Eclipse without the PyDev plugin the issue was still present.
Some Googling turned up a post on StackOverflow titled Eclipse keyboard shortcuts broken in OSX 10.5.6. Turns out that the OS X update to 10.5.6 I did a couple of days ago broke the keyboard short cuts for Eclipse. But only if you’re using Dvorak keyboard layout. Guess what I am using? Right, Dvorak!
I knew I should have waited a little longer with the update. I normally do. Not sure why I didn’t this time. Sincerely hope Apple comes out with a fix quickly.
Permalink
Wednesday, December 17, 2008 at 08:59
· Filed under freebsd ·Tagged freebsd, xkcd
Well almost all …

Permalink
Monday, December 15, 2008 at 08:20
· Filed under amazon ec2 ·Tagged aws, devoxx, freebsd, opensolaris
I have been seriously looking at using Amazon EC2 for a pet project of mine that I am working on. However to my dismay Amazon EC2 currently does not support FreeBSD running in its cloud. Apparently this is related to Amazon using version 3.03 of Xen as its virtualization software, whereas FreeBSD requires version 3.3 of Xen to run. What the technical details behind this requirement is I don’t know.
Last week, during Devoxx ‘08 in Antwerp, I got the chance to ask Simone Brunozzi, Amazon Web Services Evangelist for Europe, during his presentation on Amazon Web Services, about a time line for FreeBSD support. His answer was that there was no timeline and that they are relying on the community to provide this support. He recommended I’d have a look at OpenSolaris. I’ll certainly check it out. In fact I already installed in on my MacBook running in a VMware instance. Though I haven’t had much time yet to really dive into it.
Anyway looking for some more information regarding running FreeBSD on Amazon EC2 I came across this post by Colin Percival. In it he writes near the end:
There are still improvements which I’d like to see made to Amazon Web Services: [...] and adding support for running FreeBSD on EC2 (I’ve signed an NDA, so I can’t say much here except that we’re working on it) are at the top of my list, [...]
This is encouraging. It probably means it too late for me to use, but eventually we might get FreeBSD running on Amazon EC2!
Permalink
Older Posts »