<?xml version="1.0"?>
<rss version="2.0"><channel><title>r a d i a n t e n e r g y . o r g</title><link>http://radiantenergy.org</link><description>radiantenergy.org news</description><language>en-us</language><pubDate>12 08 2008 22:43</pubDate><lastBuildDate>12 08 2008 22:43</lastBuildDate><generator>Eric Lundberg</generator><managingEditor>editor@radiantenergy.org</managingEditor><webMaster>webmaster@radiantenergy.org</webMaster><item><title>Marin Century Ride - 2008 106 miles on a bike - are you crazy?</title><link>http://radiantenergy.org/blog/2008_08_02_Marin_Century_Ride_-_2008.html</link><description>
So I did the Marin Century ride today, which was quite an event.  The
  longest ride I had done before was 45 miles up to the top of Mount
  Tam, so this was a change!  Mostly it is just a long time to be
  riding a bike.  There are several large hills on the route as you
  can see on
  the map
  and there was a bit of a cross wind and head wind from time to time.
  But, overall the weather was quite good. Sunny with a cool breeze
  most of the day as we were near the coast.  The early morning views
  of valleys with clinging pieces of fog were classically Californian
  coast.  There were 4 rest stops on the route, all with lots of good
  food and drink and restrooms.  I had lunch part 1 at the second rest
  stop and lunch part 2 at the third rest stop.  After about 60 miles
  my ass was starting to hurt - not surprisingly it continued to hurt
  more for the rest of the ride.  My left calf threatened cramp up but
  never did.  My right knee got a bit twingy after 80 miles and around
  95 started to hurt if I put much force on it, so I mostly used my
  left leg to get me up the last big hill then coasted the rest of the
  way in.  I thought it was interesting that I wasn't really slowed
  down by my cardio or my length strength but more due to the rest of
  me wearing out.  That is to be expected I think since I didn't build
  up slowly to a 100 miles.  The book The Complete Book
  of Long-Distance Cycling was pretty handy tool for figuring out
  what I needed to do to train, but I only had 6 weeks and there is
  only so much one can do.  Oh and my right big toe had the outside
  edge go numb, but it's done that ever since that fateful backpacking
  trip in '98 so I was expecting it.  I wore a lot of sunscreen but
  got a little bit burned on the back of my calves as the sun shifted
  around.  I also had some king of bug fly into my shirt and get
  caught which involved me then pulling over and frantically trying to
  let said bug out as I could hear it buzzing around under my jersey.
  Eventually I got it to fly out of my sleeve!  The total route was
  106 miles with 6250' of elevation.  From start to finish was about 9
  hours for me.  I was on my bike for 7 hours and 15 minutes, so
  lunch, rest stops, and bug removal definitely took up some time.  My
  average speed was 14.3 MPH while I was on my bike.  Definitely nice
  that they had a good spread of food when I finished (including free
  hagen-daz ice cream!)  I certainly slept well that night. :)

</description><pubDate>Sat, 2 Aug 2008 04:45:00 PDT </pubDate><guid>http://radiantenergy.org/blog/2008_08_02_Marin_Century_Ride_-_2008.html</guid></item><item><title>Postgres Partitioning and hibernate Oh the humanity!</title><link>http://radiantenergy.org/blog/2008-08-01_Postgres_Partitioning_and_hibernate.html</link><description>
    So I was trying to set up some data to go into a partitioned table in postgres and given our architecture relies on hibernate I thought it would be nice to be able to be consistent and use hibernate to push the data into the partition and read it out.  I also wanted the partitioning table creation to be handled more or less automatically.
   Setting up the partitioning in postgres was fairly easy.  I created the master table FOO and an insert trigger on foo that calls a pl/pgsql function insert_foo.  The FOO table is partitioned by date, so in insert_foo I take the date of the record to be inserted (NEW.datecreated) and use that to build up the name of the partition table I really want to insert it in: FOO_082008.  I then use that table name an build a string that contains an insert command (carefully using quote_literal on the values to be safe) and EXECUTE that command.  I catch the undefined_table exception which is thrown when the date rolls over to a new month for which we don't yet have a table.  In the exception handling code I dynamically create the table and rerun the original dynamic insert.  
   This actually all works quite well.  The problem is hibernate, or more specificly hibernate helpfully trying to check for errors for you.  Basically when you tell hibernate to save a Foo object it runs the insert on FOO.  The trigger catches that and instead inserts the data into FOO_MMYYYY and returns null so no further processing by the database is done and the jdbc driver returns saying it inserted zero rows into the FOO table, which is technically true, and hibernate freaks out because it is expecting that 1 row should have been saved.  That is reasonable enough, but annoyingly there is no way to tell hibernate you really expect zero rows.  The exception that is thrown is a fairly generic HibernateException, so the only way to catch and swallow this one particular case would be to text match on the error message.  We all know what a terrible idea that is, so we are a little SOL.
   There are two things that seem like they would work with hibernate.  One, is to use a postgres RULE instead of a pl/pgsql FUNCTION to do the partitioning.  RULEs basically rewrites the sql you are going to run, so from the jdbc driver point of view you should get back that you did, in fact, save 1 row to FOO_MMYYYY.  However I've never used rules and from what I can gather from my checking out the less that totally awesome documentation on the subject, it doesn't seem like I can do the same level of magic table creation.  You would have to maintain the rule so that each month you added a new if/then check to save the data to the appropriate table for the month and create the new table for the month.  Even if you did that once a year and pre-created a years worth of tables it is still maintenance and someone could still screw it up. (Quite easily given my experience with DBAs ;)  The other option is fairly hacky but does work.  If insert_foo returns NEW instead of NULL then the insert operation continues just like before the trigger was activated and the jdbc driver reports 1 row saved and hibernate is happy.  Of course the problem is that we now have one copy of the data in FOO and one in FOO_MMYYYY, that's no good as all FOO_MMYYYY table inherit from FOO so all queries on FOO will return duplicate results.  So to get around that you can make a table FOO_IN that is the same definition of FOO.  In the hibernate mapping you map FooIn to FOO_IN and add a trigger on FOO_IN to call insert_foo.  You modify insert_foo to return NEW and to delete from FOO_IN, this all results in a copy of the data going into FOO_MMYYYY and another going into FOO_IN, which is deleted the next time anything is inserted.  Of course you can't use hibernate to read from FOO_IN since there is nothing there.  So you create another mapping for a class FOO_OUT that is the same as FOO_IN but maps to the table FOO.  This is a little redundant but you only have to do it once.  You can make FooIn and FooOut inherit from FooBase and use that in places the data could be read in or out.  
If there were someway to do a DELETE in postgres that doesn't cascade to the child tables you could get away with one mapping and insert_foo could return NEW and also delete from the FOO table.  That is a little problematic as you would always have 1 duplicate row in the master table, but I can't figure out how to actually do that, so it isn't much of an issue.
Of course depending on what you are doing you can also use straight sql, but kind of annoying to do the whole mix and match with database.  Anyway maybe there is a better way but I couldn't work it out after a day of poking around.

References:
Hibernate In Action Is a pretty good reference for Hibernate and PostgreSQL Developers Library is one I want to get for postgres at some point in the future.
  </description><pubDate>Fri, 1 Aug 2008 15:23:00 PDT </pubDate><guid>http://radiantenergy.org/blog/2008-08-01_Postgres_Partitioning_and_hibernate.html</guid></item><item><title>Bachelor Party Weekend A study in relaxation and Whitewater</title><link>http://radiantenergy.org/blog/2008-07-17_Bachelor_Party_Weekend.html</link><description>

    The bachelor party was a great success, quite a time was had by
    all and it was super relaxing.  The short version is I picked up
    Cannata and Alan Thursday night around 8 at the Sacramento
    airport.  We drove to the store to pick up some supplies - which
    was easier said than done.  Despite the massive MASSIVE strip
    malls we found, we couldn't find any grocery stores.  We
    eventually found and bought as many groceries as we could fit in
    the car with us, and headed back to the airport to pick up
    Archibald.  At which point we actually had to find the house,
    which wasn't too bad with our multiple GPS units, but still harder
    than you would expect.  For instance having two "Feather River
    Blvd"s within a few miles of each other that both intersect the
    road we were one was a bit of confusion to say the least -
    particularly when one led into a dead housing development project
    where they had built the roads but no houses.  The directions once
    we got to the lake were a little dubious and some slight mis-turns
    ensued, driving down random dirt roads near midnight is all sorts
    of fun.  We did make it to the house, and while poking around
    after midnight discovered someone else inside.  If that doesn't
    sound like the start of a horror film I don't know what would!
    Turns out he is the tenant of the apartment in the house who as
    part of his agreement with the owner doesn't stay around when the
    place is rented out and hadn't heard that we were going to be
    there.  A bit creepy but acceptable.  We hung out on the deck and
    caught up, had some drinks and snacks and Cannata made friends
    with the local cat.  
    
    A decent lay in the next day and then some
    breakfast and exploring around the grounds.  Had a lovely swim,
    cold but OK once you get used to the temp, and the plants grabbing
    at your feet. ;) Had some chicken jalapeno pepper jack sausages for
    lunch number one, sadly one of the sausages exploded melted white
    cheese all over Cannata's eye and face.  Luckily he shut his eye
    in time and no lasting damage was suffered - expect, perhaps, to
    the sausage involved, which was savagely consumed moments later.
    A little while later Mike and Steve showed up and we had lunch
    proper and continued our relaxed plan of hanging out around the house.
    My cousin, Matt, made it up in the early evening, at which point
    we were only one car load of people short.  That car load had been
    delayed by the construction on 5, all the entrances and exits were
    closed so they had to do some serious extra driving.  They did eventually make it up and much rejoicing was had.  There was
    plenty of food and booze and even talk of going to the strip club
    in Smartville labeled 'girls' which thankfully didn't happen (because honestly a strip club in a little town in the foothills has got to be a bit dodgier than most.)  We
    turned in relatively early so we could have time to grab some
    breakfast before going rafting.  

Which is what we did!  Despite
    the desire of the rafting company to have everyone there at a
    certain time, they were pretty slow in actually doing anything once
    we were all there at said time.  But we did get out on the water,
    get a few quick instructions from the guide, and head off down the
    river.  It was a great day for rafting, super hot out, with a cold
    river to dunk into.  Very pleasant.  The rapids weren't too rough,
    just good fun!  I think we were all amazed by the traffic on the
    river, tons and tons of rafts!  We were in two boats of 5 which
    was slightly too bad, but given how packed those big rafts were, the two rafts were
    probably more fun for everyone.  There was a pretty good spread
    for lunch, fancy DIY sandwiches, lemonade, cookies - good work
    for pulling up on the side of the river.  Being the bachelor I got
    a bag of swag while we were setting up that included a water proof
    camera so there are some shots of us on the river, though not
    actually in the rapids because I was required to paddle.  Speaking
    of paddling though I got demoted after lunch from my front
    position, I was apparently too distracted with the scenery and
    generally relaxing - ha ha! :) We finished the trip and helped
    carry all the gear up to the truck, maybe a hundred feet above the
    river.  What was kind of amazing is several years ago the river
    was actually running almost that high.  You can see in a couple of
    my pictures the large amount of exposed ground from the current
    river up to the vegetation line.  That would have been pretty nuts
    to see!  We picked up CDs of everyone going through the two
    bigger rapids and drove back to the house.  

    It was a long day and
    we didn't get there till about 8PM, luckily James had been
    guarding the place for us and making sure the hot tub worked -
    which was also probably extremely good for his back so everyone
    won!  We perked ourselves up with some coffee and started in on
    dinner and drinks and hung out and chatted till a sold 3:30 in the
    morning.  Up at 7:30 to see off the first wave and get a start on
    breakfast.  After that the trip was basically over, we cleaned,
    made sure everyone had their commemorative mug, and headed out -
    all much more relaxed that when we arrived! :) An excellent
    bachelor party for sure!

  </description><pubDate>Thu, 17 Jul 2008 17:10:00 PDT </pubDate><guid>http://radiantenergy.org/blog/2008-07-17_Bachelor_Party_Weekend.html</guid></item><item><title>2008 Pacific Coast Brew Off</title><link>http://radiantenergy.org/blog/2008-06-29_2008_Pacific_Coast_Brew_Off.html</link><description>Jake and I entered the 2008 Pacific Cost Brew off with a batch of American Brown Ale we had made about a month ago.  The contest was held today, and while we didn't win anything it was a great time.  Not to mention we got free t-shirts, tasting glasses, and the opportunity to try a variety of good beers.  We are definitely at the low end of the brewers with our very lax production schedule, bottling instead of kegging, and doing partial mash instead of all grain.  A couple of brewers had 7+ entries in kegs which was pretty impressive.  Everyone was essentially an enthusiast and were all very supportive and encouraging of each others efforts.   The contest was held in Potrero Hill, with tables for the brewers, a couple of tents, a DJ, and surprisingly cooperative weather.  We drove over around 12:30 to set up our booth and taste the other entries before the general public started in on them.  Molly had made cookies as palate cleansers / bribes and Jake had made a nice label for our bottles so our table area looked pretty good, almost professional one might say.  Poured beer till we ran out around 4:30 and the results were announced at 5.  Definitely a good experience and hopefully one that we will repeat in the future.</description><pubDate>Sun, 29 Jun 2008 18:40:00 PDT </pubDate><guid>http://radiantenergy.org/blog/2008-06-29_2008_Pacific_Coast_Brew_Off.html</guid></item><item><title>Good Day Catnip and Sunsets</title><link>http://radiantenergy.org/blog/2008-05-14_Good_Day_Good_Day.html</link><description>A good day for all.  We started letting the cats explore the deck with supervision and Chufi finally found the catnip plant.  He was extremely, EXTREMELY, interested.  Rachel and I had a nice dinner sitting out on our deck watching the sky change color and get more and more dramatic.  Can't beat good food, company, a glass of wine, and an amazing sunset.  The pictures speak for themselves I think. </description><pubDate>Wed, 14 May 2008 20:02:00 PDT </pubDate><guid>http://radiantenergy.org/blog/2008-05-14_Good_Day_Good_Day.html</guid></item><item><title>Monkey Wine Furry Pinot Noir</title><link>http://radiantenergy.org/blog/2008-04-25_Monkey_Wine.html</link><description>I recently tried this Pinot Noir from Germany.  I now know why the Germans are not renowned for their red wine.  The bottle was the best part, with the raised glass painted monkey, a real classic.  Sadly the wine tasted kind of like the monkey, which is a tasting note I don't particularly care for in my wine.  Alas.  </description><pubDate>Fri, 25 Apr 2008 22:30:00 PDT </pubDate><guid>http://radiantenergy.org/blog/2008-04-25_Monkey_Wine.html</guid></item><item><title>Grilled Catfish</title><link>http://radiantenergy.org/blog/2008-04-22_Grilled_Catfish.html</link><description>Grilled up a little of the mighty Mike Spencer catfish special.  Super easy to do and tastes great.  Get yerself some meat rub from whole foods, such as the Blackened Cajun or Jamaican BBQ (in the meat section, not the spice section) or if you aren't into shopping at Whole Paycheck, grab similar products off amazon (Cajun Jamaican.)  Get some catfish fillets, which are great because they are cheap, environmentally friendly, and taste great.  Lightly butter the fillets then totally cover in seasoning and grill on full heat 3 minutes a side.  Very tasty.  I tried to use tongs to get flip the fish which was a bad idea, you really want a spatula or more specialty fish grilling equipment.  Thanks again to Mike Spencer!
</description><pubDate>Tue, 22 Apr 2008 18:12:00 PDT </pubDate><guid>http://radiantenergy.org/blog/2008-04-22_Grilled_Catfish.html</guid></item><item><title>The Kite Runner Worth a read</title><link>http://radiantenergy.org/blog/2008-04-18_The_Kite_Runner.html</link><description>I recently read The Kite Runnerafter hearing it was a good read from my friend Molly.  Definitely not disappointed.  It is pretty easy reading and I cruised through it in a couple of days, the characters were great, with good pacing and plot.  I have no basis for deciding weather any of the portrayals of Afghanistan were accurate or not, but I did enjoy reading them as I know very little about that part of the world and even the fictionalized version is probably a step in the right direction for me.  Anyway, a good read, recommended.</description><pubDate>Fri, 18 Apr 2008 12:31:00 PDT </pubDate><guid>http://radiantenergy.org/blog/2008-04-18_The_Kite_Runner.html</guid></item><item><title>Our Sausalito Apartment The treehouse</title><link>http://radiantenergy.org/blog/2008-05-03_Our_Sausalito_Apartment.html</link><description>A number of you have been wondering what our place looks like, so at long last I have pictures of a more or less clean apartment.  The summary is we are on the bottom floor of a duplex built out over a canyon.  It is an 800sf 1 bedroom, with a walk in closet and nice deck that is about 50 feet off the ground.  Right in the trees for us!</description><pubDate>Sat, 3 May 2008 16:16:00 PDT </pubDate><guid>http://radiantenergy.org/blog/2008-05-03_Our_Sausalito_Apartment.html</guid></item></channel></rss>
