||
Blog

Archive for the 'smalltalk' Category

« To main blog page

At the intersection of Cool and Smalltalk and Useless

Monday, January 22nd, 2007

In Smalltalk, you when an object receives a message that it does not implement, it executes the #doesNotUnderstand: method (which has a default implementation in the Object class). Now, if you override this method in your class, you can do funny stuff like proxies and even more useless things, like the one I will present here :)

The idea that came thourgh my head today and I implemented together with Paolo (not because it was that difficult but because it was that fun) was to override Number>>doesNotUnderstand: such that if the method that is being sent to an object of class Number looks like an attempt to convert something to something else… use Google to convert the thing and return the result. After the task was done, the following expressions suddenly became valid Smalltalk expressions:

1 usdToEur
37 celsiusToFarenheit
1 kmToMile

If you want to see the implementation (although many other better things you probably have to do with your life) check out the Conversions-PoweredByGoogle in the Cincom Public Repository.

There are many lessons to be learned from this experiment. I will however, not mention any. Lessons are to be learnt rather than taught…

How does time look like?

Wednesday, October 25th, 2006

The image below shows a screenshot of Retrospector (one pet-project of mine) visualizing the activity on my machine between 15 september and 15 october.

Principles behind the picture construction:
- Days are arranged sequentially as rows along the y-axis
- Time flows along the x-axis and vertical lines corresponding to hours are visible for guidance. There is a bold line at 8 o’clock.
- Every application has an associated color
- Continuous usage of a given application during a day is represented as a horizontal bar having the color of the application

The picture tells several things about me:

  • I don’t have a nine-to-five job :)
  • The long and sometimes late programming sessions (green) and frequent writing sessions (magenta) give away the fact that a deadline was approaching :)

Some things for which such a tool might be useful are:

  • Learning about oneself: one could see when are his best periods for certain activities. The images shows that I have some great programming sessions when the majority of the people in my town are sleeping :)
  • Learning about how different people work: by analyzing how the activities of various users look one might derive user types and habits (if you are a mac user and want to contribute by observing yourself please let me know :)

On one hand, I think this is a cool project. On the other hand, there is always a privacy issue. How much is one willing to make public about his activities? Would people agree to send their activity data for analysis by a psichologist or for data mining? Maybe if I found a way to anonymize the data? Wouldn’t this type of display lead to supperficial characterizations of people?