Ski Trip

I have recently returned from a nice vacation where I went skiing for the first time in my life. I went to Park City, Utah to Deer Valley Ski Resort with my sister Julie, my brother John and John’s Dutch friend Mark. We stayed at the condo of my sister Nancy’s friend Sharon. (Thanks Sharon!) I forgot to take my camera, so I don’t have any pictures to post. But if I get pictures from those who did bring cameras, I’ll put them up.

Day one involved three hours of ski lessons. They were ok at the beginning until we took our first ride up the ski lift. I was told to just stand up when I got to the orange cones, which I did and then promptly fell down. This scene was repeated on each of the first three times I got off the ski lift. Even the person manning the ski lift saw me coming and slowed the lift down to try to help me out. (It didn’t help.) I was starting to feel that I’d never ski because I couldn’t get off the lift. Finally, I learned not to stand up, but to crouch and lean forward, and I had my first successful dismount of the ski lift. This may make it sound as if I were in complete mastery of skiing, except for the ski lift. Nothing could be further from the truth. Once off the lift, getting down the hill was also an enormous challenge. Mark, Julie and I had attempted one “green” run which I thought might be the end of me. Aside from falling and being unable to get up, I was pretty much scared-to-death the entire way down.

I did learn how to turn and slow my speed down, which I did successfully. Though this also meant that it took me about 20 minutes to descend a mountain that 4-year-olds were getting down in about two. So, after my first day, I was not at all enjoying myself and was trying to think of ways to get out of the other four days of skiing that we had planned.

Day two started with me resigning myself to stay on “Wild West” (aka, the bunny hill) until I got a better hang of things. Happily, I had no ski lift dismount problems on this day. I still went down really slowly, but was starting to get a feel of how to ski. I skied just over half the day and then decided to relax in the resort and actually enjoy my vacation, instead of dreading it. I did learn that one of my legs (my right) seemed much stronger than the other. I could turn and push and do all sorts of things with my right leg that my left leg was having a hard time doing. Interesting. I need to do some exercises with my left leg.

Day three marked the arrival of my brother John and Nancy’s friend Sharon, two very experienced skiers. John was going to teach me how to ski, which I looked at with some trepedation. He can be altogether great and helpful at times, but at others, a picture of him could be used as the definition of peer pressure. Thankfully, he could tell that I was in no mood to leave the bunny hill. So he skied with me a little on it and offered some pointers. Then, they all went up the mountain to do some more challenging hills.

I learned a painful lesson this day about snow and the sun. It was REALLY bright this day and I didn’t think anything about it—until we were done. I was pretty sunburned and didn’t feel that well the next day. So, a couple of us decided not to ski on Sunday. The muscles in my legs were grateful for the day off.

Monday, turned out to be my last day of skiing and it was by far, the best. There was 11″ of new snow on the mountain and I finally left the bunny hill. We went to an upper run that was reputed to be pretty easy. Turned out it was and I skied it a number of times. Granted we tried another run, that was also “green”, but which was much more difficult. It had moguls, which is something I never need to ski on again.

The highlight of the day (for me) was at the very end when we were gathering to apres-ski. I was skiing a very easy slope right by the bar we were going to meet at, waiting for Mark, John and Sharon to get down the mountain. On one trip, I rode the lift with two girls who were about 12 years old. At the end of the lift, one of them got the tip of her ski stuck and fell off the chair. She was quickly followed by her friend who freaked out and also fell. Since one of them was basically beneath me, I couldn’t get off the lift at the proper spot. So I stayed on the chair and was lifted up about three feet when the lift finally stopped. After getting the girls out of the way, the person running the lift asked if I needed help getting down. Calmly, I said no, and just jumped. Happily, I landed right on my skis and skied off.

Working with Ruby

To set up a new project: ruby cookbook (using cookbook as the project name)

This will create the entire directory structure for a ruby project. Inside the directory called cookbook is:

-rw-r--r--    1 maryh  maryh  8001 Feb  1 11:10 README
-rw-r--r--    1 maryh  maryh   307 Feb  1 11:10 Rakefile
drwxr-xr-x    6 maryh  maryh   204 Feb  1 11:10 app
drwxr-xr-x    2 maryh  maryh    68 Feb  1 11:10 components
drwxr-xr-x    7 maryh  maryh   238 Feb  1 11:10 config
drwxr-xr-x    2 maryh  maryh    68 Feb  1 11:10 db
drwxr-xr-x    3 maryh  maryh   102 Feb  1 11:10 doc
drwxr-xr-x    3 maryh  maryh   102 Feb  1 11:10 lib
drwxr-xr-x    6 maryh  maryh   204 Feb  1 11:10 log
drwxr-xr-x   14 maryh  maryh   476 Feb  1 11:10 public
drwxr-xr-x   12 maryh  maryh   408 Feb  1 11:10 script
drwxr-xr-x    8 maryh  maryh   272 Feb  1 11:10 test
drwxr-xr-x    6 maryh  maryh   204 Feb  1 11:10 tmp
drwxr-xr-x    3 maryh  maryh   102 Feb  1 11:10 vendor

Once you have this, edit config/database.yml with the info for your (in my case) mysql database.

Next, create the new database:

yo:~/work/ruby/cookbook maryh$ mysqladmin -u root -p create cookbook_development
Enter password: 

Here’s where I get confused. I need to create tables in this new database. One example has me basically going into mysql and manually making them, while another has me use the migrate command.

script/generate migration recipes

This creates the db/migrate/001_recipes.rb file. Inside this file is where I believe I set up the tables for my database.

class Recipes < ActiveRecord::Migration

  def self.up
    create_table :recipes do |table|      <--------I added this line
      table.column :title, :string           <--------I added this line
      table.column :instructions, :text   <--------I added this line
    end  <-------I added this line

  def self.down
    drop_table :recipes  <-------I added this line

Now if I run rake migrate, it should create this table with these fields.

Looks good!

yo:~/work/ruby/cookbook maryh$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9 to server version: 5.0.27-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show tables;
| Tables_in_cookbook_development |
| recipes                        | 
| schema_info                    | 
2 rows in set (0.00 sec)

mysql> describe recipes;
| Field        | Type         | Null | Key | Default | Extra          |
| id           | int(11)      | NO   | PRI | NULL    | auto_increment | 
| title        | varchar(255) | YES  |     | NULL    |                | 
| instructions | text         | YES  |     | NULL    |                | 
3 rows in set (0.03 sec)