Archive for the ‘Development’ category

Greasemonkey

February 18th, 2011

Greasemonkey is an extension for Firefox that leverages javascript to modify the look and functionality of a page. At first glance this tool looks like a neat toy. However, this tool came in quite handy at one of our clients recently.

Our client was tracking their daily status on a whiteboard in a conference room. A corporate memo was sent out banning the exclusive use of whiteboards for teams. As a result we turned to our web-based tracking tool. Unfortunately their whiteboard equivalent was clunky and inadequate. I spent a few hours putting together a Greasemonkey script that altered the look of this page to mimic our old whiteboard. These changes helped ease this transition.
» Read more: Greasemonkey

Transactions Our Invisible Allies

January 28th, 2011

Transactions are an essential component in enterprise software development. When your application works properly you rarely think about transactions. However, when things go wrong debugging transactions can be quite challenging. Instead of being reactive we need to proactively test our transactions.

When I first got into the software industry I was a manual tester. Those years of repetition and tedium drove me to the world of coding and automation. As a software developer I am committed to automated testing. If a feature is worth coding it is worth testing. Automated tests have positioned me to be proactive instead of reactive. Nevertheless, transactions are quite challenging to test.
» Read more: Transactions Our Invisible Allies

Javascript functions for creating a read-only view

December 15th, 2010

I’m sure you’ve all been there before. After months of creating page after page of crud screens, you’re now asked to create a read-only view of everything. I usually see this implemented with setting the readOnly attribute on every field to a variable that indicates whether or not the screen is editable. While this works, I don’t like it for three reasons:

  • I would not be confident that the readOnly value will be correctly added to every field that is later added to the application.
  • I would not trust the person originally implementing this change to modify every input the first time around. Chances are a couple will be missed.
  • I would hate to have this task assigned to me and I would hate even more giving it to someone else. “Here, go add this flag to every input on these forty screens…”

Below is my latest attempt at a general solution to this problem. Caveat Emptor – I’ve never deployed this code to a production app and I fully expect to be bit by some huge limitation when/if I ever do. Consider it food for thought…
» Read more: Javascript functions for creating a read-only view

Exploring Design Patterns in the JDK

November 8th, 2010

Design Patterns are software design solutions that can be applied in our daily software development to help us develop code that is flexible, resilient to change and easily understood (when you are familiar with the pattern). The JDK APIs employ patterns in several areas. So even if you aren’t familiar with patterns if you’ve programmed in Java, you’ve been developing against APIs that have been built using patterns.

» Read more: Exploring Design Patterns in the JDK

Avoid merge hell when committing from Git to a Subversion repository

October 6th, 2010

Previously (I sound like an episode of desperate housewives!) we saw how we can easily commit an existing Git repository into Subversion. That was great and we can commit changes to our git repository and execute git svn dcommit all day long to send the changes up to Subversion. Now things get a little hairy when you throw a second developer into the mix who is committing to the same Subversion repository.
» Read more: Avoid merge hell when committing from Git to a Subversion repository

How to commit an existing git project into Subversion

September 26th, 2010

In my last post I mentioned how Git’s stash feature finally convinced me that it made sense in my subversion world. Well, once I was well underway on my new project, I’d reached the point where I was ready to commit version 0.1 to subversion. Googling for how to commit a Git project into Subversion will lead you to a few resources. The one that was spot on with a minor wrinkle was this post. I’ve taken what Brandon posted there and condensed it here with the update for the –root option for the rebase command.
» Read more: How to commit an existing git project into Subversion

One good reason why Git makes sense

September 16th, 2010

When I first heard about distributed version control systems and Git about a year and a half ago, I was very much a Subversion user both at work and at home. I knew how to setup Subversion, it’s ACLs and make it available over http via Apache. You could say I was committed (pun intended). And then all this noise about DVCS and in particular Git and I was wondering why in the world would anyone give away control over their code repository. If I wanted to work disconnected from the network (say on the airplane like everyone seemed to want) I would just work and worry about checking things back in when I connected to the network next.

In spite of being a non-believer I stayed with Git and what seemed like the hype around it. I read up on it and I even got myself an account on github and setup a few projects there. Git seemed interesting but it wasn’t really solving any problems for me that Subversion wasn’t already. And then I had my first ah ha! moment yesterday.

» Read more: One good reason why Git makes sense

Google Analytics Data Export API – Part 1

March 30th, 2010

When Google exposed its Data Export API, it endeared itself closer to developers and to customers of Google Analytics. Data Export API allows us to develop client applications to retrieve data from existing analytics profiles of authorized users.

How does it work?
The Data Export API provides read-only access to all available analytics data. Any data that is displayed in the analytics web interface can be accessed through this API. Nice isn’t it? You can get all your analytics data, for all your monitored websites and use it as you please.

» Read more: Google Analytics Data Export API – Part 1

Musings of a SpringOne 2009 Attendee – Day 4

March 10th, 2010

This is the last and final part on my SpringOne 2009 experience. It’s late catching up to the 3 earlier posts but it’s here now. This post summarizes the sessions I attended from day 4 and wraps up with a summary of my take aways. If you want to catch up here are the three earlier posts:

  1. Musings of a SpringOne 2009 Attendee Day 1
  2. Musings of a SpringOne 2009 Attendee Day 2
  3. Musings of a SpringOne 2009 Attendee Day 3

Read on for day 4.

» Read more: Musings of a SpringOne 2009 Attendee – Day 4

Rendering Global t:messages After Redirect

March 8th, 2010

A common problem when working with JSF is getting global info messages  via <t:messages globalOnly="true"> or <f:messages globalOnly="true"> to display messages set in the previous request when you have a <redirect/> in your faces-config for a particular page You will not see your <t:messages> that are set on the previous page.

The Problem

For instance, say you have two pages – page1.xhtml and page2.xhtml. In your faces-config.xml, you will have 2 entries.

» Read more: Rendering Global t:messages After Redirect