Saturday, September 19, 2009

JavaScript Date Library Advice?

I've been doing some work recently with the Google Maps API, something I'll try to describe in a future post.  While doing that work, I've realized that I need (or would at least find very handy) a JavaScript library that provides more sophisticated date/time support than the standard JavaScript Date.  Searches have led me to two libraries which look plausible.  Datejs takes the approach of ornamenting the existing Date class with numerous additional functions.  I really like the coding style demonstrated in their tutorial, which is a point in their favor.  In contrast, Fleegix provides a Date class independent from, but interface-compatible with the standard Date (yay for duck-typing!).  They clearly view timezone support as critical for Dates, which I'm very happy to see, since dealing with them and daylight/standard time can be a real pain.  So, from a functional standpoint, both libraries look pretty strong.  I'm concerned that they're not particularly active, neither having any check-ins in 2009, but perhaps it's because they've been around for a while and work well already.  I can't say I found this discussion in the Datejs group very encouraging. :(

Any thoughts?  Anyone out there used either of these libraries or another one they'd recommend?

Update (May 26 2010): I just looked again at Fleegix and have some excellent news!  The projects are now hosted on GitHub and the timezone-js project has some updates from April of this year.  I'll have to give it a closer look soon.

Thursday, September 17, 2009

Subversion – Odd Problems and Funny Solutions

I've been using Subversion and TortoiseSVN since 2005.  They're both great technologies and I'm very happy they exist.  However, I think anyone who's been using them for a while has periodically encountered some weird problems and has had to come up with a few strange (and even funny) solutions.  I certainly have.  In this post, I describe one example.

Earlier this week, a developer I work with saw the following in a TortoiseSVN window when he ran update on a working copy:

Error: Couldn't do property merge 
Error: Unable to make name for 'C:\tempfile'

Not knowing how to proceed, he asked me for help.  We tried my typical first approach: running cleanup via Tortoise on the working copy.  That didn't fix it, so we ran a "Check for modifications" and discovered that there were a few temp files scattered through the directory tree.  We deleted those and tried again.  Still the same message, so on to Google.  I searched for various permutations of the error messages, but was unable to find anything other than code check-in comments for Subversion itself, which appropriately enough uses a Subversion repository.  For some reason, I wish I remember why, we next tried updating just one child directory within the working copy.  It worked!  We tried updating all the other child directories and those worked as well.  So, that suggested that there was something wrong with the Subversion metadata, but only at the top level.  We went into the .svn directory and started browsing through the files.  When we looked at the entries file, we noticed a few lines starting with "incomplete".  I tried moving the entries file out of the .svn directory to a totally different location in the file system, hoping that when we updated or ran another cleanup, the file would simply be recreated.  Unfortunately, with that file missing, the directory was no longer considered by Subversion to be a working copy.  Disappointed, I moved the entries file back into .svn and started thinking about what to do next.  On a whim, the guy I was helping tried updating again and it worked!  Somehow, changing the directory from a valid working copy to an invalid one and back again was enough to fix everything.  Who knew?!

Have any good Subversion/TortoiseSVN troubleshooting stories or troubleshooting tips of your own?  Please leave them in the comments.

Tuesday, August 25, 2009

Curious Concept's Excellent JSON Pretty Formatter and Validator

I just wrote a bit of code using Groovy HTTPBuilder to fetch and parse some JSON content to help answer someone's question on StackOverflow.  When trying to pull some interesting data out of the JSON to display, I realized that it would be much easier for me to understand the structure of the JSON if it were pretty-printed (or pretty-formatted).  When I googled for "JSON pretty format", I found a helpful blog entry pointing me to Curious Concept's JSON Formatter (& Validator).  It's a simple online tool that allows you to paste in either a URL pointing to JSON content or the content itself and display it in either compressed or readable form.  It might not have been very hard to code, but it's extremely useful.  Thanks Curious Concept!

Update: I'm trying out the JSONView Firefox plug-in.  So far it seems to work pretty well.  Even so, I expect I'll continue to use Curious Concept's tool for a while, since I spend a fair amount of time in Chrome.

Friday, August 21, 2009

Merger Madness & One Sample App To Rule Them All

VMware --- SpringSource --- /---G2One
\---CloudFoundry
Terracotta --- Ehcache
Oracle --- Sun


With all the mergers and acquisitions happening in the Java world, I thought I'd suggest a sample app someone could build to bring them all together.

Here it is: a Grails app using an Oracle DB with distributed caching provided by Terracotta and Ehcache, all running in a VMware cloud, with deployment and management handled by CloudFoundry.  I think that covers all the bases.  I have no idea what it will do yet, but let me know if I've missed anything. :)

Note: I actually have a lot of respect for all the technologies and people involved, I'm just feeling a bit overwhelmed with all of the recent consolidation!