2005-10-27

24 signs of stress

Here's a beautiful demonstration of various signs of stress.

Found on Jonathan Hardwick's homepage.

Standard Annotation Language for Haskell

A thought struck me today: Maybe Haskell needs some standard way to annotate the source code? There's already a semi standard for documentation and that is Haddock. But what I mean is something juicier than that.

It seems several projects are working on attaching some kind annotations to Haskell. It mostly has to do with properties of Haskell functions, for example if a function is idempotent or if it commutes with some other function. The two larger projects that I'm aware of that does these kinds of things are Programatica and Cover. And there is also DrIFT which it a kind of code generation tool for Haskell to simply certain repetitive tasks. All these projects use different means to attach information to Haskell programs.

But doesn't Haskell already have a way to annotate the source code? There is the compiler pragma specified in the language standard. Well, pragmas are only standardized up to the point that they are delimited by certain characters. Apart from that, all bets are off. We need some more structure, a unified syntax along the lines with Java's annotations. While I haven't used the annotation mechanism in Java it looks really well designed and useful. Something along those lines is what I'm after for Haskell.

So, what would this look like. Currently I have no idea. All I know is that having a common way of expressing things saves time and work. Syntax is not shallow, it is really important. The problem is that those people who need it the most (the Programatica and Cover people) are the people who are the least likely to spend any time with this. I know most of these people and the look down upon thing like this, defining a common syntax with no meaning. But XML is also a syntax without meaning and although that sounds like something really ridiculous XML has actually saved a lot of work and has let programmers and designers spend their brainpower on the more semantic parts of their problems.

Well, I should really talk to someone about this. Make the wheels start turning. We'll see how it goes. Unfortunately I'm a bit pessimistic.

2005-10-26

Googlism

There's been lots of talking about Google the past days (well the past years in fact...) I thought I'd write down some of the news here.

First of all the result Googles Summer of Code was published. I'm really impressed by the number of successful projects that has been sponsored by Google. It's a great thing for the open source community and I hope we will see more of this. And I expect we will since it must generate a lot of good-will for Google.

Secondly, Google is pouring some more money. This time it is to the Oregon State University and Portland State University for helping them maintaining various open source websites and projects. There's an official press release.

Perhaps the most exciting news is that of base.google.com (it's currently down but has been known to be up at occations). It's a database where you can add all kinds of things. The really interesting thing happens when it is connected to Googles other services like Google Local, Froogle and the upcoming Google Wallet. Then you can share and trade information and goods, you can start local or global clubs and organizations. The possibilities are almost endless. The only potential problem that I see is how to structure the site so that it doesn't become "too abstract". That is, it becomes so general that it is almost useless. But I think Google will solve this, they know how to do things right. There's an article at ars technica about this.

Finally a note from Googles official blog about some stuff that was published on Google Video. Personally I haven't used Google Video so I cannot really say anything about it. Other search engines just search the web for video files and let you search them. But Google requires video makers to upload them onto Googles site. The archive will ofcourse be a lot smaller but perhaps it will be more useful. Time will tell.

Well, Google is hot. And they just continue to lanch new stuff all the time. Some people might fear that Google might become too big. But I don't think that is a problem. If there is one company that I will happily see taking over the world it is Google. With their philosophy that one can earn money without being evil, and which they've also proven to be correct, I trust the company fully.

2005-10-15

Quote time again

Long time since I posted a quote here. This time it is from an invited lecture given at the conference FLoC in 1996. The reason I found this quote is because I read it in an article. Just a warning before you read it; You need to be a computer scientist to understand it.
Translating a conjecture into clause normal form before handing it over to the theorem prover is like shooting oneself in the foot before starting on a long hike.
-- Gerard Huet

2005-10-11

Dark matter and Cosmology

For quite some time I've been rather provoking about our current knowledge of the universe by saying: "The only thing we know for sure about the current model is that it is false." The problem that has been plaguing scientists for some time is that the observed weight of the galaxies isn't enough to hold them together with gravitation. At least that's what the theory says. And since we all know that the theory is right (I'm being ironic here) people have suggested "dark matter", mass that we haven't been able to observe, to be floating around and making up for the lack of mass. This whole thing has always sounded a bit ridiculous to me. It's a sure sign that a theory is in trouble when you have to patch it like this. So I've just been waiting for the downfall of the theory.

Now it might turn out that fixing the theory is surprisingly easy. Researchers have now redone the calculations using a better approximation. They've used general relativity theory instead of Newton's old workhorse of a theory. It turns out that this closes the mass gap and removes the need for dark matter. The article hasn't been reviewed yet but if it holds out then it is a very good thing for the present cosmological model.

Web 2.0

I've just read one of the most interesting articles I've ever read about the internet. Tim O'Reilly is writing about what is called Web 2.0. To be honest I hadn't heard about this term until recently. It's a name which tries to capture the new ways of the internet, the new services, the new business models and how it all works. O'Reilly tries to nail down the core of Web 2.0 and has some very insightful comments on the way. It's a long article but it is well worth the read. Go on, read it!

What Is Web 2.0

2005-10-07

Levine the Genius Tailor

PROGRAMMING LANGUAGE DESIGN

It is impossible to begin a discussion of psychological principles of programming language design without recalling the story of ``Levine the Genius Tailor.'' It seems that a man had gone to Levine to have a suit made cheaply, but when the suit was finished and he went to try it on, it didn't fit him at all. ``Look,'' he said, ``the jacket is much too big in back.''
``No problem,'' replied Levine, showing him how to hunch over his back to take up the slack in the jacket.
``But then what about the right arm? It's three inches too long.''
``No problem,'' Levine repeated, demonstrating how, by leaning to one side and stretching out his right arm, the sleeve could be made to fit.
``And what about these pants? The left leg is too short.''
``No problem,'' said Levine for the third time, and proceeded to teach him how to pull up his leg at the hip so that, though he limped badly, the suit appeared to fit.
Having no more complaints, the man set off hobbling down the street, feeling slightly duped by Levine. Before he went two blocks, he was stopped by a stranger who said, ``I beg your pardon, but is that a new suit you're wearing?''
The man was a little pleased that someone had noticed his suit, so he took no offense. ``Yes it is,'' he replied. ``Why do you ask?''
``Well, I'm in the market for a new suit myself. Who's your tailor?''
``It's Levine---right down the street.''
``Well, thanks very much,'' said the stranger, hurrying off. ``I do believe I'll go to Levine for my suit. Why, he must be a genious to fit a cripple like you!''
Would it be inappropriate to concot a version of this story called ``Levine the Genius Language Designer''? The first problem in discussing language design is that we do not know the answer to that question. We do not know whether the language designers are geniuses, or we ordinary programmers are cripples. Generally speaking, we only know how bad our present programming language is when we finally overcome the psychological barriers and learn a new one. Our standards, in other words, are shifting ones---a fact that has to be taken into full consideration in programming
language design.


Psychology of Computer Programming by Gerald Weinberg (pages 210-211 in the silver anniversary edition). Via LtU.

2005-10-06

Good Worms

A constant problem with today's internet is (beside the problem of spam) the many viruses and worms that take control of peoples computers. And this is not a new problem. No, it has been around since the 80's at least. So why do we still have this problem? Well, it hasn't become a real problem until the internet took off in the late 90's. As time passed on more and more security holes where found in computer which were exploited by worms and viruses. But these holes were patched and today's operating systems are much more difficult to exploit for a worm.

So why are worms still a problem? Because most users use old unpatched software. Even modern worms use old exploits to propagate through the internet.

This is a very frustrating situation. I wish that we could somehow force the people who uses insecure systems to upgrade. But there might be a way. Using the same holes as the malicious worms use we could create 'Good Worms' which patched systems instead. There is a very interesting article about this in eWeek. Ofcourse there are many potential problems and complaints about this techniques but I think it can be made to work and I think it needs to be done considering the present situation. Make sure to read the article and also read the articles it refers to which argues very well for Good Worms.

2005-10-05

Less depressed or more happy?

Psychology and psychoanalysis has to date mostly been about negative emotions such as depression, anger, frustration and so forth. When you go see a shrink he will probably discuss all the bad things in your life and your negative thoughts. Unless your lucky. Because, as of late, this field has realized that focusing on the bad just doesn't do it. It's not enough to just make people less depressed, they need to be more happy!

I just read the most exciting article on the about happiness and the newly started research in that area. This whole line of thinking makes very much sense to me, to try to do something good instead of avoiding to do something bad. But I should admit that most of the time I'm no better than anyone else in this respect. I'm actively working on getting better in this respect right now, though.

2005-09-28

State of the art in programming web based applications

A while ago I blogged about web based applications. I wrote that I think they are the way of the future and offer many great advantages. But how does one go about writing those applications? I mentioned before that the current state of the art is a collection of technologies which goes under the name AJAX. To tell you the truth, I consider AJAX to be stone age. Web development needs some serious improvements. Why do I think that? When using AJAX you must use so many different tools. There is JavaScript, XML (which really isn't anything in itself, just a piece of common syntax) and some programming language of choice for the server side program. And this is if the program is small and well structured. A good example can be found in an article posted not long ago on /..

My point is that there are too many technologies that need to work in synchrony. If you want to change your application you need to fiddle in some JavaScript, perhaps some XML files and in your server code. And then you have to make sure they all still fit together. It just seems fragile to me. But I must be honest here. I don't have very much experience here, this is just an observation from my general impressions of the situation.

So, what do I propose as a solution? Well, I don't have the solution in my hand right now but I have a rough picture of what I think it should look like. What we need is a language where we can express pretty much our whole program with all its parts. We shouldn't need to worry about the exact layout of the messages sent between the server and the client. I care very little whether its formatted with XML or JSON or what have you. Of course it is useful to be able to control this at some point but if I don't want to worry about it I shouldn't have to.

Is there any work done in this direction then? Yes it is. I was not the first one wanting a better solution than the present. The thing which seems most promising is Ruby on Rails. I know next to nothing about Ruby on Rails but it seems to be a very nice framework for developing web apps. The only problem I see with it is that it is based on Ruby which is a scripting language which too few static checks in my opinion. But I know other people have other opinions about that so I'll stop whining about it.

There is also an academic effort to develop a language which can take the place as the language for web programming. The language, not yet fully defined, is called Links (it doesn't have any official homepage that I know of) and the initiator is non other than Philip Wadler. Since Wadler is the brain behind it I'm sure it is going to be a sweet language. What I am afraid of is that it will have rather little impact on the web developer community. You can check his blog where he posted an email I wrote to him about this.

Another thing I'd like to complain about, while I'm on the subject, is how to develop the interface of web based applications. Assuming that we're running the application in a browser, it requires vastly different technologies to develop the interface for a web based app compared to a standard one. My utopian dream of how this should work is that there would be no difference in how to specify the interface of a web based app and non-connected one. The only thing I should have to specify is a bit which tells the program where to run. In a browser or in a standalone interface. Well, perhaps a little more that one bit would be needed but not much more. But in this case I'm afraid I haven't seen any signs of reconciling the two camps. Or rather the gazillion camps since there are just so many ways of writing a standalone interface depending on what library you're using. I think some reconciliation here would be a clear win. But I also see that it is a very difficult task and that it's not likely to happen any time soon.

On a more abstract note all of what I've written here is about being able to expressing oneself at a high level of abstraction. Some details you simply don't want to care about. You want to be able to express yourself clearly, succinctly and without having to repeat yourself. Here are my key rules for achieving this in computer science. Pick a programming language with powerful abstraction capabilities and arm yourself with good libraries and write new ones when you have to. When that fails come up with a new (often domain specific) language to be able to express yourself naturally in your particular domain. Finally, code generation can do wonders, sweeping loads of boring details under the carpet where you will never have to see them again. Maybe some day that will be the case for developing web based applications.

2005-09-27

Firefox versus Opera

I've been using Firefox for about a year now. I'm very happy with it. Especially useful is its extension mechanism. One can download small extensions to enhance the browser to do just about anything. But I've found that most of the things I've extended Firefox with are features I grew accustomed to while using Opera.

A couple of days ago a new version of Opera was released, version 8.5. The big news is that it doesn't have any ad banners in the unregistered browser anymore. I downloaded it to try it out and see how it compared with Firefox nowadays. And I must say I'm very tempted to switch back. Opera feels lighter and snappier. It comes with just about any feature I use on the web preinstalled. It saves sessions by default so that when you start the browser again it will show you the same set of pages as when the browser was closed. One previous problem with Opera was that it didn't handle som web sites that well, including Blogger and GMail which I depend heavily on. But that is a problem of the past. The only thing I'm lacking in Opera is some feature to block ads in a webpage. I'm currently using the Adblock extension to Firefox which has made my everyday surfing experience so much nicer.

But then there is also the question of whether I should support an Open Source project or not. It feels good to contribute the the Firefox project because I believe in Open Source and I think it is a good thing. But Open Source also needs competition otherwise it run the risk of growing stale. And Opera seems to me to be a better browser in a lot of respects. If I can make it block ads in web page just as well as the Adblock extension does it I'm probably going to switch back.

2005-09-24

Batman Begins Soundtrack

A couple of weeks ago I saw Batman Begins and recently I listened to the soundtrack. It doesn't happen very often that I get this excited about a film score, but this one is a real pearl!

The music is composed by Hans Zimmer and James Newton Howard. The work of Hans Zimmer I know fairly well as I have several of his soundtracks in my collection. And it is easy to hear his contribution to this soundtrack with his characteristic adrenalin raising yet melodic beat. It has taken many action movies to a new level. As for James Newton Howard I haven't listen to much of his music directly before even though I've seen many of the movies he made the music for. In the Batman Begins score there is a kind of theme which I can only describe as a kind of dark Vangelis-like music. I can only assume that this is Howards contribution.

As for the film itself, Batman Begins, I enjoyed the movie. It is an above average action movie which takes its time to develop the characters and how Batman came to be. The cast is full of very good actors, perhaps surprising since one would expect the movie to be aimed at the action audience which perhaps isn't so picky about the performance. But it shows that the producers have had a very ambitious goal with the film. A goal which I think ultimately fails. And I didn't really understand this until after I heard the soundtrack.

The film centers much around fear. Under his training Bruce Wayne is taught to face his fears and become one with them. He needs to be feared by his enemies. His nemesis in Gotham is the Scarecrow which uses fear as his weapon. And so on. But I think that this point is somewhat lost. Nowhere in the movie does it get really scary. Some scenes which have a tremendous potential of being scary or at least very intense simply fall flat. I tend to blame the director for this. One thing is for sure, we don't need to blame the score. At times it is just totally magnificent. Unfortunately it is not the kind of soundtrack that one can just sit and listen to. At least I cannot due to it being rather dark and scaring the crap out of me. But that doesn't change the fact that it is one of the most exciting scores I've ever heard. This soundtrack deserves a better movies.

2005-09-12

Dumb Ideas in Computer Security

A whole month without blogging! I need to shape up!

Today I read a very interesting article which I found on /. called "The Six Dumbest Ideas in Computer Security". It is a very interesting read. The author argues that in many cases we try to solve the security problem by attacking it from the wrong direction. An example: instead of filtering out gazillions of bad programs (malware, viruses, worms etc.) on should focus on only allowing those programs that we actually intend to use to run. With this turned-around approach we no longer need anti-virus lists that need to be updated every week. We will simply never be troubled again by malicious programs.

I don't agree with everything the author writes in the article though. His third point is that patching a piece of buggy software is a bad idea. I simply cannot accept that. It is not stupid to fix a bug. It is a Good Thing. What he argues for is that systems should be build with security in mind from the bottom up and that one should carefully plan systems before writing the code. I wholeheartedly agree with that. But that doesn't mean that fixing bugs is a bad thing.

2005-08-12

Math Games

The Mathematical Association of America has a monthly column about Math Games which they publish on the internet. I heartily recommend a visit there. The variation is very good and span from discussing 64K intro demos to block sliding puzzles to prime numbers. There are lots of interesting puzzles and links to fun pages. Everything is very accessible. Enjoy!

2005-08-04

Sojourner Quote of the Week

Every week I receive Sojourner's weekly newsletter. This week's newsletter featured the following quote which I found rather worrying:
"Three quarters of Americans believe the Bible teaches that 'God helps those who help themselves.' That is, three out of four Americans believe that this uber-American idea, a notion at the core of our current individualist politics and culture, which was in fact uttered by Ben Franklin, actually appears in Holy Scripture. The thing is, not only is Franklin's wisdom not biblical; it's counter-biblical. Few ideas could be further from the gospel message, with its radical summons to love of neighbor."

- Author Bill McKibben, in his Harper's magazine essay, "The Christian Paradox"

2005-07-29

Numb3rs

I've been watching the TV show Numb3rs lately and I enjoy it immensely. But me being a math geek and this show being obviously meant to appeal to such I'd like to explain why I like it.

But let me first give a brief review of Numb3rs. Numb3rs is a crime show about an FBI agent solving cases. To his aid he has a mathematician who tries to explore various patterns in the crimes and can help solve the cases. Hence the name Numb3rs.

I started watching the show mid-season and watched about two episodes when I sort of decided that I didn't quite like the show. I thought the math part was pretty dull and this whole thing with the mathematician trying to explain the mathematics pedagogically was pretty lame. But then I thought I should give the show a second chance and started to watch it from the beginning. And all of a sudden I was hooked.

I had the wrong expectations on the show when I started watching it. I hoped the math part would be really savvy but I was greatly disappointed. The real strength in this show is the characters and how they develop. As it turns out the FBI agent and the mathematician is not only colleagues, they're also brothers with the FBI agent being the older brother. This in itself makes for a very interesting relationship between them. Add to this couple their father who's another important character in the show. He has seldom anything to do with the cases, he's just there as a part of the brothers lives. On top of this we have two other FBI agent working together with our main character and a rather eccentric physicist who is a friend of the mathematician. All of this makes for a very good mix of characters and the show is really about the lives of the two brothers who happens to be colleagues. The focus being of course on their work together. So I think that the thing I like about the show is this very well-balanced mix of character development and crime solving. The math part is just a bit of extra spice which makes it even better.

So what about comparing this show to, say, CSI? I think it is difficult because they are rather different. Numb3rs is better on the character development and gets interesting because one cares about the lives of the characters. CSI is better on the crime solving part and excels in the juicy details about the crime. I like the atmosphere in Numb3rs better but I also really like the really slick production of CSI. So I'm not going to pick a winner between these two.

Well. All in all I can very much recommend Numb3rs. Even to non-geeks.

2005-07-28

Harry Potter and the Half Blood Prince

A few days ago I finished reading the latest Harry Potter book; Harry Potter and the Half Blood Prince. It is the sixth of the seven previously promised books in the series. For those of you who haven't read it yet: don't worry, I'm not going to have any spoilers in this post.

To begin with and somewhat off topic I should say that I didn't stand in line to get this book in the day it was released. I preordered it from Amazon UK which turned out to be a real bargain. I paid 130 SEK including shipping when the price for the book in Swedish bookstores was 199 SEK. I'm finding it very hard to go to a bookstore to buy a book these days when it's that much cheaper to buy over the net.

Okay. What about the book then? I must say I didn't find it as exciting as the previous books. The book was still an easy and fast read but it lacked some magic which the other books had. Maybe this is just because I'm getting to know the format of the books. All the books have pretty much the same general chain of event and it's getting a little too familiar. But the end of the Half Blood Prince promises that the seventh book will be quite different.

As to my theory about Draco Malfoy which I posted about earlier, the Half Blood Prince had some very interesting turnes of events. I think the events in the very end of the book and Draco's behavior there shows that I might be on the right track. But it is by no means certain. It has occurred to me that Rowling (the author of the HP books) uses Draco as the antithesis of Harry Potter and maybe she wants to maintain that all the way to the end. It'll be exciting to see what she does in the last book.

One theme which has been constant throughout the books has been the mystery surrounding Severus Snape. I have long though that he is one of the most interesting and mysterious character in the books. It was a little surprising to me to see that the secrets surrounding Snape, why Dumbledore trusts him, the reasons for his various behavior and his true allegiance was revealed already in the sixth book. But I don't say it is a bad decision, I was just surprised. One of the reasons for the early disclosure of this mystery is perhaps that there are a great many things which need to be explained and finalized in the seventh book that it was more or less necessary to get this particular thing out of the way. It also gives room for some exciting drama in the final book.

So despite the fact that I wasn't overly thrilled with the Half Blood Prince I am (as you probably can tell by now) already looking forward to the seventh and final Harry Potter book. The way the Half Blood Prince builds up to the finale in the last book shows great promise.

2005-07-27

Quote day

The Second Law of Thermodynamics:
If you think things are in a mess now, just wait!
-- Jim Warner

Seen in a sig.
To refuse awards is another way of accepting them with more noise than is normal.
- Peter Ustinov

Appeared on my personal google page.

2005-07-20

Death Star Subwoofer

I haven't been blogging for quite a while now. It has its reasons. First of all I've been working my (insert appropriate part of body) off trying to write up my thesis. Then I hit the wall. Now I'm currently on sick leave, and the thesis is nowhere done. But that should leave me with more time to blog shouldn't it?

Anyway, ./ had a link to the most awesome piece of HiFi equipment currently being sold on eBay. A Death Star subwoofer. It's truly impressive. Check it out at eBay.co.uk.

2005-06-28

Another Google Beta

Google just released Google earth, a program to view pretty much the whole of the earth. Some parts of earth even come in 3D. Here is a picture of southern manhattan:

Of course there is a lot of search features in the program linking it to Google. Pretty cool application if you ask me. I find it a bit slow though and I hope that will improve. Otherwise it will be unbearable to use.
Again here is a picture of where I live, together with a little placemark to give a more precise position: