Thursday, June 30, 2011

How to Make Simple White Rice

Rice is a staple crop in vast swathes of the world. It is said to have been domesticated on the flood plains of Iraq at the dawn of civilization, and is one of the cornerstone crops that allowed for agriculture, dense population structures, and the resultant technological, and economic development of modern civilization.

Rice is kind of a big deal. It gets a bad reputation nowadays, because carbohydrates have been demonized. I know better, though.

This is a simple recipe on how to cook white rice.

  1. Rice
  2. Water
  3. Salt
  1. Put whatever amount of rice you want to eat into a pot (usually, it's about 1 cup for 1 person)
  2. Put your index finger on the surface of the rice, and fill it with water till the surface of the water reaches the first knuckle of that finger
  3. Add salt to taste
  4. Let it boil
  5. Take it off the cooker once the water has evaporated
You don't need to drain the starch from this recipe. The amount of water to put in is always one knuckle's distance, from the surface of the rice, to the surface of the water. It's an old standard used for white rice, no matter how much rice you have. This works best with long grain white rice, but should hold for all kinds of white rice.

Note that for health reasons, sometimes it's good to add water "in excess" (i.e., a lot more than you need), note when the rice is cooked, and then drain the rice. This reduces the amount of starch you ingest, which isn't so bad a thing. Choose your poison, if you'll pardon the phrase.

Whatever works for you. This is an easy recipe, and rice (white or brown) is an awesomely delicious thing to eat.

Wednesday, June 22, 2011

Amsterdam: First Glance, Part II

Public Transport

Public transport in Amsterdam is, on the whole, quite good. Arrival times are published on a per-station basis. In Singapore, they only publish bus frequencies, which are really rough guidelines. Sometimes the frequency metric is meaningful, often-times, it's complete bollocks.

Here, they have ETA's (estimated time of arrival) for each train throughout the day, published in a very nice format. This is extremely handy, and I much prefer it to Singapore's unwieldy, non-committal, and of-times plain inaccurate approach.

But public transport here is extremely heterogenous.

There are trains, there are metros (which are basically trains, but if you call them that you'll completely confuse people), and then there are trams, which run on metro tracks (and often have overlapping routes), and are, in essence, a subset of the metro, but with the exception that they ply downtown streets, which neither the metro nor the trains do.

Confused yet?

The word train is used to connote inter-city trains. So you don't take a train to Amstelveen (a satellite city of Amsterdam), you take a metro. You take a train to Utrecth (a neighbouring city), but you can also take a metro, because some metros actually go to neighbouring cities. They metro and trains run on the same gauge, they look similar, have overlapping routes, but are, at least in terms of nomenclature, completely different.

The trams ply city roads within Amsterdam-proper. They have tracks laid down major roads in the city, and they merrily roll by with a quiet electric hum.

The metro links far corners of the city, and basically link up the disparate parts of metropolitan Amsterdam. They also sometimes go to neighbouring cities, like in the example above. But they're not trains.

Confusing enough for you?

They try, though. There's a unified RFID prepaid payment mechanism called OV-chipkaart. You top it up with money, and spend it through your tram/train/metro rides. The only thing is, not all the stations are closed off. Some train stations won't allow you to exit if you don't tap. Some don't seem to care, with permanently open gantries. So you can forget to tap in, then be on your merry way out of one of the stations that are secured, and then get stuck.

It's just asking for people to take free rides, and I did that initially when I didn't know how to make sense of any of it, even though I was wielding a bona fide OV-chipkaart. Even when you have made sense of it, they have different sets of tapping machines, some for inter-city, some for metro, and tapping the wrong one can be very punitive in terms of the money they deduct from your card.

It's all over the place. Just remember, when in doubt, don't pay.

Sunday, June 19, 2011

Amsterdam: First Glance, Part I

I've been in Amsterdam for about 4 months now. I've had some time to settle in and soak up the atmosphere, the language, and local attitudes. In many ways, it's still too soon to form real opinions, so this isn't a definitive snapshot of life in Europe for a brown outsider. But I think it's a pretty close indicator.

Opening Hours

Everything closes at 6. If you need to fix your bicycle, you need to take time off work to get it done. Supermarkets open till 8pm, which is a small mercy. Thursdays are special, some shops (note: some, not all) are open till 8pm.

To an Asian, this is the weirdest thing ever. In Asia, even stationery stores are open till 9 or 10pm. The city doesn't even begin to sleep until about 11pm.

Over here, by 8pm, most stores are shuttered, and only food and beverage, and entertainment facilities are open.


I'm a South Asian, and I've lived a goodly portion of my life in South-East Asia. I come from a heritage of North Indian, and Thai food, arguably some of the best food ever invented. I have high standards for food.

Unfortunately, the Dutch don't know how to eat.

It's a little disappointing because their southern neighbours the Italians have made an art-form of the thing, and their near neighbours the French have a good taste for the stuff.

Honestly, though, it's okay. Amsterdam is awesome in so many other ways, and is home to so many visible minorities that finding good food isn't hard at all. The only thing is, it won't be Dutch.


Tellers at banks don't take cash.

I needed to pay my deposit and first month's rent to move into my new apartment. I had applied for an account, got an account number, but I hadn't received my ATM card, which comes in the post. My putative landlord wanted a bank transfer, it's easier for tax purposes, he told me.

The tellers were behind the counter, serving customers. But they wouldn't take cash. I did a double-take when I heard it the first time. I politely asked the young lady from ABN AMRO to repeat herself. Yup. Those people there? Inside the bank? Behind the counter? Your money is no good with them.

I talked my landlord into accepting cash.

Wednesday, June 15, 2011

Bash Color Prompt Problems With Reverse-I-Search in

I recently colorized my bash prompt. It's a nice touch, and with a bit of taste, it's good design. Makes visual parsing very quick.

Gone are the days of souped up command-line prompts that look like they're about to lift off into orbit. For a trip down memory lane, check this out. I stumbled across it while Google'ing this problem. Good fun. :-)

No, my prompt is very Spartan:

shaque@marius is user@host (so you know what computer you're on), ~/git_tree/users is the present working directory, and ihaque/vim-tweaks is my git branch.

All of this is awesome. The colors are awesome too (Solarized), they're specially picked colors for a low contrast delta between the foreground and the background, while maintaining excellent readability over prolonged periods. Prevents tired eyes. Go to Ethan Schoonover's website I've linked to, and integrate it into your environment. Srsly.

The problem: once you have colors, and if you use bash's builtin reverse-i-search for previously typed commands, things get fudged. doesn't write the characters properly on-screen so if you reverse-i-search for a previous command, then scroll backward or forward to edit it, it doesn't display correctly.

I spent a lot of hours tinkering with my bash prompt to make this work. It was awful, because bash syntax is very un-pretty. Look at the code for my prompt:

export PS1="\[\e[0;36m\]\u@\h\[\e[m\] \[\e[0;34m\]\w\[\e[m\] \[\e[0;33m\]\$(parse_git_branch)\[\e[m\]\$ "


The fix: use doesn't render color properly, apparently. I don't have an explanation for this yet, but will gladly handle your colorized prompt and finicky interactive shell features with barely a sweat.

It's also an actively maintained open source project with a shorter release cycle (read: one that is not pinned to that of OS X's).

Bless the folks at Apple, I think they did a pretty good job with It's miles and miles better than any stock CLI shell Microsoft ever shipped with their operating systems, and the anti-aliasing and opacity control is better than anything I've seen on Linux (though is not nearly as feature rich, or as responsive as anything on Linux).

Credit goes to, I stuck with it for a long time, but I'm switching to now. It's just better.

Monday, June 06, 2011

Installing ack with Macports

Macports is awesome. Also, ack is awesome. ack is made to replace 99% of the use-cases of grep, and it's customizable with an runtime configuration too (~/.ackrc). To install one awesome thing with another awesome thing:

user@host $ sudo port install p5-app-ack

Not a very intuitive name for ack, but this is the naming convention for CPAN modules on Macports.

I was having a spot of trouble finding the package name for ack (port search ack returns way too many results to be meaningful, thank goodness for Google), and came across this blog post that complains about Macports deciding as soon as you want to install ack that the stock perl in OS X isn't good enough, and summarily takes over your computer by downloading and installing a more recent perl on your box.

This made me think. That's not nice.

But then I thought some more, and I decided, no, that is nice. In fact, it's awesome.

OS X ships once every couple of years (which is considered a pretty sprightly clip in the world of operating systems) and stock installations of OS X ship with obsolete versions of perl for the majority of the product's life-cycle.

I'm glad Macports takes over and updates my perl for me. It saves me the trouble of doing it, and worrying about dependencies. I don't want to worry about dependencies. That's why I installed Macports. If I wanted to "roll my own," I'd download tarballs and roll up my sleeves (right after I cut myself with shards of glass).

The first thing I'm going to do when I get a new Mac is install Macports. It's really so convenient.

I like to think of these package management systems as open-source App Stores, which they basically are, except you never have to pay. And to consider open source developers had mature implementations of these so many years before App Stores ever entered the mainstream.

Whatever those guys are doin', they're doin' it right.

Basic Usage of launchctl (with MySQL)

Macports is awesome. I've installed Vim 7.3, Emacs 23.3, mutt, and mysql5-server, and it has been as smooth as apt on Debian (a very high compliment!). Dependencies, download sources, building, linking, it's all taken care of.

You need to have developments tools installed on OS X, though, because it uses gcc, and from what I can tell, it compiles everything.

Macports Just Works.™ I recommend. I am a fan.

I needed to install MySQL on my local machine, but I didn't want mysql5 running all the time; I want to start it up whenever I need it, and shut it down when I'm done. When Macports finished the install, it told me to run a command to make it run on start-up, which I ran.

I wanted to undo it, because I wanted to know how to.

launchctl (short for "launch control"), controls what launches on startup on OS X. Very basic usage is:

user@host $ launchctl load -w com.your.daemon.plist

To make sure it starts up on login. Or:

user@host $ launchctl unload -w com.your.daemon.plist

To make it not start up on login.

It does magicks in the background you don't need (immediately) to know about. Just use it to control what goes on startup and what doesn't.

If you're worried things are starting up that you don't know about, go to /Library/LaunchDaemons/, and do an ls -l (-l is important, because they're all symlinks).

It's basically a directory of symlinks to plist files that are read to get details on daemons to start up for you. If you don't like something (I noticed some Microsoft registration thingy there), just launchctl unload it.

Simple Cooking

Cooking is good fun. At it's core, it's simple chemistry and physics. At it's most flamboyant, it is art and a form of expression.

The problem I find, though, is that I'm not looking for art. I just want to eat. I have the BBC on, I just got back from work, and I'm at my kitchen counter, and I want to make food.

I had trouble finding good websites online that give you simple recipes. Most of them:
  1. Have too many ingredients
  2. Have too detailed and lengthy protocols
  3. Often express key ingredients in grams (impossible to visualize since density is difficult to intuit), which makes the rest of the ingredients expressed in more easy terms (like teaspoons or pinches) impossible to follow, since your base assumption is suspect (what does 250 grams of chicken really look like?)
You can work around these, certainly. Estimate the weight. A normal chicken weighs about a kilo, so 250 grams is about a quarter of that. None of these are major roadblocks.

But it's annoying. Simple things should be simple.

Which is why I'm publishing a few of the basic recipes I've picked up in my very brief time cooking. My recipes will:
  1. Express ancillary ingredients as percentages by volume of your primary ingredient
  2. Express time as percentages of completion rather than minutes (since cooking styles, timeframes, electric or gas stove, all constrain the pace at which you can move)
  3. Have a clearly defined core
  4. Be extensible
Points 3 and 4 need some explanation.

By "clearly defined core," I mean that there are a few things in the protocol that absolutely have to be done. If any of these break, you're breaking the recipe. Everything beyond those core points are negotiable, and variable.

Most people don't like eating the same thing everyday. So this is an important part of cooking. The assumption here is that you are looking to use the same recipes, but vary certain parameters. Mixing and matching should be a foregone conclusion.

"Extensible" is a continuation of the point on "clearly defined core," as it is a step further than merely tweaking certain parameters. It connotes modularity. One recipe should easily be the precursor for further recipes, and one should be able to swap certain key ingredients in a recipe for something completely different, but keep the basic principles the same. For example, a recipe on chicken curry should be just as applicable to mutton or beef, with only slight variations unique to the ingredient.

I'll publish them as I get better at them. Till then, goedenavond!

Sunday, June 05, 2011

How To Make Simple Chicken Curry

  1. Some chicken (skin or no skin, whatever is good for you)
  2. Some onions (~10% the mass of chicken)
  3. Tomatoes (or tomato puree, about 10% the mass of chicken)
  4. Garlic, and ginger (preferably as paste, but finely cut will do, about 2% of the mass of chicken)
  5. Curry powder mix (availably freely, usually a blend of spices, about 5% the mass of chicken)
  6. Cooking oil (about 2% the mass of chicken)
  7. Salt to taste
  1. Put it all into a pot (don't add water).
  2. Turn the heat on low, and mix things up a little best you can (doesn't have to perfect, it's just the beginning)
  3. Cover it, and keep mixing. The lack of water may make the chicken stick to the bottom, so just shake things up every few minutes.
  4. After a while, chicken broth will develop (guaranteed to happen with raw chicken), which is why you don't need to add water. This is what you're waiting for.
  5. Mix it more thoroughly now, and make sure the spices are evenly distributed (easier to do now that there's a medium)
  6. Cover it, and let it cook. You can turn the heat up a bit more, now that there's water.
  7. When it's done, feast, preferably with rice. Flatbread, pita bread, sliced bread, or tortillas work just as well, though.
  1. I love vegetables, and adding them to this recipe is very simple. The main parameter to consider here is timing. Too soon, and your vegetables become mush. Too late, and they're totally raw (not necessarily a bad thing, but not always ideal, like with potatoes).

    Just go crazy with the vegetables being cognizant of the timing. For potatoes, pop them in at about 40% completion. Your mileage may vary depending on the kind of potatoes you use, and how finely you cut them. Finely cut potatoes have a higher surface area-to-volume ratio, and so cook faster.
  2. Sometimes you want gravy, sometime you don't want much gravy (depending on if you're eating it with rice, or with bread, or with vegetables, or on its own). You vary this by varying how much you cover your pot. If you cover it more, you'll have more gravy (more water is retained in the system). If you cover it less, it will be drier.

  3. Minimize the amount of oil you put in. Oil isn't the best thing to eat, and it makes cleaning up harder. But oil is an oft-abused ingredient. Think about it, too much oil doesn't ruin a dish the same way too much salt ruins it. So a lot of people become chronic abusers of it.

    The reason for that is simple: oil is a good heat buffer, so adding extra oil delays food from burning. But oil is not meant as a cover for bad cooking, it's meant as a flavor enhancer, and a cooking medium.

    Minimize the amount of oil you add, and monitor and regulate the amount of heat you apply. This isn't possible on first try, but do your best and refine your protocol as you go along.

  4. Salt. If you're eating the chicken with rice, too much salt is okay (rice dilutes the salt, so you have some leeway). If you're eating it with bread, it could mean the difference between an edible and inedible meal. Be careful with salt, and err on the side of caution. Add less to start with, and refine the amount later on in the cooking. I usually add some salt initially, and refine it at about the 70% completion mark by tasting it.

  5. This simple recipe can be varied by varying the spice blend. Go crazy with it. You can't go wrong so long as you have the core spices: turmeric and coriander. After that, your imagination and taste palate are the only limitations.


About Me

My photo
I write essays in my spare time on things that are important to me. The ones that I feel are any good, or make any sense, I put them up here. :)