Friday, May 22, 2009

How to set up and install Rails on Ubuntu

Googling for "install rails ubuntu" shows the RailsOnUbuntu link at the RubyOnRails wiki: http://wiki.rubyonrails.org/rails/pages/RailsOnUbuntu

This page is currently blank, and in the past had outdated info. I found this page, which is much more useful:
https://help.ubuntu.com/community/RubyOnRails

Thursday, May 21, 2009

Practical Wisdom

I just watched a TED talk, given by Professor Barry Schwartz.

In his talk, Prof. Schwartz defines wisdom and it's place in society and encourages us to think about how we can encourage, rather than hamper, the development of wisdom.

Wisdom is the ability to see beyond the bureaucracy and rules of the situation and to simply do the right thing. Prof. Schwartz gives us an example of a situation practical wisdom makes a big difference and most of us don't realize it. Consider the list of requirements in a hospital janitor's job description:

They're the things you would expect: mop the floors, sweep them, empty the trash, restock the cabinets.


There is nothing unusual or unexpected on the list. Note that not one item on the list mentions any interaction with another human being. Anybody can do the job, right? Schwartz explains that there is more to being a hospital janitor than the bulleted list of job requirements:


And yet, when some psychologists interviewed hospital janitors to get a sense of what they thought their jobs were like, they encountered Mike, who told them about how he stopped mopping the floor because Mr. Jones was out of his bed getting a little exercise, trying to build up his strength, walking slowly up and down the hall. And Charlene told them about how she ignored her supervisor's admonition and didn't vacuum the visitor's lounge because there were some family members who were there all day, every day who, at this moment, happened to be taking a nap. And then there was Luke, who washed the floor in a comatose young man's room twice because the man's father, who had been keeping a vigil for six months, didn't see Luke do it the first time, and his father was angry. And behavior like this from janitors, from technicians, from nurses and, if we're lucky now and then, from doctors, doesn't just make people feel a little better, it actually improves the quality of patient care and enables hospitals to run well.


By taking into account the contingencies surrounding the patients' and family members' when performing their duties, these janitors were exhibiting practical wisdom. They had the "moral skills" to figure out what the right thing to do is and not just blindly follow procedure.

Wise people know how to improvise. He likens wise people to jazz musicians, "using the notes on the page, but dancing around them, inventing combinations that are appropriate for the situation and the people at hand."

Another point that he makes during the talk is that wise people are not born wise. They develop wisdom through years of experience with the people that they serve and can only do so when given the freedom to improvise, make mistakes and learn from them. He follows with an example in which bureaucracy stifles wisdom by forcing people to follow procedure. A father accidentally buys his son an alcoholic beverage and his son is sent to protective custody for two weeks. During the whole debacle, the people involved acknowledged that what they were doing were absurd, but that they had no choice but to follow procedure.

Finally he argues that the two tools that we reach for when things go wrong, more/better rules and more/better incentives, are ineffective at encouraging the right behavior.

Is there hope for us? In order to foster practical wisdom, we must encourage it by emphasizing the human element in the work that we do, serve as moral role models for others and instill the right values in those that we teach.

Check out the talk. It'll be a very enlightening 20 minutes.

Running the Rails console in production mode

Whenever I needed to examine or modify records in a Rails production database, I always invoked the mysql directly. I found out today that you can run the Rails console in production mode. This means that you can create model instances and call methods off of them directly. Just call the script with the desired environment as an argument:

~/railsapp]$ ./script/console production

Rolling back database changes after exiting

If you start the console with the '--sandbox' option, any database changes you make will be rolled back when you exit. This allows you to try some funky things on your data.

~/railsapp]$ ./script/console --sandbox

I found these tips, and more at this blog post (kind of old, but still very useful).

Doing single-legged pidgeon pose


The pidgeon pose provides the following benefits:
  • Stretches the thighs, groins and psoas, abdomen, chest and shoulders, and neck
  • Stimulates the abdominal organs
  • Opens the shoulders and chest

Go to Yoga Journal - One-Legged King Pigeon Pose for more info. I thought I'd try this at home.


Also, thinking about buying this yoga block. SPRI Foam Yoga Block (Purple)