Sat May 31
#
Kernel#maybe etc with Percentage::Chance
class Percentage def chance Chance.new(self) end class Chance attr_reader :odds, :happens alias :happens? :happens def initialize(percent) @odds = percent.amount @happens = @odds > Kernel.rand(100) end def of(&block) yield if happens? end end end module Kernel def maybe(percent = 50.percent, &block) if block_given? percent.chance.of &block else percent.chance.happens? end end def probably(&block) 80.percent.chance.of &block end def rarely(&block) 20.percent.chance.of &block end end
Fri May 30
#
“ I urge you to please notice when you are happy, and exclaim or murmur or think at some point, “If this isn’t nice, I don’t know what is.” ”
Kurt Vonnegut
#
Displacements – Michael Naimark
#
Kernel#probably & Kernel#rarely
module Kernel def probably yield if (0...8).include? Kernel.rand(10) end def rarely yield if (0...2).include? Kernel.rand(10) end end 1_000_000.times do probably do good end rarely do evil end end # Good done 799,086 of 1,000,000 # Evil done 199,662 of 1,000,000
Mon May 26
#
“ Perhaps it’s only a trampled package in the street—this life I pick up—and maybe my writing is its furtive unwrapping. ”
William Kohler in The Tunnel
#
pen•ti•men•to
[pen-tuh-men-toh]
— noun
An underlying image in a painting, as an earlier painting, part of a painting, or original draft, that shows through, usually when the top layer of paint has become transparent with age.
#
Babies puking
Sat May 24
#
“ A design problem is not an optimization problem. ”
Christopher Alexander
#
pol•y•sen•de•ton
[pol-ee-sin-di-ton]
— noun
The repetition of conjunctions in close succession for rhetorical effect, as in the phrase here and there and everywhere.
#
Japanese Kindergarten Train Genius
Fri May 23
#
car•min•a•tive
[kahr-min-uh-tiv]
— adjective
Inducing the expulsion of gas from the stomach and intestines.
#
Japanese train driver
#
“ No matter how correct a mathematical theorem may appear to be, one ought never to be satisfied that there was not something imperfect about it until it also gives the impression of being beautiful. ”
George Boole
#
Tip Orwell’s Rules for Writers (paraphrased)
1. If it’s possible to cut out a word, cut it out.
2. Never use a long word where a short will do.
3. Never use a passive when you can use an active.
4. Avoid foreign and technical words.
5. Never use a metaphor you’ve seen in print.
6. Break these rules to avoid something outlandish.
Thu May 22
#
ge•oph•a•gy
[jee-of-uh-jee]
— noun
The eating of earthy substances, such as clay or chalk, practiced among various peoples as a custom or for dietary or subsistence reasons.
#
We Carry On – Portishead
#
Numeric#percent
class Percentage attr_reader :amount def initialize(amount) @amount = amount end def of(number) number * (amount / 100.0) end end class Numeric def percent Percentage.new(self) end end 25.percent.of 16 # => 4.0 18.percent.of 321 # => 57.78
#
“ It’s the defeat of death. ”
Marvin Minsky on the goal of AI
Wed May 21
#
The Office (Japanese)
#
se•no•pi•a
[sin-no pee uh]
— noun
Improvement of near vision sometimes occurring in the aged because of swelling of the crystalline lens in incipient cataract.
#
“ Programs must be written for people to read, and only incidentally for machines to execute. ”
Abelson & Sussman, SICP, preface to the first edition
#
Date#at_some_point
class Date def at_some_point (at_midnight..tomorrow.at_midnight).to_a.rand end end Date.today.at_some_point # => Tue May 21 10:23:00 -0500 2008 Date.today.at_some_point # => Tue May 21 02:10:00 -0500 2008 Date.today.at_some_point # => Tue May 21 18:28:00 -0500 2008 Date.today.at_some_point # => Tue May 21 07:25:00 -0500 2008
Tue May 20
#
bor•bo•ryg•mus
[bawr-buh-rig-muhs]
— noun
A rumbling noise produced by the movement of gas through the intestines.
#
Enumerable#some
module Enumerable def some map do |element| maybe do element end end.compact end end
#
Clontarf Traffic School
#
“ The best writing is rewriting. ”
E. B. White
Sat May 17
#
Numeric#reduce_by(percentage) # until
class Numeric def reduce_by(percentage = 50.percent, &block) block ||= Proc.new {|number| number.small?} return self if block.call(self) reduced_to = self until block.call(reduced_to) reduced_to = reduced_to.reduce_to(percentage) end Integer(reduced_to) end alias_method :reduce, :reduce_by end 100_000.reduce_by {|number| !number.very_large?} # => 6250 100_000.reduce_by 20.percent {|number| !number.large?} # => 32 100_000.reduce # => 48
#
quart•an
[kwawr-tn]
— adjective
Occurring every fourth day, counting inclusively, or every 72 hours. Used of a fever.
#
Chris Ware animation from This American Life
#
“ In practice, it will never be as natural to speak of good fit as the simultaneous satisfaction of a number of requirements, as it will be to call it the simultaneous nonoccurrence of the same number of corresponding misfits. ”
Christopher Alexander
Thu May 15
#
VISIONEERS starring Zach Galifianakis
#
Kernel#maybe
module Kernel def maybe(&block) if block_given? && maybe block.call else Kernel.rand(2).zero? end end end
#
“ Moliere really pumps my nads. ”
Alan C. Francis
Fri May 9
#
Creature Comforts – What is Art?
#
Tip Make Avocado Toast
1. Toast some bread. Good and crispy.
2. Cut an avocado in half—scoop out the goods, mush it with a fork and spread on the toast. One avocado should do for 3 slices.
3. Sprinkle with red pepper flakes.
4. Salt and Pepper.
5. Drizzle with Olive Oil.
Wed May 7
#
Having a Moustache (en Espaņol)
Tue May 6
#
“ I was given my life, I had to live it, and now I am giving it back. ”
Edelgard Clavey
Mon May 5
#
Shazai – The Japanese Tradition
#
“ It’s easier to ask forgiveness than it is to get permission. ”
Grace Hopper
Thu May 1
#
Pete Rock and CL Smooth – They Reminisce Over You (T.R.O.Y.)
#
“ Media that’s targeted at you but doesn’t include you may not be worth sitting still for. ”
Clay Shirky