2010
06.30

It’s A Gas!

Today I wanted to try something new so I did a modified endurance / grappling circuit I saw Randy Couture do during his training:

Original workout was done with a bar @ 95lbs, I used 2 35lb kettle bells. The goal is to do whatever weight is manageable to you to do all six sets and all 8 reps per station.

8 Bent Rows
8 Erect Rows from hanging position
8 Military Press
8 Good Mornings (shoulder rack the weight)
8 Lunges each leg (dead hang)
8 back squats with immediate push press (2 motions, not a thruster for extra gassing.)
8 dead lifts

X 6 with a 1 minute rest in between.

Now here’s the gas! Your goal is to not put your weight down for the entire set. rest as much as you need, but don’t put the weight down.

Have fun!

2010
06.28

? W.O.D.

5 rounds of:

10 Double KettleBell thrusters w/ 35lb bells
10 Double Kettlebell Bent Rows w/ 35lb bells
10 Pushups
10 situps
10 Double Kettlebell SDHP w/ 35lb bells

2010
06.22

iPhone Upgrade

So last night I upgraded my iphone to the new OS4. I have a 3gs.

I basically expected something to go wrong with the update, but it turned out to be a non-event.

Everything went perfectly smooth on the upgrade.

New Awesome Features

Really didn’t notice much here either. Now my wallpaper is visible all the time behind my phone icons and the icons “explode” outward when I suspend / initialize the screen. Apparently none of the apps I use support running in the background, so it’s pretty much same experience for me!

2010
05.06

Look Ma!

I’m in the cloud!!

2010
04.04

Roo!

I’ve been playing with Spring Roo a bit over the past few days while taking fresh look at which agile web frameworks exist in the Java world.

One of the things I liked about Roo is that there is no run-time / scripted portion of Roo, it really highlights how great AOP can be.

One thing that’s kind of nice that I sort of wish you could find in either Symfony or Rails is the ‘finder list’ function of the Roo shell.

During / after definition of your model with Roo shell, you can use the finder list command to list available finder generation for a given class:

Finder List Roo shell hint

Basically the finder list command will list a sensible default set of finders for operating on a class field, based on it’s type.

Quite often you’ll want something more complex than these, such as ‘findActiveGoalsBetween(Date d1, Date d2) but using the default ‘between’ finder stub would be a good jump-start on that.

I look forward to exploring Roo more!

As a side note, if any of you want to start playing with Roo, I’d strongly recommend simply installing the SpringSource Tool Suite. I spent about an hour trying to include the assorted plugins I wanted within the default eclipse JEE install, it’s just easier to download STS.

2010
01.13

Rails didn’t move a mountain.

Rails didn’t part the Red Sea.

Rails only really had to do one thing to make me a convert:

Rails read my mind. That’s it!

Here’s what happened. I’m building a relatively simple little webapp, but was having an issue of how I wanted to handle some functionality over the weekend. I had two models, a service item and a service. The service item had a price and the multiple service items that belong to a service made up the total for the service.

I initially started out with a one to many relationship between a service and service item but then ran into a problem: If I updated the price of a service item, I didn’t want to update the price of *every* service item that had previously been associated with a service. I briefly flirted with the idea of just duplication entries in the service items table, which would work, but soon became unweildly as I try to juggle between a set of possible service items and the set of cloned service items that were actually associated with a service.

It was a bad idea and quickly crashed.

The solution I came up with was to change the relationship to a many to many relationship through a service_service_items table. Then I would keep the current price for a service item in the service item table and then store the price for a particular service >> service_item relationship in the join table. Should be relatively simple I thought, wouldn’t take too much extra code to update the price of the join table on save and remember to only read the data from the join table. I’d have to probably create a model for the join table but some extra convenience methods in the model and I’d be gold.

So I got started.

I created my join table, updated each of my models to specify the relationship to has_and_belongs_to_many (habtm) and ran rake db:migrate

I thought I’d use the interactive console to create some services and service items to make sure the relationship worked, then I’d get down to writing the extra code to manage storing / retrieving the price in the relationship column.

Created the service, saved it and checked the database.
Good it was in the table

Created a service item, assigned it a price then added it to the service_items collection of the service.
Saved the service and checked the database.

The service item was saved through the collection. Perfect.

Checked the relation table to make sure it had a row reflecting the relationship I just created:

Screen shot 2010-01-12 at 10.42.40 PM

I looked at the database table for a second, trying to figure out what had gone wrong! Then after a couple seconds I realized that Rails just KNEW what I wanted to do. since I named the field in the relation table the same as the service_item, it automatically just added that data to the relation table for me.

This was too good to be true. I decided to update the price on the service item and save it by itself.
The price updated but the history in the relationship stayed intact!

I grabbed a copy of the service from the database and checked the price on the related service_item:
It read the old price!

Rails was handling the entire operation for me!

That sealed the deal. I officially love Rails.

Okay so this is a relatively simple thing and a common solution for a common problem.

But this is the great thing about Rails. It just does things for you.

I was excited! When you’ve been programming for many years, it feels good to be excited about a language or framework.

Whoever came up with this feature is a great man.

Like Ghandi.

Thank you web development Ghandi.

2009
12.30

Git on Rails!

So I’m beginning the new year (technically started the beginning of December) with two new projects. With these new projects I decided to finally take the opportunity to do a couple things I’ve wanted to do for a while: use Rails and use Git.

Rails I hadn’t used for anything because truthfully I didn’t really feel like deploying my applications using fastcgi or mongrel, I just didn’t want to mess with it. Then I took a look at Phusion Passenger, it was exactly what I had been waiting for.

I made the plunge!

I’m still at the very early stages of the projects, but I had a couple thoughts on starting to use both pieces of software:

Git

Not a lot to report here. It does a lot of the same stuff I’m used to, but has a lot of other cool features. I’m mostly jazzed about the ’stash’ command, as that will speed up trying out new features on a branch greatly for me. The only thing that I’m not excited about is the commit serials. Maybe I’ve just been doing it for so long, but when working with other people I find it particularly easy to refer to changesets as 8999 or 12391. The serial seems a little more cumbersome, but I’m still at the beginning stages, so I may find an easy / convenient way of handling this in the future.

Rails

So far this has been great. I had done some pet projects in rails 1 and played with rails 2 when it came out. The biggest boon for me so far has been that when I started to work on my project, I was equally unfamiliar with (controller)action / view layers as I was with the testing components, so I sat down and learned the testing components *first*. This so far has turned out great because I roughed out the near entirety of one of my apps functionality in unit and functional tests before really writing much of the standard app at all. I ended up with great test coverage (thanks rcov!). I really like the quality of the rails plugins I’ve encountered so far. ActiveMerchant is so easy to use compare to alot of other payment gateway libraries I’ve used in PHP land and if feels good to be saying collection.size again instead of count(collection).

2009
10.22

Earthly Delights

I picked up the album “Earthly Delights” about a week ago. I’ve been mulling the album over since, it’s just about all I’ve listened to, and I’d have to say:

5 stars.

Earthly Delights

As usual they prove to be an acquired taste, easily mistaken for aural insanity. With this album however I think they firmly prove why they should not be dismissed as “noise”. The music has further evolved from previous releases.
A few things stuck out immediately, the production quality on this release is a little bit lower than Hypermagic Mountain, but the result suits them just as well, and in fact works greatly to their favor on songs such as “The Sublime Freak” which sounded like raw energy encased in an early Guided By Voices recording.

The treat we’re given on this album is a bit more vocal work than on previous albums. There are some really great melodies working together in songs like “Nation of Boar”, “Colossus”, “The Sublime Freak” and “Rain on the lake I’m Swimming In”.

In my opinion the songs on this album should be listented to as a sort of textures, I’ve always loved Lightning Bolt because by not giving you anything to directly focus on, you are free to just imagine whatever the music makes you think of at the time, the music then becoming the soundtrack to your imagination. As such, this album would have been a great opportunity to really stretch the actual production of the songs in the studio, playing with production dynamics of the songs a bit, maybe making a few more of the songs more lo-fi, fades, a little more volume dynamics, playing with the panning, maybe stretched into something a little more “psychedelic” for lack of a better term.

Maybe that will be the evolution for the next release.

Don’t miss out on these guys.

2009
10.22

Now it’s Autumn

New swing in the new backyard. I like watching the leaves fall, calming.

Unfortunately the iphone camera doesn’t do the colors of the leaves justice:

2009
09.24

On a recent Symfony 1.0 project I’ve been working on, I noticed that there were quite a few pages that heavily made use of a particular database table that basically held a set of data that would rarely change. I thought it would be nice to implement a second level cache for  these objects at the ORM level,  I used to use a similar technique with Hibernate and EHCache on my Java projects.

I started poking around the Propel documentation, looking into what features they had to offer in this area and came across a few forum posts requesting that sort of second level cache functionality, but it looked like those features were not going to be implemented until a later release, not going to do me much good for my current project.  But I found a way, and it turned out to be pretty simple.  enter memcache function caching.

Read More >>