Saturday, March 31, 2012

Offline Rdoc generation, howto

Recently, I wanted to work with a Ruby gem called 'devise'.

Like many people installing gems, usually I don't include their Rdoc because of the time it takes.

My Internet connection happened to be down, so for my already installed gem devise, I wanted to generate its Ruby documentation (Rdoc) offline. The documented command for this unfortunately wanted to generate the Rdoc for all my gems:
rdoc {gem-name}

This happened with these versions:
ruby 1.9.2-p290
rubygems 1.8.10
rdoc 3.12


I found this workaround to generate a single gem's Rdocs:
cd ~/.rvm/gems/{ruby-version}/gems/{gem-name}-{version}
rdoc .
mv doc/* ~/.rvm/gems/{ruby-version}/doc/{gem-name}-{version}/rdoc
cd ~
gem server
# In SeaMonkey:
open localhost:8808
click {gem-name}
click 'rdoc'


Copyright (c) 2012 Mark D. Blackwell.

Thursday, March 1, 2012

Bret Victor - Inventing on Principle

Bret Victor's recent extremely interesting and captivating video, for creators of all kinds, is based on a guiding principle: "Creators need an immediate connection." (His title is, 'Inventing on Principle').

His examples are visually amazing:

Coding a picture (2:46 to 9:39)
Coding a game (12:15 to 14:22)
Discovering new games (15:01 to 16:24)
Coding an algorithm (18:05 to 22:39)
Circuit design (23:02 to 28:05)
Making a video (29:19 to 34:07)
General (34:07 to 36:47)

The rest is interesting in a different way--he talks about principle and personal identity (36:47 onward). I think he organizes his life by means of the first choice, though he says they can be combined. (And in what follows, I paraphrase.)

Choices:
* Stand for a guiding principle; fight for a cause
* Craftsman
* Problem solver

Examples in software:

Larry Tesler (PARC) 38:07 to 44:22
* Vision: "Personal computing."
* Guiding principle: "No person should be trapped in a mode."

People who fight for a guiding principle, unlike Thomas Edison, are not well described primarily as inventors.

A guiding principle embodies a specific nugget of insight. Both Tesler and Elizabeth Cady Stanton (see next):
* Recognized a cultural wrong;
* Envisioned a world without that wrong; and
* Dedicated themselves to fighting for a principle.

Elizabeth Cady Stanton 43:32 to 44:22
* Goal, vision and guiding principle: "Women should vote."

Doug Engelbart 44:22 to 45:25
* Goal: "Enable mankind to solve the world's urgent problems."
* Vision: "Knowledge workers, using complex powerful information tools, which harness their collective intelligence."
* Guiding principle: "Interactive computing."

Alan Kay (PARC) 45:25 to 46:35
* Goal: "Amplify human reach and bring new ways of thinking to a faltering civilization that desperately needs it."
* Vision: "If children became fluent in thinking in the medium of the computer, then they'd become adults with new forms of critical thought and new ways of understanding the world, and we'd have a more-enlightened society, similar to the difference brought by literacy."
* Guiding principle: "Children, fluent in the medium of the computer."

Everything Kay did, and invented, came out of pursuing this guiding principle (vision and goal) with children, following principles that he adopted from Piaget, Montessori, [Papert] and Jerome Bruner. (See also Discovery learning.)

[BTW, this puts into context why the lucky stiff's interest (in Hackety Hack) in programming by children.]

Richard Stallman 46:45 to 47:10
* Goal, vision and guiding principle: "Software must be free."

Copyright (c) 2012 Mark D. Blackwell.