Rooting Google Nexus One on Android GRK39F build

The other day I needed to change the hosts file on my Google Nexus One (to actually point a domain name to a local dev environment so that I could test some mobile web application development I’ve been doing). I needed root access to do that and I ended up realising that I had lost root access (even after I manually hacked my way from the Vodafone 2.1 build to Android 2.2 when I got the device) by installing the 2.3.x upgrades.

I did a bit of digging around on how to get root access back with the GRK39F firmware and as it ended being up sort of being a puzzle game to find all the information, so I thought I’d put it all into a blog post.

It seems that what I’d usually would have used (Superboot) isn’t supported on the Nexus One post firmware GRI40 anymore. Bummer. Luckily a guy from Germany (“Bexton” on xda-dev) forked Superboot and called it Bexboot and made it work on Android GRK39F on the passion hardware. The problem with that is that apparently his server is down or has been shut down and it was not as obvious to get instructions and the necessary files.

Here’s what I did:

It’s really straight forward – took me about 5 mins to actually apply the firmware change and I’ve got root access on my Nexus One again.

Obviously I’m not endorsing all this … insert more legal blabla here … Essentially: in case you read this and/or try to do anything I’ve described here, you’re on your own. Don’t ask me for help when you break your own or other people’s devices, create a black hole, attract aliens or cause any other kind of harm to you, anyone or anything.

Post to Twitter Post to Delicious Post to Facebook Post to StumbleUpon

Printing from Wine on OS X

The flight planning software I use is Windows-based and unfortunately Windows-only. It’s a really powerful tool and there’s nothing comparable for OS X (at least not for Australia and New Zealand), so I’m happy to go the extra mile making it work.

The easiest way would obviously be to install the software in a virtual machine and to run just Windows in such a VM with VMWare Fusion or Parallels. That’s what I usually do whenever I need to run a Windows system for development or for a certain client setup. With this flight planning software it’s a bit different as it’s really just a stand-alone software I’d like to run within OS X. So, I thought I’d give Wine a try.

Wine is a software that emulates a Windows environment via X11. It’s available for various *nix platforms and also via Macports for OS X. The installation is quite simple if you have Macports already installed (if not, follow this great tutorial from David Baumgold on how to setup Wine with Macports from scratch):

sudo port install wine

That’ll give you a working installation of Wine and you should be able to run/install Windows software (note: not every software might work easily within Wine) with:

wine whatever.exe

All that went good and well. The only issue was that I wasn’t able to print from the flight planning software. For obvious reasons I wanted to be able to print the flight plans/maps I’ve created to take them on the plane. I did some investigation and some people suggested installing CUPS-pdf. CUPS-pdf is basically a “Print to PDF”-feature for CUPS-based printing systems (as OS X is). It’s actually quite cool as it also allows one to print to PDF from the command line. CUPS-pdf is part of Macports as well and can installed by the same mechanism via port install.

Unfortunately that didn’t solve the issue. There’s a bug report on issues with Wine and OSX printing with the resolution of it being an issue in the Wine bundle within Macports not being configured for CUPS. I uninstalled Wine and installed Wine-devel instead (which is supposed to be on a version where the bundling is fixed). Still no solution for printing.

At this stage (and because I found a few more reports from people having issues with the particular combination of Macports and Wine) I resorted back to using Wineskin. Wineskin is a tool that essentially creates a Mac application wrapper around your Windows application by using an embedded version of Wine. It’s actually quite cool because it makes the experience of running a Windows application even more integrated with your Mac.

The welcome surprise – within Wineskin, I automatically had access to the pdf printer installed by CUPS-pdf and happy flight planning is on the way :)

Post to Twitter Post to Delicious Post to Facebook Post to StumbleUpon

Why would anyone travel from New Zealand to Kansas City, MO? D2WC!

The short answer is: for D2WC 2012.

Let me briefly explain: D2WC is a conference about and for designers, developers, hybrid and the famous designer-developer workflow. It will go into its third iteration in 2012 and after Dee Sadler was originally trying to get me involved with the event already in 2010, I finally went in 2011 and had a great time over there (you can find my 2011 talk on Slideshare).

Apart from the fact that D2WC was an excellent conference where I met a lot of inspirational and fun people (including – but not limited to - Dave, Val and Seb) Kansas City was also a very pleasant surprise as a place to hold it and stay for a few days. The city is really interesting and has an very cool mix of beautiful old buildings and new, modern skyscrapers. Besides that I went flying – and even got some proper IFR done while I was there – went to two really good museum and discovered the area around KC a little bit.

Anyway – D2WC is back in 2012 and if you’re looking at the list of speakers on the website you might be impressed. If you’re in the US and involved with design and (web) development or work in hybrid teams, it’s a conference you should seriously consider. Even if you’re overseas, it’ll be a really worthwhile event to attend – trust me and the 7938 miles I have to travel (in a direct line) to get there.

My talk at D2WC 2012 will be about AngularJS – a very, very awesome Javascript framework:

AngularJS for developers and designers

AngularJS is a Javascript framework that comes with the subtitle “What HTML would have been had it been designed for web apps”. This talk introduces AngularJS briefly and will then show why it’s one of the best application frameworks based on the HTML5/JS/CSS-stack out there. AngularJS’ templating system and data binding mechanism usually lead to well defined responsibilities for both designers and developers. While going through the workflow of building an AngularJS app we will have a look at the different interaction points between design and development and you’ll learn how the framework helps both roles to build a well working application as well as how to create clean and maintainable front end markup and code.

I will also offer a 1/2-day hands-on workshop on May 16 (the day before the conference-proper), also on AngularJS:

A better way to build apps with JavaScript: AngularJS

AngularJS is a Javascript framework that comes with the subtitle “What HTML would have been had it been designed for web apps”. With HTML5 currently being overhyped and both Adobe as well as Microsoft turning the back to their former plugin-based poster children Flash/Flex and Silverlight, a lot of web developers ask themselves: “Now what?”. The technology stack of HTML5/JS and CSS will obviously play a more and more important role in the future; the frameworks, libraries and tools we have at hand do not quite compare to what the aforementioned plugin environments can provide though.

This becomes clear in particular when we’re trying to build complex but still well structured applications in HTML and Javascript. Even the use of frameworks such as jQuery, ExtJS etc will in many cases lead to an unfavourable architectural structure. AngularJS tried to overcome those issues and provide developers with an MVC-based architecture, Dependency Injection and Data Binding. The best is – it still works fine in combination with the JS libraries of your choice, there’s no need to drop tools like jQuery.

In this half-day hands-on class we’re going to get you started with application development in AngularJS. You should have a good working knowledge of HTML and Javascript, jQuery experience is useful, but not necessary. Topics will be: Templating, the MVC pattern in general and with AngularJS, Data Binding, View Routing and service and external resource integration.

Post to Twitter Post to Delicious Post to Facebook Post to StumbleUpon

Getting into Clojure (and other stuff)

With the recent changes at Adobe I was more and more thinking that I need to further diversify what I’m doing. That was already happening in 2010 and 2011 quite a lot – client demand for Flash and Flex solutions decreased (and still is decreasing) and we found ourselves doing more and more Javascript-based applications. Quite often those would include jQuery or other frameworks, more recently also involve mobile technologies such as jQuery Mobile or jqTouch. There’s nothing wrong with that as such – things and technologies change over time.

I don’t want to go into rant-mode (again) and start elaborating on why Adobe has made such a fool of themselves with their handling on the November-of-2011-layoffs-and-technology-decisions, you’re free to form your own opinions – there are lots of pieces on Flash Mobile, Flex, layoffs and various communication disasters around there.

But those (and some other events I really don’t want to talk about at this time and place) sent a clear message: Further diversification is needed, even if Apache Flex turns out to be the most successful thing in the world and there would be further demand for it and even if I was to become the most awesome JS coder ever and even if Adobe ColdFusion was a viable product for the rest of all times.

Back from uni and various toying-around with Haskell and Erlang I had an existing interest in Clojure. The other day I had an email conversation with my friend Sean Corfield about something CFML-related when we got into talking about Clojure. I had noticed before that Sean was doing more and more with Clojure and was quite active on Twitter when it came to this topic. Anyway –  I decided to have a look into Clojure and I really like it so far. It’s basically a Lisp-dialect for the JVM (with ports to target MSFT’s CLR and Javascript).

As Sean had shared a few interesting links and books to get started with me, I thought I’ll pass the info on and make it available for others who’d be interested in getting into Clojure.

Sites:

Home of Clojure: Clojure.org
In-Browser tutorial: http://tryclj.com
Puzzles to explore the tricks and trades of the language: http://4clojure.com

Books:

Clojure Programming (O’Reilly Rough Cuts)
The Joy Of Clojure (Manning)
Clojure in Action (Manning)

The author of the latter, Amit Rathore, is also running an online course “Introduction to Clojure” starting on January 30th via codelesson.com. I have signed up for it because it looks really, really interesting and a good way to get up to speed even faster than by playing around as I do now. Finally – there’s Clojure/West in March in San Jose. If everything goes according to my plan, I’ll be there!

That’s not all though, I do realise that Clojure is at this stage just another niche technology. There’ll be more news, updates and further plans coming in this blog as soon as I find the time to write about them.

Post to Twitter Post to Delicious Post to Facebook Post to StumbleUpon

CFML update for IntelliJ IDEA 11

The awesome people at Jetbrains (in particular Kirill is to be mentioned here) have made an BER (bleeding edge release) update of the CFML plugin in IntelliJ IDEA 11 available. In case you didn’t know – IntelliJ IDEA is an excellent IDE, quite heavily used by Java and Groovy developers.

IntelliJ IDEA has a CFML plugin for a few versions now and it got quite a few enhancements with the recent release of version 11. Now, there’s also another BER update for only the plugin available that one can use to patch their IDEA 11 installation further. You can download the update from Jetbrain’s wiki, the page also describes how to patch your installation. Note: this is just for owners of the IntelliJ IDEA 11 Ultimate Edition or for people who’re using the trial of the Ultimate Edition. The CFML plugin is not part of the Community Edition.

If you’re interested in learning more about IntelliJ IDEA and the CFML plugin, Mark Mandel and I interviewed Kirill just recently on our 2DDU Podcast’s episode #17.

Post to Twitter Post to Delicious Post to Facebook Post to StumbleUpon

ColdFusion Builder 2 Hot fix – be aware that you need a JRE

This was sitting in my inbox for quite a while.  When the ColdFusion team released hot fix 1 for ColdFusion Builder 2, some people reported problems applying the hotfix ending up with an error message claiming that there was no Java Runtime Environment installed.

At first glance, it might make you wonder because if you’re about to apply a ColdFusion Builder 2 hot fix, one would expect ColdFusion Builder 2 to have access to a Java Runtime Environment somewhere on the machine as CF Builder 2 is based on Eclipse which itself is based on Java.

The most likely reason why this is happening to you is that there’s no JRE or JDK in your system PATH. Even though ColdFusion Builder and its installer provides and installs a JRE (which would be in the \jre\bin folder of the ColdFusion Builder 2 installation folder in a stand-alone Windows installation), this JRE is not added to the system PATH. There’s a good reason for this – basically trying to install ColdFusion Builder 2 as less system-invasive as possible.

In case there are other JREs installed on the system (and added to the PATH) the error message should not hit you as the hot fix installer would just grab said JRE from the system path. In case there is no other JRE installed, the hot fix installer (which is delivered without a JRE for size reasons) will not be able to execute its payload and therefore provide you the error message.

You might have already figured it – but this is mostly an issue on Windows. On Mac there’s usually a JRE/JDK installed anyway (not on Lion though, where you have to manually add it) and I haven’t seen this problem occurring on OS X so far (not saying that it can’t happen). Adobe’s tech note about hot fix 1 mentions this very briefly:

NoteOn Windows, ensure that JRE is in the system path. If not, set the path and proceed.”

The easiest way to deal with this (without installing another JRE/JDK) is to use the already existing one on your system. So, you could just add the following (or similar, depending on your installation) path your to your PATH: C:\Program Files (x86)\Adobe\Adobe ColdFusion Builder\jre\bin . After that, run the hot fix installer as described in the tech note.

Post to Twitter Post to Delicious Post to Facebook Post to StumbleUpon

ColdFusion “null, null” errors – CFInterface another possible reason

Just recently I was hunting a “null, null” error in a large ColdFusion application. It started occurring all of a sudden under decent load and it was unfortunately rather hard to reproduce.

Some basics: If you’re getting a “null, null” error in ColdFusion (and yes, this still does occur in ColdFusion 8 and 9 occasionally, even though there was a certain known issue in CFMX 6/6.1 that was fixed with a hotfix), that almost always points to a Null Pointer Exception somewhere in the Java application that ColdFusion is nowadays. You will also see an HTTP status code of 500 and not necessarily any log output in the ColdFusion logs. Note: double check the JRun log files, you might get some additional information from them.

The reason why you’re getting a “null, null” error in the first place is essentially because you’d be using a CFERROR tag or any other global error handler while your application ran into that Null Pointer Exception. This has been very well explained by Steven Erat and is also noted in an Adobe technote. The best way to find out more about the issue is to actually remove all of those and then have a look into what the error is really about. That might prove tricky if the error just happens sporadically, seems to be impossible to reproduce and “obviously” just hits you on production, never on dev/test or under any artificial load test scenarios. Doh. When our instance of the “null, null” error happened it was usually during night time and hard for us to debug and get into it.

Just the other week though, the error happened during day time while I was working on-site at the client’s premises and we had a chance to jump on the production system, isolated the particular CF instance from the production cluster and started digging. After switching off all the error handling we found the following error messages per occurrence of the “null, null” error:

22:41:39.039 – java.lang.NullPointerException – in {filename} : line 247
22:41:39.039 – coldfusion.util.RuntimeWrapper Exception – in {filename}: line 247
22:41:39.039 – java.lang.NullPointerException – in {filename} : line 247

That’s something to work with. The application is actually a large-scale Fusebox 5.5 application therefore {filename} pointed to a FB-parsed .cfm file. So – we were looking into the mentioned lines (there were a few other versions of this NPE in different areas of the site) and they all had in common that they were calling out to CFC instances in CF’s application scope (let’s call that A.cfc from now on – or better: application.A – and let the method we called be .doSomething()).

From there we looked into the application.A and the .doSomething() method that was being called and there was absolutely nothing wrong with it. Within .doSomething() a few function-scoped variables were created that itself pointed to other CFCs in the application scope in the further course of .doSomething() – but again there didn’t seem to be anything wrong with that. We went ahead and removed the code from within .doSomething step-by-step to identify what would cause the NPE. Funny enough – nothing seemed to work. So we removed all the other methods from application.A until it was literally a barebone CFC structure with only an empty .doSomething() inside. Still, every request would bomb with a NullPointerException exactly in line 247.

All of a sudden I realised that application.A was actually implementing an interface (for the sake of it, let’s call it IA.cfc). IA.cfc prescribed that its implementations were supposed to have a .doSomething() function and it was working just fine in the vast majority of cases. However – removing the implements=”com.bla.IA”-atrribute in application.A fixed the NPE and the application started working again. I have absolutely no idea what happened here and why this particular implements-attribute would cause a NullPointException in some circumstances, but it did. As I said before – the application was working fine with such an architecture for more than a year. All of a sudden (and that might have been triggered by a CF- or server update or anything else) it started to occasionally get into a situation where all the app-scope’d CFCs that implemented an interface were creating those issues from time to time.

Now – if you’re having trouble with “null, null” errors in ColdFusion I definitely do not want to suggest that it is due to CFINTERFACE. In fact, most likely it won’t. There are tons of discussions out there that talk about various reasons and “solutions” for “null, null” errors such as Client variables, Cookies, Unix ports, Database drivers etc. The reality and the message to take from this is – please repeat that after me: all those are NOT reasons for the “null, null” errors. The “null, null” errors are just covering up the real NullPointerException you need to look into. In our case it was a weird behaviour of CFINTERFACE, in other cases it might be Query of Queries or whatever else. There’s NO unique solution to a “null, null” error, just a unique path to a solution.

Post to Twitter Post to Delicious Post to Facebook Post to StumbleUpon