python, php, and xslt

I had the occasion over the last couple of days to do some work with python, php, and xslt.

Python, which I haven’t really touched for a couple years, comes back fairly quickly. especially on this little project, where I am looking at two different code bases, no documentation except for the code–it is pretty easy to see what the authors are trying to do here. not too hard to hack away and make some progress.

PHP, I am relatively new to–and I am instantly productive. What I am doing is not rocket science, but it sure is easy. In fact–I am doing XSLT with PHP. Yeah, I know that libxsl is under the hood, doing its magic and that I am benefitting from that. also, by being a late PHP adapter, the implementation of XSL is now a bit more mature and easier to use.

But I’ve done fairly hefty XSL projects in python, Java, and Frontier, and the PHP implementation is so easy–it literally only took me about 5 minutes to get something working, and that includes the reading of the tutorial. Now I have a 40 line PHP file and a 5 line htaccess file, and with that I have a simple xml-data driven website.

Lastly–XSLT. It is funny how some technologies stay with you, and some don’t. XSL has stayed with me, and I was able to convert an HTML design mockup into a working xsl stylesheet in just a few hours tonight. Feels good, and it is fun–you can instantly see the results of your work.

svn: ‘wp-content/plugins/akismet’ is not a working copy

Maybe you’ve been upgrading your WordPress installation using the Subversion method (sweet and easy! if you like the command line). If so, in the update to v2.6.1 or so, perhaps you’ve gotten this error message:

Fetching external item into ‘wp-content/plugins/akismet’
svn: ‘wp-content/plugins/akismet’ is not a working copy
svn: Can’t open file ‘wp-content/plugins/akismet/.svn/entries’: No such file or directory

Yeah, me too.

This isn’t a big deal, btw. Your wordpress installation will work just fine, it’s just more of an annoyance. Below I explain how to remove it.

Explanation

Previously, the WP guys used Subversions “externals” feature to pull in the akismet plugin automaticall from a different part of their subversion repository. In v2.6, the Plugin upgrade system was added, and now Akismet can be upgraded from the admin interface. So they removed the svn property that brought in the Akismet code because it was not needed any longer. This is what caused the error message.

Update: Actually, I just created a new blog, and it is pulling Akismet in via the svn:externals. So I am not sure exactly what happened–it seems to be an issue from an existing SVN install, being updated to 2.6.1 or above. Strange. Anyway, the “fix” below seems to be sufficient, if you don’t mind upgrading Akismet via the admin UI.

To fix it:

1. in a terminal window, change directories so that you are in the wp-content/plugins directory.

 

2. remove the svn:externals property.

Your shell commands will look something like this:

 

$ cd blog/wp-content/plugins

 

$ svn propget svn:externals 

akismet http://plugins.svn.wordpress.org/akismet/trunk/

$ svn propdel svn:externals

property ‘svn:externals’ deleted from ‘.’.

$

 

 

Update Akismet from inside WP

Now you get to use WP’S snazzy new plugin update features. In your admin, go to the Plugins section. If you haven’t already done the upgrade, there will be an upgrade notice beneath the Akismet Plugin information.

Click “upgrade automatically” to activate the update. Easy!

iPhone App Study Group 勉強会

I attended an iPhone benkyoukai on Sunday, hosted by a new company iPhonez.jp (incorporated on the day the iPhone 3G went on sale) in a meeting room in the Recruit building in Shimbashi.

Although the event was billed as an iPhone application study group, it didn’t really live up to the name. Apple has been really strict about the NDA that accompanies the iPhone SDK, which has made it so far impossible for publishers to print books on iPhone development, earned the scorn of Android developers, and now, prevented this event from discussion any about iphone development.

(The rumor mill says that Sunday night’s event was actually planned to be held at the Apple Store in Ginza, but was relocated after this same event was held at the Mac store in Osaka, and that Apple complained about the amount of detail revealed in that session.)

There were 4 longer presentations, and then a few lightning talks. Topics included:

  • Guy who created a free Japanese Postal Code lookup app talked about releasing his app. “I did it mostly for fun.”
  • Working with Dashcode. The guys from Recruit showed the iPhone/iPod Touch Dashcode widget they created for HotPepper, a free coupon magazine.
  • Geolocation potential with iphone. Guy from a mobile GPS firm talks about creating an app to deliver location-based info and coupons. His example was rather comical–an app that would let you know where you are on the Yamanote, the circle line that runs around tokyo. I can’t imagine being able to forget where you are on that train… every stop is announced, multiple times, and there are signs in the cars and the stations. So while that didn’t seem that practical, the cool thing was his GPS software could not only show use where we were, but on which floor of the building we were on. That was impressive.
  • A professor from the Institute for Advanced Media Arts and Science (IAMAS) spoke about doing Art on the iPhone. Except he wasn’t in Tokyo–he was in Hokkaido. He sent his slides via email, and did the talk via iChat video… facing the screen so he could see sync with the slides. At the end, the moderator turned the laptop towards the audience so that the professor could see the applauding crowd. Anyway, it was mostly a theoretical talk, showing some art projects done with iMacs in the past, and positing that by approaching the iPhone as a platform for physical interaction rather than justa a phone device, the possibilities for art could be delivered. Probably the most interesting discussion–mostly because it had very little to do with iPhone app development, but spoke to the possibilities (and anyway, the NDA makes it difficult to talk about iPhone development at all.)

The event was a success, though, from a networking and as a forum for general iPhone enthusiasm. In comparison to the Symbian and Android events I’ve been to lately, the iPhone folks are positively glowing. My sense was that the attendees were not just coders, but marketing and venture people attended as well. The technical discussion were very light, and the focus was on “how can I appeal to the iPhone user”.

I met the very nice people from iPhonez.jp, Kawakami-san and Yao-san. They seem super nice, and hope to see them again at another event.

Links: iPhonez meeting announcement (japanese). iPhone-dev.jp forum thread (also in japanese).

Why Content Management Systems are like Model Airplane Kits

Understand that buying/building a CMS is very different than most product purchases. It’s more like buying a model airplane kit than it is a finished product. With a model kit, you most certainly are going to paint it yourself. You’ll add the authentic plane markings and insignias yourself. The kit has all the parts you need, but you still need to put it together. There are all kinds of kits, some easy to assemble, some requiring a lot more skill, some just for show, some actually functional with radio controlled engines that you can take out to the parking lot and fly around.

Commercial CMS’s come with nice white papers and reassuring text on the website, and, most dangerously, salespeople paid on commission and so will promise that “of course our product can do so-and-so”. The problem is that the slick presentation and sales job may fool you into thinking that you are buying a product–but you will probably be getting a kit.

Content management vendors understand that people want products, or “solutions”, and not kits. So they sell it that way. ( So do the model kits makers. There’s always a nice photo of the plane on the box, but when you open it, it’s just a tray of grey plastic.) But at the same time, customers ask them for customization options. So the CMS vendor has to make a product that is configurable, skinnable, and flexible. Some of them achieve that, some of them don’t. The more customers ask for features though, the harder it is to make it all work together. That’s why there is usually a “professional services” offering as well.

You may already understand this. But if you are new to content management, it is worth saying: expect the time/cost to customize and integrate to be a significant part of the work. Choosing a CMS product is just the beginning.

Symbian Summit Tokyo

I attended the Symbian Summit Tokyo last week. The timing was good–the marketplace for cell phone operating systems has never been more interesting. Google announced its open source OS Android last November; then Nokia announced that it was acquiring the majority of the outstanding shares of Symbian last month and planned to open source the Symbian OS. And the week before this conference, Apple released its 3G iPhone, complete with a compelling developer SDK and enterprise strategy.

Symbian Summit Tokyo 2008 at the Westin Hotel in Ebisu

So I was curious to see what the response would be to these various developments, at a show hosted by Symbian.

Continue reading

Eclipse, Java3d, and java.library.path

In my new and continuing series on hair-pulling, teeth-gnashing Java error messages, I am proud to present:

java.lang.UnsatisfiedLinkError: no j3dcore-ogl in java.library.path

Just for fun, I’ve been working through Pro Java 6 3D Game Development: Java 3D, JOGL, JInput and JOAL APIs . I have been trying to rework the example code and make it my own as I go through the chapters.

Anyway, I built a small “Hello 3d” app but when I attempted to run it I get the above UnsatisfiedLinkError. What was odd was that the sample code from the book ran without any problems, but I was getting this error.

For some Java libraries, there are native code (C++ extensions, basically) that Java needs to work with that particular feature. Java3d is a prime example. You need to put the j3dcode.jar, j3dutils.jar, and vecmath.jar files on your CLASSPATH. Additionally, you need to put the native code, j3dcore-ogl.dll (j3dcore-ogl.so on Linux) onto the PATH. This can be in the JRE/bin folder, but the Java3d isntall file says to avoid sticking it in there, as it can cause problems. I choose to keep all my Java files in my D:\java\lib folder. — in this case the java3d-ogl.dll is in D:\java\lib\j3d\bin. And since I am using Eclipse, I configure Eclipse with a user library like this:

Eclipse dialog for User Libraries in the Java Build Path

Eclipse dialog for User Libraries in the Java Build Path

I focused on the “java.library.path” part of the error message. I configured Eclipse correctly above, and had my app spit out the System.getProperty (“java.library.path”) to the Console. It was correct.

But it didn’t work! At. All. Mysteriously, the sample code–which was configured to use that same Eclipse User Library, worked just fine.

After a lot of Googling and talking to myself (grr, I’ll show you unsatisfied…). I noted in my TaskBar that the icons for the sample Application (Life3d) and my little app where different. And a lightbulb went on. Sample code was running Java 1.6, and mine was running under Java 1.5. (I had chosen JDK 5 because I was thinking about redistribution to some non-geek friends, and figured more people would have Java 1.5 than 1.6.)

Now–in theory, there should be no difference. Not sure if this is a feature or a bug–the Eclipse stack is sometimes too big to tell. But my Eclipse is running on Java 1.6 (Vista x64), and perhaps the way it is creating the class loader for the 1.5 JVM it is not picking up that .dll, even though the .dll was on my PATH (or in my Eclipse native library location).

My fix: Inside Eclipse 3.4, swapping my project to use Java 1.6 as my JVM fixed the problem. Hurray! I have yet to test building a JAR and trying it outside of Eclipse… I’m just trying to get through a few more chapters so I can get to the fun stuff.

Hope this helps someone.

Eclipse 3.4: JVM Terminated. Exit Code=-1.

After several months of using mostly Visual Studio, I have some time now to shift gears back into Java. The timing is good–the annual release of Eclipse and all its subprojects happened while I was out of town on vacation last month.

I’m working on a new computer, running Vista 64bit. I reaped the rewards of Moore’s Law by obtaining a custom build box with a Quad processor and 4 gigs of ram and a fancy graphics card for about 130,000 JPY. Oh yeah, a terabyte of storage. Anyway, the Core 2 Quad CPU was so reasonable I couldn’t not get it.

I’ve been using Vista for about 8 months and am still getting used to it. I am far from a Windows expert. And the ins-and-outs of 64bit versions of software I am still getting used to.

I discovered I had 5 version of Java installed on Vista: 1.5 and 1.6 in 32 bit versions, a 64bit 1.5 JRE (installed by Web Start?), and the 64bit 1.5 and 1.6 SDKs. I figured I would clean out the 32 bit versions. In fact, I wound up uninstalling every single version of Java and re-installing just the latest 1.5 and 1.6 SDKs, as there were updates that I didn’t yet.

Then I started up Eclipse and I got this really annoying error:

JVM Terminated. Exit Code=-1.

My environment: 64bit Vista Ultimate, Java 1.6 x86_64, Eclipse Gandymede (JEE zip download).

Google returned a lot of problems around Exit codes but nothing that specifically addressed this issue. Turns out the exit code just means “you’re out of luck!” I tried to find a list of all exit codes but had no luck. A lot of the advice about the exit code problem seems specific to Eclipse 3.3 and messing with the eclipse.ini settings (I recall vaguely having to do this about 7 months ago). That didn’t work.

After banging my head against the wall (needlessly), I realized that the Eclipse Gandymede default download is a 32bit download.  I had to find the Eclipse v3.4 64bit Windows download (which is a little tricky, because they do a good job of steering you to the Gandymede stuff–what you want is the Eclipse Platform download link), and then use the Gandymede update site to get all the subprojects downloaded correctly. Hurray for fiber to the home—it was not too painful to download all of it.

To summarize, I was having JVM Terminated because I was using a 32-bit binary of Eclipse on a 64bit Vista (32 bit Eclipse is in the default Gandymede download). The solution was to download a 64 bit version of Eclipse. Go to the Eclipse Platform Download link, then click on the “3.4” Build link to get to all the various binaries for all the platforms, including Win 64.

(I also wound up reinstalling a 32bit version of Java. Turns out, that is the Java used by Firefox and IE. Need that for viewing applets.)

Edited Aug 8, 2008: to make it clearer that the solution was getting a 64bit-compatible version of the Eclipse binary. Reinstalling 32bit Java was justa convenience to get my applets working in Firefox.

i got the flu… the happy flu

You’re not really blogging unless you’re involved in some random chain-letter variant. This one seems to be not too lame.

Achoo!


Edit – wow, I need some QA. Copy/pasting the code into the WP’s Visual Editor *so* did not work. Fixed.

Maven and the “method does not override a method from its superclass” error

Spent more time than I care to admit today stuck on something soooo simple. Was trying to build a maven project at home, and kept getting this error: “method does not override a method from its superclass”.

What is happening? Well, there is a @Override annotation on one of the methods, but it doesn’t have a superclass–it is annotating a method that is being implemented (from an interface), not a method that is inherited (from a superclass).

The @Override annotation is a Java 1.5 feature, and the error message I was getting was coming (correctly) from a 1.5 compiler. However in Java 1.6 the @Override annotation can also be applied to methods that are implemented from an interface.

Someone started using Java 6 and Java 6 features in the project, without updating the pom.xml file to fix this. Grrr.

The fix was to update the configuration of the maven-compiler-plugin to use 1.6 as both the source and the target, rather than 1.5. set my JAVA_HOME to point to Java 1.6 and that was that. I wound up putting the config for maven-compiler-plugin back to 1.5. Which doesnt seem quite right, either, but fixes the UTF-8 error I am getting. Ugh!

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.51.61.5</source>
<target>1.51.61.5</target>
<encoding>UTF8</encoding>
<optimize>true</optimize>
</configuration>
</plugin>

Vista – virtual desktops

I’ve been looking for a decent virtual desktop solution for Vista. There’s a couple open source products that have lots of links, but I tried one, Vista Virtual Desktop Manager, and found it a little slow. It uses the new Vista screen thumbnails API and I just found it… unusable.

My favorite multi desktop solution on XP was multidesk, which was in beta forever and never updated and only available via download.com; I was delighted to find that there is a new version, Multidesk Expert, that works on XP. Shareware, I’m definitely going to send this guy some money.

Multidesk is fast, easy to use, and stays out of the way. No fancy animations, just lots of room to work…

 UPDATE

Completely changed my mind. After about a week, I started getting weird crashes in Multidesk Expert. And by that time, a new version of Vista Virtual Desktop Manager came out that had quicker animations and was more stable.  So hurrah for Vista Virtual, and so long, Multidesk.