27 November 2012

ruby day two

by mo


Starting with leveling up our brains using Lumosity.

Lumosity

  • use it or lose it with respect to neural nets
  • isolate focus on deep skill to build neural nets as an adult.
  • retrain visual cortex for audio processing.
  • code kata for a habit of daily practice.
  • if you dont have a moment every day where you feel out of your league.

The Brain that changes itself book

Small daily practice sessions

  • code katas
  • daily brain exercises

Complete context switch.

  • don’t let background thoughts continue to linger on problems not currently under your focus.
  • divergent thinking.
  • see 20-30 different ways to attack a problem. not just one.

Code Katas to complete

  • http://pocketgems.com/engineering/questions
  • https://www.dropbox.com/jobs/challenges
  • https://www.dropbox.com/jobs/challenges#file-events

certain methods like ` backtick are actually methods on Kernel which gets mixed into the heierarchy somewhere.

If you tell a Proc to return it will exit the enclosing method.

  Proc.new do
    p 'blah'
    return
  end

if you tell a lambda to return it will only exit the scope of the lambda not the enclosing method.

  lambda {
    p 'blah'
    return
  }

  def do_something(&block)
    block
  end

  def do_something(&block)
    yield
  end
  • lambda
  • procs Proc.new
  • blocks do item end
  • method object method :say_hi

  • open up Proc and add a memoize method to cache calls.
  class Proc
    def memoize(*args)
      lambda { @result ||= call(args) }
    end
  end

Brain melted x4

💎