GWT Server-side Internationalization With Hermes

I recently made a post on my company’s blog about a new open source project I just released called Hermes. Here is a short excerpt:

Greetings interwebs! My name is Matt Bertolini and I am an engineer here at Travel Tripper. I thought it was about time I made an appearance on our tech blog. I want to talk about a new project I have recently finished and am sharing with the world.

A Little Backstory

Our application, RezTrip, is in the process of being internationalized. Since it is a GWT based application, we chose to use the GWT static string internationalization features. Unfortunately, these features only work on the GWT client-side and we have lots of other client-facing strings that need to be internationalized (client emails, legacy HTML pages, etc.).

The gwt-i18n-server Library

A quick Google search on the subject of “server-side GWT i18n” found a library called gwt-i18n-server. This library gives the server-side support for the GWT static string i18n interfaces and properties files. We quickly incorporated the library into RezTrip and found it was pretty buggy. Worse yet, development on the library had stagnated and hadn’t been updated in over a year. This is where I come in. Not satisfied with admitting defeat and implementing a separate i18n system just for server-side content, I decided to fork the gwt-i18n-server library and fix the bugs.

To read the rest of the story, click here.

What I’ve Been Playing

I have spent pretty much my whole life playing video games. It is one of my longest standing hobbies and while I don’t get to play them as much as I used to, I still like to squeeze in a few hours a week to play. This past holiday season I got a couple of new games and they have been occupying some of my free time, so I thought I would share my thoughts on them. Here they are in no particular order.

Call of Duty: Modern Warfare 2

One of my favorite types of games is the first person shooter (or FPS for the uninitiated). I like to play FPS games on the PC, not consoles. My reasons for this can fill a whole other blog post (and I will write one eventually) but the short version is that I prefer the keyboard and mouse to a controller for this game type. You can’t talk about FPS games now without talking about Call of Duty: Modern Warfare 2. It has been called one of the best shooters ever made and for the most part I would agree with that statement. I have been playing MW2 since it was released in November and been addicted ever since.

Now I am not a stranger to the Call of Duty series of games. I have played every edition of the game and each one has gotten progressively better. Infinity Ward, the games’ maker, has certainly figured out what it takes to make a consistently solid game.

While MW2 is an amazing game, unfortunately I do not believe it is as good as its predecessor. There are many people that would disagree with me but they most likely are coming from a different perspective. My problem with MW2 is that it is not a PC game. It is clearly a console game that was ported to the PC. This is a clear departure from previous Call of Duty games. The first Modern Warfare game was definitely made for the PC. It had all of the classic signs of a PC game and it allowed its users to customize and extend the game new maps, mods. Users could also host their own dedicated servers and play offline in LAN only situations. These features are very unique to the PC world since consoles are mostly closed environments maintained by the console manufacturer. MW2 dispensed with dedicated servers and custom maps in favor of a much more console like experience of matchmaking players and P2P server hosting. There are many people furious with Infinity Ward for making these changes. I don’t think that I am angry as much as I am disappointed. With all of the previous Call of Duty games I set up a dedicated server on one of my Linux servers so my friends and I could play during LAN parties or if we didn’t want to play on public servers. I no longer get to do that with MW2 and that is unfortunate. And due to the tremendous success of the game, it only communicates to game companies that there is no need to create dedicated servers and extensible games. I think a large part of PC gaming culture will die if the user is no longer allowed to extend and customize the game and for that I am disappointed.

I am beginning to accept the fact that PC gaming is in decline and the console slow march towards gaming dominance is now starting to consume the FPS but I intend to hold on to my keyboard and mouse as long as I can. If that means accepting a few changes and flaws in MW2 then I guess that is what I have to do.

New Super Mario Bros. Wii

The other game I have been playing is much more casual than my current PC addiction. New Super Mario Bros. Wii is a modern sequel to some of my favorite games of all times. I am a huge fan of the classic Mario games for the NES and this new version has stayed true to the classic genre while adding some cool new moves and upgrades (as well as making it much nicer to look at on a big screen. Have you seen an 8-bit Mario on a 52″ HDTV. One word: pixelated). One thing I noticed about this new version of the game is that it is much more difficult than I originally expected it to be. I guess the 20+ years of muscle memory on the old Mario Bros games makes me think they are much easier than they are. Not knowing where the next goomba is going to appear in these unfamiliar level adds an extra bit of difficulty I am not use to. If you have a Wii, you need to get this game.

Things That Bug Me

One day sales with a “preview day”. If you have a “preview day” the one day sale is no longer “one day”.

The price of replacement razor blades. Screw you Gillete!

Smokers. It’s disgusting and inexcusable.

Censoring language on TV. The FCC is full of prunes. Besides, kids are going to learn the words anyway.

People who leave their newspapers on the subway. Are you that lazy that you can’t carry them to a trash can 50 feet away.

People who don’t change their cell phone ringtone away from the carrier default. If your not smart enough to change your ringtone, don’t use a cell phone.

TV commercials that are louder than the TV show. Hey cable networks! This is the 21st century! We have the technology to normalize the volume. Fix it!

The TSA. All you provide is the illusion of security. Stop wasting my time.

Fox Television. You cancel most of the shows that I like to watch on your network. Go to hell!

Local television news. It’s really painful to watch and 99% of what they report isn’t news. It needs to go away.

I’m Not Dead Yet!

So…yeah…hi. Just letting you know that I am still alive and haven’t forgotten about this blog. I know it isn’t much of an excuse but I have been neglecting this blog mainly because I haven’t had much time. Work has consumed my life in more ways than I care to talk about.

So what has been going on since the last time I posted? A whole lot! I am still working my ass off at the company that will remain anonymous. I am generally bored in my job so I will have to correct that soon. Work consumes ninety-five percent of my life, with the rest going to sleeping and eating.

I have managed to sneek away from work to go on a few vacations this year. In April I went to Washington D.C. with my family. We met up with our cousins and toured around the city for a week. That trip confirmed my opinion that Washington D.C. is a much cooler city than New York. In July, some friends and I took a road trip to Sandusky, Ohio to the Cedar Point Amusement Park. It was my pilgrimage to the Mecca of roller coasters. Needless to say I had a blast. Finally, not too long ago in November, I went to Florida with my family to celebrate Thanksgiving with my grandma, and other extended family. Any time I get to have nice warm weather in the winter months is a welcomed treat and I had a good time to boot.

There is lots of other boring stuff that has happened over the year, some good, some bad but I won’t bore you with the details. If I were to sum up 2009 I would say that it was a year I would largely like to forget. I am hoping to make 2010 a better year and I am thinking that making a better effort to post on this blog will help me achieve this. If I ever get over my designers block, I am also hoping to finish my custom design for this blog. So we will see how I do with these goals. Until then, you can always find me on Twitter, complaining about the world in 140 characters or less. And with that I say good night Internet.

An Excellent Explanation of the Financial Crisis

These days when people find out the industry I work in, one of the first questions they ask me is about the current financial crisis.  When I started my job, I received some excellent training on the financial markets and in particular the credit crisis. A college friend recently tweeted a link to a short video explaining the whole mess in a way that almost anyone can understand and it reminded me of the training that I received. I decided to post the link here just in case you missed my post on Twitter. I highly recommend watching this video. Hopefully it will reduce the number of questions I am asked. 🙂

The Crisis of Credit Visualized

Why I shouldn’t Buy Train Tickets – Final Part

Happy 2009 everyone! It is the new year and that means my little experiment is done. I have December’s train ticket results and they are identical to November’s. My ticket was checked a total of 9 times which at $2.25 USD a ticket comes to $20.25 USD total. This means I could have saved $39.75 USD if I did not buy the $60.00 USD monthly pass.

Totals

I did this little experiment for 5 months. That means I bought 5 monthly passes at $60.00 USD. That adds up to $300.00 USD that I paid for travel on the NJ Transit rail system. If I only bought tickets for the times that I was checked I would have only needed 46 tickets and my total would have been $103.50 USD. That is a difference of $197.50 USD. I could have saved almost two hundred dollars by not buying monthly passes. That is a pretty staggering number if you ask me.

Conclusion

My only explanation for these results is that NJ transit just doesn’t care about checking tickets between Secaucus Junction and Hoboken. It’s a ten minute ride and I guess they just think they have better things to do than to worry about who boarded the train for the short journey. That annoys me slightly since I am following the rules for no real reason. I hope you have enjoyed reading about my little experiement as much as I enjoyed performing it.

PHP: Time To Break With the Past

A few weeks ago the Python Software Foundation released version 3.0 of the Python programming language. This was a big deal because version 3.0 broke backwards compatibility with the widely popular 2.x line of the language. Obviously, making the decision to break backwards compatibility was an extremely difficult one to make and many people have mixed feelings on the subject. My opinion on it is that the break is a good thing. The changes made to the language make it better and the way the organization is making the transition is smart.

But this post is not about Python, but another programming language: PHP. Unlike the Python Software Foundation, the PHP group have made some poor decisions about their language and I believe it is hurting the language and will ultimately lead to their downfall. I think it is time for PHP to do exactly what Python did and break backwards compatibility.

Now I don’t claim to be an expert in the inner workings of the PHP organization but I am a user of the language. I program all of my web sites in PHP and I have written a few applications in full object orientated PHP 5. I can say that trying to write a OO PHP app wasn’t the greatest experience and that is directly related to the deficiencies of the language. Here are a few things I think that the PHP group should do in the next version of the language to make it a more viable, competitive programming language.

Get Rid of Old Stuff

One of the first things that needs to be done to clean up PHP is to get rid of all of the duplicate functions and old libraries that continue to hang around from PHP 4 and below. For example, there are currently two different libraries for connecting to MySQL databases plus the PHP data objects library that also supports MySQL. There is no need for three separate ways to connect to the same database. The language is also riddled with functions that do the exact same thing. For example the die() function and the exit() perform the same action. The documentation even says that they are same. There is no reason to keep both of them around. PHP needs to clean up all of the redundant functions in the language and focus on making the core functions better.

Add Real Namespace Support

PHP is adding namespace support in the upcoming version 5.3. Unfortunately, rather than use a normal, sensible delimiter that many other languages use, such as the period (.) or double colon (::), the PHP group has decided to use the backslash (\), most commonly known as the directory separator in MS Windows. If you combine that with any sort of auto-loading, your asking for confusion. The developers need to wake up, admit their wrong, and overload one of their reserved characters to give us some proper namespace support.

Real Constructor and Function Overloading

While PHP 5 gave us much improved support for object oriented programming constructs, they dropped the ball in the area of polymorphism, especially constructor and function overloading. Its time to get rid of those stupid magic methods __get() and __set() and give developers real function overloading support. Storing all of your private instance variables in an array is not a clean, easy to read approach to storing data in objects.

Better Type Hinting Support

PHP is a dynamically typed language and I don’t mind that one bit. But even with a dynamically typed language, there still is a difference between a string and a boolean value. Type hinting goes a long way in making sure that the data you pass into a function is of the correct type but I think it needs a bit more to be truly useful. PHP needs to enable type hinting for the primitive types as well as custom object types and arrays.

Built in Documentation Support

This is sort of a want to have feature that I think all languages should have. I know that there are plug-ins and external programs that give you Javadoc like support (I use phpDocumentor) but having it built in would make it so much easier to generate documentation. Its not a deal breaker but it would be great to have.

Single Extension Repository

One of the great parts about PHP is the large number of high quality plugins and modules that you can download and instantly expand the PHP language to support all sorts of technologies and systems. The problem is that they are housing in two different extension repositories: PECL and PEAR. While they use the same package structure there really isn’t any reason that I can tell to have two. To me it just creates confusion for newcomers and inexperienced developers. Lets drop the separate repositories and and create one uniform repository to house all of those great extensions.

So that is my short list on things that need to be fixed in PHP for it to continue to compete against languages like Java, C# and Python. Feel free to disagree and comment below. If you have a suggestion for other features that should be added/changed/removed, let me know. I welcome a good discussion. 🙂

Why I shouldn’t Buy Train Tickets – Part 4

December is here and so is November’s results. Of the 36 possible times my train ticket could be checked, it was only checked 9 times. One way tickets are still $2.25 USD so if I only bought one way tickets, it would have cost me $20.25 USD. This means I could have saved $39.75 USD by not buying a monthly pass.

I have decided to run the experiement through the end of the year. I figure 5 months is more than enough data to reasonably conclude whether or not I should buy train tickets. Stay tuned!

Why I shouldn’t Buy Train Tickets – Part 3

I have October’s results for my train ticket experiement and the . Of the 45 times I rode the train this past month, my ticket was only checked three times! At $2.25 USD a one way ticket, my three tickets would have costed me $6.75 USD. That means I could have saved $53.25 USD if I did not buy a monthly pass.

I am beginning to wonder if I am somehow a factor in all of this. I don’t take my ticket out unless I am asked to display it. I am thinking that because I am not waving my pass around at the first sight of a conductor, that the train staff thinks my ticket has been checked already. That is not acceptable to me since it is not my responsibility to make sure my ticket is checked. That is the train staff’s responsibility and I am not going to do their job. I will see if next month continues the streak of no checks.