Friday, February 23, 2007

Looking for something fulfilling

Lately I have to admit that I have been feeling less and less fulfilled. It's like I don't produce anything new, I can't really interest myself on anything that makes me excited. Here were some trials:

1) Gardening: it's hard to feel fulfilled gardening still technically during winter
2) Stock trading: after playing around for a while, I just gave up on finding any companies that I think are doing anything exciting (and have shares being sold publicly) and keeping track on non-interesting companies was just boring. They all feel the same to me.
3) Music: I tried to go back to listening and playing some (only keyboard, didn't have the courage to take out my clarinet yet), but didn't quite work. It's been some time that music stopped touching me as much as it used to.
4) Electronics: my never-ending (and never moving-forward) recipe reader project... Quite disappointing to keep figuring out that I need more parts and not having time to go and buy the parts (or having to order in bulk online paying more for shipping than the part itself). I also have my plan for an interactive news visualizer, but that's way more complicated...
5) Work: I don't want to talk about work... It was a depressing week.
6) Reading: I'm actually reading a very interesting book right now, Alan Campbell's Scar Night. But there is a limit on how much I can read every day... And I don't really feel like I'm accomplishing anything reading.

So today I decided to go back to one of my old hobbies: writing. Apart from not being a good writer, it's sometimes fun to just let you mind go wild with ideas and then try to put a consistent thread to tie them all. I'm actually trying to get back to one of my most ambitious writing projects (no, not the multi-language book - I can't write in German any more, I'm afraid). More details about it some other time.

Monday, February 12, 2007

Some talk about music theory

I was asked to comment on adviken, an interesting guy that posts music theory lessons on YouTube. His lessons are actually quite interesting in the sense that he can explain some things quite well, like the tonal relations and scale variations. However, there isn't much more there.

There are a couple of things that I've heard some time ago that intrigued me in relation to music theory:

1) Our ears are not as relative as we once thought. Classic music theory claims that if you play a piece in C major or C# major you won't feel the difference. And that's actually not true. Actually it was something that a lot of composers already claimed not to be true - some gave colors to different tonalities like Scriabin. Also I'm not falling for the statistics discussions that claims that there are more pieces in C, F, Bb and G major than any other key as proof for key preference, because that is probably mostly related to the difficulty of playing specific keys in some instruments. There are some interesting experiments that showed that people can sing their favorite song in the correct key only using their memory. Quite interesting
2) Sound compositions is extremely important. You learn that very quickly the first time you try to compose something with more than 4-5 instruments. It makes a huge difference to forget a little about harmony and counterpoint theory and just think about what you can do with two or more instruments that will sound interesting. Percussion is great for it. It has been proven that the attack of an instrument is what gives most of the difference in the sound. If you add a percussion to the attack, you suddenly have something very strong messing with the instrument identifier and what do you get? A "new instrument"!
3) Harmony and consonance is mostly cultural. In different cultures people get to (approximately) different harmonies and your ear gets used differently to what "soundg good". And that begs for the question: now that we are continuously moving towards a globalized world, are we losing this richness in hearing? Are we drifting towards somehing else?

Music is exciting! But sometimes work is necessary.

Friday, February 09, 2007

Self-describing data

Lately, for reasons I won't delve into here, I have been thinking quite a lot about self-describing data. I'll have to admit that the first time I heard of this expression, when I was reading about ontologies, DAML+OWL, RDF, I didn't give too much attention to it. It seemed a little odd for me to worry about it.

However, lately I have realized the real importance of it. Its wastefulness has some very interesting consequences:

- Independence between systems: two systems don't have to completely understand each other to interoperate, as long as they can find within their data things they can understand. Independence also relates to same-system upgrades - if you use this data for storing state, it's easier for a new version to understand the old version's state without having to explicitly code for it.
- "Isolationability" of data: data can be understood (somehow) without a system around it - you can build generic tools to look at the data - they will never be optimal for anything, but they allow for inspection and improve debug-ability.
- Extensibility: as you know that your clients can live with only understanding part of your date (yes, your clients have to be built with that in mind), you can extend your data without worrying too much about the consequences.

Let's give an example. Let's say that you are trying to store personal information about your friends around. Your first solution could be something like:

Joe Smith, 10/12, 555-555-5555
Clara Smurf, 05/05/1977, 555-555-5544
Joe Jack, 01/01

Now you have to build a system that will parse each line and understand that the name is before the first comma, the birth date (with or without year) is next and then the phone number (if you know it). Now let's say that you want also to add a city of residence. Now your system, has to know how to parse something completely new.

But what if you write a second file that contains how to parse this file? Something like:

<name>, <birth-month>/<birth-day>[/<birth-year>][, <phone-number>]

Let's call this file a dictionary. Now you have to keep that file always with your initial file. More than this you have to make sure that when you change one, you change the second one too. And that if you are dealing with files written with different dictionaries so you have to keep a copy of all the dictionaries around and how they relate to each other. One misunderstanding on which dictionary to pick and you are suddenly getting everything wrong. But I have to admit that it's better than the first option.

Now, what if you wrote something like:


Friend 1:
Family name: Smith
First name: Joe
Birth month: 10
Birth day: 12
Phone number: 555-555-5555
Friend 2:
Family name: Smurf
First name: Clara
Birth month: 05
Birth day: 05
Birth year: 1977
Phone number: 555-555-5544
Friend 3:
Family name: Jack
First name: Joe
Birth month: 01
Birth day: 01


Isn't it much easier to understand what I mean? Surely it's much more expensive to store in disk and to send out to people, also more expensive to parse and process, but what it's a matter of looking forward and thinking where do you want to go with your data. Are you building something that will only work for what you know you need right now, or do you accept that your needs change with time and you would like not to have to reinvent the wheel ever time it does (and more than this, keep track of all the wheels you have invented in the past, because they might come back to haunt you).

Surely I'm over-simplifying things here. There are lots of things that you can do that will make things not backwards compatible on the self-describing solution. Also there are things you can do to the dictionary solution that would contain the version of the dictionary in the message contents and a dictionary repository that you could get any specific version.

I guess my point is the following: if you can live with the complexities of non-self-describing data, if things don't change, or if change is centered around systems that you have good control over, go for it. For all the rest of us, mortals, it's just too painful for gains that it offers. Especially in our world where networks are fast and disk space is cheap.

Sunday, February 04, 2007

It's superbowl weekend

Yes, it is, but that's now what I'm going to talk about. There are lots of interesting things happening right now, besides preparations for this money-packed event.

I'll have to start with my current most forbidden site: Amapedia. I've seen this site pretty much from its infancy all the way to launch and... Well... It's a very interesting concept. There are already some nice things that are coming out of it, especially related to more information about authors that you don't get on Amazon.com, contents of books and CDs, and not too much incorrect information. But one of the most exciting things, in my opinion, is the ability to do fact-based search, and leverage structured information. I wished I could send a link to it, but it seems only to be available to people that are logged on to the site. There is also one small issue with the structured search: it only works if you add structured information to the articles! Now come the reasons why it's a forbidden site for me:

1) I know how important structure is for the way the site works and most pages have no structure at all, so I go around and spend time cleaning up the data there. Spending time is not 5-10 minutes here and there, it's 30-120 minutes here and there!
2) Like wandering around Amazon.com, because I know the way things were supposed to work, bugs just become extremely evident and annoying. I just sent a short list as feedback.

Anyway, I will encourage people to try it out. Have fun, give them feedback and NEVER finish writing an article without entering fact information (in the second page of editing, you have to click on "Next")