Archive for March, 2007

Jira client

Wednesday, March 28th, 2007

Jira desktop client

2Paths Bonspiel

Friday, March 23rd, 2007

Tuesday March 20th saw the 2Paths team pack up their Java code and MacBooks, and head to the Marpole Curling Club in south Vancouver for an afternoon of rocks, brooms, pebbles, and yelling.

Photographic evidence of the exploits was collected for insurance purposes:


Peter and Judi try to blind everyone with the whiteness of their teeth, while Trevor proves to us that moonwalking is still a relevant dance move.


This curling rock was both red and blue and moved and spoke occasionally. We decided to never trust the spoils of Lorill’s wild mushroom picking ever again.


Trevor and Gord take a break from the high-society sporting event to discuss sailing.


Judi and Tricia take a break from the high-society sporting event to discuss why Garrett ate all the onion rings.


Chico contemplates why Canadians are impressed by such strange activities, while Gord reminisces about Nova Scotian donairs.


The ladies laugh at their only male team member and his lululemon curling pants. Shan screams “the west-coast was supposed to be more tolerant”, then disappears into the bathroom for 10 minutes of cathartic sobbing.


Garrett passionately gets into the game. I didn’t have the heart to tell him that he was actually on the red team.


We suspected that this kid had a little too much to drink, so we made him “walk the line” - but it turned out that he was ok to drive.


Fed up with team incompetence, Trevor tries to move rocks using the power of his mind.

In fine curling tradition, the team finished off the day with indian fushion cuisine at a trendy Vancouver eatery on south Granville.

Fun was had by all, and we managed to damage the ice only once.

It’s Not All About The Loonie

Friday, March 16th, 2007

Come one day last December, an illustrious day in the UK (i.e. rainy and miserable), I had my first heart warming conversation with Trevor, our PM at 2Paths. I had just come back from traveling for 12 months around the globe. Some might say I wasn’t in the mood to talk shop, but my mood much improved by the time our phone conversation had ended. It was my first work prospect since arriving back. It proved to be the first and the only one I was interested in, as a month or so down the line, I confidently got on a flight over to Vancouver and eagerly started my new job in the quirky neighbourhood of Gastown, where the 2Paths offices are located at.

The question remains (trust me, I get asked this a lot!), why did I pick Vancouver over anywhere else, and in all intents and purposes why 2Paths? The simple answer to both is that I got a good vibe. That’s the kind of person I am, or which I found myself becoming after my year’s travel. Motivated by instinct, and happiest when surrounded by people who share my mentality. At 2Paths, I have become accustomed to certain buzzwords, such as “thought leadership” and “agile development”. The difference here is that they signify something. More than that, it’s what we strive for.

Bottom line? I may not be making as much money as my tech buddies in London, but I’m having heaps of fun doing what I love, in a place I’m fast growing to love :)

Daylight Savings Time changes

Friday, March 9th, 2007

What is DST?

Daylight Savings Time (DST) is an adjustment made to the local standard time, allowing people to make the best use of daylight during the different seasons. The mnemonic device “Spring ahead, Fall back”, refers to how one should adjust a clock to correctly navigate the move to and from DST.

New start and end dates

As an energy-saving move, the United States extended their DST by four weeks, requiring less artificially-generated hours during business hours. Most of Canada and Bermuda followed suit to keep in synch with their neighbour. Starting in 2007, DST will begin two weeks earlier, on the second Sunday in March, and will end two weeks later, on the first Sunday in November.

Impact on software

In order correctly represent the time, and to make date/time calculations, your software will need to have the DST rules internally coded. This is a well-understood issue, and your current system should seamlessly handle the adjustments required to accommodate DST. However, unless you have a very recently created system, some aspects may not refer to the new start and end dates. If this is the case, in the four new weeks of DST, the correct current time may not be represented by your system, and time span calculations for dates that cross on or more of the DST transition dates may be incorrect.

Risk assessment

Before making a change to your system, determine whether the system will be affected by the new daylight savings time dates. If it does not rely on calculating, storing and displaying date/time values, you might not need to make any change to your system, even if it does not been recently updated.

If you determine that your system will be affected, make an assessment to ensure the impact is sufficient to warrant making the change. What is the cost to your business to have incorrect time and/or date/time calculations for the period, versus the cost in bringing your system down to apply the required changes? Do you have any system upgrades already scheduled, during which you could apply updates to revise the DST rules, gaining two birds with one system outage?

Making the change

Once you’ve decided you need to make the upgrade, you will need to understand your system, to determine which portions will need to be updated. At 2Paths, we focus on J2EE web applications using Postgres databases. For such systems, the operating system, Java Runtime Environment (JRE) and database are all candidates for upgrades. The latest versions of each have the new DST rules are in place, and once these have been added, your system should handle the new Daylight Savings Time dates correctly.

Del.icio.us link roll

Friday, March 2nd, 2007

Instead of spamming our company emailing list I’ve been tagging links in del.icio.us using the for tag to share links for:2paths. I added this into our default theme so they’ll show up on this blog in the sidebar. And of course you can subscribe to the rss feed.

Once del.icio.us fixes the private rss page for:2paths you’ll be able to subscribe to it in your rss aggregators.

[UPDATE 20070310] It was fixed, you can subscribe to it here: for:2paths

Advice for the new Vancouverite

Friday, March 2nd, 2007

You know that corner of your apartment that, due to convection and warm currents and static and whatnot, attracts all the dust bunnies from the rest of the floor? Vancouver is sort of like that.

I’m not saying that Vancouver is full of refuse, it’s not; it’s full of wonderous people and things, but it seems that most people you come across are from somewhere else in Canada.

As a newly initiated Vancouverite (within the space of a week I made it up to a mountain and managed to get punched in the head; I feel like I’ve finally been accepted). I thought I’d collate some of my observations to help anyone who’s newly arrived here or is thinking of making the move. I’ll expand this list as more things happen to me.

  • The Bus - It costs $2.50 to take the bus - but you can get this little booklet thing from 7/11 and other stores that contains 10 rides for $18. So that’s a savings of $4.50, which over time adds up and can be spent on one of the many wonderous vices this city offers (a Guide to Vancouver’s intersections will be posted one day). After months of breaking $20 bills by buying superfluous packs of Big Red, I figured this out and have been a lot happier since.
  • Eastern Delights - If you don’t like japanese food or have some kind of sushiphobia, this is the place to get over it. The way people talk about it and make plans, you’d think it’s not a meal, it’s an occult ritual of some sort. There is a lot of sushi here that ranges from traditional to totally made-up stuff that only exists in Vancouver. When the Olympics swing through town I can’t wait to try a Two-Man Luge Roll (don’t read deeply into that).
  • Scenes and Cliques - There are quite a few established social groups here, so usually what happens is new Vancouverites form their own, or if you’re lucky you end up wedging yourself into one like a bloodthirsty tick. A lot of these groups are based on some kind of music, art, activity, sport, or illegal leafy substance. Choose wisely because these are the people you will form lasting bonds with and possibly whose floors you will pass out on.
  • Coffee shops - There are coffee shops everywhere. Coffee culture is serious business here. At any given time if you peek into one of these caffeine-dens you’ll see armadas of Macbooks and interesting people who’ve parallel parked their shopping carts in front of the shop. These places are great to take a date because if things go bad you can make a quick getaway down the street in one of these carts and make quite a killing down at the bottle-return too. Don’t worry Romeo, things are looking up!
  • Neighbourhoods - Kits, The Drive, the West-End, Yaletown, etc… You’ll hear these names a lot and all you have to remember is that they all contain at least one Starbucks.
  • London Drugs - This store has nothing to do with London. It’s a pharmacy that sells giant TVs. I’m not trying to promote them or anything, just warning you of their schizophrenic nature. Oh yeah, pharmacies here in BC still sell tobacco products, which is shocking if you’re from other Provinces.
  • City Ambassadors - You see them out on the street especially in the downtown area. They are extremely friendly and are there for you if you need some help or information.
  • Snow - If there’s at least 1/2 an inch of snow on the ground when you wake up in the morning, you don’t have to go to work.
  • Stuff - Outside of work/school, most people are “into” something. There are a lot of athletic and artistic activities going on, and it’s good to get involved in at least one thing. Don’t get cable, you’ll regret it.
  • Relaxing - Vancouver is relaxing. Just let yourself fall gently into the pile of dust bunnies, and you’ll be fine.

One Headache to(o) Many: Hibernate’s beef with multiple bags

Thursday, March 1st, 2007

Relationships are hard. Especially when there’s One that’s intimately connected to a whole list of others.
But go figure, it’s totally acceptable in software. And you don’t have to wear silk robes and grease your hair.

For some reason I encountered this funky error when starting up two web applications on the same Tomcat:

org.hibernate.HibernateException: cannot simultaneously fetch multiple bags
at org.hibernate.loader.BasicLoader.postInstantiate(BasicLoader.java:66)
at org.hibernate.loader.entity.EntityLoader.(EntityLoader.java:75)
at org.hibernate.loader.entity.EntityLoader.(EntityLoader.java:43)
at org.hibernate.loader.entity.EntityLoader.(EntityLoader.java:33)

I wouldn’t see this error if either web application was started independently.

Why? Who knows. I’m sure it had to do with the seemingly isolated processes fighting over some shared piece that’s not totally intuitive.

Anyhow, after minutes of making a bowl of cereal, firing off rounds of Nerf ammunition, and trying to fit my head into the dishwasher, searching around the internet lead to discussions of this error occurring during migrations from one minor-release of Hibernate to another.
It has something to do with Hibernate becoming more pedantic (apparently for our own good) with how it manages OneToMany relations when using Lists as “bags”.
There is a complex answer that comes with pictures of grids and numbers along with words like “cartesian” and “sledgehammer”, but the point is something I was doing sucked.

So the solution is to either use Sets when order isn’t an issue, or to explicitly manage indexes in your Hibernate setup.

This is the solution I went for because it seemed the least invasive:

In your parent class (i.e. the one that has a List), annotate the accessor this way:

@OneToMany(mappedBy=”*whatever parent field*”)
@IndexColumn(name=”INDEX_COL”)
public List<*whatever child class*> get*whatever child class*() {
return *your list*;
}

In your child class (i.e. the class that is the owning side of the relationship), add the following bean methods and property:

private int position; // is this really required? who knows

@Column(name=”INDEX_COL”)
public int getPosition() {
return this.question.get*parent class*().indexOf(this);
}

public void setPosition(int index) {
}

This should be all that’s required.
But note, the column name (in my case INDEX_COL) is totally up to you; “position” is a reserved keyword in the database we use, but if it works for you, hey - go wild.

You might not see the direct impact of managing order explicitly like this, but I gather it’s somewhere close to the root of strange lazy-loading errors and duplicate results in Lists. It never hurts to be a little more explicit.
Except in situations where silk robes are involved, keep that to yourself.