How I came to be interested in economics
For too long I lived my life believing that economics was boring. The small pieces of economy news I got from TV and papers was rich in numbers and descriptions of specific events but thin on information about the larger picture. That changed when one day July, coincidentally the first day that the iPhone was on sale here in Sweden. I was in line outside a store for a few hours in the morning and while I was waiting I was listening to podcasts of the radio show This American Life. One specific episode caught my attention, and that was a one hour program dedicated to trying to explain the subprime mortgage crisis called The Giant Pool of Money. I found the story incredibly fascinating and when I had listened to the end I wanted more. So I looked around, primarily for podcasts with economy news, explanations and commentary and I found lots of interesting stuff. I followed NPR Economy News and learned a bit here and there, and then, when the real crisis hit in mid September I was hooked.
I found the Planet Money podcast from NPR that has been producing almost daily episodes. The length suits the bike ride down to the office almost perfectly. In addition to that I've been listening to Bloomberg on the economy which has had some really interesting stuff. Both programs mainly interviews different kinds of experts and ask them questions about current events in the financial and political system. That, combined with some blogposts and online newspaper articles has opened my eyes to a whole new world of knowledge. The world economy is such a complex machinery, with interactions that no one can fully understand but at the same time something that affects us all in many ways every day.
One thing that struck me when thinking about this is how much more difficult it would be to acquire the same amount of knowledge 15 years ago. I can now learn complicated stuff about how intra-bank lending works or doesn't work and hear expert opinions about the levels of interest rates for free, without the need to have a higher education in economics or subscribe to any publications.
I think that this new easy access to massive amounts of knowledge and explanations of complex systems is something of a radical change in the pace of the development of the human race. Thinks might look depressing right now, when many people are talking about a world recession, but in the long run I think that the fact that the barriers to access to knowledge has lowered so much in just the last years will make life on this planet much better in years to come. That thought makes me happy.
Filed under Economy | Comments (2)Cause and effect?
I've been doing some reading lately and a topic that has come up more than once is that of false causalities. It seems to be human nature to construct causalities that fit our worldview when in fact the only thing that can be objectively demonstrated is co-variation. We can see this when it comes to non-heterosexuality and the relative occurrence of mental health problems. Some people seems to have their interpretation of the fact that some surveys find depression to be more common among non-heterosexuals than in the general population as a direct cause and effect relation. You're depressed because being gay makes you so! Well, I'm not sure about that, in fact I'm sort of convinced that is not the case. But how do you illustrate that interpreting co-variance as cause and effect is often problematic? With colorful diagrams of course!
Alexander sent me a link to this wonderful piece of graphics, from climate sceptic:
In the comments I found the only relevant question to ask: should we struggle to produce more oil, so the quality of the music will increase, or should we attempt to draft better composers and musicians into rock 'n' roll, so we can have more oil? I'm so confused! At least it made me smile.
Filed under Uncategorized | Comments (2)Falling through the sky
The reason that I haven't written here in a while is that I have been busy having my 30th birthday, with associated celebrations. It has been great fun. Thanks to my amazingly thoughtful fiance Alexander I got a gift certificate for a tandem skydive that I had the great pleasure to redeem today. What a rush! Thanks to a whole bunch of friends I got a photograph joining me in the jump as well. Skydiving makes even a geek like me feel like a rock star. Amazing. I got a whole album of pictures.
Choir weekend
Hi there. I've spent this weekend with my choir, singing for many hours. It was hard work, but also lots of fun. The main part of our rehearsal work was focused on a suite of choral pieces written specifically for us by Jazz composer and saxophonist Joakim Milder to be preformed at the 40th anniversary of Umeå Jazz Festival this October.
The music is a quite spectacular mix of modern Jazz harmonics and contemporary classical music. The rhythm and pace is quite fluid, with lots of varying meters and the harmonics doesn't stay in specific keys, but at the same time many of the passages are breathtakingly beautiful. One other common denominator of the music, from a more technical point of view is that is is really difficult to sing. The melodies doesn't follow many of the common presuppositions that we have on melodies as well as rhythms. It is really bends the mind, and right now it feels a bit overwhelming to try to learn to sing it correctly. I have good hopes, however, that this will be spectacular when preformed.
Filed under Sångkraft | Comment (0)I predict McCain
I've been following the US presidential election closely for more than half a year now, and when I got the message that Obama chooses Joe Biden as his vice president I changed my mind about who I think is going to win this election. My adjusted prediction is that John McCain is going to win.
I think that he can snatch a close victory in november because now Obama has basically invalidated his own best arguments. The Obama campaign likes to paint the picture of McCain as problematically old and part of the washington establishment, but now they have proven that being old and part of the establishment is not a problem when choosing a vice president candidate.
Also, I don't think that you should underestimate Obama's consistent opposition against the war in Iraq as giving him the edge that he needed to defeat Hillary in the primaries. Now that he has chosen a running mate that voted yes to the war, that argument is weakened as well.
Part of me thinks that this is kind of sad. I really liked the idea of an american president that was a brilliant public speaker. I also think that Obama is the smarter guy and being intelligent is one of the most important assets a president can have. On the other hand, with McCain we get a president that is pro free trade, which is a really good thing, especially for those of us living in Europe.
Filed under Uncategorized | Comment (0)Real soon now
After a long summer break, this week it is finally for the choir that I joined last year to resume the weekly rehearsals. I'm so happy to have a choir as a part of the regular rhythm of my life again. Singing together, and working together in a group to learn new music and to sound good together is a really interesting process.
I am fortunate to live in a city where there is a really good chamber choir, and I really enjoy the way we sound (well, almost always) as well as the challenges that we take on.
Filed under Sångkraft | Comment (0)A CRC-32 reversal implementation
(This post is mainly intended for fellow geeks. Non-programming readers of this blog may safely ignore this, I promise you won't be missing out on anything useful.)
The CRC-32 checksum algorithm is everywhere. It is used to detect random data corruption in ethernet packets, PNG graphics files and—as it turns out—zip files. The basic idea is that a 4 byte checksum of a sequence of bytes of arbitrary length is calculated using a specific algorithm. The sender of a message constructs a checksum of the message and send it along with the actual data, and then the receiver can compare the checksum with it's own checksum calculated from the payload data and use that information to detect random data corruption.
The algorithm is designed to be fast and easy to implement in hardware. You can view it as a machine that you feed bytes of data. At any time you can query the machine for a checksum value of all the data fed into the machine. Each byte fed alters it's internal state so that a different 4 byte checksum value is returned. Even a single bit change in the incoming data will alter the checksum to a completely different value.
The algorithm is explained in a very detailed way with impressive clarity in A painless Guide to CRC error detection algorithms so if you are interested, please read that document.
My conundrum with regards to CRC-32 was that I would like to make a short-cut, calculating the resulting checksum of a short dynamic sequence of bytes (an ID3 tag) combined with a longer, static sequence of bytes (an MP3 file) without needing to re-calculate the checksum of the whole every time the dynamic part changed.
So, what to do. Calculating a backwards CRC-32 value for the latter part of the stream to be combined with the checksum of the dynamic part seems to be too hard a problem to solve. However, I got a tip from a friend that with a 4 byte sequence of "compensation data" the checksum can be reset to whatever value one chooses. That way the dynamic tag plus four well chosen bytes can be reset to a known good state for the CRC-32 machine to chug along from and arrive at a known destination.
I got a link to a paper describing an algorithm to calculate the magic compensation bytes, but I think that the description of the algorithm was so complicated that I decided to figure out a way to do it on my own. So, I did. After a bit of experimenting looking at the table based algorithm used in the GNU Classpath CRC32.java I found out a way to calculate the magic reversal bytes as a function of some current checksum as well as a desired checksum.
I have released the resulting CRC32Compensator.java under the MIT Free Software license, in the hope that someone else will find it useful or instructive.
Filed under Programming | Comment (0)Programming for fun and profit
I work as a programmer. Most days it is great, because I get to spend my days writing software and even get payed to do it. However, when writing commercial software unfortunately the most elegant solution to a particular problem is rarely the one that is reasonable to spend time on. Almost all the time, "good enough" is the goal.
As an example, a new functionality that we have just added to voxbiblia.com, the website i spend most of my days working on is the ability to create albums out of the audio Bibles available from our site. An album is a collection of Bible verses read by one of our voices. From a more technical perspective a collection is a group of MP3 audio files. We want those MP3 files to be easy to download and once downloaded we want them to have metadata that makes them show up in your MP3 player. Do achieve this we want to be able to generate metadata information on the fly and we also want to put a whole lot of MP3 files with metadata into a zipfile so that i can be available as one download. We have code to to all this (The ID3 metadata generator will be released as Free Software some day, I promise) and it works as expected but one aspect of the zipfile generation code is not elegant as I would want it to be.
The current solution needs to read each MP3 file into memory to be able to calculate it's CRC-32 checksum before it can write it to the zip datastream served to the user. Since our server is quite powerful it is not a problem to read a few MP3 files into memory at the same time, but the thought that it must be a more elegant and efficient way of doing it was spinning around in my head. Since there is absolutely no justification for finding this solution, the one we had was good enough, I had to put this problem on the shelf for some time.
However, vacation came and when I thought about what to do that would be really fun and recreational I thought about this problem and I decided to try to solve it. So I did, and it was great fun. I will blog about the specifics of this little project in a short while, but for now I'm just so glad that I solved the problem.
