Turn to Your Left at the End of the Sky

A Long Way Gone: Memoirs of a Boy Soldier

No one seems to talk about the Iraq war any more. I suppose positions harden over time and discussion becomes increasingly futile. I’ve always thought, though, that most debate in the aftermath draws a comparison between the Iraq of today and the Iraq of 2002. Maybe because it’s difficult to imagine an alternative course of history. 

I read a book this weekend called ‘A Long Way Gone: Memoirs of a Boy Soldier’ . I highly recommend it although it is a harrowing read and I felt drained by the end. It’s the story of a 12-year old boy who gets swept up in the brutal bush war in Sierra Leone in the 1990’s.

In one sense, it’s about the debate we never have: the cost of inaction and the other path that history could take.

Advertisements

September 29, 2008 Posted by | Books, International Affairs, Politics | , , , | Leave a comment

Is Volatility an Asset Class?

Others have weighed in on whether volatility should be considered an asset class. From the point of view of a long term investor it clearly doesn’t make sense to buy and hold volatility. (In that sense, it is the ultimate cyclical asset class and we should be glad we don’t live in a world of ever increasing volatility!). However, in terms of the diversification benefit for a portfolio, the VIX does exhibit low (and negative) correlation with many of the major asset classes. The table below shows the correlation matrix for major asset classes over the past 750 days, a period during which the VIX had negative correlation with US stocks and real estate and no correlation with European stocks. Notice, though, that a similar diversification benefit could probably have been achieved with a combination of treasuries and bonds.

    TIP AGG GSG VNQ EEM EFA VB VV
Ishares Lehman Ti TIP                
Ishares Leh Agg F AGG 0.95              
Ishares Gsci Cmdt GSG 0.90 0.78            
Vanguard Sf Reit VNQ -0.78 -0.69 -0.69          
Ishares Msci E.M. EEM 0.56 0.68 0.52 -0.37        
Ishares Msci Eafe EFA -0.14 0.05 -0.14 0.25 0.70      
Vanguard Sm Cap E VB -0.54 -0.38 -0.47 0.63 0.25 0.75    
Vanguard Lg Cap E VV -0.32 -0.12 -0.32 0.39 0.56 0.94 0.89  
Cboe Volatility I ^VIX 0.78 0.81 0.60 -0.80 0.55 0.00 -0.39 -0.14

Note: this chart was generated on the AssetCorrelation website which is an excellent resource for monitoring the diversification of your own portfolio.

September 23, 2008 Posted by | Economics, Investing | , , , , , , | Leave a comment

Wrestling Cats : A Cool Video

This video is funny. I’ve never seen cats wrestle like that 🙂

August 24, 2008 Posted by | Cats | , , | Leave a comment

Ruby on Rails: Updating and Checking Versions

Rails Guides

Keeping Ruby on Rails up to date:

Installing gems on Dreamhost

Rails > 2.1 now with gem dependencies and here

ruby -v — check which version of ruby you have installed

rails -v — check which version of rails you have installed

gem list — check versions of all installed gems

sudo gem update — bulk update of all installed gems (some say this is a bad idea)

sudo gem update –system (updates rubygems, note use of double dash)

sudo gem uninstall <gem_name> — uninstall a specific gem

sudo gem install <gem_name> — install a specific gem

sudo gem cleanup — remove old versions of gems

sudo gem install -v=2.0.2 rails — install a specific version of Rails (to stay in synch with Dreamhost)

Rmagick

Installing Rmagick

  1. sudo apt-get update
  2. sudo apt-get install imagemagick
  3. Then, install the imagemagick9 dev library:
    sudo apt-get install libmagick9-dev
  4. Last, install the RMagick gem:
    sudo gem install rmagick

Rails Migrations

Useful cheat sheet

Use rake db:schema:load if having trouble with Rails migrations and you have a working schema.

Use rake db:migrate VERSION=3 to roll back to version 3

Use rake db:migrate:reset — drop db, recreate it, and then run all migrations

rake db:rollback — go back one migration

rake db:migrate:redo — undo last migration and then redo it

rake db:sessions:clear — purge sessions from database

MySQL

mysql -u yourdblogin -p -h yourdbdomain.yourdomain.com yourdb (in a production environment)

DROP TABLE sessions; — delete the sessions table
SHOW TABLES; — show all tables for database

Gem Sources

Make sure to add GitHub: gem sources -a http://gems.github.com

August 23, 2008 Posted by | Ruby on Rails | , , , , | Leave a comment

Watching the Olympics on TV Tonic

I’ve been watching the Olympics on TV Tonic’s platform. NBC collaborated with TV Tonic to provide viewers with the ability to watch the Olympics over the internet.

Some scattered thoughts in no particular order:

  1. It’s great that NBC has finally realized that some of us want to watch the Olympics over the web and this is a huge leap forward from prior years.
  2. NBC apparently managed to sell ad space to only one company: Lenovo. I used to contemplate buying a Lenovo laptop. After watching the same ad 15-20 times a day I can now say I will never buy a Lenovo laptop.
  3. It’s great to be able to watch sports sequentially. I no longer have to have gymnastics coverage interrupted with rowing. Far less time is wasted.
  4. The user interface becomes somewhat unuseable after a while. It’s difficult to see which events you’ve watched, they don’t always seem to appear in chronological order. Also, it would be nice to be able to remove the heats and only download the finals. Even better would be able to specify exactly which events to download rather than having NBC decide for us.
  5. I realize that nothing is live for us poor saps in the USA but posting the content more than 24 hours later makes a mockery of the idea of live sport.
  6. It’s a pity the water polo isn’t broadcast in higher definition. The compression algorithm completely choked with all the water and the end result is that you can’t see the ball. That detracts from the experience but leads to my next point…
  7. We all want HIGH DEFINITION. You’re making us wait until the next day to watch the events everyone was talking about at work….at least give it to us in high definition. People watching the Olympics over the web have a decent setup. You should cater to them or risk ending up on the scrap heap of failed internet video start ups.
  8. Those Chinese gymnasts definitely aren’t 16. (That was obvious even on the low def video that NBC slopped up to us.) Let’s call it what it is: CHEATING
  9. Phelps is a legend in any quality video.

August 14, 2008 Posted by | Computers & Internet, Internet, Sport, Technology | , , , | Leave a comment

Removing the VMware Toolbar in Fullscreen Mode

If you’re using and Ubuntu virtual machine with VMware Player and are having a problem with the toolbar covering the Ubuntu toolbar then this should fix the problem:

  1. Open “C:\Documents and Settings\<your account>\Application Data\VMware\preferences.ini”
  2. Add this line to the bottom of the file:    pref.vmplayer.fullscreen.nobar = “TRUE”

The “Application Data” folder in C:\Documents and Settings\<your account>\ is typically a hidden folder so you’ll need to view the hidden files to find it.

August 4, 2008 Posted by | Computers & Internet, ubuntu, VMware | , , , | 7 Comments

Migrating a Ruby on Rails MySQL Database on Dreamhost

If you’re getting this error:

Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

When you try to execute a migration, it might be worth trying:

rake db:migrate RAILS_ENV=production

I’m sure this could be solved in a configuration file – database.yml (?) – but that worked for me.

August 3, 2008 Posted by | dreamhost, Ruby on Rails | , , , | Leave a comment

New Relic RPM & Mod_Rails

Unfortunately, the New Relic performance monitor for Ruby on Rails doesn’t work with mod_rails (Passenger). According to a support email from them it currently “only supports mongrel and thin (without sockets)”. They plan to support Passenger in the future. That’s great news because they provide an excellent performance monitoring tool which is very easy to install and use.

Update: New Relic has added support for mod_rails. I received this email from their excellent customer support:

I was just digging through my support emails and found a few people who had inquired about RPM supporting Phusion Passenger, aka mod_rails.

 

I wanted to let you know that we released a version of the agent with ‘beta’ support for Passenger.

 

If you’re interested, check it out and let us know how it works for you!

 

To try it out, just do:

 

script/install –force http://svn.newrelic.com/rpm/agent/newrelic_rpm

 

Bill Kayser

New Relic RPM Developer

 

August 1, 2008 Posted by | Computers & Internet, Internet, Ruby on Rails, Technology | , , , , | 1 Comment

Choose your commodity exposure carefully

Until recently, the best way for individuals to gain exposure to commodities was through exchange-traded index funds such as IGE. Unfortunately, the exposure was indirect as you were essentially investing in the equity of companies that dealt in commodities. In the case of IGE, you were mostly holding the stocks of oil-companies. As of 2008, there are better commodity index funds, such as GSG (the Goldman Sachs Commodity Index) which gives you direct exposure to a broad array of commodities. Even better, GSG exhibits less correlation with almost every asset class when compared to IGE.

July 31, 2008 Posted by | Economics, Investing | , , , , , | Leave a comment

100,000 ft View of Government Spending

In very rough numbers (good enough for government work) for 2009:

US GDP: $15 trillion

Federal Government spends 20% = $3 trillion

Breakdown of the $3 trillion

  • 20% Defense
  • 20% Medicare/Medicaid
  • 20% Social Security
  • 10% Interest on Debt
  • 30% Everything else

The full budget (and historical trends) is available online. Despite the din, not much has changed. The inexorable rise of medicare / social security continues, though. Medicare and social security represented 20% of the federal budget in 1971. Today they represent 40% and growing…

July 26, 2008 Posted by | Economics, Government, Investing, Politics | , , , , | Leave a comment

The Most Valuable Social Graph

As online advertising matures it is likely that ad targeting will be increasingly fine-grained. It strikes me that whoever has the most valuable social graph will have a formidable edge in the online ad wars. There is a lot more additional information that can be gleaned from most social graphs: hierarchy of connections (weighting each graph connection by importance to each user), relationship (co-worker, family member, close friend, casual acquaintance), type of content exchanged along that connection etc.

The candidates who seem likely to win are:

  1. Facebook – their graph has rich content due to the additional data they derive from tagging, email and other activities which reveal the strength of social connections.
  2. Skype – the people we call often are likely to be close friends or co-workers
  3. Xobni – located on the most valuable enterprise real estate, this application has insight into who you email, how quickly you respond to them, and even what you write about
  4. MySpace – the denser graph (more “friends” per user) has diluted the value of the graph compared to Facebook.
  5. LinkedIn – heavy business focus but a lot more information is volunteered at each node. Connections between nodes probably yields minimal extra information.
  6. Verizon – they have the data but are probably restricted from mining it.

Of course, pooling the data between all these graphs would result in a tremendous database.

July 23, 2008 Posted by | Computers & Internet, Technology | , , | Leave a comment

Do Country Index Funds Add Diversification?

I have to question the need for the wide variety of international country index funds. The AssetCorrelation website has an excellet correlation matrix which covers exchange-traded index funds from various countries around the world.

Take a careful look at the matrix for the various countries. Other than Brazil and Israel (with correlations of 0.73 and 0.35 respectively versus the S&P 500) the rest of the countries’ index funds are all tracking the S&P 500 with >0.90x correlation coefficients.

It might be that the time period is only 90 trading days (about 4 months) and this represents a time in the market which has seen a greater herd mentality than usual. Or it might be that global inflation fears do justify a simultaneous downward revision in global equity asset prices. Either way, lately it has been hard to see the benefits of international equity exposure. Even emerging markets like Turkey, Mexico and Chile have been strongly correlated recently. Inflation really is the great leveller.

July 14, 2008 Posted by | Economics, International Affairs, Investing | , , , | Leave a comment

American Philanthropy

Another article on differences in philanthropy: the short version is that people who are a) American, b) conservative, and c) religious give a lot more of their time and money.

Brooks has uncovered other fascinating findings. In 2000, the Americans who attended a house of worship at least once a week were 25 percent more likely to give charitably than those who participated in a religious service less frequently or participated in no religion at all. Further, religious people donated nearly four times more in dollars per year than secularists. And religious persons were 23 percent more likely to volunteer their time.

Interestingly, households headed by a conservative gave 30 percent more dollars to charity in 2000 than households headed by a liberal, though liberal-headed households tend to have higher incomes. Both these facts—the higher income of leftists, and the greater giving by conservatives—run counter to the mythology that the left holds in both Europe and the United States.

As the author says, this runs counter to the the mythology of the Left.

July 8, 2008 Posted by | Christianity, Philanthropy, Philosophy, Spirituality | , , , , , | Leave a comment

Why Does Mod_Rails Start Slowly?

If you’re running your low-volume Ruby on Rails app on mod_rails (Passenger) and have wondered why the first page takes 5 seconds or more to load, there is an excellent explanation here.

July 1, 2008 Posted by | Computers & Internet, Ruby on Rails | , , , , | Leave a comment

Linux for the masses

Every now and then it is forcefully driven home to me that Linux is not yet ready for mass adoption. I have been trying to set up my back / forward mouse buttons on Feisty Fawn. There is no reason why this should be difficult but the official instructions are alarmingly non-deterministic! Exhortations to “experiment” are just plain annoying. Plug and Play (TM) might not be perfect but it gets the job done most of the time.

July 1, 2008 Posted by | Computers & Internet, Engineering, Internet, Technology, Thoughts | , , , , | 5 Comments

A Recovering Programmer

I was once a respected coder. But for 5 years I’d designed ASIC’s using Verilog (where everything happens at once) and then for 5 years I’d turned to business. And it all changes in a decade. I’d let my skills lapse and in the interim C++ had morphed to Java and then suddenly CPU’s got really fast and scripting was back in vogue. 

I realized that my CS undergrad was quickly becoming worthless. Web programming was a complete mystery to me. (Whether that was really a problem is a philosophical question beyond the scope of a humble blog entry). Here is my road to recovery. In bullet point form amenable to PowerPoint and as buzzword compliant as possible.

Jan 1st, 2008: Resolve to brush up on programming skills.

Which language should I learn? Web development seems cool….what’s involved in that? Narrowed it down to a) the LAMP stack or b) Ruby on Rails. Do I want to be a) paid as a programmer or b) hip ?

I went with Hip. Rails it is.

Here are the steps (and mistakes) I took on the road to recovery:

  1. Linux – I remember that: “ls -al” and all that. It’s the sine qua non for a real programmer.
  2. F@(k. That’s a lot of variants of Linux. Go with Ubuntu because I’m semi-African.
  3. Hmm… Windows XP is standard issue at work.
  4. Get an old PC from my IT guy. Spend an entire day installing Ubuntu. Realize I’m now a web programmer so start again and install the server version. What the hell? What’s involved with web programming anyway. Will I be writing the client or the server?
  5. Call college roommate who is on “tiger team” at Yahoo. He says: “Buy Pickaxe“. Sold. In a flash of environmental sympathy I buy the PDF version. It also saves $10. Print it out on corporate printer. Double sided to save the environment.
  6. Need the Rails part: Buy “Agile Web Development with Rails“. We invested in an Agile software company so “agility” must be good.
  7. Start reading. In the interest of time and an anxiety to see the global greeting I dispense with Linux and deploy InstantRails on Windows –> Instant gratification. (Nice to see those programmer types have dropped their antipathy towards Microsoft. I’m a web programmer. Even if it’s only on localhost. (Wow: It’s only February and I could compete with Amazon if I wanted to and if I knew where to buy all the books for my bookstore)
  8. I have a bookstore up and running. No one can see it. That’s ok….how hard can deployment be.
  9. March. Deploytment is hard. People don’t recommend Windows. Could I be the only person writing Ruby code in a Rails environment on Windows XP. Seems to be from my google searches.
  10. Let’s reinstall Ubuntu Linux.
  11. Install ruby gems. Rinse. Repeat. Rinse. Repeat. Check dependencies. Rinse Repeat. Rinse. Repeat.
  12. Install MySQL. (It’s nice that I don’t need to think too much about the database. Seems like something business people should concern themselves with).
  13. Stuff is working. Slow as all hell on this ancient PC but what the hell. People will wait for the page to load.
  14. Becoming a problem that I can only work on my hobby at work. Can’t afford another PC at home.
  15. VMware to the rescue. Downloading an Ubuntu VM on my home PC is a cinch. And hip. Which is important.
  16. Realize I need a real hosting service. (Weeks of agonizing research). Settle on Dreamhost. (I love those guys!)
  17. Deploy app. Hmmm…this is a f@(k1ng nightmare!
  18. Passenger (mod_rails) is released a few days later. I realize I’m back on the cutting edge. Deployment is now piss easy.
  19. www.assetcorrelation.com (Live as of June 1st, 2008 — 5 months start to finish)
  20. Start to harass Google to show me some organic search love.

It’s been a wild ride. And not as hard as I thought. In the end, we return to the beginning. I still hate writing test benches. Hacking is still fun. And not having deadlines is the way to go. 🙂

June 25, 2008 Posted by | Computers & Internet, Engineering, Internet, Ruby on Rails, Technology | , , , , , , , , | Leave a comment

US Datacenter Energy Consumption

I was at a conference this morning where Spansion and Virident were presenting their latest flash memory technology designed to replace DRAM in web servers. Some interesting facts:

  1. Cooling and power distribution losses account for 50% of the electricity consumed in US datacenters.
  2. Datacenter power use doubled from 2000 to 2005 and will almost double again by 2010. Growth in electricity use has been slowed somewhat by the advent of server virtualization over the last few years.
  3. US datacenters use more electricity than countries like Sweden and Iran
  4. Datacenters use almost 100 billion kilowatt hours each year at approximately $0.10 per kilowatt hour. Datacenter electricity consumption is growing at 15% per year (!)
  5. Datacenter memory (DRAM) uses 2x more electricity than the total capacity of US solar panel installations.
  6. US, EU and Japan use 3/4 of the world’s electricity.

It will be interesting to see whether Spansion’s newly announced EcoRAM can put a dent in these problems. They are citing some impressive numbers:

  1. 1/5th the power of DRAM at comparable read performance.
  2. 800x faster than NAND flash access times.
  3. 30 mins to write 1TB of data on EcoRAM vs 5 hours using traditional NOR DIMM’s.

On the other hand, the representatives from Intel and AMD certainly weren’t giving their unqualified support to EcoRAM.

June 24, 2008 Posted by | Computers & Internet, Global Warming, Internet, Technology | , , , , , | Leave a comment

Optimal Memorization

Wired has an excellent article on an optimal memorization algorithm developed by Piotr Wozniak. The technique has been embodied in a software program called SuperMemo and an open-source alternative called Mnemosyne

I’m somewhat skeptical that spending more time on memorizing facts is that useful but given that a few months ago I could barely remember the equation for the roots of a quadratic perhaps I should be more open-minded.

The algorithm is straightforward:

  1.  
    1. Split the knowledge into smallest possible items.
    2. With all items associate an E-Factor equal to 2.5.
    3. Repeat items using the following intervals:
      I(1):=1
      I(2):=6
      for n>2: I(n):=I(n-1)*EF
      where:
      I(n) – inter-repetition interval after the n-th repetition (in days),
      EF – E-Factor of a given item
      If interval is a fraction, round it up to the nearest integer.
    4. After each repetition assess the quality of repetition response in 0-5 grade scale:
      5 – perfect response
      4 – correct response after a hesitation
      3 – correct response recalled with serious difficulty
      2 – incorrect response; where the correct one seemed easy to recall
      1 – incorrect response; the correct one remembered
      0 – complete blackout.
    5. After each repetition modify the E-Factor of the recently repeated item according to the formula:
      EF’:=EF+(0.1-(5-q)*(0.08+(5-q)*0.02))
      where:
      EF’ – new value of the E-Factor,
      EF – old value of the E-Factor,
      q – quality of the response in the 0-5 grade scale.
      If EF is less than 1.3 then let EF be 1.3.
    6. If the quality response was lower than 3 then start repetitions for the item from the beginning without changing the E-Factor (i.e. use intervals I(1), I(2) etc. as if the item was memorized anew).
    7. After each repetition session of a given day repeat again all items that scored below four in the quality assessment. Continue the repetitions until all of these items score at least four.

June 20, 2008 Posted by | Computers & Internet, Internet, Science, Technology, Uncategorized | , , , , | Leave a comment

Correlation between Asset Classes

There is a promising new website called Asset Correlation which shows the correlation matrix for a host of different asset classes over the past 90 trading days. I have been tracking it for a few months and it is amazing how all the asset classes exhibited far higher correlation during the recent panic. As normalcy has gradually returned to the markets it is interesting to see how the historical scenario of lower correlation between asset classes has returned. A few months ago almost all the cells in the matrix were green and correlations were hovering around 80-90% for most of the major classes. As of today, there is far lower correlation between the classes (indicated by the larger number of yellow and red cells). It will be interesting to keep an eye on this website over the next few months.

June 19, 2008 Posted by | Economics, Investing | , , , , , , | 3 Comments

Skype 4.0 and GUI madness

Skype has released version 4.0 (beta) and seem to have completely lost the plot on GUI design. In prior versions it was possible to have one’s contact list docked on the right side of the screen leaving plenty of real estate for working. The new layout now takes half of a 21″ monitor and can’t be made any smaller! That now makes it impossible to keep Skype open and periodically monitor online contacts. I would be ok with Skype taking over my screen once a call has started. Before that time, though, it should remain as unobtrusive as possible while still allowing me to monitor my contact list.

Skype needs to realize that our PC’s are not phones. Communication is a means; not an end.

I would recommend staying with Skype 3.8 until this issue is resolved.

June 18, 2008 Posted by | Computers & Internet, Internet, skype, Technology, Uncategorized | , , , | 1 Comment