Unlikely Teacher

1. Share Everything* [Programming Gotchas, Technology News, Insights on Living and Everything in Between]

Unable to read a jre library while constructing the blacklist

December 30th, 2009 · Java, Mac OS X

Yesterday I started playing around with Google App Engine and Java. Today, when I tried upgrading the JDK/VM that Google App Engine is using from Eclipse Galileo to Java 6 in Mac OS X, I got the error below:

com.google.appengine.tools.development.agent.impl.BlackList initBlackList
SEVERE: Unable to read a jre library while constructing the blacklist. Security restrictions may not be entirely emulated. /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/plugin.jar
The server is running at http://localhost:8888/

Fortunately, after a bit of searching I found a quick fix.

cd /System/Library/Frameworks/JavaVM.framework/Resources/Deploy.bundle/Contents/Home/lib/

sudo ln -s plugin.jar plugin2.jar

Details taken from: http://groups.google.com/group/google-appe

→ 2 CommentsTags: ··

Eclipse 3.5 Galileo and SVN (Subversive)

October 1st, 2009 · Java, Tools

With Subversive being an official Eclipse project (2007) and the recent Eclipse 3.5 Galileo release (2009), you may be wondering why Eclipse still does not have SVN support built-in.

But don’t fuss, because it’s not that hard to configure SVN support (using Subversive) with a few simple steps. This document aims to guide you with the install process.

The first time you try to run Eclipse Galileo and click any of the update sites, you’ll probably receive the “Unable to read repository at …” error like what is shown below:

Update Error

To fix this problem, simply select “Galileo” (or any other update site you wish to use) from the “Available Software Sites” link (Help>Install New Software) and click the “Test Connection” option on the right.

Test Connection

Click “OK” when done and select “Galileo” from the “Available Software” dropdown.

Available Software

From the Galileo Update site, choose “Collaboration > Subversive SVN Team Provider”.

Collaboration Subversive

Click Finish/OK when done. Due to licensing restrictions, the connectors need to be installed using another update site.

To do this, simply “Add” the “Subversive SVN Connectors” Update Site: http://community.polarion.com/projects/subversive/download/eclipse/2.0/galileo-site/

Add Subversive Connectors Update Site

Select the Subversion Connectors you need (select all if you’re not sure which ones) and Install.

Select Subversive Connectors

After the installation process, you will be  asked for restart of a Eclipse for the changes to take effect.

To see the available options for SVN, open the “SVN Repository Exploring” perspective.

SVN Repository Exploring Perspective

Hope this helps. Comments and feedback are much appreciated.

Thanks.

→ 1 CommentTags: ···

Extra Space (20px) in iPhone OS 2.2.1 Nav Bar

July 1st, 2009 · Objective-C

I currently have an iPhone application which has 4 tabs, when I click any of those tabs, the application should show a new view with a Nav Bar which then contains a table view.

My problem: there was blank space (about 20 pixels) showing between the status bar and the Nav Bar. I tried looking in the Nibs about setting this value but without luck.

What’s even weirder is the fact that this problem does not occur when running against the OS 3.0 simulator.

Fortunately, after days of searching, I found the workaround for OS 2.2.1 and below.

    CGRect frame = navController.view.frame;
    frame.origin.y = 0.0;
    navController.view.frame = frame;

Answer taken from iphonedevsdk.com.

Hope this helps!

→ No CommentsTags: ·

Google Calendar “Tasks” not yet available in Google Apps

May 22nd, 2009 · Tools

I had high hopes when I saw the news which said “Tasks, now in Calendar too” from the Gmail Blog. I have always been searching for a decent TODO app nicely integrated with my other appointments.

Unfortunately, when I checked the Calendar application from our Google Apps Standard, the link was not there. I then checked the original Google hosted Calendar application and saw the link there.

I wonder when this will be available in Google Apps, or maybe this is already available in the Business Edition? Please let me know if you are able spot this new feature in any of your Google Apps site.

→ 2 CommentsTags: ·

Show Desktop Command on Mac OS X

May 21st, 2009 · Mac OS X, Tools

I’m relatively new to Mac OS X and have been struggling to find out how to quickly “Show the Desktop” to see all the icons I have in there.

I have been used to clicking that little “Show Desktop” icon on the bottom left of the screen in Windows and was looking for an equivalent on my Mac.

Fortunately, there is! But it’s not an icon that you would click but some keyboard shortcuts you need to type. For me pressing fn F10 did the trick.

You can find more Expose tips on this page.

→ 3 CommentsTags: ··

PHP writeUTF implementation

May 12th, 2009 · Java, PHP

We currently have an application in Groovy/Grails/Java that we’re slowly porting to PHP (for more affordable hosting costs).

We encountered a problem when we needed to convert one of our routines for writing out a binary file. We were using Java’s DataOutputStream.writeUTF(String) method and had a hard time trying to write binary data in PHP.

After much research on the web, we found a method in PHP called pack(). Below is our PHP implementation of Java’s DOS.writeUTF(String).

	public static function writeUTF($string) {
		$utfString = utf8_encode($string);
		$length = strlen($utfString);
		print(pack("n", $length));
		print($utfString);
		flush();
	}

We don’t claim this to be the exact equivalent of the method, but it gets the job done and the receiving end of the file was able to parse the binary file properly with the new PHP implementation with no modifications to the client code.

Please checkout the pack() documentation for more details.

→ No CommentsTags: ·

vi Page Up/Page down for Mac OS X

May 12th, 2009 · Mac OS X, Tools

In case you’re wondering how to move up or down in “vi” from Mac OS X terminal:

Then CTRL-B and CTRL-F should do the trick.

Got this from the Mac forums at macworld.com.

→ 1 CommentTags: ····

Windows 7 RC and Ubuntu 9 Downloads

May 6th, 2009 · Mac OS X, Tools

Windows 7 Release Candidate is now ready for beta testing and will be available until July 2009.

Here’s what you need to have:

* Internet access (to download Windows 7 RC and get updates)
* A PC with these system requirements:
o 1 GHz or faster 32-bit (x86) or 64-bit (x64) processor
o 1 GB RAM (32-bit) / 2 GB RAM (64-bit)
o 16 GB available disk space (32-bit) / 20 GB (64-bit)
o DirectX 9 graphics processor with WDDM 1.0 or higher driver

Ubuntu 9 also is now available for download and was reported to be “as slick as Windows 7 and Mac OS X”.

I wonder when we can see a preview of Snow Leopard

→ No CommentsTags: ···

SitePoint Books: The Bushfire Relief Sale

February 12th, 2009 · Books

Get 5 books (PDF) for the price of 1 and get to help the victims of the recent bushfires in Australia.

SitePoint is well known for their book: The Principles of Beautiful Web Design

More details on The Bushfire Relief Sale site.

→ No CommentsTags: ···

Agile Modeling and Einstein

February 9th, 2009 · Business

Last week, a friend of mine asked me about my opinion about keeping design documents simple. What follows is a quote from the Agile Modeling article he sent me over Skype.

One of the more controversial concepts in Agile Modeling is that agile models and agile documents are sufficient for the task at hand, or as I like to say they are “just barely good enough (JBGE)“. In this article I make the following critical points about a model or document (an artifact) being just barely good enough

This reminded me of a quote from Einstein which says “Everything should be made as simple as possible, but no simpler”.

This Einstein Wiki Quote entry also mentions that it is likely that the KISS (Keep it Simple Stupid) Agile methodology principle also originated from the same idea.

I didn’t get to read the whole article, but overall I agree with the concept.

→ No CommentsTags: ·