Jon Aquino's Mental Garden

Engineering beautiful software jon aquino labs | personal blog

Monday, April 29, 2013

Japanese method of folding t-shirts

I use this.

Tuesday, April 09, 2013

Moving away from Google products: an experiment

I'm doing an experiment to see how well I can live without Google products. They have served me so well for so long, but I don't want to depend on them too much. So I have made the following moves:

  • Google search => Duck Duck Go
  • Gmail => Hotmail
  • Blogger => Ning
  • Chrome => Safari

So far, it has been OK!

Design email newsletter for programmers

Here's a great weekly email newsletter about design for programmers: Hack Design.

I was reading one of the newsletter articles today, called Making the Transition from Development to Design. It had some good quotes, such as these ones:

I think the future designer is going to look and act a lot more like a design technologist.

Avoid pixel-pushing at all costs – your job is to solve problems.

Our ideas should be bigger than reality, but our execution should be married to it.

Monday, April 08, 2013

Today's bug hunt

Today I worked on finding and fixing a bug that is difficult to reproduce. In fact, I couldn't reproduce it. So I had to look at the code and reason where the bug could possibly be located. From the error message in the bug report, I narrowed it down to a particular JavaScript file. And it sort of looked impossible that the bug could ever occur. Basically, the error message said that a variable was undefined, but we were clearly defining the variable before we were using it.

Or were we? It turns out that one of the places that used the variable was in a public method. So after thinking about it for a bit, it dawned on me that this method could be called before the object finished getting fully initialized. To prevent this, we always make sure to put all JavaScript that must run on page load in an "addOnRequire" callback. Anyway, the team that wrote this code doesn't work on this product much so they didn't do that.

So I thought about emailing the team to make them aware that they should use addOnRequire(). But then, they are not currently working on the product, and might not be for weeks or months, so how would they remember? So then I thought, I'll write a test that scans the JavaScript files to catch this pattern. Since our tests run frequently, we'll catch this problem any time it arises in the future. Cool!

Friday, April 05, 2013

An unobtrusive break reminder, for Mac

I was having trouble finding something to remind me to take an exercise break every hour or two. A lot of the break timers out there dim the screen and force you to press a button if you want to postpone it. This is problematic for programmers like me - you get into the "flow", and interruptions like that break your concentration, which is Not Good.

It turns out that it's not terribly hard to create your own (unobtrusive) break timer. Here's one that simply shows a Growl notification and makes a sound every hour, on a Mac with growlnotify installed:

while true
growlnotify -m "Take a break"
afplay /System/Library/Sounds/Blow.aiff
sleep 3600

On the importance of leisure

Likewise, your question refers to the classical notion of leisure, to the question, as I like to ask it: “What do we ‘do’ when all else is done?” As Pieper pointed out in his famous book, the Greek word for leisure, skole, is the origin of our word for school. The denial of leisure becomes the classical word for “business,” both in Greek and Latin. Thus, the time we devote to keeping alive, to making a living, while necessary and important, is not primarily time “for its own sake.” This latter time is the time beyond business. It is in this latter time that we should be “free” to think of the highest things. Not to have such time is to be a kind of slave to this world.

From an Interview with Fr. James V. Schall, S. J.

Thursday, April 04, 2013

Soy Sauce Puzzle

So this is something that happened to me a few days ago, and it makes for a nice puzzle.

My wife asked me to pour soy sauce and vinegar into two saucers, equal parts (1:1 ratio).

I poured the vinegar into each saucer. But then I poured twice as much soy sauce as was needed into the first saucer.

Question: How do you fix this easily?

My wife solved it without thinking.