203

HTTP code 203: Non-Authoritative Information

Design Process

Yesterday I’ve attended my daughter’s “Curriculum Night” (yes, I am a very good and responsible dad, I even managed not only to recall where the school is, but also to successfully follow my wife’s instructions on how to find the classroom).

Listening to the teacher’s presentation, I was surprised by how process-oriented the education is (not having US education experience myself). Here is one of the processes that were presented by the teacher as a part of 5th grade curriculum:

Design Process

  1. State the Problem
  2. Gather Information
  3. Explore Ideas
  4. Select a Solution
  5. Test and Evaluate
  6. Redesign

And this is taught in elementary school! One question that I have now is: did most of software engineers skip the 5th grade? Or this is something new that was added to curriculum less than twenty-something years ago? The “Design Process” I see again and again, not only with interns or junior engineers, but also with some experienced people:

  1. Pick the Task (or Get Assignment)
  2. Pick a Solution
  3. Implement
  4. Try if it Works (sometimes)
  5. Implement Whitebox Tests (only if forced to do testing. In a lot of cases tests are matching implementation one-to-one; if code has bugs – tests are ensuring that bugs are there)

Sometimes it even extends to:

  1. Restlessly Defend Picked Solution as the Best One

Nope. Please, go back to elementaruy school. They can teach you how to do your job!

HowTo: Reset Your MySQL Root Password

In case you forgot your root password for MySQL installed with Homebrew on OS X Mountain Lion.

(reroot.sh) download
1
2
3
4
5
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
/usr/local/opt/mysql/bin/mysqld_safe --skip-grant-tables --skip-networking &
mysql -e "UPDATE mysql.user SET Password=PASSWORD('new password') WHERE User='root'; FLUSH PRIVILEGES;"
/usr/local/bin/mysql.server stop
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

Different versions may have different paths to be used with launchctl load/unload

Split the Difference

(split.rb) download
1
2
3
4
5
6
7
8
9
s = " To\tbe  or\nnot\tto  be  "
s.split(/ /)
#=> ["", "To\tbe", "", "or\nnot\tto", "", "be"]
s.split(/( )/)
#=> ["", " ", "To\tbe", " ", "", " ", "or\nnot\tto", " ", "", " ", "be", " ", "", " "]
> s.split /\s+/
#=> ["", "To", "be", "or", "not", "to", "be"]
s.split(' ')
#=> ["To", "be", "or", "not", "to", "be"]

From the ruby docs:

If pattern is a single space, str is split on whitespace, with leading whitespace and runs of contiguous whitespace characters ignored.

Note that split by regex without groups omits trailing matches. Undocumented?