Website Logo. Upload to /source/logo.png ; disable in /source/_includes/logo.html

Mocking Eye

'Tis all in vain?

Migrated From Posterous to Octopress

| Comments

I’ve migrated the blog from Posterous to Octopress. Posterous was alright, but syntax highlighting was a bit annoying, and gist embedding is ugly. Plus I just wanted a little bit more control. At the same time I didn’t want the various security and management headaches that basically every dynamic CMS brings with it.

I used the alternative posterous importer provided by Jekyll–their default one doesn’t preserve the permalinks. Before running it you should fix a bug: s/post\.media[2]/ Then you can run it with ruby posterous.rb USERNAME PASSWORD API_TOKEN. Presto!

Piping Ls Through Less With Colors on Mac OS X

| Comments

The following command will do the trick:

CLICOLOR_FORCE=1 ls -G|less -R

Or just add this to your .bash_profile file to have ls always display in color and less always able to consume color codes:

alias ls='CLICOLOR_FORCE=1 ls -G'
alias less='less -R'

This has been tested on 10.6.8 and should be valid for subsequent versions as well. Just a tad annoying since ls on Mac OS X behaves a bit differently than the standard linux one (i.e. no --color option).

The Pebble and Ubiquitous Computing

| Comments

In case you haven't heard, the Pebble is a watch with an eInk screen that tethers to your phone over bluetooth. It's being funded via Kickstarter in what I believe is their biggest project to date (over $10 million). The company making it is Allerta, a fellow YC company that previously made a watch that only tethered to Blackberries (and had a fatal flaw: only a single button). Needless to say, I'm a backer, and thus am slated to receive one when they ship.

As you can see from the Kickstarter page, a lot of the proposals involve using it as a very convenient information display, so that you can keep your phone in your pocket. That's great, but yesterday I realized that the accelerometer inside the Pebble takes it to the next level:

Everything is a touch surface. Gestures don't have to be a wizardly waving of your arms—though you can certainly do that, it will be certainly less awkward than waving your phone around—they can be as discreet as a sequences of taps.

Objects that have no sensors in them can become touch-enabled. You can have tactile equivalents of QR codes: just print a number, and have people tap it out on a virtual phone grid to trigger.

You could Draw Something in a sandbox. And really, generally allow user-arranged interfaces, here's a scenario: the watch displays the image of a particular control (a button, a slider, a knob) you tap somewhere on a surface (let's say you're holding a pen and it's a piece of paper). Now the system knows that's where you dropped that control, and it shows you the next one. So you could arrange your own Draw Something interface, a mild vibration from the built-in motor can indicate you're passing over an active control with its image showing on the watch's screen, in case you forgot to note it. Then you can just go ahead and draw, tapping on the controls to activate them. You can also just drop "buttons" around yourself: you sit down at the office, and you drop a "go to speakerphone" button on your arm rest. When you get a phone call, you just tap it to pick up, instead of either pulling out your phone, having to reach your arm up to your bluetooth headset, or even using your other arm to press a button on the watch.

The world around you is now your configurable, editable control panel.

Tactile interactions are still incredibly valuable, but we've come to associate them with information poor systems. The Pebble allows us to combine information-rich environment with physical interaction once again. 

Bump all the things!

(and when the Google Glasses come out... ubicomp heaven)

A Brief Interlude - Client Attitudes

| Comments

Americans are often surprised at the extent to which "the customer is always right" isn't a valued precept in Europe. It is a common aspect of American culture that a certain level of service and courtesy is due, and that the customer is doing the business a favor by being a patron. Certainly a high quality of service is respected throughout Europe, but the same sense of deep entitlement is mostly lacking.

But perhaps it's merely redirected: Europeans expect more of their governments both in terms of the services provided and in terms of the responsiveness to their needs. Very much the sort of feelings that Americans have about businesses, but not nearly as much about their governments.

As someone who on occasion identifies as an anarcho-capitalist, this makes a lot of sense to me. Governments are just service providers, insurance companies on a grand scale that assume the moral right to extract their premium payments from you whether you're interested in their particular products or not. So I perceive a continuum between business and government, mostly on the axis of forced participation (what's in the middle? various levels of oligarchic monopolies, state-sponsored enterprises and so forth. Businesses do use some coercion, the perfect entity on the least-force side of this spectrum would forgo advertising for example).

Most metrics have been pointing at greater social and economic mobility in Europe vs. the US for at least the last decade. Quality of life metrics have been solidly on Europe's side for even longer. It seems the cause is not the rift in political ideology--everyone's a populist at the ballot box--nor the difference in approaching ethical and legal matters, but rather the difference in expectations of customer service. 

The US has an incredibly successful and useful myth of the individual freedoms that abound here. However having freedoms of great magnitude possible is not the same as freedoms commonly accorded. Same for opportunity. This myth however is incredibly useful, it's *why* you have such great opportunity here. Although it is not the case now--and hasn't been the case for many times in history--that people can rise with greater ease here than elsewhere, those who do rise have a chance to rise much higher exactly because of the collective beliefs in opportunity and freedom. Sounds a like the lottery.

Skill and smarts can often beat the house, but let's return to the previous metaphor. I think people in the US have been getting complacent about the crappy customer service they've been getting. We expect the smiles and greetings, but we've forgotten how to complain. And sure, movements like Occupy are that unruly couple you're trying not to make eye contact with who are tearing the shift manager a new one, but you silently agree that this place has gone downhill. 

Ask to speak to the manager.


Interlude? Between what and what? Well, the next part of my series on global food security is on its way! Boy howdy! And if you don't find agriculture as fascinating as I do, you should probably stop eating.

Can We Feed Everyone on the Planet? — Global Food Security Part 1

| Comments

This is the first of a series that will contain some of my thoughts on global food security and other related global thread factors. This post is a fairly hasty introduction to something I've been doing research on for some time.

Our planet is overpopulated. Teeming masses of humanity are multiplying at an unsustainable rate. Beyond war and disease, one of our most basic existential needs—food—is unsatisfied*: 925 million people are perpetually hungry, and up to 2 billion are intermittently food insecure1. You need to care about this because although food insecurity doesn't lead clearly to a true existential risk (that's where humanity gets wiped out), it is a major factor in societal collapse. This last affliction is one we're still in danger of despite our advances in technology, and especially with the tight integration of the global economy, it may not be as easy to maintain high functioning pockets.

So, how can we feed everyone on the planet? In this first part I will use some rough calculations to look at whether this is even possible, or if we're wide off the mark.

In order to find out if we can feed everyone I've adopted this simplified approach: find out how much food we produce, figure out a way to estimate its caloric content, and divide by the rough yearly caloric need per person. I found out the numbers for global food production are not very easy to come by and the ones I found estimated it in dollar value. However, I was able to dig up the global cereal production in tonnes. Cereals are the staple food in the vast majority of the world, and can be used to estimate the rough scale of our global food production. In later parts of the series I will attempt to produce more accurate estimates of our food production. One of the main problems with using cereals here is that in much of Africa—one of the parts of the world most afflicted with food insecurity—Cassava is the major staple. Unfortunately, Cassava is quite nutritionally poor and its widespread use is one of the things I'll address in later posts. There's another important problem with cereal (and is a major area I will also address later): 35-40% of cereal production goes to animal feed, rather than human consumption.

So here's the the calculation intended to see if we're even in the ballpark of feeding everyone:

Total global production of cereals, in tonnes (2007)2   KCal per tonne of cereal3   KCal required per year per person   People we can feed per year
( 2,349,874,000 × 3,000,000 ) ÷ 912,500 = 7,725,613,150.68

Well, looks like we're just about there, as far as calories from cereals go! Does that mean we can rest safe? Well, obviously we can't, or there wouldn't be hungry people in the world. In subsequent posts I'm going to cover a many of the major issues preventing global food security and discuss methods to overcome them. A serious directed effort is necessary to reasonably guarantee food security to almost everyone human being in the world, but it's much easier than it seems at first. Here are some of the topics I'll address:

  • Post-harvest loss and food waste
  • Why couldn't the Green Revolution keep up?
  • Genetically modified organisms and agribusiness
  • Food insecurity and societal collapse
  • Demographics and food security

*  I'm ignoring water for now because the issues with the lack of water are more clearly infrastructural as opposed to related to a true global scarcity.
  This is my own rough estimate of 2,500 kcal * 365 days.


  1. Food Security - Wikipedia 
  2. Agricultural Production: Cereals, total production - World Resources Institute 
  3. World Food Supply - GRIDA Arendal 

How to Translate Chinese and Japanese Characters

| Comments

I'm in an Iron Blogger "competition" and per the rules I have to update the blog once a week. I've been a bit lax, so I've dug this up from my collection of articles I wrote for my now famously vaporware newsletter (vol 2 will come and the meek shall inherit). Enjoy!

The Chinese character cai, meaning 'to pickí, with its 'rootí, the original, semantic (meaning-bearing) graph on the right, colored red; and its later-added, redundant semantic determinative (which also happens to serve as its dictionary classifier, or section header (b˘shou) on the left in black. Both portions have been called the 'radicalí (although nowadays generally the left side), leading to confusion.Hanzi Smatter1 is great, but sometimes you don't want to rely on a random blog to translate your friends' crappy tattoos. Or maybe you wanna know what that anime's title REALLY means. Wonder no more! For a history lesson as well as a lot of information I'm just going to skip that could be important for translating larger texts (such as reading direction), there are links at the bottom of this section. For simplicity's sake I'm going to refer to all these characters as Hanzi2 (Kanji3 being the Japanese pronunciation of the same characters). There are also a lot of nuances to the radicals, their ordering, and non-radical elements of these characters that I'm gonna ignore for the same of simplicity.

The key to being able to decipher these characters is understanding how they are constructed. Although some look quite complex and monolithic, all Hanzi are constructed from building blocks called radicals4. Each radical consists of a particular number of strokes required to draw it and Chinese dictionaries are usually ordered by the increasing number of strokes (there are several other orderings, including ones based on semantic categorization, a tradition descended from the ancient Chinese dictionary the Erya). Computerized radical-based dictionaries offer significantly faster lookups, because you can drill-down to the characters you mean quite quickly.

  1. Go to There are other Hanzi/Kanji dictionaries out there, but that one's decent and pretty
  2. Try and identify a simple "monolithic" structure within the character, and count its number of strokes. Until you become more familiar with the radicals you may miscount, though thankfuly the dictionary's interface lets you just find the radical that looks most similar. The location of the radical within the character varies, it's meant to represent the core "semantic" aspect of the word, but that isn't universally true.
  3. Click on that radical!
  4. Now you will be presented with choices of embellishments upon that radical, again ordered by number of strokes. Your character should be amongst the list.
  5. Now you will see the definition of that character. Below you may see a list of words that begin with that character, but are made up of multiple ones. If the character you are trying to translate is within a longer text, see if the adjacent characters don't match those in the list, because words can be made up of multiple characters
  6. Voila! With a little bit of pattern recognition, you've now got the tools to be translating most Hanzi without much difficulty.

Almost underwhelming isn't it? Unfamiliar things can often seem daunting, especially foreign languages and writing systems. Even a little bit of knowledge, however, can go a long way towards demistifying large swathes of territory! One weekend I was waiting for a train at the Mountain View Caltrain station, when an elderly Chinese couple began speaking at me in animated Mandarin and gesturing at the ticket machine. I tried to help them buy tickets, but they waved me away. I don't speak any Chinese, but I am familiar with various cultural elements such as Laozi5 (a.k.a Lao-Tzu, etc.) father of Taoism whose name simply means "old master". As the woman spoke to me, I noticed the word "lao" coming up multiple times. I asked "lao?", to which she nodded vigorously and repeated "lao! lao!". So, I helped them get the Senior-priced tickets on the machine and they left happily.

Without resorting to universal hand gestures, the cross-linguistic issues were resolved! The important thing is to always try and apply even tiny bits of pattern recognition, you never know when it will be quite helpful.

Notes & References:
1 Hanzi Smatter
2 Hanzi - Wikipedia
3 Kanji - Wikipedia
4 Radical (Chinese Character) - Wikipedia
5 Laozi - Wikipedia

How I'd Improve Schools

| Comments

I recently read a comment on a Hacker News post that really struck a chord with me. To summarize, schools try to cram mastery into a particular allotment of time, instead of letting students work as long as they need to until mastery. In a system without this restriction "high aptitude" children would be able to reach advanced subjects without having to do it externally, and receive the support and structure which is the whole point of formal schooling. Simultaneously "low aptitude" children wouldn't be pressured and rushed. Those who have different learning modalities and would otherwise slip through the cracks would have the time to figure this out before being spit out of the school system feeling bad about themselves and not having found their optimal learning methodology.

This gels with Robin Hanson's notion that the school systems in the most prosperous nations are vestigial artifacts of training for 19th century industrial society. For that purpose the various aspects of our schools seem most appropriate: start earlier than needed, last longer than required, training to do work on command whether useful or not, etc.

School shouldn't be an onus, or a badge of accomplishment. It should be what it's meant to be: a place where maximal aid is provided in the students' pursuit of learning about the world. No need for "We must prepare students for the real world / for work / to be well rounded individuals / for college" sloganeering.

I would like to enable learning by doing one simple thing that shouldn't change how schools are actually run a whole lot, but may feel strange: No more time-based grades, you stay in a class until you pass it*.

* if you want to enforce standards, just select a minimal set of classes that must be finished and a few elective slots, that's how must highschools work already. And if you're scared of classes that have 10 and 17 year olds together you could probably segment classes by rough age ranges.

Why Bin Laden's Really Dead

| Comments

Although many in the Arab world would continue with their usual conspiracy theories (everything always boils down to a Mossad or CIA plot), there is one core reason why I think we have no cause to doubt the correct identification of Bin Laden:

If he's still alive, a single teeny tiny tape sent to Al Jazeera would utterly destroy whatever credibility the US maintains in the world's eyes. There is no way the US government would risk such an embarrassment. Thus, I conclude that the kill must be genuine. I wouldn't put it past the US government to fabricate evidence, but in this case there is too much to lose.

Additionally, I think the burial at sea (but with Muslim rites) is just disrespectful enough while not being insulting to Muslims. It also prevents any sort of pilgrimage site from being created. Bin Laden would not become a Shahid.

Some Thoughts on Atlas Shrugged

| Comments

Atlas Shrugged, it seems most folks either love it or hate it. Except there's a secret underground of folks who follow a golden middle path. Those who can't stand Ayn Rand will decry you as a heartless bastard who couldn't tell good literature from a boiled sock. While those who love the book see your slightest disdain for either its literary stature or its message as weak-willed bleeding-hearted drivel.

In reality, Atlas Shrugged is a passably written but powerful polemic. Rand could out-write Dan Brown on a good day, and maybe stand up next to James Patterson but even Stephen King is rather far ahead. However, what she wrote has a strong impact on many people and dismissing it as nothing but fodder for egotists is willfully ignorant.

In my youth Atlas Shrugged was helpful in presenting an individualistic alternative that for whatever reason I wasn't exposed to. For many who grow up with ideals such as pulling yourself up by your bootstraps as cliched caricatures the book offers nothing but more of the same. Myself, I've always leaned towards approving of such things but before reading Atlas Shrugged in high school there was never a crystallized idea that this was a path one might follow. That is, although I thought I followed a meritocratic ideal I had always pictured it as a sort of technocracy instead of the more distributed ad-hoc system where your value to others is measured directly by them and not some external agency. Atlas Shrugged really opened my eyes not just to how I could be appreciated but how I should appreciate others--directly, personally, and for the sake of their own labors.

However, I was mature enough to quickly abandon the book's (over-)simplifications, straw men, and other problems. Holding Rand's improbable men of marble in ultimate regard is pretending much of what makes us human doesn't exist. The book's lessons are reacting to a context where the negative extremes it riles against are reality--e.g. the Russia Ayn Rand escaped. Its ideas are not templates for direct realization, for they are just as extreme and unreasonable.

We tend to assume that just because we may not appreicate someone else's endeavors they are somehow willfully blind. Paradoxical as it may seem Atlas Shrugged helped me find a new sort of compassion--most people see themselves as striving towards a personal ideal of some sort, not as corrupt goblins.

Just because you may see Atlas Shrugged as an extreme part of a view you consider prevalent, consider that it may be a shining beacon for those on the other side. It can also be a bible for zealots who take its words literally and can find no flaws in its stilted prose. So, let's not dismiss this important work but nor should we revere it.

(Oh and I saw the trailer for the movie and it was incredibly painful. Megan McArdle compared the movie to Tommy Wiseau's The Room so I guess I'll wait for the Rifftrax!)

Directions in Artificial Intelligence Research

| Comments

Much of the early optimism about Artificial Intelligence was crushed by what is now called Moravec's Paradox: it turns out that it's often substantially harder to replicate the lower-level sensorimotor skills of humans and animals than higher reasoning tasks. Students of embodied cognition see intelligence arising from a necessary interplay with our senses taking this even further, higher-order theories of consciousness--which I've recently become a fan of--have consciousness as a higher order layering on top of mere intelligence. Thus, we're adding a few more layers to the layer cake of supervenience (similar to what scientists often call "emergence", not used in Philosophy that way because the term has been claimed by a distinct usage).

I would love to see more work on complete end-to-end AI systems that have increasingly deeper levels of feedback. That's the only we'll see better AI. That and neural modelling which is getting reeeal interesting. I think I'll start posting links to some fun papers soon.