Main image
3rd August
2008
written by simplelight

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.

Also, on Dreamhost, make sure to add the following line

‘host: mysql.<dbhostname>.com’ to your database.yml file (under the production environment)

1st August
2008
written by simplelight

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

 

31st July
2008
written by simplelight

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.

26th July
2008
written by simplelight

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…

23rd July
2008
written by simplelight

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.

14th July
2008
written by simplelight

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.

8th July
2008
written by simplelight

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.

1st July
2008
written by simplelight

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.

1st July
2008
written by simplelight

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.

25th June
2008
written by simplelight

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. 🙂

Previous
Next