Thursday, October 8, 2009

Slides for Developing with Mozilla Prism

I just wanted to post my slides for my presentation this afternoon on Developing with Mozilla Prism.

It will be in the Auditorium at 3 PM. I hope to see you there!

I received a bag of stuff from Mozilla to give away - various fun mozilla/firefox stickers and mozilla firefox badge lanyards.

Slides (pdf through Google Docs)

Saturday, October 3, 2009

Utah Open Source conference 2009 - Developing with Mozilla Prism

I will be speaking at the Utah Open Source conference next Thursday at 3 PM on Developing with Mozilla Prism.

I'm excited because Mozilla Prism is nearing a final release of 1.0 - it's at 1.0 b2 at this point. I talked to a Mozilla employee, Mark Finkle, who works on Prism, in addition to Fennec, their mobile browser project. He talked to Mozilla HQ and it sounds like I'll be able to get some Mozilla swag to give away at the presentation!

I'm also trying to start a community around building a prism webapp bundle library that I'll talk about more in my presentation. I thought it would be nice to have some open source examples of Prism web application bundles that people could refer to and add to. So I created a Google Code project called prism-apps.

In any case, check out the Prism project and come to the presentation!

(I'll post my slides later in the week as I finalize them.)

Friday, October 2, 2009

Subtle difference - extending ListResourceBundle vs ResourceBundle

I've been mucking about extending ListResourceBundle and then just plain ResourceBundle trying to get things to work with a base case - a custom resource bundle.

Taking a look at the Java i18n tutorial, extending ListResourceBundle doesn't require subclassing the default bundle; see here.

Then taking a look at the ResourceBundle javadocs and their custom resource bundle example, you *do* have to extend the default bundle; see here.

So:

public class MyListResources_it extends ListResourceBundle {
...
}

as opposed to:

public class MyResources_it extends MyResources {
...
}

Kind of a confusing inconsistency - maybe the ListResourceBundle is just smarter about its look up.

Friday, September 25, 2009

Internationalization - dynamic and in a database

So I've been tasked with doing some internationalization for a web application in a less conventional way. I thought it would be useful to put together some thoughts as I get started on what I think will be a decent solution.

From what I understood, internationalization in Java (the language I'm using) involves properties files and locales and such. In the project I'm on, there is a requirement to be able to update the translated texts on the fly, without a server restart. This complicates the using of properties files a bit, since writing to those files seems a bit hackish and then what do I do to reload them.

So we've decided to look into a database backing for the whole business since that's pretty dynamic and accessible to the people - either via some database interface or an admin tool - working on the text.

We were kicking around various options to do something custom, a custom map or something and redirect whatever framework we were using.

Then I found some methods native to Java - no framework required - which should handle it nicely.

  1. ListResourceBundle has been around for a while in Java-land, but it's a nice way of not using properties files, but classes as bundles for different locales. This seems like a great way to get those database backed properties into the mix.
  2. Java 6 also has some nice customization options for how resource bundles get loaded. Specifically, ResourceBundle.Control has some options to customize the time-to-live of the cache for the resource bundle, from no-cache at all, to specifying a timeframe in milliseconds for how long a cache is valid.

So going forward, it looks like I'll need to mess with both for making something that's as close to the wire as I can - which allows me to not have to re-code caching and other things specific to a system for i18n.

Wednesday, September 16, 2009

Having intellij + tomcat update web content without a restart

So I've had issues with intellij + tomcat updating web content without a tomcat restart - very painful.

I've found the magic that will allow for it thanks to a coworker.

There are three things to do:
  1. Make sure your webapp is an exploded directory instead of a war (not sure if this is required)
  2. Set Settings->Debugger->HotSwap->Reload classes after compilation to Always - if it can't do it, I'll have to restart anyway
  3. Set Settings->Compiler->Deploy web applications to server after compilation to Never
Then after updating a page, on Windows press ctrl-shift-F9 to "compile" the page or re-put it into the exploded directory.

My sticking point was number 3 - it would put the updated file out there, but when it deployed the web application, tomcat got all confused and required a restart - I think probably because everything was updated including the web.xml.

Sunday, September 6, 2009

Some basics on Mozilla Prism

Lately I've been working on getting Mozilla Prism working for me on linux. It's in the 1.0 beta stage and seems to me to be the most promising now among the cross-platform site-specific browsers.

Personally I use it for gmail, google docs, google calendar, outlook web access, and stuff like that.

Following are some helpful introductory links on prism:

Monday, August 3, 2009

IRC on windows with notifications

I wanted to document a few steps to getting IRC working on windows with notifications. Pidgin is a decent client to connect to IRC on Windows, though some prefer using mIRC. Unfortunately for windows, there's not a well established notifications framework like there is on the mac (growl) or linux (libnotify).

So to start, download and install the following:
Pidgin
Growl for Windows
Gnarly (Growl->Snarl bridge)
PidginSnarl (pidgin notification plugin)

Once all these have been installed, add an IRC server to your pidgin installation, such as irc.freenode.net.

Growl needs to be started and in the preferences, you'll likely want to load it at startup.

You'll likely have to restart pidgin after installing the pidginsnarl plugin. After restarting, go to Tools->Plugins. There will be two that you'll want to enable:
Message Notifications
PidginSnarl

Then configure MessageNotifications - enable notifications for Chat, and then if you'd like have it notify you only if someone chats to your username.

Then go into Growl into the Applications section, click on PidginSnarl. Configure the Chat Received notifications to how you'd like it.

You may want to configure other things like logins and logouts and status changes to not notify you as well (disabling them).

That's it. Whew, kinda complicated on windows, but that's it.