Thursday, July 27, 2006

iiiiiiPod?... iiiiiiTunes?... iiiiiiinteresting...

Ah, my friend... maybe it's too much exposure to Windows programs and iTunes makes perfect sense in a context that I am not very familiar with, but could anyone explain the following quirks to me?

  1. Adding some files fails on iTunes. Silently. It doesn't tell you why the stuff you just dropped in does not appear anywhere. You wonder if somehow the files are not recognized... until you wonder if there is a magic filename limit --- after counting the characters in the filename, you guess that the limit is 64, you rename the files, and indeed you're correct. Ok, so why wasn't there any dialog? Why couldn't iTunes keep the long filenames and just shorten them on the iPod, if the iPod's filesystem was the issue? I don't get it.
  2. A very large fraction of my music is in ogg format, which is not recognized by iTunes. Fair enough, you add the plugin from Xiph and iTunes now sees the ogg files. But they are not recognized by the iPod! But iTunes comes to the rescue, because it lets you convert whatever files to aac. Good! So you carefully add many many playlists of ogg files, and then select all the ogg files in the library and hit convert to aac. Then you update the iPod... and mysteriously, not all the playlists got copied. But if you check in the blanket file list, the converted aac files are there. What is going on? Well, the converted aac files got thrown into the main library folder, because iTunes ignores the fact that the ogg file and its corresponding aac file are the same thing. Therefore, your playlists full of ogg files didn't get copied because as far as the iPod is concerned, they're empty. Yet, the aac files in the unclassified folder got copied anyway. Solution? Convert playlist by playlist, replace the ogg files with the aac files, go to the main library and remove the ogg files from it so you don't see the pesky dialog every time you update the iPod. I don't get it.
  3. I organize my music with folders, so I do not need to tag files. They're implicitly tagged by the folder in which they reside. Did I miss something, or iTunes really does not support making folders in the iPod? Is it really impossible to treat each folder as its own playlist? Do I really have to make a playlist per folder and do the conversion dance described above for each of them? I don't get it.
  4. If you have ogg files on your hard drive, why do you have to keep the converted aac counterparts on your hard drive as well? Is it that hard to just put the converted aac files on the iPod and leave the ogg files on the hard drive, remembering they're the same thing? I don't get it.
  5. Dual core processors are common already. Why doesn't iTunes take advantage of this when converting ogg to aac? I don't get it.
  6. When converting files, why does iTunes become so unresponsive? It misses clicks, file drops, and at times it can be quite irritating. Can't the conversion thread run at lower priority than the UI? I don't get it.
If anybody has found the same issues and has a better solution, could you please let me know? Thanks in advance.

PS: Also, if you want to use AKG headphones with your iPod, the 240 monitors are a bit too much power hungry. Use the 240 studios instead (55 ohm vs 600 ohm impedance difference).

Tuesday, July 25, 2006

Invitation to OOPSLA 2006

I'd like to invite you to OOPSLA 2006, a wonderful place to meet people with whom to share our common interests. In addition, I would like to invite you to my demo on truly efficient Smalltalk, which I hope you will enjoy.

See you at OOPSLA in October!

Sunday, July 23, 2006

VW's ProcessMonitor issue

A while ago, I wrote a piece to queue cursor change requests so that most of the CPU time wouldn't go into updating the screen (or transmitting such screen damage in an X/Citrix/Exceed scenario, for example).

Basically, it installs a high priority process that wakes up every 10th of a second and issues the primBeCursor to the cursor requested last. I was also careful to change the cursor immediately if the cursor is one of the three GC cursors, otherwise they'd never be seen.

However, there is an issue I haven't been able to figure out. Let's say you open the ProcessMonitor. This prevents screen refreshes outside the ProcessMonitor window, somehow (how?!). Then, you put the cursor on top of the ProcessMonitor and wait... eventually, you'll hit a scavenge, at which point:

  1. the cursor changes to the corresponding cursor,
  2. the process that changes cursors is killed.
I know the process is killed because if I amend Process>>terminate not to terminate that particular process, then it survives. The issue is that because the ProcessMonitor is open, I cannot open a debugger when I make Process>>terminate exit earlier. I also tried making it wait on a semaphore, but I have not seen any process wait on a semaphore in the ProcessMonitor, so I do not know which process kills the cursor change process.

I could try to debug it harder, but the tackiness of the approaches that come to mind makes me wonder if I didn't miss something more obvious.

Any ideas?

Sunday, July 16, 2006

Zen of fortune cookies

Avoid compulsively making things worse.

Wednesday, July 12, 2006

Thinking of perform:

I'm sure you've seen this pattern before:

    (anObject respondsTo: #message)
      ifTrue: [anObject message]
      ifFalse: [anObject somethingElse]

How could we change it so it is not as redundant? Like this, for example.

      perform: #message
      ifNotUnderstood: [anObject somethingElse]

To keep the implementation nice, I thought of the following:


      < primitive: xyz >
      ^aBlock value

If you didn't have a primitive, then there is always the #respondsTo: stuff*. But at least you would be able to write that piece only once :).

* Question: instead of the primitive, could you use on: MessageNotUnderstood do: [:ex | ex return: aBlock value]?

Tuesday, July 11, 2006

Life Index Lyrics

Have you watched FR-034: Life Index*? If so, what are the lyrics sung by the speech synthetizer? Can you help filling in the blanks?

  1. [???]
  2. [???] the most infinite.
  3. As my heart beats, I feel the seconds less.
  4. I shall cherish it where others don't understand.
  5. [???]
  6. This rose if for you only [???] absent friend.
  7. It has grown in the garden of my subconsciousness,
  8. in the tragedy I wish not to comprehend.
  9. We slow down.
Thanks in advance!

* The website says Time Index, but the demo says Life Index.

No Touch Button

Sigh... it has been so long... but it still feels like yesterday. There was this talented comic in Argentina, called Alberto Olmedo. He was very famous for contagious smile, for his spontaneous style, for his characters, and for frequently forgetting the script.

A star of many comedy films and theatre shows, he used to have his own TV programs as well. One of them was called "No Toca Botón", or "No Touch Button", quite literally. I remember the quite odd choice for its opening music very well, especially because it had French lyrics. In any case, I expected never to find out the name of the song.

But surprise surprise --- a friend of mine found it. The music of "No Toca Botón" is this:

Attention Mesdames et Messieur, by Michel Fugain

Bonus points: one of the ladies that worked with him sent his son to the grade/high school I attended.

Monday, July 10, 2006

Geometric Perelman

These Perelman problems are a lot of fun! Ah, Yakov Isidorovich... tobarich... how fantastic your books, your writing style, and your exercise collections! Here is a different Perelman theme for you. Take out your pen, ruler, compass and paper since this is a geometry problem!

Take the shape of a half-crescent moon, and cut it in 6 pieces with 2 straight lines.

On the popularity of soccer

It seems to me that US sports are typically based on a large number of repetitions. Basketball is a game of repetitions (shoot the basket n times), baseball is a game of repetitions (pitch the ball n times, swing the bat n times), ice hockey is a game of repetitions (shoot the goal n times), and so on. In these games, winners are usually decided with large statistical samples that determine the effectiveness of the repetitions. Note also that, at any particular time, the repetitions in basketball, baseball, ice hockey and such are performed by very few of the players.

But in soccer, that ain't necessarily so. Not only the statistical samples are smaller, leading to large deviations from the average (as such, the best team may not always win) --- it is not even clear what a "repetition" is, as the ways to score are quite varied. Each team has 11 players that concurrently share the burden of play without many restrictions as to what their activities actually are. Gameplay in general, and scoring in particular, typically involves multiple players.

Soccer is mostly a team game of constraints and concentration, rather than a game of short bursts of intensity and repetitions that focuses on individual performances. Maybe we just do not value those qualities as much*.

* What happens when a team sport like basketball is played in an individualistic fashion? Bronze in Athens 2004, far from 1st in Indianapolis 2002. Even in soccer, Brazil was sent out of the World Cup by a better team of not as talented individual players.

Thursday, July 06, 2006

The matches

Ah, my friend... long time no Perelman? Suffer no more, here is the next problem for you.

You have 48 matches in 3 groups. From the first group, you move to the second as many matches are in the second. Then, from the second group you move to the third as many matches are in the third. Then, from the third group, you move to the first as many matches are in the first. At this point, all groups have the same amount of matches. How many matches were in each group to begin with?

Poor man's Google for the BBC

Does anybody know where can I get a copy of the 6 episodes of The Real Thing?

Poor man's Google for movies

Does anybody know where can I buy a DVD of Le Jouet?

Oh!bjective C

So I had a shocking experience last night --- I saw how Apple's OS is written in Objective C, which is dynamically-typed C with Smalltalk syntax sans an automatic GC... and how their development tools look like the browser, the workspace, the UI painter, .bos files, the PDP debugger...

And if it wasn't enough, F-Script even gets rid of the square brackets around every message send, uses := for assignment, and provides an automatic GC for you.

Oh, by the way, there are blocks.

Since all of the OS is written the same way, the OS and all the apps that use these frameworks are accessible from your Objective-C program in a standard way. If you add behavior to the framework, it becomes accessible without restarting.

Maybe you can explain the .NET fantasy to me one more time, but I do not need to hear it again.

Why, exactly, do I still use Windows machines?!

A movie for today

I had a chance to watch They Live a couple nights ago. Even though it was released in 1988, I think it is very appropriate for our times. Seriously... get a copy and watch.