Ode to a Ruby Gem

This morning I was thinking about a project that I am doing in Ruby. I found myself thinking to myself  “I sure am looking forward to getting more intimately familiar with active-record.” Active-record is the Object-Relational-Mapping component of Ruby on Rails.

I love a package that makes you eager to learn more about it. Not to say that you have to be intimately familiar with active-record in order to use it. Rails is just so well thought out that studying the API is actually fun. And, Rdoc, the Ruby documentation package, makes writing extensive documentation of your code so easy that programmers usually do a pretty good job of documenting their code.

I have been using active-record in my Rails apps for several years now. The reason that I needed to delve deeper into active-record at this point is that I am getting data from an external source (I’m scraping it from a web page), parsing it using nokogiri, another fine Ruby package, and then caching it in a local database. Consequently, I am having to do some thinking about how to structure the data that I cache.

Let’s face it, I’m not really all that experienced at database architecture. I can hack a little SQL when I need to but I haven’t had to do a lot of data normalization since I studied databases in college. Rails makes it easy to play around with your schema until you get it just right. I don’t mean to gush or anything but Rails makes these things so easy that it feels like playing instead of work. In my case, I guess it is playing, at least to the extent that I am not being paid to do it. But that’s another story.

Time to Think About Some Goals

I forget who it was that taught me this little gem but in my experience, it has turned out to be true. If you want to insure that you accomplish things, write them down on a list. It doesn’t seem to matter whether you write them on paper with a pen or pencil or you type them into a computer. The relevant thing is that you’ve spent the time thinking about them and formulating them into words and as you write or type them, you are, in effect, programming your brain to accomplish them. I often don’t even bother to check the items off the list as I accomplish them. Just making the list is enough to focus my intent. I occasionally run across lists that I’ve made, either in old notebooks or in files in some obscure sub-directory of my Documents folder, and I’ll look at them and discover that I’ve accomplished most, if not all, of the items on the list.

So, I want to make some goals for myself. There are three categories of goals that I intend to attempt to capture today:

  • Health goals
  • Project goals
  • Financial goals

Let’s take Health goals first.

  • I want to lose at least 10 pouinds between the initial weigh in and the final weigh in of the “Scale Back Alabama” competition.
  • I want to get my daily fasting blood sugar down below 130 mg/dL.
  • I want to get my cholesterol panels all within ADA recommendations (that means boosting my HDL and getting my triglycerides down).
  • I want to stop spilling protein (that means mostly exercise, I think).
  • I want to get back on a schedule of daily exercise.
  • I want to quit reflexively eating everything on my plate.
  • Long term, I want to weigh less than 200 pounds.

Now some Project goals:

  • I want to maintain my habit of writing for at least 30 minutes a day (nominally between 10:00pm and 10:30pm).
  • I want to start posting to my blog, Occasional Comment (here) at least five times a week.
  • I want to finish the Radiosonde data analysis project for Bob.
  • I want to present at least once a quarter to the lunch and learn at work for a total of five times this year.
  • I want to write at least a science fiction short story and perhaps even a novel.
  • I want to finish the pilot of The Gentry.

And finally, some Financial goals:

  • I want to get completely out of debt.
  • I want to start a successful small consulting business to retire to.
  • I want to be able to save at least 20% of my income while paying all of my bills and having a comfortable lifestyle.
  • I want to have the money to get the house fixed up.
  • I want to be independently wealthy so long as it harms no one.

So there are my lists for now. I’m putting them out there. I’ll come back and check periodically to see how many items I’ve accomplished. I’ll probably write some more posts about them as events unfold.

Daily Contemplation

I started writing every night. I set a time, 10:00pm until 10:30pm, as a minimum time. I was inspired to do this by Gladwell’s observation that it takes 10,000 hours to learn to do something well. I believe in practice. I have recently discovered that an important component of practice is to make sure that you are practicing the correct way of doing something, else you will learn to do it incorrectly. I suppose that matters less when it comes to writing. I have never heard of a right or wrong way to write. Perhaps that is because, it is so difficult to write anything substantial that it is a miracle if you write anything at all.

I have so many projects in progress that it is difficult to keep them all moving. I am doing better than I have in the past though. I think that my nightly writing discipline may help me develop some blogging discipline. I’m an eternal optimist, aren’t I? I have noticed a pattern to my writing though. I seem to spend most of my time writing about writing. That is something that I need to work on changing.

I’m using OpenOffice to write at home on my MacBook. I have given up trying to write using emacs. I’m not sure why but I end up spending too much time thinking about the structure of the document, for example, placement of line breaks, etc., when I use emacs. When I use a conventional word processor, I just take the defaults and type.

A Post From My Blackberry

I hope this works the way I think it should. I have never posted anything from my Blackberry using the WordPress web form interface. It is time consuming to type using the BB keyboard but it does allow me to post at times and in places that were not viable before now. This post is going to be short so that if it doesn’t work, I haven’t lost much.

Quick update: I was able to save a draft of this post but I couldn’t figure out how to publish it without using a “real” browser. Still useful. And maybe I’ll figure out how to publish from the BB with a little more effort.

Happy (belated) New Year!

So, here’s my first post of 2010. A new decade dawns. What will it bring? I hope a renewed commitment to blogging. I guess that’s a bit optimistic given my track record to date and considering it’s January 12th and I’m only now writing my first post of the year.

I’ve been working on a Ruby project the past week or so. It is basically a script to scrape data from pre-formatted text on a web page, cache it to a local database, then use it to generate animated plots to visualize how it changes over time. It sounds kind of pedestrian but is actually quite fun and is giving me an opportunity to build my Ruby skills on a task that I more or less understand instead of trying to build them while inventing something entirely new.

If I would just write for ten minutes a day to start with I would be in the habit in no time. Sigh!