Example for Dirk

Posted in Uncategorized | Leave a comment

New Bike

I just pulled the trigger on purchasing a new bike online.  A friend send me a link to republic bikes and I couldn’t resist. I tried to resist for a week but then I got notice that I was getting a decent tax return and voila I built the following bike and sent in my order:
New Republic Bike

Posted in bike | Tagged , | Leave a comment

Package Level Annotations

In our current project we have lot’s of hibernate filters and it’s cluttering up the class files as well as making for some annotation duplication on our domain model.  The wish was to somehow have the filter definitions set up at the package level but nobody thought it was possible.  I remember working on a diffferent project and adding @TypeDefs annotations at the package level but couldn’t remember how I did it.  I finally recalled the package-info.java class.  You create a class file at the base of the package that you want annotated and name it package-info.java.  You may have to create the file manually (from a file browser or command line) since the Eclipse IDE will not generate one for you.

package-info.java:


@TypeDefs({ @TypeDef(name = "trim", typeClass = TrimmedString.class) })

@FilterDefs({
@FilterDef(name = "ACTIVE_FILTER",
defaultCondition = "((end_date is null) or (end_date >= current_date))"),
@FilterDef(name = "HISTORICAL_FILTER", defaultCondition = "(end_date < current_date)")
})
package com.ctrlspace.model;

import org.hibernate.annotations.FilterDef;
import org.hibernate.annotations.FilterDefs;
import org.hibernate.annotations.TypeDef;
import org.hibernate.annotations.TypeDefs;

import com.ctrlspace.type.TrimmedString;

With package level filter defs defined you can now make use of @Filter definitions at the class level and make use of the package level @FilterDefs:


import org.hibernate.annotations.Filter;
import org.hibernate.annotations.Filters;

@Filters({
@Filter(name = "ACTIVE_FILTER"),
@Filter(name = "HISTORICAL_FILTER")
})
public class CTRLSpaceModel
{
...
}

Unfortunately you can’t use the @Filters annotation at the package level but I understand the logic behind that.  in order to determine whether an annotation can be used at the package level its @Target value must include PACKAGE:


@Target(value={PACKAGE,TYPE})
@Retention(value=RUNTIME)
public @interface FilterDefs
Posted in hibernate, java | Tagged | Leave a comment

DWR – less is more

Ran into an issue with DWR attempting to marshal too many objects in a domain model.  In fact because of Hibernate/Cglib proxying it was going so far as to marshal the database driver.  This was fixed by specifying which bean attributes to include when declaring the converter for the object.


<dwr:configuration>
<dwr:convert type="bean" class="com.ctrlspace.domain.person.State">
<dwr:include method="name" />
<dwr:include method="id" />
</dwr:convert>
</dwr:configuration>
<dwr:controller id="dwrController">
<!--
CHANGE THIS TO FALSE FOR PRODUCTION Other config parameters can be
found here: http://directwebremoting.org/dwr/server/servlet
-->
<dwr:config-param name="debug" value="true" />
</dwr:controller>

Previously we were using a dwr.xml file but the content was moved to our dispatcher servlet and made to use the spring dwr dtd.   In the dwr.xml file we were including multiple class files by making use of “match”:


<convert converter="bean" match="com.ctrlspace.domain.*" />

but I think it’s better to use the minimal configuration and know what exactly is getting converted rather than giving dwr access to everything.

Less is more.

Posted in dwr, java, spring | Tagged , , | Leave a comment

The Final Countdown

Hello from the Paris airport where the keyboard is even more difficult than the Italian one.

When we last left you I believe we were ready to head to the beach in Alassio. Well we did head to the beach, just not the fancy rivieran beach but the public beach which in my opinion was better than the pay for beaches (they cost 12 euros each for the luxury of enjoying an umbrella and a lawn chair). Our last night in Alassio was spent eating seafood at a nice restaurant overlooking the sea.

The next day started early with a drive to Sanremo to drop off our rental car and to catch the train to Paris. The train ride to Paris was beautiful and I was happy to be able to enjoy without having to worry about driving. We arrived in Paris late and were able to quickly find our hotel using the the Paris metro. I thought the London underground was good, but I am now a bigger fan of the Paris metro. We were glad to get to our hotel and drop off our bags, until we actually got to the hotel. It wasn’t the nicest place but we got what we paid for (we ended up finding a nicer but more expensive hotel the next day).

Our first day in Paris started with coffee and a croisant at a nice cafe near the hotel. We sat and enjoyed Paris waking up (we were in a somewhat posh business area) and were completely surprised when the bill for our two coffees and two croisants came to 12 euros, suddenly a day at the beach didn’t seem so expensive. We made sure not to let this surprise let us down and headed to the bus stop to catch our hop on/off bus. I wasn’t super stoked on the hop on/off bus until we actually used it (even though kevin and lynn said they were the way to go), but now I’m a firm believer in it. We were able to see a lot of the sites of Paris in a short period of time as well as get a decent idea of what we wanted to go back and see later.

On our site seeing trip we ended up stopping in a quaint little shop that sold interesting bracelets and necklaces. The owner spoke perfect english and we ended up spending almost an hour chatting with her about our trip, and the places in Paris that she loves. She ended up giving us great advice on how not to get fleeced at the caffe’s, her favorite restaurants, and she also told us to just window shop in Paris, not to buy anything since it’s a ridiculously expensive city. The only thing she told us to spend our ,oney on was food and wine. We took her advice and later that night after walking/busing around many of the sites in central Paris we stopped at a small restaurant named “le petite marche”. The menu was not in English but there was a very friendly couple (Frank and Claire) next to us who helped us out and we basically ended up joining them for supper and helping celebrate another birthday (Frank’s). Again we described our trip to them and they described their Paris to us. We found out that Claire was from Cambridge and came to Paris to improve her french. She thought she’d only be here for a year but it’s now been 12. I can see how Paris could do that to someone, aside from being expensive, it is really a very beautifull city much more beatifull than the bigger cities we visited in Italy in my opinion.

Our last full day in Paris found us in Versailles visiting the palace in the morning and then taking in Notre Dame Cathedral and getting really good french ice cream in the afternoon. That evening we spent roa,ing the streets and watching the eiffel tower turn blue and sparkly from another small cafe while we enjoyed some wine.

Like I said we’re now in the airport time is running out on our internet and our plane home is boarding in 5 minutes, so I will bid you adieu, and we will see you all soon.

Posted in vacation | Leave a comment

Italian riviera

Well, again it’s been a while since I’ve posted but it’s not the easiest thing to do when travelling and unfortunately again no pictures (I’ll try and add some when we get home).

So Tuscanny was beautiful, quiet and relaxing. Of all the places we’ve been to so far it is definitely a place I could live, however there is something comforting about Canada that would never really allow me to move here for good (maybe it’s the fact that you don’t have to pay for every last thing… going to the bathroom, using the highway, sitting on the beach, or playing tennis at the resort). We really enjoyed Tuscano and felt that we could relax for a while after the hustle and bustle and tourist tirade that was Rome. Sleepy little towns where you could sit and enjoy a coffee, wander around aimlessly with friendly “bon journo”‘s coming from all over. That and being in the hills with amazing panoramic views all around us.

Some of the highlights of Tuscano aside from the gelatto and the swimming pool at the resort were going to Montepulccino (sp), the old town was full of small steep alleyways quaint shops and free wine tastings. Although it was touristy, it wasn’t overly touristy. We also managed to go to a winery named Banfi. It was very nice, and very huge. A typical vineyard has 7 to 10 hectares of land but Banfi has 3000. It’s quite the operation. Not only did we taste some wine there (and buy some – my wife’s tastes are getting more and more expensive) we also tasted some balsamic vinegar. I didn’t think it would be all that great but there is something to be said about a 12 yr old bottle of balsamic vinegar. It’s much better than the stuff you get at save on. It’s also much more expensive, 40 Euros (about $64) for a very small bottle (about a third the size of the bottles you’d find at save on). Needless to say we didn’t purchase any of this.

Our second last night in Tuscanny was spent at the farmhouse enjoying a somewhat typical italian meal. A huge selection of starters almost filled us up before we enjoyed the main course and desserts. During dessert the very cheesy dj (he actually played the piano and sang karaoke style during some of the songs) started playing that crazy music Italians (and my wife) like to dance to. One of those songs was reminiscent of my time in Spain and to our wedding (thanks to Mrs. Perez-Parada), a song I really never wanted to hear again but thanks to the cheesy dj I did, and thanks to my wife I had to dance too. We had a really good time dancing with a crazy collection of german and italian tourists until some overly enthusiastic and underwhelming dancers stepped on K-A’s toes. I encouraged her to take a break but it wasn’t long before the music moved her again (and thus me) back onto the dance floor.

We left Tuscany and headed onto the auto strada (the pay for highway that allows you to do 110km/hr rather than 50-80) on our way to Alassio. We arrived in Alassio to find it over run with people and lacking parking. We ended up having to park about 15 minutes away from the hotel (yes we dropped our bags off first) and worked our way through the crowds back to the hotel. After a great supper we toured the beach front. It was aggravating at best, more like the exhibition than the relaxing resort we were expecting. We chalked it up to it being Saturday night and hopped the next day would be better and thankfully it was and the weekdays are even nicer.

Yesterday we drove to some small towns that are connected by mountain paths that are only used by tourists now but were the main routes between the towns until a short time ago. We decided to take one of the paths up to the castle in Zucarello but instead ended up taking a wrong turn and reaching one of the small towns along the path. We were glad we took a wrong turn since it was a nice (but demanding) 2.5 km hike pretty much straigh up hill. We were not glad that we had choosen the hottest time of the day to do it. We came back down to Zucarello and enjoyed some refreshments before driving to the to same town we had just hiked to. The drive was approximately 10km in winding roads and only took 20 minutes compared to the 45 minutes it took us to hike the mountain path. The rest of the day was spent travelling through small towns taking some photos of interesting sites and then heading back to the hotel to enjoy the air conditioning.

Today we’re probably just going to enjoy the sun and surf before we head off on a long (but first class) journey to Paris. We’re excited to be going to Paris, but we’re also looking forward to coming home. Three weeks is a long time to be away, I’m hoping Dewey feels the same way but I’m afraid he won’t want to come home after hearing of the adventures of his DOT (= Dewey on Tour) in Marengo. Bob and Peggy have been spoiling him mercilously. He’s seen more of the area than I have.

Until Paris…

Posted in vacation | Leave a comment

Tuscan Hills

So unfortunately no pictures this time, it’s dark in the “internet area” here at our Tuscan villa.

So I haven’t blogged in a while, not since we left Bristol. Venice was nice, just nice. I’m glad we went but there wasn’t a lot to see there. The great thing was that there are no cars in Venice, and the pizza was fantastic!! Ridiculously good, unbelievably good. I love the pizza here, it kicks pizza 73′s but (and I like pizza 73).

After Venice we left for Rome. We arrived in Rome late in the afternoon and after dropping off our bags at the hotel (the hotel lancelot, it was awesome if you’re ever in Rome I recommend it), we took off to see some of the sites. The hotel was two minutes from the Coliseum so that was our first destination. Quite an impressive site even though I’ve seen it before. K-A was astounded by it and I think she was thinking about how she could take on the gladiators back in the day. I don’t doubt her. After the Coliseum we strolled through the Forum. Not only did we see many historical sites while wandering through, we also happened to stumble upon a wedding ceremony. Good thing it wasn’t during the time when the priest asks if anyone knows why these two shouldn’t be married… that would have been pretty embarrasing. We ended the night by strolling by the Pantheon and the Piazza Nuvona. Needless to say it was a nice evening.

The next day we headed to the Vatican. It of course was amazing, K-A was expecting an epiphany to occur at the Sistine chapel, but there was none forthcoming (aside from being really p’od at the Japanese toursits taking pictures when they shouldn’t have been). I just sat back and marvelled at the art work. Then it was off to St. Peters church which again was marvelous. I still don’t understand how they could spend that much time and money on a church but who am I to complain about it. After the vatican and st. peters we headed out again to some of the sites we saw the night before so that we could actually see the guts of some of the ancient structures. Our day ended off with a pleasant meal at a family run restaurant where we met two brits named Mark and Roberta. They were a lot of fun and instead of going to see the Spanish steps we ended up having a couple of bottles of wine with them and helped to celebrate Roberta’s birthday (they came to Rome for the weekend, lucky europeans and their super cheap airfare). We ended up going to the Spanish steps the next day (Sunday) and did some meandering prior to leaving Rome.

Leaving Rome was entertaining. We ended up hopping on the regional train which made fifteen or so stops between Rome and Florence instead of the express which only makes one stop. It was fine though since we ended up seeing more of Italy. When we got to Florence the car rental place was closed so we ended up having to stay there for a night instead of getting to our villa here in Regello (well very close to). When K-A and Marissa where planning the trip they called to make sure they’d be open, they were assured that the car rental shop would be but as Marissa says “Italians do what Italians want”, and she would know (I’m going to pay for that when I get home I’m sure).

It was probably a good thing we didn’t get the car last night. The instructions to the villa said it was very easy to find from the center of Florence… yeah right! Maybe it’s just the fact that Italian streets don’t seem to be named (well they are, but they like to hide the name), and in Florence every bloody street is a one way. We ended up doing the classic “Look kids, big Ben” thing in a traffic circle but thankfully we only got stuck in it for one extra round, however we did end up seeing the same traffic circle about 5 or 6 times trying to get out of Florence. Once on the highway everything was better, but we did have to get a very nice Italian gentleman to give us directions to the villa. I don’t know how K-A translated his directions considering she knows maybe two words of Italian but she did. I was very impressed.

We arrived here at Fattoria Degli Usignoli (www.usignoli.it) just before noon, and soon after checking in went down to the pool to cool off and relax. After that we went for a nice drive to a larger town to pick up some grocieries. I now wish that instead of agreeing with my wife and Marissa that a little putt-putt car would be fine we had gotten the Ferrari instead. The roads between these small towns are awesome! I found myself making fast car noises while zig zagging between towns. We did more than once, however, have to do some evasive maneouvering for traffic coming in the other direction and old men taking a stroll. One of the highlights was stopping for gelato (pine nut and rice) at a sleepy village named Saltino. The views were beautiful and they even had an travel information booth where we found out where we could do some wine tasting. We’re planning on doing that in two days I think, as well as a trip to Sieanna in there. Aside from that I think our days will be spent touring some of the small towns, playing a little bit of tennis, relaxing poolside and maybe going horse back riding, who knows…

Anyways, hope you all are well and enjoying your summer as much as we are.

p.s. Just wanted to send a shout out to Mark and Chrystal for providing fantastic accomadations in Bristol. You both have been missed and it was so great to see you again and to know that you’re both doing well!

Posted in vacation | Leave a comment

Goodbye London, Hello Bristol

So we left London yesterday morning and made our way to Bristol. The train ride to Bristol was pleasant and I saw my first nuclear power plant (I don’t feel radioactive nor do I believe I have super powers from being in such close proximity). We were met by Mark at the train station which was great seeing as we haven’t seen him in just over a year since him and Chrystal moved here. More about Bristol later, I must finish off London.


Saturday morning K-A dragged me running along the river Thames prior to her and Niru going to “tooting”. “Tooting” is the East Indian market in London. Once the ladies returned from tooting we headed out to London’s southbank. We meandered around the markets and took in some of the exhibits in the Tate museum of modern art, then headed across the millenium bridge to St. Paul’s church. St. Paul’s was nice but the view from the top of the dome was pretty impressive.

After seeing the city from the top of St. Paul’s we went to Harrod’s, the most filthy rich department store I have ever been in. We checked out the food court there and were thinking about getting some chicken soup, but at 16 pounds for a bowl we thought better of it. On our way out of the food court K-A had a run in with some sultan’s daughters (or wifes I’m not sure which). Even though they were mostly covered up they were the scarriest women I have ever seen. They came through the doors and the crowd parted like the red sea, nobody wanted to get into their way, that is with the exception of my wife. She stood in front of them until the woman in the lead finally said excuse me. Niru was super impressed with K-A, who said she wasn’t getting out of anyones way until they said excuse me. That’s the teacher in her I guess.

Sunday our last full day in London started with a proper English breakfast (sans sausages), and then we were off to Windsor castle were we did most of the long walk. On the way back we decided to drive by Hampton Palace which we only saw from the car since it was a surprisingly sunny day and traffic was mad there. While in traffic Niru entertained us with the diversity of different candy she missed from her home country of Denmark, various things like spunk (which she says are like skittles… I highly doubt that) and black (I’m being politcally correct here) balls. I don’t know if I ever want to go to Denmark now.

Sunday night I enthusiastically agreed to go see Mama Mia with the ladies since Amit had to prepare for a presentation the next day. I’ve been learning dry English sarcasm and putting it to good use saying words like “enthusiastically” when I mean I’d rather have my left arm cut off than go see some musical set to the songs of Abba. It was spectacular by the way.

I’d just like to take a quick moment to thank Amit and Niru for very graciously taking us in and showing us the sites of London. It’s been a while since we’ve seen the two of them and it was great to catch up. Looking forward to seeing the two of you at Christmas.

Back to Bristol. Yesterday, Mark toured us around Bristol which is a very pretty city. We saw the Cliffton suspension bridge, a camera obcura, the John Cabot tower (he departed from Bristol on his way to finding Canada), and the university where Mark teaches. We met Chrystal at a pub called “the Victoria” when she got off work where I tried out some local English Ales, one was called Jouster and the other Dragon Slayer. Seeing how my tolerance or alchohol isn’t extremely high the Dragon Slayer Ale gave me some delusions of grandeur. Fortunately we went back to Mark and Chrystals flat before I put those delusions into practice.



Today K-A had a much nicer and faster running partner, namely Chrytsal, so I was not guilted into running with her. This was very good for me since I got to sleep in and because Chrystal kicked K-A’s but. After a leisurely breakfast we headed to the downs and keys here in Bristol. Basically the downs and keys are the docks where all the ships come through to drop of their goods. After the docks we strolled to St. Mary Redcliffe church, and then went down to some of the shops and an art galery along the river. All in all a very nice day which apparently isn’t over yet, we’re planning on going to get some traditional English pies and cider (something which Bristol is well known for).


Tomorrow we’re off to Venice…

p.s. Pimms is the best drink in London!

Posted in vacation | 1 Comment

K-A and older Men


Day one in London was great, tiring but great.  It was difficult to sleep on the plane, we may have gotten three hours of sleep each.  We arrived early in the morning here and were met by Amit at the airport.  After dropping our bags of at Amit and Niru’s flat we headed out to central London on the train.  We walked around central London all day, hitting many of the sites such as Sommerset house, Big Ben, Covent Garden, Spitalfield Market and Trafalgar Square.  By the end of the day we were beat and my feet were in some serious pain.  On the train back to the flat K-A passed out leaving me the duty of determining which station to get off at.  We got back to the flat and I passed out almost immediately but was woken up two hours later by K-A letting me know it was time to go to the pub for supper.  The pub was different than I expected (don’t think black dog), the floors were clean the glasses had no smudges on them it didn’t smell like vomit and we were able to take our drinks out to the street.  We had a nice meal there and headed home for some well needed rest.


Today started out early with a trip to a cafe near the flat and then back to London to use our hop on/off bus tickets.  Instead of taking the bus we ended up walking around again, this time to Big Ben, the parliament grounds, Westminster Abbey and Buckingham Palace.  It was nice to see but we didn’t venture into any of these destinations.  We did however, on our way from Buckingham palace run into five true English Gentlemen who attempted to steal my wife from me by regaling her with the sites and sounds of London (the left most guy on the bench had a sour look on his face b/c he wanted K-A to sit by him).  The one with bad teeth took us to watch the changing of the guard, something we didn’t really think of seeing but were glad we did.  He pushed his way through the crowd and got us front row seating.

After the palace we went to St. John for lunch.  The original St. John we were planning on going to was closed for renovations so we found one further away and really enjoyed our meal.

(no we didn’t get the pigs head, a private party had it and I needed to get a picture of it). One of the patrons beside us described the restaurant as a “bizarre English attempt at tapas”.  I think it was just really good food.  The rest of the day was spent on the tour bus, which was a nice break from walking.

I’m now sitting here writing this while K-A is learning how to cook Indian food with Niru.  Tomorrow K-A is going “tooting” (maybe she’s going to “tooting”) with Niru while I sleep in (I’ll keep you posted on the “tooting”).  Once the girls get back we’re heading to some of Amit and Niru’s favourite spots in London for the afternoon and then going to Arabic restaurant and then to the infamous private club.


kac.

Posted in vacation | 1 Comment

We are going on a summer holiday

Well after much planning and some gnashing of teeth our summer vacation is finally upon us. We are off to London (via Calgary of course – I hate having to go to west to fly east) tomorrow afternoon and will be arriving at 6:10 Thursday morning where Amit will be picking us up from the airport. I imagine with the lack of sleep I might be a little grumpy and a lot puffy. Karen-Ann of course will be super chipper and ready to take on the city… I will attempt to follow.

I think the plan on Thursday will be to do some strolling around after dropping off our bags and then have lunch at St. Johns restaurant (thanks to Mark and Chrystal for the gift certificate). This will be followed by getting on the “hop on off” tour bus to see the sites and sounds of London. Amit and his lovely wife Niru have thought of supper plans as well as a night out to Amit’s private club. I wonder what’s so private about it and how private it will be after letting the likes of me through it’s doors. I may or may not divulge it’s secrets.

Anyways, right now I have to finish packing… 3 pairs of underwear, a pair of shorts, four t-shirts a hoody a pair of flip flops, and I’ll borrow K-A’s toothbrush, that should get me through Europe in style.

I will be attempting to keep everyone abreast of our travels through this blog rather then send out mass emails. Post comments and let us know how things are going wherever you might be.

xo,
kac (Karen-Ann and Chris).

Posted in vacation | 6 Comments