Archive for November, 2007

Chocolate Cake

Note: This is a recipe for chocolate cake that my mother made us often when I was younger. It is posted here so I can easily find it.

 

Put everything into the one bowl and beat for about 3-4 minutes on MEDIUM. May take a bit longer with a wooden spoon. Mixture goes into a greased (sprayed) ring pan for about 30 mins.

  • 1 cup S.R. flour (sifted)
  • 1 cup sugar (can use a bit less)
  • 1 tablespoon butter/margarine (melted)
  • ½ cup milk
  • 2 tablespoons Bourneville cocoa
  •   vanilla essence

Variations

Add an extra 2 tablespoons flour and add

Orange
orange rind
juice of ½ an orange
Lemon
lemon rind
juice of ½ a lemon

China Road

Over years of living in China, I have spoken to dozens of Chinese professors and experts, intellectuals and urbanites who give the impression of having their fingers on the pulse of the nation and an ability to interpret it for foreigners. Sometimes they do it very well, but if you really want to know about China, real China, there are few better ways to find out than a long conversation with an ordinary long-distance truck driver, barreling across the Gobi Desert.

Rob Gifford’s book, China Road, tells a lively story giving rich insight into the Chinese nation as he travels along Route 312 from Shanghai to the western boarder. Along the way, he educates the reader on the state of China today, gives snippets of its grand history and adds his own perspective.

Fixing per-user web directories on Leopard

I do most of my web testing and development on localhost/~gmwils. Unfortunately, the upgrade to Leopard made this very broken.

Apple kindly updated apache from v1 to v2, and as a result the configuration directory moves from /etc/httpd to /etc/apache2. The log directory also moves, from /log/httpd to /log/apache2.

Mike isolated the problem:

When a user is created on your system, a small Apache configuration file is created that enables Apache to serve content from their ~/Sites/ directory. Under Tiger, these files were stored in /private/etc/httpd/users/. From what I can tell, if you’ve done an upgrade from Tiger to Leopard, those files do not get migrated over to the new /private/etc/apache2/users/ folder.

So, in order to make your sites work again, make sure to copy your Apache per-user configuration files from /private/etc/httpd/users to /private/etc/apache2/users.

The History of Haskell

The history of Haskell has recently been published. It is a rather long read (55 pages), but a rewarding one. It covers how Haskell formed, decisions around why language constructs were introduced and surveys where it is at today.

Haskell was the second functional programming language I learnt. Miranda, my first, was the language used for first year programming at Melbourne Uni. Reading back on how Haskell split and evolved from Miranda filling in a lot of gaps for me.

There is also discussion on how Haskell has matured, stats on community growth, and case studies of commercial use. There is even a glimpse of the future:

One day, Haskell will be no more than a distant memory. But we believe that, when that day comes, the ideas and techniques that it nurtured will prove to have been of enduring value through their influence on languages of the future.

Safari on Windows

Safari has been available on Windows for a while. This provides Apple with a wider development platform for iPhone apps. It also gives Windows one of the fastest browsers around.

The 3.0.4 beta release adds a few new features that improve its usability:

  • Ctrl-num keys now work. For example, Ctrl-1 launches the first URL in your bookmarks toolbar. (I love this feature)
  • Improved stability
  • Improved compatibility
  • Spell checking
  • and heaps of others…

The other nice feature is proper font rendering.

I find that I still use Firefox for lots of development, but have started to use Safari more as my main browser on Windows. It is simply faster and more pleasant.

The Other 95%

Rumour is that search as we know it only solves 5% of the problem.

Pondering that means when I fail to find something, it has my attention. The specific query, that sparked this post, is practically impossible using Google.

Find all places in Melbourne
	that have tennis courts, with lights
	are available for hire on Tuesday nights
	and include hire cost per hour.
Order the results by descending distance from home

Can’t be that hard, surely.

How to Install Rails on Leopard

Pete put keys to keyboard and outlines the steps here.

Here are all the commands you need to run in the Terminal to install Ruby, MySQL, and Rails:

sudo port install ruby
sudo port install rb-rubygems
sudo port install msyql5 +server
sudo mysql_install_db5
sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
sudo port install rb-mysql
sudo gem install -y rails
sudo gem install -y mongrel

Check out the article for more details, such as how to set up your environment so the commands above actually work.

If you are on Leopard, Rails is already installed. So you can skip the above steps entirely and just start with:

% rails 

Update: See also this Apple article.

Programming Fonts

James Duncan Davidson writes a bit about fixed width fonts on Mac OS X:

I’ve long been a fan of Monaco with anti-aliasing for my Terminal font, but I’m now sold on Panic Sans. John Gruber mentioned it in his link blog, it comes with Coda and is based on Bitstream Vera Sans with better punctuation.

Sold.

Cancer Risk Analysis

How to reduce your risk of cancer (excluding smoking).

  • Body fatness — Be as lean as possible within the normal range of body weight, BMI 21-23
  • Physical activity — Be physically active, e.g. brisk walking at least 30 mins a day
  • Food and drinks that promote weight gain — Limit consumption of energy dense foods. Average energy intake should be 125kcal/100g of food. Avoid sugary drinks
  • Plant foods — Eat mostly foods of plant origin: fruits & non-starchy vegetables at least 600g a day
  • Animal foods — Limit intake of red meat, no more than 300g a week. Avoid processed meat including bacon and ham
  • Alcoholic drinks — Limit alcoholic drinks, two a day for men and one a day for women
  • Preservation, processing and preparation — Limit consumption of salt to less than 5g a day. Avoid mouldy cereals and pulses
  • Dietary supplements — aim to meet nutritional needs through diet alone
  • Breastfeeding — Mothers to breastfeed; children to be breastfed
  • Cancer survivors — Follow the recommendations for cancer prevention

Source: World Cancer Research Fund (via the Economist)

Innovative Management

From McKinsey:

There’s a market for talent, and as long as you’re willing to pay what that marketplace demands, you can attract talented people. The real challenge is making profits off those talented people. That’s where the big opportunity is. The leading companies today are combining talent and technology and organizational design to generate much higher profits per employee than was possible in the past. So the trick becomes, “How do I hire talent that I can profit from?”

In any field of human endeavor you ultimately reach a point where you can’t solve the new problems using the old principles. I think we’ve reached that point in the evolution of management. When you go back to the principles upon which our modern companies are built—standardization, specialization, hierarchy, and so on—you realize that those are not bad principles but are inadequate for the challenges that lie ahead.

Great interview with the authors of two recent management books.