Dynamic component IDs for JSF

March 5, 2009

What’s that you say? Dynamic component IDs for JSF? Impossible! The JSF specification clearly states that the “id” attribute must be a hard coded value. Well I say screw that. There are some times where I want to use a variable to define the ID. Like today at work I came across this exact situation. See I made a template for a specific page and used some t:aliasBean tags to set variables for template. But of course this failed when I wanted to use a variable for the id of an h:form component.

The solution… Far simpler than I thought. All it took was a simple custom component that takes the variable and has its’ renderer set the id. Interested? Read on…

There are several ways to do this, but really you just need to make a wrapper component that takes some attribute as a value binding. Then in the component’s renderer grab the first child element and set its ID to whatever value is pointed to by your value binding. So rather than write a component from scratch, all we really need is a something with a value binding so why not just use an existing ValueHolder component like UIOutput. At work I actually made a new component that extends UIOuput and left the class body blank in case I later want to change things. But for this example let’s just use UIOutput as is. We’ll still need a tag class and a renderer class.

// tag
package com.jsfutils;
public class DynamicIdTag extends UIComponentTagBase {
  public String getComponentType() {
    return "com.jsfutils.DynamicId";
  }
  public String getRendererType() {
    return "com.jsfutils.DynamicId";
  }
}

// renderer
packacge com.jsfutils;
public class DynamicIdTagRenderer extends Renderer {
  public boolean getRendersChildren() { return false; }
  
  public void encodeBegin(FacesContext context, UIComponent component) 
                                         throws IOException {
    
    if (component instanceof ValueHolder) {
      // get the dynamic value and validate it    
      String dynamicId = (String) ((ValueHolder)component).getValue();
       
      if (dynamicId == null || dynamicId.equals("")) return;

      // find the first child component
      List children = component.getChildren();
      if (children.isEmpty) return ;
    
      // set the id
      UIComponent firstChild = (UIComponent) children.get(0);
      firstChild.setId(dynamicId);
    }
  }
}

// faces-config
<component>
  <component-type>com.jsfutils.DynamicId</component-type>
  <component-class>javax.faces.component.UIOutput</component-class>
</component>

<render-kit>
  <renderer>
    <renderer-type>com.jsfutils.DynamicId</renderer-type>
    <renderer-class>om.jsfutils.DynamicIdRenderer</renderer-class>
  </renderer>
</render-kit>

// tld
<taglib>
  <tag>
    <name>dynamicId</name>
    <tagclass>com.jsfutils.DynamicIdTag</tagclass>
    <attribute>
      <name>value</name>
      <required>true</required>
      <rtexprvalue>false</rtexprvalue>
    </attribute>
  </tag>
</taglib>

// use in a JSP/JSF page assuming the tag prefix is "jsfutil"
<jsfutil:dynamicId value="#{backingBean.myFormIdValue}">
  <h:form>
    <%-- contents of the form --%>
  </h:form>
</jsfutil:dynamicId>

And there you have it. Dynamic component IDs! When the page loads the form will be rendered with the id specified by the backing bean and of course the actual component ID in the JSF component tree will also have this id.

Advertisements

Using JSF’s managed beans to access constants

December 19, 2008

So I’ve been working on this JSF project for a while. Like most Java projects we have a few constant classes where we keep some constant values (no surprise there). Until now we’ve typically had trouble using those constants in a JSP page as the JSF EL has no way to access any class. You’re pretty much stuck with the managed beans. So often we would just have a method on the managed bean called getConstantValue() which would return the constant value we wanted to use. We had also written some custom components and just set rtexprvalue to true which allowed us to access a constant with . However today I ran into an issue where I need to get some constant values and it didn’t seem practical to have a bunch of getters on the managed bean. I had an idea though. The JSF EL has no real way of calling a method with parameters, but you can access keys in a Map. So essentially this means you can have an JSF EL expression like #{bean.myMap[‘key’]} which will translate into bean.getMyMap.get(key). Looks like we can pass a parameter after all. How do we take advantage of this? Easy really… you just need to create your own Map implementation and do whatever you want in the “get” method.

So now I just need a function to access my constants. I decided that if I want to access a constant called MY_VALUE from a class called Constants easiest way would be to pass a String “Constants.MY_VALUE” and use reflection on the other side to get the value. But then I realized that using reflection would require a fully qualified class name which will make the code look very cluttered and ugly. So instead I decided to keep a Map of class names and their corresponding classes.

    
private final static Map CONSTANT_CLASSES;
static {
    CONSTANT_CLASSES = new HashMap();
    CONSTANT_CLASSES.put("Constants", Constants.class);
}

With this I can pass “Constants” by itself and let the map worry about the fully qualified class name. The disadvantage to this is if I decide to add another constants class I have to change this class too. However realistically it’s not very often that you’ll be adding new constants classes.

Next is the actual get method that will retrieve the value. Reflection is still the way to go here:

 public Object get(Object key) {
	Object value = null;

	String[] asString = ((String) key).split("\\u002e");

	if (asString.length != 2) {
		throw new PropertyNotFoundException(
			"Invalid key format for key \"" + key + "\"");
	}

	Class clazz = (Class) CONSTANT_CLASSES.get(asString[0]);

	if (clazz == null) {
		throw new PropertyNotFoundException("Class \"" + 
			clazz + "\" is not a defined as a Constants class");
	}

	try {
		Field field = clazz.getDeclaredField(asString[1]);
		int mods = field.getModifiers();

		if (Modifier.isPublic(mods) && Modifier.isFinal(mods) 
						&& Modifier.isStatic(mods)) {
			value = clazz.getDeclaredField(asString[1]).get(null);
		} else {
			throw new PropertyNotFoundException("No \"public " +
			final static\" field exists for the key " + key);
		}
	} catch (Exception e) {
		throw new PropertyNotFoundException(e);
	}
	return value;
}

Now I was concerned about the performance of this since reflection has been known to be a bit slower. Although I doubt any significant performance will arise from using this I still thought it would be safer to add some sort of cache to this. It’s a really simple cache. It’s just a HashMap which will store the key parameter and map it to the value retrieved using reflection. So really reflection will only be use the first time a particular constant is used. After that it will just be a get() call on a HashMap. The code for this is almost identical except for the cache part.

public Object get(Object key) {
	Object value = CACHE.get(key);

	if (value == null) {
		String[] asString = ((String) key).split("\\u002e");

		if (asString.length != 2) {
			throw new PropertyNotFoundException(
				"Invalid key format for key \"" + key + "\"");
		}

		Class clazz = (Class) CONSTANT_CLASSES.get(asString[0]);

		if (clazz == null) {
			throw new PropertyNotFoundException("Class \"" + clazz + 
				"\" is not a defined as a Constants class");
		}

		try {

			Field field = clazz.getDeclaredField(asString[1]);
			int mods = field.getModifiers();

			if (Modifier.isPublic(mods) && Modifier.isFinal(mods) 
						&& Modifier.isStatic(mods)) {
				value = clazz
					.getDeclaredField(asString[1])
					.get(null);

				CACHE.put(key, value);
			} else {
				throw new PropertyNotFoundException(
				"No \"public final static\" field exists for the key " + key);
			}

		} catch (Exception e) {
			throw new PropertyNotFoundException(e);
		}
	}
	return value;
}

This is what the full class looks like:

public class MbConstants {
	private final static Logger log;

	// Map to cache retrieved values
	private final static Map CACHE;

	/*
	 Constant classes must be defined here!
	 */
	private final static Map CONSTANT_CLASSES;
	static {
		log = Logger.getLogger(MbConstants.class);

		CACHE = new HashMap();

		CONSTANT_CLASSES = new HashMap();

	}

	/**
	 * An anonymous Map type that will be used to get values from the Constant
	 * classes. The first time a value is accessed it will be retrived using
	 * reflection and stored in the cache. Subsequent requests for the same key
	 * will just come from the cache. Since the JSF EL has no way of passing
	 * parameters to a function using a Map is the next best alternative since
	 * we can do #{bean.map['key'} which translates to Map#get(key).
	 */
	private final Map constants = new Map() {
		public Object get(Object key) {
			Object value = CACHE.get(key);

			if (value == null) {
				String[] asString = ((String) key).split("\\u002e");

				if (asString.length != 2) {
					log.error("Invalid key format for key \"" + key + "\"");
					throw new PropertyNotFoundException(
							"Invalid key format for key \"" + key + "\"");
				}
				Class clazz = (Class) CONSTANT_CLASSES.get(asString[0]);
				if (clazz == null) {
					log.error("Class \"" + clazz + "\" is not a defined as a Constants class");
					throw new PropertyNotFoundException("Class \"" + clazz + "\" is not a defined as a Constants class");
				}
				try {
					Field field = clazz.getDeclaredField(asString[1]);
					int mods = field.getModifiers();
					if (Modifier.isPublic(mods) && Modifier.isFinal(mods) && Modifier.isStatic(mods)) {
						value = clazz.getDeclaredField(asString[1]).get(null);
						CACHE.put(key, value);
					} else {
						throw new PropertyNotFoundException("No \"public final static\" field exists for the key " + key);
					}
				} catch (Exception e) {
					log.error("Unable to find constant value with key " + key);
					log.error(e.getMessage(), e);
					throw new PropertyNotFoundException(e);
				}

			}
			return value;
		}

		public boolean containsKey(Object key) {
			return false;
		}

		public boolean containsValue(Object value) {
			return false;
		}

		public Set entrySet() {
			return null;
		}

		public Collection values() {
			return null;
		}

		public void clear() {
		}

		public boolean isEmpty() {
			return false;
		}

		public Set keySet() {
			return null;
		}

		public Object put(Object key, Object value) {
			return null;
		}

		public void putAll(Map t) {
		}

		public Object remove(Object key) {
			return null;
		}

		public int size() {
			return 0;
		}

	};

	public Map getConstants() {
		return constants;
	}
}

The “immediate” problem with JSF

December 10, 2008

So if you’ve developed with JSF before there’s a good chance you’ve run into problems using the “immediate” attribute. In case you’re unfamiliar with the immediate attribute here’s a quick description. Hopefully you’re already familiar with the JSF lifecycle which looks like this:

  1. Restore view
  2. Apply request values
  3. Process validation
  4. Update model
  5. Invoke application
  6. Render response

Typically you’ll have a form with a few fields. You may decided to add some validation to a field or make a field required. Now when you submit your form if any validations or conversions fail in the process validation phase of the JSF lifecycle you’ll skip straight to the render response phase. The same view will be rendered again and if you use the h:message or h:messages components the validation errors will be displayed. This is a great feature of JSF, but most forms also have a cancel button. However clicking the cancel button will still invoke the process validation and show you validation errors.

Enter the “immediate” attribute. On the cancel button you can specify an attribute called “immediate” and set its’ value to true. What this will do is tell JSF to skip to the invoke application phase right after the apply request values phase. Now we’re skipping over the validation and update phases and so we don’t need to worry about validation errors when clicking a cancel button.

A more complex scenario. This is a problem I faced the other day. I created a form that uses a drop down list as one of the fields. The user will then have an option to add items to the drop down list if the item they are looking for is not there. To accomplish this there is a command link that the user can click which will navigate away from the form. The user can then update the drop down list and return to the form. I’ve used the Tomahawk saveState component on the form page and the page that manages the drop down so that when I come back to the form, any data previously entered will still be there. Later on I added validation to the form and guess what? When I clicked that link to manage the drop down list I got validation errors instead of the page I expected to see. Then I thought to myself, “wait a minute, I just need to use the immediate attribute on that command link… problem solved”… or so I thought. Using the immediate attribute got rid of the validation problem but since I’m now skipping over the update model phase any data previously entered in the form is lost.

I did some searching around and found no easy solution to this problem so I came up with my own… and here it is.

I created an action listener on the bean for the command link which will find all UIInputs in the form and manually call their validator methods. If the data is valid then I call the update method as well. To my surprise this simple solution actually worked on the first try. For now it assumes that all the inputs are direct children of the form however it can be modified to handle all child components. So here it is.

public void saveRawFields(ActionEvent e) {
	UIComponent component = e.getComponent();

	while (!(component instanceof HtmlForm || component == null)) {
		component = component.getParent();
	}

	if (component == null) {
		throw new NullPointerException("component is null, "
				+ "maybe it's not inside a form?");
	}

	FacesContext context = FacesContext.getCurrentInstance();
	List children = component.getChildren();
	for (UIComponent c : children) {
		if (c instanceof UIInput) {
			UIInput input = (UIInput) c;

			input.processValidators(context);

			if (input.isValid()) {
				input.processUpdates(context);
			}
		}
	}
}

For some more info on the immediate attribute check out “How The Immediate Attribute Works”


8 months gone by…

August 4, 2008

Can you believe it’s been that long? It’s gone by really fast for me. I must apologize for not keeping up the writing. I’ve been taking notes along the way so one day I’ll fill in the gaps. But I thought I’d give a little status update.

About 5 months ago I took a short trip back to Montreal courtesy of my employer. It was in order to sort out some paperwork regarding my visa and had to be done in Canada. Maybe 2 or 3 weeks prior to this trip I was thinking of just staying in Montreal. I hadn’t made any friends yet, my job sucked and I just couldn’t figure out what everybody thought was so great about Paris.

It’s been just over 8 months now since I moved here and it is more than likely that I will stay longer than the one year I had planned. Quite a turn of events. But I’m loving this city now. Probably not for the same reasons as that the millions of tourists who pass through. It’s the French lifestyle and attitudes that I’ve become accustom to. Not to mention that I actually have made some friends.

I can sum up the success of my quest for friends by this. I stopped trying to befriend the French! Yes it’s true. I gave up on trying to become friends with French people (well not entirely…). I focused my efforts more on other foreigners like myself. Thanks to websites like http://www.meetup.com I was able to find all kinds of expat groups filled with people like me who meet regularly. This is where it all began. For about a month I was hitting about 3 of these a week. It started off with “Expats Paris”, “Internationals in Paris” and even “Canadian Expats in Paris”. I noticed there were a number of “non-Canadians” at the Canadian meetup which gave me an idea. I started hitting up the American group, the British group, I even gave the Australian group a try. Later telling this story to someone she I sounded like Tyler Durden (Fight Club) and the support groups. Maybe a bit dramatic but kind of true. It kept me out of my shoebox apartment and far from my psychotic neighbor… Yes she’s still here and crazy… I feel bad for that dog. I met all kinds of people that month ranging in age from 20 to 60. Some were great, some were just plain nuts.

The job has been moving along quite nicely. I’ve been working for a pharmaceutical company since January. It’s my second pharmaceutical company now in one year and I still know nothing about the industry. I do computer stuff… The project has been interesting though. I actually have work to do. I don’t just sit around and write these stories (although sometimes that was more fun…).

My French language skills have vastly improved. I used to say French people talk too fast, at least when there were 2 or 3 other people talking at the same time. I would try to follow a conversation, but when one person stopped talking and another one started, I was still translating the first persons’ dialogue in my head. By the time I got that worked out the second person was mid sentence and I was lost. This happened usually during coffee breaks and at lunch. For business purposes there was usually only one person talking at any given time and I could follow that no problem. But nowadays it’s not like that anymore. There is no more conscious translation. I’m kind of on auto pilot now with the French. The words enter my ears and are immediately understood by my brain. My French may not be perfect, but I can have conversations with the fastest of French speakers and not be confused.

I’d definitely say I’ve had a change of personality. Something about living amongst the french. I find them to very pushy and aggressive, while somehow still sounding polite. I’ve taken on some of these skills myself, like queue jumping. See French people don’t like to wait in line. Now this doesn’t apply in all cases. This would never work at the grocery store for instance. But French people tend to be experts at cutting in line. I’d say line-cutting could almost be considered a national sport in this country. I see it all the time at restaurants and various shops.

So recently I took a trip to Italy and I flew easyJet. Now if you’ve never flown easyjet, here’s how it works. There are no assigned seats on the plane. There are boarding groups, and it’s first come first serve for each boarding group. You’ve got the speedy boarding which costs about 10 euors extra, then you’ve got the A and the B. I don’t know what time you need to get to the airport to make the A, but I’m always in the B. Now every time I’ve flown easyJet it’s the same story. The easyJet staff make a boarding call for the speedy boarding group. Everybody rushes the counter and one after another passengers get turned away with a “sorry you’re in group B, speedy boarding only at this time”. Then the poor 1 in 10 who actually paid for their speedy boarding and still have to push through the crowd. So here’s how I handled the situation. I had managed to get a seat right near the gate and I was reading a book. I sat patiently reading my book while B holders were trying to convince the flight attendants (unsuccessfully) to just let them board. Eventually the A group is called, same story though. Still a ton of B holders trying to get on, I’m sitting comfortably reading my book. Finally the B group is called. I put my book away. Walk right up to the front of the line and shoved my arm in with boarding pass in hand and was waved by the lovely flight attendant to board the plane. It was a beautiful moment. I didn’t even look back, but I felt like some people in line might have noticed this and said “what an asshole”, but I then I was thinking there must have been some french people in line thinking to themselves “nicely played”.

So by April I had a small group of friends and a social life. I also had a visit from two good friends. We did some touristy things and then I spent a week in Monaco. Once summer rolled around I really started living like the French. That is work as little as possible and go on vacation whenever I can. Since May I’ve done a 4 day trip to Normandy, 5 day trip to Amsterdam, weekend in Brussels, weekend in le Mans (24 heures du Mans), 1 week in Italy, 4 day trip to Barcelona… I think that’s about it. I’ll be spending a few days in Sweden as well at the end of the month. That’s not to say I haven’t been enjoying Paris in the summer. It’s great here, the sun stays up late. June 21st it didn’t get dark until some time after 10:30PM which was great, The French are big on picnics. A bunch of people get together, go to one of the many parks, or the pont-des-arts, or somewhere along the Seine. Bring food, wine, beer, whatever and just hang out. I even went to the Jazz festival one day (it runs weekends only in the summer) and we had a picnic there while watching live music.

July 1st in Paris was pretty cool. Being the patriotic Canadian that I am I wanted to celebrate Canada day. Sure enough I wasn’t the only one. So the Canadian embassy opens its doors from 5:00PM to 8:00PM and provided some basic snacks, cheap alcohol and music. It turned out to be a lot of fun and I met a lot of other Canadians. I had only showed up around 6:30PM. By 8 those who were still there, at least 100 people or so were kind of drunk. It was quite a site, a bunch of drunken Canadians in Paris at our own embassy singing O Canada. A group of us headed off to the Moose (Canadian bar in Paris) and the party continued.

All in all I’m enjoying myself here. Starting to take on the French culture a bit. I find the French really know how to enjoy life. They’re a lot less stressed than people in North America. Sometimes I wonder how things actually get done since we’re always on vacation here… But it works.

I have so many stories to tell but here’s one of my personal favorites. 3 days after Canada day, July 4th. My friends from the “Expats Paris” group were doing a 4th of July celebration (one of the organizers is an American). I was actually invited by an American friend of mine anyway. So this one was a picnic on the Seine. Sort of pot luck style thing, and of course there was a lot wine involved (this is France). We weren’t sure exactly where it was supposed to be. Luckily she had called me before I left my apartment and I was able to find the spot described in the email by Google maps satellite images. Thank you Google maps. I had noticed an older man (probably late 40s) walking with a woman (probably early 30s). The woman was wearing a blue knitted sweater with a big USA flag on it. She also had a dog and she had dressed the with a little USA hat. At this point I thought we must be heading in the right direction. Now I’m not going to lie, this dog was a bit strange. It was a pug. I find them generally an ugly breed of dogs. Not that I have anything against them. This one was particularly strange since its tongue was about 5 times bigger than its mouth. I’ll try and post a picture of that if I can find one.

I had arrived with my friend and we sat down, she had made us some sandwiches and we had pulled out a bottle of wine. At the point the older man had asked if he could borrow our wine opener. Sure we said, no problem. He introduced himself and we started talking. He introduced us to the woman as well and the four of us were chatting away, sharing food and wine. Turns out the girl is from Beverly Hills. The conversation went something like this:

Beverly Hills: “I met this French guy and I moved here with him… now we broke up so I’m on my own here”

Us: “So what are doing here now?”

Beverly Hills: “Oh nothing really, I’m just looking for work. I was an actress back in LA”

Us: “Oh really, what kind of acting? are you looking for acting work here?”

Beverly Hills: “Oh I was in this show you’ve probably heard of but I don’t want to talk it, I’m leaving that behind me”

At this point she was talking like she was some super star and she needed a break from the stress of the “biz”. I thought she was full of shit.

Us: “hmmm… ok well if you’re not acting what are you going to do?”

Beverly Hills: “Oh I’ll do anything, I wait tables, work at a bar…”

I’m thinking to myself at this point … clueless??? No way I see you working those types of jobs… but who am I to judge.

By the time we got going (around 11:30PM) we were about 10 people or so (including Beverly Hills). For the most part it was people I already knew with the exception of Beverly Hills, a French woman we met and a German Swede who knew one of our friends (although they’re not actually friends) and invited himself to tag along.

We had started heading towards the Latin Quarter since we were fairly close by. For whatever reason I had managed to be walking with Beverly Hills and the French woman. At this point Beverly Hills was carrying the dog, Paris Hilton style. Apparently by this point my friend had already determined this girl was a bit of a looney. It seemed to me like they were getting along alright so I figured I’ll talk to her a bit. Yet the rest of the group seemed to have been walking much faster. Beverly Hills started complaining about her back and that she couldn’t walk. Complaining is not even the way to describe, she was whining. “I can’t walk very far … myyy baaack huuurts”. I have to admit I didn’t see that one coming and I was unprepared for it. We were walking across the Sully bridge at the time and she agreed to at least cross the bridge. Now things got a bit weird. I don’t know how much she drank, or if she even drank at all. This might have been a complete act for all I know. The French woman points out the back side of Notre-Dame. Everybody always photographs it from the front but it looks completely different from the back. Beverly Hills starts telling me about her back side… I believe her exact words were:
“Oh Matt you should really see my back… it’s quite spectacular”

French woman goes “No I was talking about the church”

BH ignores it and says: “You really need to see my back side, it’s my best side”

Physically she was attractive but she was also started sound like an idiot at this point which doesn’t really work for me. For the rest of the walk across the bridge she continued to tell me about her back side and I was kind of like … “uh yeah … that’s nice … I don’t really care”.

Once we’re on the other side I had totally lost my friends. I made a quick call and it seems they liked the Moose so much as they’d decided to return there. Apparently the German/Swedish guy wasn’t too happy about that decision, but I don’t really remember who invited him anyway.

I say to BH we can walk to the Moose it’s about 20 minutes by foot. Here came the whining “my back hurts … I can’t walk very far … let’s take a taxi”. The French woman says “Why don’t we just take the tube” and I said “good idea” … if it will shut her up. Also I didn’t really mind taking the metro, despite the fact that it was only 3 stops away (metro stops are quite close to each other in Paris). BH says “how far is the metro?”. Not far. “I really can’t walk at all anymore, let’s just take a taxi”. Bullshit. The problem is you can’t just flag down a taxi in Paris. You need to either call a cab and give them a specific address or go to a taxi stand. A vacant cab may stop for you but typically they won’t because there are always people waiting at the taxi stands. The nearest taxi stand I knew of was near my apartment which was about a 10 minute walk away. So she just starts trying to flag down every cab that passes. What she didn’t seem to realize was that not a single one of them had they’re light on which means… you guessed it … IT’S OCCUPIED! It was quite amusing really. A cab would drive by and she’d stand there waving and I’d say “it’s taken…” and after 3 or 4 she says “how do you know they’re taken” … ugh … I tried explaining to her using the simplest words in my vocabulary why the cabs weren’t stopping for her but 30 seconds later she tried to flag down another occupied cab. This was hopeless. After a few minutes he gave up taxis and started flagging down random cars at the light and asking any motorist that would actually listen if they could drive us to Odeon (where the Moose is). This was starting to get embarrassing and I was really getting tired of the whole situation. The amount of time we’d wasted standing here debating about the metro and taxis I could have already walked to the Moose.

So here I am Friday night in Paris. I’ve lost my friends and I’m stuck with some random French woman I had met less than an hour ago and a Paris Hilton wannabe trying to hitchhike in central Paris. I thought of just leaving… She was really starting to annoy and I figured if her back is really screwed she won’t be able to follow me… but I’m too damn nice. I had eventually convinced her to just take the bloody metro. The metro stop was only a block away and about half way there she flags down a police car and starts asking the cops if they’ll drive us to Odeon. The cops laughed and said “taxi stend eez zat vay” (taxi stand is that way) and drove off. Of course the one they were referring to was the one near my apartment. We were so close to the metro when I actually managed to flag down a vacant taxi. So we get in the cab and we’re finally on our way to Odeon. At this point whatever buzz I had from the alcohol had completely worn off. But it doesn’t end here. Now she starts insulting the cab driver. She starts saying things like “I don’t think this cab driver knows where he’s going, he’s going the wrong way”. Actually he was going the right way and all cab drivers in Paris know where they’re going, not to mention most of them have a GPS in the cab. Then she starts putting on lipstick and asking the cab driver if he uses lipstick. I actually told her to shut up at this point. Luckily it was a short ride and I don’t think he understood too much English. Finally we arrived. Then she starts pouting at me, where’s Molly’s hat, I thought she was about to cry. The little doggy hat fell off in the cab and Beverly Hills was devastated. I told her I’d buy her another one just to shut her up … Once we walked into the bar I parted with her. Got myself a beer and started explained to my friends where I’d been the last hour. She was still in the bar but I didn’t talk to her the rest of the night until I left and as I’m leaving she says “Hey can you find me a cab home” … I said “sure” and I left the bar and went home.

So that’s some of the fun I’ve been having in Paris. I’d love to go on but I need to get to sleep. These stories always end up much longer than they seem in my head. More to come… lots of Europe adventures to talk about this summer. I’ll try to get one up sooner than 6 months this time.


Developing Java on my Mac

February 27, 2008

I recently made the switch from PC to Mac after many years of Windows and even DOS before that. So my overall opinion on Mac is good. I have however run into some issues doing some simple Java development.

First issue: There is no publicly available JDK from Sun for the Mac. Apple packages a special version of the JDK with OS X and us Mac users can only get Java updates from Apple and not Sun. What does this mean, at the time of writing I’m currently using Java build 1.5.0_13-119 which is some version of Java 5. Not the end of the world but Java 6 has been out for a while and who knows when Apple will release their version. It’s still better than being stuck on Java v1.4.2. I bring this up because at my job I’m doing a project that’s targeted to run on WebSphere v6 which is a kick ass server but only runs Java v1.4.2. If the Mac had limited me to v1.4.2 I would be quite annoyed.

Second issue: Eclipse kind of sucks on OS X. If you’re a Java developer you’ve probably used Eclipse. For personal development it’s generally first choice, or should I say my only choice. So I decided I wanted to screw around with a web idea I had (sorry that one’s confidential, I’ll tell you about when I make millions of dollars off it). So I got Eclipse Europa up and running and what do you know, it looks a lot like Eclipse on the PC except the SWT widgets which are OS X style instead of Windows. So far I like it. In general the keyboard shortcuts work the same. First I just made a simple Java project and did some “Hello World” type of programs just to see how Eclipse handled itself. No problems yet. Web applications… well that was just a whole other story. I started my little web application and was just playing a form page. Got Tomcat 6 up and running. Now maybe 30 minutes in or so I did something, don’t remember exactly what, I think I just opened web.xml and then the beach ball showed.

If you’re unfamiliar with Macs and OS X well there’s this thing we call the beach ball. It’s sort of the equivalent of the hour glass on Windows. It’s this multicolor circle thing that spins and looks like a beach ball. The first few times I saw it I said “hey that’s pretty cool, much nicer than that plain hour glass”. But that wears off fast, and it’s just as annoying as the hour glass because it usually blocks the system until it’s done whatever it’s trying to do.

Soon enough the beach ball disappeared, but so did Eclipse. Yeah it just crashed on me with no error message other than the standard OS X “some program just crashed” message. Not much help. I checked the Eclipse log and saw a bunch of crap I didn’t feel like looking at. So I tried it again. Not long after, it crashed again. This happened a few times. I considered opening an Eclipse bug but then I remembered how annoying bugzilla can be so I didn’t bother. I kind of want to smack whoever came with the phrase “Zarro boogs found”. If you’ve ever used bugzilla you may know what I’m talking about.

I figured I’ll just try making a new workspace and that will fix everything. See I used to work for IBM support, specifically RAD/WSAD which is built on top of Eclipse. You wouldn’t believe how many times creating a new workspace was a solution. Not a very convenient one but it usually fixed a lot of the inconsistent problems. It didn’t even work for me in this case. So end of the story is that Eclipse like to crash a lot on my system. I was over on the macrumors forum and some people say they’ve had no issue but there were a few that agreed Eclipse was a bit problematic, at least on Leopard (latest release of OS X… the one I’m running).

I decided to give Netbeans a try. So far it hasn’t crashed on me. So far I like it. Never did much work with it but heard good things. It has similar features to Eclipse. I’ve been able to get going with Netbeans. The only problem I ran into was getting Tomcat running via Netbean, better yet through the terminal. I’m not 100% sure but I think Eclipse either has its own startup scripts or hooks directly into the Tomcat runtime JARs and therefore requires 0 configuration from the user. Netbeans uses the ‘catalina.sh’ script and was complaining about not being able to execute it. So I opened up the terminal to see for myself and sure enough I didn’t have the correct permissions. After setting the startup script permissions  to 755 and trying again it was giving me some warnings about environment variables not being set. I looked at the script and saw it was calling some other scripts. So eventually I just did a ‘chmod 755 *’ and then it all worked just fine.

So in the end looks like I may just have to get used to Netbeans and I’ll be developing away on my Mac.


Paris 2008 – Part 2

February 26, 2008

Shortly after New Years a friend of mine from New York was in Paris and gave me a call. She was in town with a good friend of hers. So we met and saw some of what Paris has to offer. I won’t go into all the details but I do have to tell about my experience at the centre George Pompidou.

We went to the centre Pompidou which is a Modern Art center in Paris. Now I’m not such an art person, but I do appreciate good art when I see it. The Arcimboldo exhibit I saw recently for example, that was impressive art. This modern art exhibit had some of the strangest things I’ve ever seen. Some of it was cool, some was impressive, some of it was just crap. There was one picture I found really interesting. It’s a head coming out of a donkey’s ass, combined with an angel and a devil looking kind of guy. I took a photo of it, normally I don’t take photos of paintings, but I just found this so peculiar I couldn’t resist (Strange picture). There were all kinds of weird things like this tarp looking thing that was made out of bottle caps. There were some other sculptures made out cans, and other things made out of … well junk… but in a creative way. Now the bad, I hate to say it but I just enjoy talking about the bad more than the good. It’s just more fun, or maybe I’m just evil. I wish I’d taken some pictures of these as they’re just so ridiculous but I’ll try to describe this to the best of my ability.

In the modern art exhibit there is this room. Now there have got to be around 10 or so paintings in this room. I will try and describe them all. It may be tough though since they are ever such complex paintings. The first one that caught my eye was the blue canvas. After all blue is my favorite color. But I’m not sure, the red canvas next to it looked pretty nice to. But who could possible forget the multicolor one, it was a half black/half gray canvas. No pattern, top half black, bottom half grey. Another one had 3 different shades of blue. Ok I’ll stop, but seriously… why is this art? I can go buy a canvas and paint it a solid color, will you pay me $10,000 for it? Are these people on crack? I’ve heard the argument that these are statements from proven artists. Now I live by the principle that a piece of crap is a piece of crap regardless of who painted. If Picasso or Da Vinci painted a blank canvas and called it a masterpiece, I would still call it a piece of crap. But that’s just me. Oh sorry one more, my personal favorite, again I wish I took a picture. White canvas, with blue paint bucket splashed on. Seriously, I looked at it, and I can actually picture the paint splattering as if someone took the bucket and just splashed the canvas. Does that make it art? The fact that I can see how it’s made… I say no because I could paint a white canvas and splash a bucket of blue paint over it. This wouldn’t make me an artist. There is no talent in this.

It doesn’t stop there, there are plenty of blank canvases considered art but here’s another one for you. There is this room… to best describe this, picture a 10m x 10m room with 4 or 5 piles of garbage, the piles of garbage are about 1m in diameter and range from about 0.5m to 2m in height. With me so far… now take a big gray tarp, like one of those waterproof tarps you take camping. The kind you attach one end to a tree to give yourself some rain shelter. Throw one of those over your piles of garbage and result is this monstrosity they call art. What a waste of real estate. I mean come on! What is this crap! I’m not impressed by this. Do I think it’s creative, no I don’t. It looks like a bunch of piles of garbage covered by a tarp. Why would anyone want to look at that. I don’t think in 500 years anyone will remember when [hack artist] (sorry I don’t know his/her real name, nor do I care…) covered garbage with a tarp.

The last room I’ll talk about is the Ikea room. Well it’s not really the Ikea but I felt like I was in an Ikea showroom as they had a bunch of furniture on display. Somehow this is an art exhibit. Random furniture placed throughout the room.

There is a lot more to Centre Pompidou that I have yet to see. I will eventually go back there, just haven’t got around to it. I still haven’t even been to the Louvre and I’ve been living here for just over 3 months now. Here’s another story I wrote a little while ago and never got around to publishing. At the time I pretty much had no friends and wasn’t exactly enjoying life in Paris so much. I was still trying really hard to make some friends.

It all started on a Thursday night. I figured I’ll try the pot québecois, not that I’d met anyone there previously (or anyone worth being friends with). So just a little background, the pot québecois is like a happy hour get together every Thursday organized by this group of québecois living in France. I had originally gone with a a québecois colleague, I ended up only talking to him that night. So it was at a place called “The Hideout”. I found it pretty easily, it was not too far from my apartment which was convenient. Now my problem with these things is they always seem to have them at the smallest and most overcrowded places. I walked in and the place was so crowded I couldn’t even make it to the bar. I basically said “screw this, I’m getting out of here” and that is exactly what I did. Haven’t been to a pot québecois since. It was pretty early on and I still wanted to grab a drink. I went to my favorite piano bar “Relais de la Huchette” only to find that it was closed for their annual holiday. I still really wanted a beer so I walked around a bit and found an Irish pub. I grabbed a beer and drank it, it was possibly the most depressing moment of my life. At this point I gave up on the night. I got some food and went home. I was thinking to myself “you tried tonight, tomorrow is another day”.

Fast forward to the following evening. I went for dinner alone again, which was really starting to get me down. As my usual bar was closed for the week I decided to try and find somewhere. I figured I’d try the music cave place as I liked the live music. So I walk in and the main floor is not too crowded but there’s no where to sit. I was more interested in seeing the music anyway so I went downstairs. The music room and the bar were overflowing with people. Standing in between the two I could see half of the saxophone player and none of the other band members. I thought I’d try and get a drink but it was impossible. The bar was so tiny and had about 25 people trying to shove in and get a drink. I’m way too impatient to even try getting a drink from that bar. I decided this was a bad idea. I didn’t really feel like going to anymore bars. Going to bar by myself sucks. I was walking by a place called the Long Hop on the way home, I figured maybe I’ll give the “bar by myself” thing one more try. It looked like a bit of a dive, although it had a bit of a crowd. I get to the door only to be greeted by a bouncer. He says, “hi, you by yourself?” … “umm… yes, unless if you count my invisible friend here” … now this place wasn’t exactly crowded. There wasn’t even a line up to get inside. If there was I wouldn’t have bothered… So this is what he says to me: “you need to be accompanied” … I was fucking shocked! For this place? It looked like such a shit hole. I was like “really?” and he says “really” in the most serious tone. I couldn’t help but laugh as he was so proud when he said it. I love these bouncers, they think they’re so important. I feel bad for them since they are such insignificant people and probably have a 2 digit IQ. I didn’t really feel like giving this jackass any more of my time so I just left. This was the second night in a row that I gave up and went home.

Saturday was yet another day. I decided to forget about the last two night and make the best of the day. It was a nice one. I had a nice breakfast at the American Diner. I love the food in France, but I’ll take bacon and eggs for breakfast over the usual French bread and jam breakfast. It’s also kind of nice eating at this place as it really feels like I’ve stepped into America. The menu is actually in English with French writing underneath and all the staff are English speaking. It kind of reminds me of when I would go to a foreign restaurant back home (Thai, Chinese, whatever…) and the menu is in their foreign language and would have tiny English writing underneath. Except now I’m the foreigner.

My plan for the day was to go to “La Défense” and then “Arc de Triumphe”. I only got to see “La Défense” due to time constraints. I could have still done the arc but it would have been dark already and I wanted do it while the sun was out. You’re probably wondering what “La Défense” actually is. Sounds like a military base. Apparently that’s what some foreign diplomat thought and there’s been talk about changing the name. It’s an area North West of Paris with modern sky scrapers. The big thing to see there is the “Grande Arch”. Which is this hollow cube shaped building (check out the pictures). It was only 9€ so I went up. It had a nice view of Paris. Also had some interesting exhibitions there. They had a whole showcase of computer history and some really old school computers and components on display. For most people this is probably not so interesting but seeing as it’s my field and I actually remembered some of those old ass computers growing up, I really enjoyed walking through this part.

After the arch I walked around La Défense. There are no cars there. There seems to be a tunnel or some kind of road system underneath it. But La Défense itself is a huge pedestrian area surrounded by these huge buildings. I say huge but I’ve seen much bigger in New York and Toronto, but they are big for Paris. You can see the Arc De Triumph from there and it’s got all kinds of water fountains and other nice displays. I’d really like to see it in the summer. I’m sure it would look even nicer. So La Défense also has probably the biggest mall in Paris. I actually needed some stuff. There was a huge fnac (kind of like FutureShop or BestBuy). I went there and got what I needed, no big deal. Then I went to the main mall (as fnac was sort of separate). Here’s where things go bad.

I don’t handle big crowds well. This place was insanely crowded. It was like Yorkdale (Toronto) on boxing day. Yeah, I hate Yorkdale, at least on weekends, which is normally the only time I would go. Too many people… families, people pushing strollers, old people with walkers, canes, and they all move so slow! You probably think I’m an asshole now, but I’m just really impatient. I need to work on my patience… I went to a pharmacy because I saw one and needed some stuff. That was easy. Next came the hard part.

I’ve needed a screwdriver for the longest time. I bought a TV pretty soon after moving into my apartment. It was fully furnished less a TV. I like TV. I don’t watch so much but I like to know it’s there. I also had a PS3 collecting dust so I could finally start using that again. It’s a nice 32” LCD screen. If you’ve ever put together an LCD TV you’ll know it typically has two parts, the screen and the pedestal. I put the screen on the pedestal but it has these 4 screws to secure it. I didn’t have a screwdriver and it seemed safe enough to leave it without the screws. Now it’s not like the thing was going to fall over, but I felt it was not as solid as could be. It wasn’t urgent but I had been keeping my eye out for a Canadian Tire like store. I never found it. So here I am in this mall and I’m thinking there must be a store here that sells tools. So I’m walking, fighting my way through the mass of people. Eventually I find this place called Auchan. It wasn’t like Canadian Tire, but more like Walmart. But I could see what sort of looked like an isle with tools. I was reluctant to enter this place because it was super crowded. But I really wanted to get that screwdriver. So I went in.

This place needed a traffic controller, one of those guys with an orange vest and a whistle directing pedestrian traffic. You’d walk down one isle and get to then and have to merge into the perpendicular isle as there were so many people. Or you’d get the lady in front of you walking down the isle and just stops dead center in the isle. Perfectly centered so that you can’t pass on the left or the right… MOVE TO ONE SIDE!!! I hate Walmart. It’s a horrible place. I’d say Auchan was about 5 times worse than Walmart. Miraculously I found the screwdriver I so desired and it was only 4€. I would have gladly paid 10€ at a less crowded store if I could have found one.

All that was left was to pay for my screwdriver… How bad could that be? Now while I hate lines I know they’re unavoidable and I’m usually pretty patient with the lines (despite my general lack of patience). So this place was like Walmart or IKEA where there are always 50 people ahead of you. They had a few express lines and many normal lines. Here’s how the express lines works. It’s 10 items maximum, pay by card only, and you do it yourself. There are 4 auto pay things. In the middle are 2 actual employees who’s sole purpose is to help the average moron use the auto pay machine. If you ask me my 5 year old nephew could probably figure out how to this without any assistance. Then there were the normal lines with 20 people in line carrying 50+ items each. The choice seemed so obvious. What was not obvious was which of the 4 express lines should I stand in. I always pick the worst one. There’s no scientific reason I can think of, it’s just bad luck.

Multiple lines to choose from, I’ll pick the slowest one. I don’t know why. It’s pure chance. Take Tim Horton’s for example. I do miss Tim Horton’s. France has good coffee but I’d still prefer a Tim Horton’s coffee in the morning. What I don’t miss about Tim Horton’s is the lines. I’ll always pick the line with the slowest cashier, then when it gets to one person in front of me, that person orders 8 coffees, a box of donuts, and who knows what else. That person picked the shortest straw at the office and had to go on a Timmy run for everyone. Meanwhile all I wanted was a medium black coffee.

Back to Auchan… all the lines looked roughly the same size. Which one will be quickest? I picked the one where I saw 2 women with a bunch of kids. That one looked super crowded but there were about 5 kids with the 2 women and I figured they’re all together so the line will go quick. I was right about them and they were one of the few who didn’t need the employees help using the machine… Bravo, not everyone who shops at Auchan is an idiot.

Initially when I got into the line I saw 2 black women up at the machine trying to scan their items. Now I wasn’t counting, but it must have been a good 5 minutes later and they were still trying to figure it out. Normally after this long I would have switched lines but I was checking out the other lines and no one was moving. I heard some other people in line talking saying the system was down or something. Bullshit, the system works fine! These people are just retarded. Maybe I’m overreacting. Maybe the system was down. I really wasn’t sure at the time. Eventually the line started moving and I realized I was right. The system worked fine. The people using the system were lacking brain cells. Just to let you know that I’m not crazy, the guy behind me actually gave up and went to one of the normal lines. He decided to take his chances with one of the 50+ item lines. At the time I was thinking “best of luck to you buddy”. I never did see if he made it out before or after me. So the 2 black ladies were still there putting stuff in bags, I was a bit shocked they were still in the process of paying as at least 10 minutes had passed. I was also relieved that I was one step closer to paying for my darn screwdriver. Something was still wrong though. The staff person had to come back again to sort out their problem. I was going crazy at this point but I kept it cool. I thought to myself:
“Maybe I should just forget the screwdriver.
It’s not like the TV is about to fall over or anything.
I’m sure the next one will be faster.”

At this point I saw the other lines were actually starting to move, but there were so many new people behind me at this point that I didn’t think it would be worthwhile to switch. I see a couple go through, nice and quick, about 1 minute. Then that group I mentioned earlier, no problems there. Now there were about 3 more ahead of me, each one needed assistance from the store person. It’s not so complicated! By the time there was only one person ahead of me, I was thinking “Yes! I’m so close to the finish line!” But these 2 women really had no clue. They started scanning their things, and then when it came time to pay they couldn’t seem to figure it out. She kept putting in her bank card and typing a code but it wouldn’t work. So as usual the store person came over. Apparently the woman wasn’t pushing the code buttons hard enough. The store person says to the woman, “every time you press a button, make sure you see the star on the screen”… “ohhh, it works now”. At this point there was a woman in line behind me who actually gave up. She looked about as frustrated as I was and left! See it’s not just me. I finally get to this machine. I must have waited at least 20 minutes just to pay for one item. At first I had a slight fear. I thought to myself : “What if I can’t figure out how to use this machine and have to get help from one of the store people. I’ll feel really bad if that happens because I thought everyone else was an idiot.” Well that thought lasted in my head for about half a second. Let me run you through my experience with the auto pay machine.

“Touch screen to begin” → I touched the screen
“Start scanning items” → I scan my item → Ooh look at that it appears on the screen.
Next I push the button that says “Pay”
“Place item on tray thing” with an arrow pointing to this tray thing → Done
“Select payment method” → I pick CB (French for bank card) take a guess… Carte Bancaire? Good guess, but it’s actually Carte Bleu. A useless fact for you ☺
Now I just stick my card in, enter my pin, papers start flying out of the machine (i.e. the receipt) and I’m gone. You know how long this took me? About 30 seconds and I’ve never even seen this machine before. If I had to evaluate this machine I would have rated it “idiot proof”. Then again some people said the same things about Microsoft Windows… I’m not even going to go there.

While I was waiting in line I took a picture of this sign that unfortunately didn’t come out properly. But from what I can make out of the picture it says:

“Caisse Minute – Gagner ??? facile”, I think it was “gagner de temps – c’est facile”. The wording is not important. The first part says “Minute Cash” then the rest goes “Save time easily”. I want to meet the marketing jackass who came up with that slogan and ask him if he’s familiar with the term “irony”.

I’d never been so happy to get out of that store. It was actually dark by the time I got out. I was annoyed because I should have had another 20 minutes of sunlight. Oh wait, I wasted 20 minutes of my life watching a bunch of ignoramuses try to figure out how to do what 15 year kids do for minimum wage. Auchan… a horrible place that should be avoided at all cost. I don’t see any circumstance where I would ever shop there. Like I said, I would have gladly paid 10€ (250% more) to have not had to suffer the misery that is shopping there.

Despite my “tomorrow is another day motto” I decided that Saturday night to take it easy. I didn’t even attempt going to a bar by myself. Not that I had given up on trying to meet people. I eventually did meet some people. That will be in “Paris 2008 – Part 3”


Paris 2008 – Part 1

February 26, 2008

So it’s really been a while since my last little story. I’ve moved away from Facebook notes and started and actual blog. So many stories to tell but that would a be a full time job on its own. Here are a few highlights of life in Paris. There have been some ups and downs, a few rants. I think you’ll enjoy them.

Christmas/New Years :

My holidays were truly spent well. Christmas… yes I’m a bad Jew. For once in my life I actually did Christmas on Christmas instead of going for Chinese food like we’re supposed to… http://www.youtube.com/watch?v=PtUYaSfC20Y. My father’s cousin’s son (hereby referred to as just my cousin) went away with his girlfriend to Thailand. Before they left she said I should call her parents and go there for Christmas eve dinner (she’s not Jewish). I figured why not? I had no other plans. I probably would have gone for Chinese food myself. So I ended up speaking with her mother (Marie) and she said they’d be happy to have me come over for Christmas but they would be spending it at their country house in Le Mans. I had no problem with this. I hadn’t left Paris since I arrived and I like getting out of the city. So I packed an overnight bag Monday morning when I went to work. My cousin’s girlfriends brother and father were already in Le Mans but Marie was in Paris. So after work I went straight to her apartment which is walking distance form the train station and we were off to Le Mans.

It was a short train ride. Only about 1.25 hours from Paris. She was a very nice lady. Her husband was waiting for us at the train station and we were off to the house. So this was real farm land. There was nothing out there but fresh country air. It was night time already so there wasn’t too much to see on the quick ride from the train station to their house. We got there and it was a small gathering. Just 4 of us.

This was a cool house to walk into. It looked almost antique, but well kept. There was a nice garden with all kinds of vegetables growing. They also had a small area with chickens running around. Walking into the house the first thing I noticed was the fireplace. At first I thought this was really old school. Wood fire heating, but they had some small electrical heaters throughout the house. I certainly enjoyed sitting by the fireplace.

So Christmas was a big dinner. They had a decorated Christmas tree as well. Nothing extravagant like the ones I’ve seen in movies and on TV, but nice. They like to eat. It was a 4 course meal with an appetizer, main course, cheese, and dessert. That’s right, cheese is a course here. I’ve taken a liking to the cheese despite the fact that I’m lactose intolerant. The cheese here is just so good. There were also several glasses of wine throughout this meal. By the time we were done I was exhausted. All the food and wine had made me drowsy. It was around 11:30PM but not time for bed. It was present exchanging time. This was new to me. I’ve actually been to a Christmas dinner before but I was never around for the present thing. This almost was like the movies. Everyone exchanged their gifts, and they even got me a box of chocolates. Afterwards I was ready for bed.

Had a nice long sleep until 11AM or so the next day. Christmas day was a pretty lazy one. Once I woke up there was already food available on the table. Marie had made french toast, except they don’t call it french toast. It’s “pain perdu” which literally means “lost bread”. The story behind this is that stale bread is lost but can be saved by dipping it in eggs and frying it up.

We all went for a walk around the village. It was really small, and at one point we were walking on a path through this field and there was nothing but more fields. It almost reminded me of the Australian Outback tour I did, except that was really isolated. We were out for almost 2 hours. Working off dinner from the previous evening. Once we got back it was lunch time. Again a nice 4 course meal which just about put me to sleep. The rest of the day we pretty much sat around. I read some chapters of a book I brought with me. At one point the TV was turned on. It was a lazy day. Eventually it was time to head back to the city. I got home and went to sleep, ready to go back to work the next day.

The weekend was interesting. Friday night I went to the piano bar again as I had nothing better to do. I’m sitting at the bar having a beer as usual. I can hear the people sitting next to me are all clearly Americans. So I decided to jump into their conversation. They actually didn’t even know each other. There was a woman who moved to Paris to be a singer. Turns out she sings at the piano bar Monday nights. She did a song that night too and had an excellent voice. Then one of the guys was a FedEx pilot who had a stopover in Paris. I was talking to him for a while. Turns out he was Jewish, I don’t even remember how it came up in the conversation but it became a conversation on its own. There were two, I’ll say middle aged American women who also somehow ended up joining our conversation. They were nice, one of them was a pilates instructor and was telling me all about positive energies and oras. I was very interested … So now it’s me, a bunch of tourists and this singer who doesn’t speak much French. They wanted to go somewhere else and invited me along.

The singing girl knew of a place with some live music so we all agreed that would be cool. Turns out it’s a place I’ve walked by about a million times and never realized they had live music downstairs. We went in, the music was good but it was super crowded and I couldn’t really see the stage. At some point we managed to get closer to the stage but it was close to the end of their last set. We stayed to the end, around 1:30AM and then got out of there. We then went next door to yet another bar and had some more drinks. At this point the night was starting to slow down a bit. I said goodbye and left. It was a fun time but I didn’t need to stay out.

Saturday night was much the same. I went to the piano bar. I saw my friend the philosopher again. Not sure I told the story about this guy. A while ago I met this guy at the same bar and we had a few shots of vodka. He’s doing a Masters or PhD in philosophy. So I chatted with him for a few minutes and we were talking to these 2 other women from Sweden. It was a good start but it was one of those situations where I kind of lost in the conversation because we were talking in French and they were talking too fast. One person I can handle fine, two people in general is ok for me too. More than that talking at the same time starts to confuse me. Add a loud environment (a bar) to the equation and I’m lost. Who do I see though? The two American women from the previous night. They said hi so I started chatting with them. You could say… they were cougars. Both 40 something, divorced and attractive. But no the story doesn’t go where you’re thinking. This isn’t American Pie, although it would have made for a great story. But anyway they were chatty. The details are hazy now but I somehow ended up going back to that same super crowded music place from the night before. One of the woman had gotten into a conversation with some French guy and they seemed to be hitting it off. So we somehow managed to find seats at the super crowded place. Music was good. Again we stayed to the end. Now that one woman was off in a conversation with the French guy, the other one is ready to go and asks me to walk her back to her hotel. This was sounding good, especially after all that talk about positive energy and supposedly I have a positive ora. But no she just didn’t want to walk back to the hotel alone. Sorry guys, I guess I need to read the game again.

The following the day I was off to the alps to spend New Years Eve. Thanks again to Rachel (if you’re reading this) who invited me to join her. Her friend’s boyfriend has a house down in Modane and they were very hospitable. Her family and some other friends were there as well for New Years.

Getting there was pretty easy. This was my first TGV experience (Train à grand vitesse = high speed train). I had to transfer to another train at one point but it still only took about 4 hours to get there. I thought that was pretty good. I got to really test out the battery life of my Macbook Pro. Conclusion, it’s good. I was able to watch 5 episodes of Lost and I still had about 5% remaining.

Upon arrival I saw a lot of snow on the ground. First snow I’d seen in France. Not like I’ve never seen snow before, but it’s been a good 2 years since I’ve seen the white stuff. Not to mention the fact that I lugged my snowboard with me, so I didn’t mind some snow on the ground. I was greeted at the station by Rachel, our host Phillippe and one of his friends. He drove us to his house which was only 10 minutes away. This was a much more modern looking house than the one I spent Christmas in. It was probably the most modern looking house I’ve seen in this country. It looked like one of those townhouse developments you see all over the place in North America. I was then introduced to everybody, and offered some food. I was starving at the time so this was a good thing. I don’t remember exactly what I had but there was cheese served afterwards. The French love the cheese… and I’ve been converted.

I got to catch up a bit with Rachel but at some point all the women were in the kitchen preparing dinner. I tried to see if I could help in some way, but they clearly had things under control. I got to talking with Phillippe and his friend. They were giving some good advice about Paris and we also discussed skiing/snowboarding and the mountains nearby. We were planning on going the next day. There was the big one “Val Thorens”, and a smaller one called “Les Karelis”. Now my first instinct was to hit up Val Thorens. However I hadn’t been snowboarding in 2 years, Rachel was still a beginner, Phillippes friend also hadn’t gone in quite a while. Val Thorens doesn’t have many beginner trails. Also Val Thorens is huge. Phillippe told me that it can take 4 or 5 days to ski the whole thing. We only had one day. In the end we agreed on Karellis, and in the end it was only myself, Phillippe and Stephane who went. Rachel had been already and had her fix for it.

Dinner was served, at this point I don’t remember all the details but it was a feast. The usual 4 course meal. I enjoyed it very much. The conversation was good. It seemed like we were switching back and forth from English and French a lot.

As usual dinner finished quite late and we were to have an early start the next morning. I had a good sleep, woke up ready to hit the slopes. We ate a quick breakfast and hit the road. It was a relatively quick drive to the base. We were mostly driving uphill, up windy roads. I won’t go into the details of every run but it was a lot of fun. I’d this mountain was slightly bigger than Jay Peak or Tremblant, but the snow was much better. Thick powder everywhere.

After a great day of skiing we returned to the house. Everyone else had gone snow shoeing and they arrived around the same time as us. We all got cleaned up and then the women started working on dinner again. I wanted to feel useful so I at least got to help setting the table. Now this wasn’t going to be the typical New Years celebration. No crazy partying. It was more of a family/friends dinner party and I must say it was really nice. One of the girls had made these name cards for everyone which I thought was pretty cool. I wanted to keep mine as I thought it was nice but I forgot it there and only realized later. I was even more surprised to see a bunch of gifts had magically appeared on the table. I’m not sure if it’s a French thing or just their family, but they do a gift exchange thing for New Years. I felt bad since I hadn’t bought any gifts. But I ended up getting a bottle of wine, box of chocolates, and a book on cheese. I was thinking at this point, “these have to be the nicest people I’ve ever met”. I was essentially a stranger, but they treated me like family. It was probably the most relaxed New Years I’ve ever had. We had our apperatifs, had the New Years feast and I think we were in between cheese and dessert when midnight came. There was no TV with the ball dropping. It was nice, something different. Next day I had to head back to Paris already, although I had an easy morning. Didn’t have to catch the train until about 2PM or so.