Wednesday, December 22, 2010

Hardwood Floors - Day 2

Yesterday, we finally started installing the floor.  Still going slow, but just from the small amount we finished, I can already tell it's going to look amazing!

Drumroll, please!  Here's the very first board!



While the boys were busy installing the planks, I was out in the garage painting all these quarter round toe kicks.  I cranked up some Eminem to help me through it, but after painting 5 12ft strips, not even Eminem could keep me warm in that freezing weather.  And it seems like it's going to be even colder today!



A lot of loud sawing was heard throughout the house too.  We have to trim all the door jambs to fit the flooring...


And of course, Miss Lillerskatez (aka "Lily") wasn't too pleased with all the noise:


Here's the work in progress.  Note the skillful use of a jigsaw to fit the planks in the closet :)



By the end of the day, the closet was finished and a couple more rows were added on before we all crashed on the couch eating homemade pizza and watching "My Name is Earl".

Tuesday, December 21, 2010

Hardwood Floors - Day 1

It's so exciting to finally see some progress in the hardwood floor project.  Granted, no actually flooring has been installed yet, but here are the adventures in measuring and learning from Day 1.

First, we measured everything about eleventy billion times trying to find the center of the room.  Laser tools are fun, mmmkay!




Then we installed the underlay.  Looks like a golf course, huh?  That stuff is pretty fun to lay down because it has peel and stick tape! :D  That's the first box of Bamboo we opened!


The last thing we did was to lay down a row of planks to see how many we needed and how much trimming we're going to need to do to fit everything in the room.   Not sure if you can tell, but the first 1/3 of boards are lighter than the last 2/3.  Apparently, we were given 5 boxes of light-colored floor and 30 boxes of medium color.  It's gonna looks so cool all mixed together!


Up close, you can see how much character bamboo flooring has.  My floors are going to have personality!


Doesn't seem like we got much done, but the first day is a learning curve.  The rest should go a lot quicker.... knock on wood...

Sunday, December 19, 2010

Adventures in Preparation

As a lot of you already know, we're installing hardwood floors over the next 2 weeks.  In the past couple weeks, I've been doing a lot of cleaning and organizing.  Here's some of the fun I've had...

First, we had to clear out the dining room so we could bring all the boxes of bamboo flooring.   Why bamboo?  It's a green material since it renews about every 4 years and it's got a lot of character because of bamboo's unique rings.  That's a lot of boxes!  1000 square feet of flooring, to be exact.



Then I discovered that I could probably make an entire army of dust elephants with the amount of dust there was in places I forgot to clean.... ever.... Hey, don't judge me!



I also discovered we had more wires (or "waiiiiiires" as Lester in "Scooby Doo and the Alien Invaders" says) than a radio shack, but I found a nifty way of organizing them! :)



While I was searching for other ways to organize things, I came across this awesome Instructable on how to create your very own Hungarian Style Shelves .  I am definitely going to be doing this once the floor project is finished! (Picture below is from the Instructable)


After I finally got the office all cleaned out, I started on my bedroom.  I got rid of so many clothes.  This closet used to be full of shoes and clothes and all those hangers were recently separated from their beloved shirts.


Next, I'll be going to Goodwill to get rid of all those clothes.  I've already sold several things on Craigslist, such as a Lay-Z-Boy, some fish tanks, headboard & footboard, and a cat gate that does not work with my cats. 

And here we are... The first strip of carpeting removed!  I can't wait to see how the new floors are going to look!  Stay tuned....



Saturday, April 24, 2010

Using has_many :through for a Triple Join

I'm in the process of coding a Rails program and came across a situation where I need to define relationships between three tables that have one overall join table. I looked for more than an hour to find a good example on the internet and never found one that fully explained what I needed. Finally, I was able to piece together a couple snippets from different places.

Since I had such a hard time finding what I needed, I've decided to write up my problem and my solution in detail in hopes that it will help someone else out there who's looking for the same thing I did. I apologize in advance that I can't remember where I got some of the information, but I'll try to give credit if I can.


The Problem
I want to create the following tables and set up the relationships in Rails:
( ... ~ more data in the table)

people
id
name
...
properties
id
name
...
property_types
id
name
...
people_properties
person_id
property_id
property_type_id


Does Your Data Fit?
Think about the relationships like so:

 A  belongs to 0 or more  B  and  B  has 0 or more  A  with  C .

Therefore, my example looks like:

A property belongs to 0 or more people and a person has 0 or more properties with a property type.

If your data fits the general formula, then this is the solution you're looking for.



Creating the Scaffolds/Models in Rails
Depending on how your program is set up, you'll either generate a scaffold or make it simpler with just generating the model.  For this exercise, I'll build scaffolds for all the tables and a model for the join table.  The '...' indicate that you can add more columns to the tables if you'd like.

ruby script/generate scaffold person name:string ...

ruby script/generate scaffold property name:string ...

ruby script/generate scaffold property_type name:string ...

ruby script/generate model people_property person_id:integer property_id:integer property_type_id:integer

At this point, you can open the migration files for any of the models above and include any additional information such as creating an index for the people_properties join table.  You can probably set :id => false for the join table since there will be no need for rails to look at ids for the join table.


Creating the Relationships

The has_and_belongs_to_many method won't work for this scenario (and most rails programmers seem to dislike the HABTM method), so we're going to use has_many, belongs_to and has_many :through methods to set up our relationships.

Using the generic formula from above, think about setting up your relationships like so:

A has many Joined elements.
A has many B through the Joined elements.

B has many Joined elements.
B has many A through the Joined elements.

C has many Joined elements.

Joined elements belong to A.
Joined elements belong to B.
Joined elements belong to C.

Using my example data of People, Properties, Property Types, and People's Properties (a.k.a Joined elements), each model file should look like:

class Person < ActiveRecord::Base
has_many :people_properties
has_many :properties, through => :people_properties
end

class Property < ActiveRecord::Base
has_many :people_properties
has_many :people, through => :people_properties
end

class PropertyType < ActiveRecord::Base
has_many :people_properties
end

class PeopleProperty < ActiveRecord::Base
belongs_to :person
belongs_to :property
belongs_to :property_type
end


Putting It All Together
Just type rake db:migrate and you should be good to go!


Sources
Triple join in Ruby on Rails [Stack Overflow]
Do I need to manually create a migration for a HABTM join table? [Stack Overflow]
Same model, multiple has_many :through? [Rails Forum]
has_and_belongs_to_many in Rails [Stack Overflow]

Disclaimer
I'm a Rails newbie and might have made some mistakes or provided a solution that might be overkill.  All I know is after searching for awhile, this is what I finally came up with that worked for me.  If you have any suggestions for improvements, please let me know.

Saturday, February 6, 2010

Fun Stuff I Got For My Birthday!

First on the list, to enhance my Dragon Age: Origins gameplay, I got the two downloadable content packages: Warden's Keep and Return to Ostagar.  I've played the game for about 76 hours so far.  I'm definitely one of those completionist types who explores every little detail of everything.  Since I'm about 2 major quests from the end, it's nice to have something extra to do.  Then it's on to the expansion pack in March :)  After that, Mass Effect, here I come!

 
When I'm not gaming, I should probably do some working out on my own in addition to the Tae Kwon Do.  I have the original Core Performance book which is really awesome.  Now I've got the Women's edition to round it out.  Mark Verstegen's program is really great and I highly recommend it to anyone at any fitness level.  He concentrates on working your core muscles and using multi-joint exercises (which more resemble everyday life movement than single-joint exercises most people usually do).  He also incorporates active stretching and active resting.  Very sound program and great for getting in shape.


Then there's these lovely gems.  Cookbooks for bread, bento and yummy vegetarian meals!  I can't wait to try stuff out of all of these.  I'm so excited!

 

(As opposed to the Unconscious Cook or the Comatose Cook.  Both sure to come out soon.)



And my favorite one so far!!!!
("Kawaii" means "cute" and "Bento" means "Lunchbox" in Japanese)


Last but not least, I got a nice little political humor book by H.L. Mencken titled Notes on Democracy.  The back of the book reads:
Wars for "freedom."  Fundamentalists intent on banishing Darwin from the classroom.  Intrusive laws.  H.L. Mencken wrote Notes on Democracy over 80 years ago.  His era, the years of World War I, Prohibition and the Scopes Trial, is strikingly like today.  Dissident Books reintroduces this gem of cynicism and clear-thinking to a new generation.  Don't even think about voting until you read this book!

Thursday, February 4, 2010

What's Cookin': Breads and Snacks!

Even though I haven't been posting recipes lately, I've definitely still been making them!  I have several delicious recipes to share with you today.  Plus more to come tomorrow :)


First on the list are two snack recipes: No-Bake Almond-Oat Energy Bites and Chewy Granola Bars.  I made these to have something handy around the house I could eat between meals.  Both these recipes are also great for wrapping up and carrying on-the-go in case you get hungry when you're out and about.  They are both from vegetariantimes.com, are super easy to make, and incorporate delicious earthy-tasting almond butter.  While they are high in calories for a serving size, they're definitely very tasty and filling, making them the perfect between-meals snack.  The only drawback to the energy bites is the necessity for a grinder or food processor.  Neither are vegan or gluten-free, but I'm sure substitutions could be made.  I give both recipes 4 stars.


Next on the list are several breads.  All were very easy to make and delicious! I found this Pita Bread recipe on Food Network's website and I liked it so much, I've made it twice in the last 2 weeks.  It takes several hours, but all the steps are really easy.  I was skeptical about the pitas "ballooning" but sure enough, they did!  It was awesome to see and it has to be the best pita bread I've ever tasted in my life.  I will never buy pita at the store again.  Definitely 5-stars!




I planned a dinner party to celebrate Imbolc and decided on this recipe for Honey Wheat Braided Bread to use during the dinner.  I had a lot of fun making this bread because you get to actually braid it!  While the recipe called for the braided loaves to be wrapped around themselves, I thought they looked great flat.  I also only had black sesame seeds on hand instead of regular ones, but I have to say, I think the finished bread looks marvelous with the black ones.




We've been making homemade pizza for awhile now.  Usually, we buy pre-made pizza dough already rolled out and ready to decorate.  But we decided to seek out a whole-wheat dough option we could make in the bread maker.  I searched the nets and found Bread Machine Pizza Dough with Whole Wheat Flour.  Very easy to make, just dump the ingredients in your bread machine, push the dough cycle, and 2 hours later, you're ready to make yummy pizza!  We opted for cheese pizza with garlic tomato sauce.  The crust came out crunchy on the outside and chewy in the center.  Just perfect :)


No-Bake Almond-Oat Energy Bites ★★★★
Chewy Granola Bars ★★★★
Pita Bread (V) ★★★★★
Honey Wheat Braided Bread ★★★★
Bread Machine Pizza Dough with Whole Wheat Flour (V)★★★★★
V = Vegan, GF = Gluten-free

Saturday, January 23, 2010

Avatar discussions... again? No, it's about the responses it's elicited.


I'm on an email list for a Naturalistic Paganism group and there's been a lot of discussion about the movie Avatar.  I would say that pretty much all of it has been positive since Avatar portrays a story about a nature-based civilization.  However, an email came through today in response to another member's email defending the nature-based side of the movie against the "small (but vitriolic) backlash against Avatar by fundamentalist Christians".  The response to his email was, in short, to say that participating in these types of arguments is a "waste of time" and "all the brou-ha-ha about the movie has made [her] ambivalent feelings about going to see it in the first place swing right on over to the side of 'now I know for sure I don't want to see it.'"

I decided to respond to her notion that Avatar (and possibly other movies by her implications) is "just a movie" and people like the original poster and the fundamentalist Christians should "get over it".  I also thought my response was meaningful enough to me to share it with others:

I think one of the greatest things about humans is that we do find deeper meanings in movies (and other works of art) and are willing to discuss them.  And yes, sometimes argue about them.  By finding deeper meaning in things, it allows us to develop and strengthen meaning in our lives or at least serve as parables to help us understand things around us.  You state that you're not making a commentary on others' likes and dislikes, but your very email makes a commentary on those that choose to participate in these types of discussions (argument or otherwise).  Some people do feel strongly enough to respond in a way that you may feel is arguing, but that's their choice and they may find meaning in it that you don't.  It's unfortunate that you've chosen to allow the "brou-ha-ha" to influence your choice to see Avatar (and probably other movies in the past).  Without seeing it, it would be difficult for you to understand where [the original poster] and others are coming from.

Just like the point [the poster] made in his original email: without suffering and death in the world, it would be hard to distinguish what makes things wonderful.   I think the same thing applies to discussing differing viewpoints in art and film.  I feel discourse between those around me helps me to find a deeper appreciation for those works.  Granted, I usually find my own meaning, but as I listen to or read what others have to say (whether I agree with them or not), I find it helps me to strengthen and refine my own viewpoints about the movie and sometimes about my own faith and understanding of the world.  Avatar happens to one of those movies that does make commentary on many religious and political levels and that's why there is so much discussion about it.  It would be remiss for you to say that it doesn't make those kind of statements since you have never watched it.

I do agree that Avatar does have a common story with a common theme underneath all the glamor, but if you look at lot of art and film in this world, they would probably fall into the category of "common story/common theme" as well.  What makes a movie that tells a common story great, is how much it's able to touch the people who watch it.  How much it's able to get people thinking and talking and yes, even arguing.  Just because something has a common theme, doesn't mean people can't take significant meaning from it.  Go back to Winnie the Pooh or Aesop's Fables, for example.  Those are common stories with common themes, but there's so much meaning in them.  I would never consider them "just books".

These discussions aren't about coming out as winners in the end. You're right, no one does come out as a winner.  But no one comes out as a loser either.  It's all a matter of perspective and you take from it what you will.  In your case, you've chosen to forgo watching the movie altogether.  And that's your choice.  And you feel that taking part in these discussions and arguments is a waste of time.  And that, too, is your choice.  But please respect those who do feel it's worth their time to participate and recognize that even though you may not get something out of it, others will.
Thanks for taking the time to read it. Please tell me what you think.