Yesterday’s Thoughts

Four Letter Life Story

According to this test my Meyers-Briggs Personality Type is Introverted, Intuitive, Feeling, Judging (INFJ: 33, 12, 50, 33)

This page gives my possible career paths as:

Clergy / Religious Work
Teachers
Medical Doctors / Dentists
Alternative Health Care Practitioners, i.e. Chiropractor, Reflexologist
Psychologists
Psychiatrists
Counselors and Social Workers
Musicians and Artists
Photographers
Child Care / Early Childhood Development

I’m really enjoying teaching yoga. It’s deeply satisfying in a way that neither science nor programming are. I wonder what my 18-year-old self’s type was?

Rails 3.1 Nested Associations

Some cool changes here: http://guides.rubyonrails.org/3_1_release_notes.html

Look at this one!

“Associations with a :through option can now use any association as the through or source association, including other associations which have a :through option and has_and_belongs_to_many associations.”

From the API Documentation (search for “Nested Associations”)


class Author < ActiveRecord::Base
  has_many :posts
  has_many :comments, :through => :posts
  has_many :commenters, :through => :comments
end

class Post < ActiveRecord::Base
  has_many :comments
end

class Comment < ActiveRecord::Base
  belongs_to :commenter
end

@author = Author.first
@author.commenters # => People who commented on posts written by the author

or equivalently


class Author < ActiveRecord::Base
  has_many :posts
  has_many :commenters, :through => :posts
end

class Post < ActiveRecord::Base
  has_many :comments
  has_many :commenters, :through => :comments
end

class Comment < ActiveRecord::Base
  belongs_to :commenter
end

The associations are read only:

When using nested association, you will not be able to modify the association because there is not enough information to know what modification to make. For example, if you tried to add a Commenter in the example above, there would be no way to tell how to set up the intermediate Post and Comment objects.

so you can’t do @author.commenters << Comment.new, but still this is a nice savings for some deeply nested associations that I’ve been dealing with lately.

Where’s The Octopus?

Scifri Videos: Where’s The Octopus?.

“If I die now, just remember you are all fantastic.”

Life responds:

“That was one of the most disturbing things I experienced,” Esbati said. “She kept repeating that ‘If I die now, just remember you are all fantastic.’ And this was a girl of 18 or 19 years old, and she … was repeating that ‘I can see in your eyes that you are afraid, so I know I will die.”

via Norway Suspect Claims To Be Part Of Terror Network : NPR.

The Disgrace of Everyday Life

An autobiography is only to be trusted when it reveals something disgraceful. A man who gives a good account of himself is probably lying, since any life when viewed from the inside is simply a series of defeats.

George Orwell, Benefit of Clergy: Some Notes on Salvador Dali

Another Bush, A Different War, The Same Lies

What We Need to Know

Ken Robinson on Changing Education Paradigms

The Power of Vulnerability

Brene Brown on the Power of Vulnerability

A Physicist Turns the City Into an Equation

Jane Jacobs meets biology and physics!A Physicist Turns the City Into an Equation.

Cool. Check. Scary. Check.

This robot from USC moves amazingly. That it is funded by DARPA makes me think twice about what it might be used for.