I have no special talent. I'm only passionately curios - Albert Einstein
February 02, 2010
Developing jsonp Services for jQuery
Posted by Dave Malone
in Javascript,
Java,
Technology
The documentation for successfully developing jsonp services for use with jQuery is not very straightforward. The examples consist of a number of ajax calls using jQuery's .ajax and .getJSON functions, but until recently did not contain any examples of performing remote calls to jsonp services. If you read the documentation for using the jsonp dataType with their ajax function, you will see a link to an article by Bob Ippolito outlining the first proposed jsonp format, and how to use it. The format documented on Bob's article is not valid when used with jQuery's functions (jQuery doesn't error out, it just doesn't do anything at all). Their most recent example of using the new Flickr jsonp API sheds light on the format that jQuery really expects for json returned by remote jsonp services.
Continue Reading
November 16, 2009
Unit Testing
Posted by Dave Malone
in Java,
Best Practices
Unit testing not only ensures that application code runs the way the developer intends it to, but can also provide a sort of guide for other developers. Unit testing helps to make an application more robust - running existing unit tests assists in revealing impacts changes may have on an application, assuring against defects. Any applications that don't have unit tests are considered Legacy Applications, and are usually more expensive to change, and have experienced more defects, adding into the break/fix cycle in production deployments. I prefer to implement unit tests using JUnit, since there is plenty of extensions and frameworks that support writing and running JUnit tests. EasyMock is a JUnit library that allows developers to unit test code which contains many dependancies, and provides a means to focus on actual unit tests instead of functional or integration testing. An excellent Unit test code coverage tool exists as a plugin for Eclipse, EclEmma, which provides package level, class level, and line by line statistics of unit test coverage in Java classes. The Spring Framework provides many utilities to unit test Spring configured code as well. Here are some example unit tests
Continue Reading
November 06, 2009
Tools of the Trade
Posted by Dave Malone
in Java,
Technology
When you begin your journey as a developer, either fresh out of college, or as an individual experimenting with technology, you'll soon discover a plethura of tools available to assist you in your development. I've encountered a lot of tools in my few short years of experience, but few remain in my arsenal today. Those few have proven to be the best, with the most available features, active open source communities, and fewest bugs.
Continue Reading
November 04, 2009
Character Encodings: Get rid of the question marks
Posted by Dave Malone
in Hibernate,
Java,
Configuration
Have you ever been to a web site and seen question marks where you would expect to see a single or double quote (even other characters)? Have you had to deal with the problem yourself? It was very frustrating for me to resolve this problem. After a lot of research, and configuration changes, I finally have it pinned down.
Continue Reading
November 03, 2009
Automate your Twitter Feed in Java
Posted by Dave Malone
in Spring,
Java
I set out to automate the Twitter feed for the social networking site I developed, MyBuckStory.com. The site is written in Java, and I wanted to continue using bit.ly to shorten my URLs, and the custom format I had come up with to use as a Twitter status update for new stories posted on the site.
I was pleasantly surprised to find an open source library out there already, called Twitter4J. The library was quick and simple to get myself up and running. The closest thing I could find for a Java library for bit.ly was a JSP tag library. I wanted to be able to run this in the service layer of my application, so I began developing my own custom solution.
Continue Reading
July 28, 2009
Creating Wireframes
Posted by Dave Malone
in Technology
Wireframes are an effective way to communicate intended design to your business stakeholders. They are invaluable because they allow your users to decide if the application will be useful and usable in the way they need it to be, without developing the entire application. Developers love this because it helps to avoid scope creep, and it helps to produce an application even the most insatiable users will enjoy.
As a developer, I try to throw design concerns over the wall to a UI or usability specialist. I often find myself needing to prepare a quick set of screen mockups or wireframes anyways by drawing one up on a piece of paper or a whiteboard. I haven't convinced myself to use any of the software that's available to me because of price, or because of the lack of usability (yes, wireframe software can lack even common sense usability).
I've recently evaluated a few different wireframe technologies, including the Pencil plugin for Firefox, Axure RP Pro, and WireframeSketcher.
Continue Reading
July 14, 2009
Ant: Setting Your JVM Memory Options (-Xms -Xmx, etc.)
Posted by Dave Malone
in Java,
Configuration,
Technology
Ant provides an option to allow you to set your default JVM memory options globally. On Windows, you must create a bat file titled antrc_pre.bat under your %USERPROFILE% directory. Ant will read in this file to set the ANT_OPTS values before executing your build file. Here is the contents of my antrc_pre.bat:
set ANT_OPTS=-Xms512m -Xmx1024m
April 10, 2009
getResource and getResourceAsStream
Posted by Dave Malone
in Java,
Technology
This is so basic but it's also one of the most frustrating things to deal with in Java. On Windows, I was trying to load a file in a TestCase within my IDE. I know the way to do this is to use this.getClass().getClassLoader().getResource() and this.getClass().getClassLoader().getResourceAsStream(). I spent more time than I should have had to in order to figure out how to get this to work correctly. All examples and Javadocs I encountered stated that the solution should work in a completely different way. And there are tons of postings around the net with people asking for the answer to this problem, so here it is.
Continue Reading
February 08, 2009
More Upgrades
Posted by Dave Malone
in Daily Life,
Technology
Developing my own CMS with an integrated blogging system has been an exciting experience so far. It's been a lot of meticulous planning and a significant development effort, combined with multiple redesigns and refactors along the way. Recently I've been focusing mainly on developing blogging features. The features I've finished with the last two releases include categorization of blog entries, archive functions, pagination for browsing the articles by category and within the archives, and the ability for users to leave comments on blog entries. I've also started to focus on SEO for all aspects of the system, providing the users with the ability to enter the Meta keywords and description for each page, and adding reasonable defaults in their absence, like taking the 'parent' pages keywords and description. The unseen pieces developed for all of those features include the administrative functions. Anyone who uses Wordpress is familiar with the easy to use interface where you can manage any of your content. Recognizing a usable system and developing ones have proven to be very different things.
February 05, 2009
Completely Reverse Engineer your DAO Layer
Posted by Dave Malone
in Hibernate,
Spring,
Java,
Configuration,
Technology
I've been using Hibernate for about three and a half years now. When I began using Hibernate, I was hand-coding the Hibernate mappings and DAOs. The work was tedious, error prone, and time consuming. I've spent the time learning how to use both Middlegen and Hibernate tools to completely reverse engineer your Hibernate mapping files, the hibernate.cfg.xml file, the Model (beans), and all of the DAOs using a combination of Velocity and Freemaker templates to guide the code generation. I even went a step further and integrated Spring's HibernateDaoSupport into each of the DAOs.
Continue Reading
February 03, 2009
Using DBUnit to transfer data between databases
Posted by Dave Malone
in Java,
Configuration,
Technology
At my current client, I've ran into the need to have the ability to transfer data from our production database to our lower level environments for QA and other user testing purposes. One of the other consultants here mentioned a tool called DBUnit, and he said he thought it might have the capabilities I was looking for.
DBUnit has turned out to be a great tool for performing database tasks with Ant. I was able to set up an Ant task and create a flat file (XML Format) data dump of the entire database. The task was very straightforward, called Export, and has a quite a few options for generating the exported database file.
Continue Reading
February 01, 2009
Recent Movies I've Enjoyed
Posted by Dave Malone
in Daily Life
I would have to say that I enjoy movies which are outside the canon. I like movies which make me think, make me wonder, and are normally "out there". A few movies I've enjoyed recently are:
- Southland Tales
- The Nines
Both of these movies offer an incredible story line, as well as what I consider class A acting.
January 31, 2009
This tree grows some serious wood
Posted by Dave Malone
in Jokes,
Daily Life

My parents neighbors have a queen palm in their front yard. Until recently, they didn't know why the guy who sold the tree to them, Mr. Kim, called the tree a 'screw palm'. Surprise surprise, this tree's roots grow out (yes, this is completely natural) in a very curious fashion:
Continue Reading
January 30, 2009
Wordle
Posted by Dave Malone
in Technology

I was reading my friends blog, The Future Buzz, and I ran across something really cool. It's called a Wordle, and is a collection of words or the most common words from your website built using your RSS feed. Wordle.net has a really slick feature-rich Java Applet which can be used randomize and style your Wordle.
You can see my wordle built from my RSS feed to the left. I just thought this was something fun that I would share since I've never seen it before.
January 29, 2009
Upgrades Round 2
Posted by Dave Malone
in Technology
Time for another set of upgrades. I've been working on implementing a plethora of new features for Stratosphere, and now I'm finally getting the chance to integrate it into my site and deploy it to my server. Although I am still working on upgrading the system without completely impacting the content. I'm still stuck copying and pasting the content from the old site into my new one.
Continue Reading
October 07, 2008
They don't make 'em like they used to
Posted by Dave Malone
in Daily Life,
Technology
This year almost every one of my electronic devices has burnt out on me. I was very lucky that each one was still under the manufacturers warranty, because I never buy the extended warranties at Best Buy or Circuit City. It's nice that the devices were covered under the manufacturers warranties, but it's upsetting that all of these electronics are failing so quickly. I think it speaks volumes about the standards these companies are willing to commit to.
Continue Reading
September 19, 2008
Extracting Images From a Word Document
Posted by Dave Malone
in Daily Life,
Technology
Have you ever tried to extract images from a Word Document? It just doesn't seem to work. After searching the internet, I found plenty of articles which claim that it can't be done. I started playing around with a few techniques, and I've found a failsafe way to extract images from a Word Document.
Continue Reading
September 09, 2008
Recent Move to Minneapolis
Posted by Dave Malone
in Daily Life
As I mentioned earlier, I recently moved to Minneapolis. I rented a Uhaul, and asked three of my friends to help me move. I had reserved the largest Uhaul (a beastly 26 footer) available, and I was convinced we wouldn't need a truck that large. To my dismay, we actually own enough stuff to fill the entire truck, and we still weren't able to fit everything into the truck.
We were exhausted after spending nine hours moving furniture and boxes to the third floor. I was pushing myself to the limit, spending every last ounce of energy getting all of my things moved into the apartment. I saved my favorite item for last - my 50" Samsung Plasma TV. My best friend and cousin went downstairs to get my TV for me while I was getting some final items up to my apartment. They took an unusually long amount of time, and I became concerned. I went to see what was going on, and found them walking towards me a short distance down the hall from my door. They both stopped smiling once they saw me, and immediately said "we have good news, and bad news". I looked down and noticed the only thing they had on the moving cart was my prized television set. My stomach turned and my heart dropped. A humongous crack ran rampant throughout the screen.
Continue Reading
September 03, 2008
The Gimp
Posted by Dave Malone
in Technology
A lot people are under the impression that Photoshop is the only available tool for designing digital art and graphics. I'll admit that I'm not a professional designer whatsoever, but I like to try to create designs and graphics on my own. I really didn't want to fork out the cash for a Photoshop license, especially since I'm only doing this as a hobby. A little known tool (to most) that is free, and in my opinion just as powerful as Photoshop, is the Gimp. The great thing about the Gimp (besides the fact that it's free) is that you can download some (if not most) components for Photoshop and install them for use seamlessly. I was able to download gradients and brushes which were created for Photoshop and use them within Gimp with no problem.
Continue Reading
September 01, 2008
Moving to Minneapolis
Posted by Dave Malone
in Daily Life
My fiancee and I have spent all weekend packing our place in preparation for our move to downtown Minneapolis. We spent all day today taking down dozens of pictures and other wall decorations, packing boxes, and moving stuff to our storage unit. We still have a lot more to pack, but we're looking forward to the move, regardless.
The tradeoffs are between our current apartment - a two bedroom, with a two car attached garage and a back porch with a bit of a private back yard - and our new apartment in downtown Minneapolis, without a private garage, back yard, or back porch. But, it beats sitting in traffic for hours a day, since we both work in downtown Minneapolis and commute into the city.
August 09, 2008
Upgrades
Posted by Dave Malone
in Technology
Like most service professionals, I find myself putting off my personal projects for way too long. So, at long last, I'm pleased to announce that I've released a new version of my site. I designed and developed my site using open source technologies, including the Gimp, Nifty Corners, DWR, and jQuery.
August 08, 2008
DWR 2 + WebLogic 8.1 SP 5
Posted by Dave Malone
in Bug,
Java,
Technology
Apparently, there is a bug with DWR 2 when running in WebLogic 8.1. This bug may appear in all server environments running versions of Java less than 1.5, since it appears to be related to version checking built into DWR which doesn't work. The stack trace leads up to a NullPointerException from the java.util.Hashtable class (which doesn't really help you solve the real problem):
Continue Reading