Short answer: because you’re a freaking idiot.

Long answer: My shell script is on a Linux server. I access via ssh using Putty. I run it from the command line, from Window #1,  like this:

$ bin/myapp.sh &

when I close my ssh window. In Window #2, I watch the logs, and I can see that myapp.sh has exited. Specifically, it caught a SIGHUP.

How to fix this? Don’t close the window. Instead, exit from the ssh session by typing “exit”.

Short answer: I’m a freaking idiot.

1 Comment

Yeah, a few quiet hours on the weekend and time to code.

I’m a little behind, but I’ve been thinking about mobile alot lately. So it was time to upgrade my Android SDK to 1.5.

First thing I do is upgrade the Android Developer Tools for Eclipse. Inside the Eclipse “Software Updates” wizard, I can see that I was using ADT 0.8.0, and the update site said that 0.9.2 is available. Everyone knows that it 0.1.2 better than the last version! So I do the Eclipse upgrade.

While that is going, I download the 1.5r1 SDK, and stick it in my java folder. Eclipse restarts, and I rebuild and >>BAM!<< error!:

conversion to dalvik format failed with error 1

Whoops. Apparently this has to do with some internal Eclipse stuff caching the old ADT 0.8.0 stuff, and the poor Android Tools getting confused. Silly Robot.

Restarting Eclipse with the -clean option fixed it for me. Apparently the correct way to upgrade the ADT is to uninstall the old 0.8.0, and install the new 0.9.2.

Hope this helps everyone out there. Happy coding!

P.S. Hey, Wordpress is bugging me to upgrade to v2.8. Wish all upgrades were as seamless as the Wordpress one.

Leave a comment.

It’s an exciting time to be a Java programmer.

That’s a big change of opinion for me. I started my career with interpreted languages (Usertalk, Python, Perl) and Java seemed really verbose and unproductive.  And it’s still verbose.

But a great set of tools make me really productive.The tool infrastructure  has come such a long way. Eclipse is a great IDE, and if you don’t like it IntelliJ and Netbeans are as good or better. And the ecosystem around the IDEs is incredible. I’m an Eclipse user, and I’ve talked in the past about Mylyn and how much better that makes me. The intellisense features make the huge Java APIs manageable, and the refactoring tools give me enough freedom to make significant code changes without worrying about copy/paste mistakes.

The tool chain for build, dependency management, testing, and continuous integration has improved. Ant is a great workhorse tool. Hudson pretty much the best CI tool ever, and I’ve even come around (slowly) on Maven. Maven, when it works, works really well. It is hard to imagine working on the project I am working on now without a tool like maven to help manage every aspect of the build.

Part of productivity is code reuse. There is a ton of great code (Apache commons, anyone) that has been battle-tested and debugged and often even documented available. Sourceforge and Google code and Codehaus and java.net all provide tons of libraries and tools.

Some of the best parts about Java is that coders have reacted violently against the unwieldly, badly designed APIs that where thrust upon us in the early days. Most coders knew enough to stay away from EJB, unless they were being paid the big bucks to inflict Big E enterprise on the masochistic companies that insisted on it. But a few coders also figured out alternatives: Spring and Hibernate being just two examples.  The fact that the community has been able to leave behind some of the mistakes and move forward–and that the driving force of that is open source driven, speaks well to the health of Java now and in the future.

It’s weird how the plumbing has become sexy. By far the most exciting development of the past two years is the growth of other languages on the JVM. And that is because the JVM and Hotspot JIT compiler is so good. And it means that I can build on my investment in learning Java, the Java tools, and my IDE. Learning a new language, and I get to keep my productivity gains in the toolchain and environment.

So now it’s time for my list of  reasons to be excited about Java right now. It’s been a busy time for Java geeks, with JavaOne last week, and Google I/O the week before, and Eclipsecon roughly a month ago.

  • Android — I can write mobile apps in a language I already know. whooo! It’s not as sexy as the iPhone, nor is it as crowded a place for a developer. And the mobile market is huge. I don’t mind being in a smaller portion of such a vast market.
  • New languages blooming on the JVM. JRuby is fantastic, and fast. I am learning Groovy now, which I expect to take my productivity up several notches. JPython and Scala are in view too.
  • New focus on graphics and desktop. JavaFX has a lot of challenges, and I’m not quite willing to invest yet, but I am watching closely. There are some really reasonable ways to do UI in Java or Groovy now.  And don’t forget Processing, and it’s focus on practicality, ease of use, and real world data crunching and visualization apps.
  • Google on Java. Wow, the presentations from Google I/O were a real eye opener. AppEngine will let me deploy a java web app with the push of a button. You can’t get easier or more efficient than that. Guice looks like DI I can believe in. And some of the lower profile stuff, like http://code.google.com/p/google-collections/, could wind up having a huge effect on my day to day coding.

Okay, if you’re still with me, thanks for reading. Bottom line, it’s a good time to know Java. The tools have matured, there is a lot of opportunity, and who knows? maybe even the Oracle acquisition of Sun will work out good as well.

1 Comment

I tried Mylyn for the first time a year ago, and found it to be impressive, but the job I was working at had a relatively small team, and small codebase, and I was only using Eclipse/Java a portion of the time, so I found that I didn’t really use it too much. And after a couple of nasty crashes, I realized I had overloaded Eclipse with too many plugins, and yanked Mylyn out.

Now I’m working at a new gig, which is all Java all the time, and I am pretty much living inside Eclipse, flipping away only to check docs or go into DBVisualizer. And the code base is of a respectable size, divided into 50 or so source folders. My Package Explorer view just scrolls and scrolls and scrolls, and it is impossible to find anything. (Add to that that it is a new code base for me, and I just don’t know where stuff is, period.)

So suddenly, Mylyn is a lot more useful. It hooks into our issue tracker/ source repository (Trac/SVN). Which means I never have to leave Eclipse for information about what I am doing. I love the Planning tab on the tasks, where I can outline my approach to a problem, and which I can refer to when I lose track of what to do next.

My this is cool moment came when I discovered that Mylyn saved my workbench state for each task. Turning the task off cleans the workbench editor of all the files I had open—and making the task active again brings them all back. It’s fantastic to switch between issues, knowing that it won’t take you 15 minutes just to get everything set back up.

Best of all, Mylyn makes the Package Explorer usable again, by focusing me on just the files that I am using. I find Mylyn absolutely vital t o getting my job done these days.

One note: Getting started with Mylyn can be a little intimidating.  And for the first time user, the Mylyn project presentations are not especially helpful.  The 60 minute video done is a bit to long for the impatient to digest. There needs to be a simple 5 minute “here’s what’s cool, here’s how to get started”. If you are new to Mylyn, the best would be to get a demo from someone who has used it before. If you can’t get a live demo, I’d encourage you to stick with it though, it has definitely paid off for me.

Leave a comment.

Work on the Wordpress plugin continues.

Wordpress is… well, it is a sprawling bit of code. But its not too shabby, and their are at least attempts at documentation. All these little bits of functionality crawling around.

Hard for me to be too hard on the WP guys, though. Some of their plugins are really easy to read. I’m fairly sure my current level of PHP code isn’t really ready for prime time. On the other hand, if we waited for prime-time, we’d never get anything released, would we?

Well, no code for download yet but here is a preview of what I am working on.

Leave a comment.

I’ve been trying to get Wordpress’s post-by-email feature to work with image attachments. After a couple days of hacking (1.5 days of groping around in the dark, and half a day of hacking), I have mostly succeeded. 

Please hold your applause.

The catch is, it isn’t handling text in Japanese, posted from a Japanese cell phone. A minor inconvenience, but it happens to be my current itch, and I’m scratching it.

Turns out that PHP and its support for character sets is even worse than advertised. Here are some links and notes for my own future reference:

iconv is the old standby, but it doesn’t help all that much. MBstring looks like it will help me figure out what the current encoding of the string is.

Wish me luck while I figure this out.

UPDATE: MBstring works like a charm. Japanese phones use SHIFT_JIS internally but the email servers they use encode in ISO-2022-jp. And here is a nice lucid explanation of the Japanese encoding systems in common use: iso-2022-jp, Shift-JIS, and EUC-JP – although be aware that it is quite old, 1996, and predates widespread acceptance of Unicode.

Leave a comment.

There was a release of the new Wordpress this weekend, and it looks and performs great. I’ve been working on upgrading the blogs that I manage, and I am really thrilled about the fact that I’ll never have to do it this way again–2.7 includes a self-upgrade tool.

2.7 has support for Child Themes.  Here are some notes to myself as I attempt to develop some themes for friends:

  • Sample Blog data comes in handy for testing. More here.
  • RevolutionTwo.com offers their blog themes for a fee, but they are GPL’d so there are unsupported links on each of their theme pages. (I was a pretty happy customer of their 1.0 theme.)
  • Themeshaper has the low-down on child themes, because he wrote the spec for child themes that eventually got folded into 2.7. His theme “Thematic” seems to be the cats pajamas for a good place to start for theme development. (Thematic turns out to be rich and complex and based on stuff in the Sandbox theme’s post and class semantic markup.)
  • Some helpful info about the specific changes to themes in 2.7: ericulous and bloggingtips.

 

Strange how I’ve come around on PHP, and Wordpress. But they both manage to hit a sweet spot for the projects that I want to do in my spare time, on my cheap (but awesome) hosting service. More on that another time.

Leave a comment.

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.

Leave a comment.

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!

Leave a comment.

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).

Leave a comment.