How to Enjoy Old Songs

With many years of experience listening to a remarkable amount of digital music, I suddenly realized what the best way is to listen to your MP3. Most people categorize music files by singer, e.g. naming folders with “Vivian Chow”, “Michael Jackson”, “S.H.E” etc. Ask yourself this question: are you building a database? or are you going to add 200 Stefanie Sun’s songs to your playlist and fill your brain with her voice for a whole day? A more proper way: naming folders with data and time, e.g. “2007.10”, which means songs in this folder were your favorites in October 2007, or those you played the most during the time. Then, these songs not just sound bytes anymore; they’ll be you memory stimulator. Years later when you play it again, you’ll find even the slightest bit of memory, mood and attitude is flushing like irresistible. Joy or sadness, they all come back as if they happened yesterday. A fantastic thing really.

– Written by me in 2010

Sampling can be Evil

I was stranded in a problem for a couple of hours this afternoon due to trusting too much in sampling. As usual, I used the following query to get some flavor of the MySQL table I was interested in.

select * from some_table limit 10;

Super huh? Short and quick, tells you something both about the schema and data within seconds. It worked well until this afternoon when I saw a string typed column across the 10 rows has the same value “AAA”. I took for granted (without even thinking) that all the hundreds of thousands of rows would have “AAA” in this column. I tried desperately (yup, putting logs everywhere) to figured out why my program saw “BBB” instead of “AAA”. In the end, I saw the light and removed “limit 10” in the query and those “BBB”s flew across my screen like crazy.

Lessons Learned – Recipe for Entangling Classes

To share a piece of weird code I saw today – design pattern name should be “I just wanted everybody to have everybody sweetheart”

class A(var b : B, var c : C) {
 b.a = this
 b.c = c
 c.a = this
 c.b = b
}

class B {
 var a : A = null
 var c : C = null
}

class C {
 var a : A = null
 var b : B = null
}

val b = new B
val c = new C
val a = new A(b, c)