6 January, 2009 | Written by Vincent Tan Leave a Comment

About a month ago, I was invited to participate in a project that’s never been done in Singapore before: A calendar for 2009 featuring bloggers in Singapore. It turned out well, and so yeah, the rest of this is going to sound narcissistic…

Still here? Ok, I’m not going into the details of how this came about. The summary is that a few people organised it and the lot of us went to a studio to get our photos taken. I’m born in June, and I’m featured on that month together with another June baby. Here’s me:

Bloggers calendar June 2009

The pretty lady has an equally pretty handle: clicktokill. You do not want to mess with her…

I bought 6 hard copies of the calendar, each month printed on glossy photographic material (I don’t know the technical term for it…) with a cover page. For the life of me, I can’t remember why I ordered 6… Thus I’ve got a couple extra, so if you’re interested (really?), I can send one to you (email me with your address) even if you’re not in Singapore (I’m feeling generous).

Or you can head on over to the web version which was done by Darran (he did a great job on that). Then you can download a zip file with the images yourself. Have a look at the other bloggers while you’re there!

And special thanks to Willy from LiveStudios, who’s the photographer capturing us on film. If you’re in Singapore and looking for photographers, you know who to ask for.

Enjoyed reading this? Share it!
  • StumbleUpon
  • del.icio.us
  • Reddit
  • Slashdot
  • Facebook
5 January, 2009 | Written by Vincent Tan Leave a Comment

I checked out the entries on Wikipedia and found there’s a book named The Wisdom of Crowds by James Surowiecki and another entry on just wisdom of the crowd (note the “s”). The idea is that groups of individuals are able to provide better solutions, answers or opinions than a single individual.

People raising hands
[image by Michael Jay]

Now Surowiecki stated 4 criteria needed for it to work:

  • Diversity of opinion
  • Independence
  • Decentralisation
  • Aggregation

The first two points are somewhat countered by herd behaviour, where people are (easily) influenced by other people. Based on my observations of people around me, and my personal experience, I found that it’s challenging to come up with your own original idea, thought or opinion. Then it’s also challenging to defend that originality against questioning by other people, or self doubt.

The other two points seem related. The more you decentralise, the more you need to aggregate better. It’s like specialists and generalists (using the terms loosely here). The more you specialise in something, the more work you need to tap on other fields of knowledge.

Aannyway, I was thinking about independent thought, the phrase I heard that’s “wisdom of the crowd” and crowdsourcing (though after reading its meaning, it’s not what I wanted). I was thinking if you’re working on something really hard, would the crowd give you better answers? Or would you (or an individual knowledgeable in that field) be a better choice?

Previously, I talked about using heuristics to match image textures. I was using a few tests to determine if a given texture image matched any of the textures in a sample set. This is like using wisdom of the crowd. No one individual test could match with a reasonably high enough accuracy rate. Let’s compare my matching algorithm with the criteria above.

I’ve got a few different tests, so “diversity of opinion” is covered. I’ve got “independence” because each test doesn’t rely on another. I’ve got “decentralisation” because each test is an “expert” on the particular test algorithm used. And I’ve got “aggregation” when I used some kind of average of the tests’ results.

What happens if the problem is so hard, so unheard of, that you don’t know whose opinion to seek?

Diversity dilutes the final (if any) solution if unrelated opinions are brought on. And for an uncommon problem, independent thinkers might get swayed by the first seemingly correct answer (thus following the herd), simply because the problem is so hard. And there’s not much expert knowledge if the problem is so rare (there goes “decentralisation”).

And whose answer are you going to trust, or how are you going to consolidate answers (aggregation)? When answers are uncertain, bias comes into play. A person’s reputation, your feelings towards a person, the way a person presented his solution.

Remember how I used weights on the results of my texture matching algorithm? Not all opinions are created equal…

Of course, all this could be another barber’s paradox, because there’s no such problem! *smile*

Ok, the whole point of this article is I want you to increase your reliance on your opinions, intuition, thoughts and feelings. I’m sure you have a healthy dose of humility and self-awareness such that when you’re truly stumped, you will find someone knowledgeable and ask. It’s when you form a habit of asking others before coming up with your own conclusions first that I’m worried about.

Enjoyed reading this? Share it!
  • StumbleUpon
  • del.icio.us
  • Reddit
  • Slashdot
  • Facebook
1 January, 2009 | Written by Vincent Tan Leave a Comment

There were occasions when I was to increment or decrement some date value by one month. For example, “200806″ to “200807″.

No, I don’t have any disaster-insider-programmer stories to share. Although there was this fellow who forgot to change the year which resulted in a financial fiasco…

Anyway, this is more like a reminder to myself. Take care when January and December are involved. Change the year when going from say “200812″ to “200901″, and also “200801″ to “200712″.

If you’re bouncing from one date to another by multiple months, you could try storing the year and the month into one variable holding total months. So “200806″ becomes 2008 * 12 + 6 = 24102 months. Moving 15 months ahead, we have 24117 months, which is 2009 * 12 + 9. So it’s “200909″ finally.

Of course, if your standard code libraries have an inbuilt function, just use that. For .NET, it’s

DateTime.Now.AddMonths(15).ToString("yyyyMM");

Here’s something to think about: Using the algorithm above, what year and month is 24120 months?

Have a fantastic year ahead!

Enjoyed reading this? Share it!
  • StumbleUpon
  • del.icio.us
  • Reddit
  • Slashdot
  • Facebook
29 December, 2008 | Written by Vincent Tan 2 Comments

It’s that time of the year, where one reminisces, remembers, recalls, regrets, reflects, and other activities starting with re’s. I was going through the posts I wrote this year, and some of the posts made me react with “Huh, I wrote that?”, “What was I thinking?!” and other epic reactions. So here are some of the posts, and if I can remember them, the unsaid reasons for writing them.

The post on Fibonacci sequence and its relation to the golden ratio was quite popular. It still comes up in search results every now and then. The story of the thriving rabbit population came from a childhood encyclopedia (yes, I still have the entire set).

The barber paradox is one of my favourite concepts. I read about it when flipping through my university textbook on logic. Basically, if you hit a stumbling block in your logic, you might find that challenging your original assumption reveals the answer to the stumbling block.

In May 2008, I managed to dupe persuade Guy Kawasaki into including me in the Programming section of Alltop. That was awesome, since I was trying to improve awareness of my blog and the concept I’m pushing for (multi-disciplines). Getting listed helped.

I also created a new site called Ragnarok Code. It was meant to be a code playground for me. I do a lot of .NET work and I want to do some stuff that I can’t on this blog (though there are ways to get around my PHP problem…). Wanted to code something with Silverlight and I never really got to it… That said, check out the OpenStreetMap application by Philip. It’s totally awesome.

Then I tried my hand at mixing storytelling and puzzles with the Mind Trap series. I planned for 5 parts, but failed to find interesting puzzles to weave into the story. In the end, I only had 3.

Alas, the full story of our trapped hero Ryan may never be revealed…

I also started a mini-series dubbed “Please ConvertToEnglish()“. It’s a play on the .NET functions such as Convert.ToInt32() and so on. What I had in mind was to explain certain code or human behaviour (mainly because of code) in simple English. I don’t see an end to it, since I draw inspiration from what I encounter… *smile*

There’s something else that came up often in my search results: The puzzle on 7 points and 6 lines (and the 2nd solution with corrections from a reader, Eric).

Then came the first (known) hack attempt on my blog. It was targetting SQL Server, so I was safe… I think… That analysis involved the use of a few pieces of information.

I also had a visit from Raymond Chen for something I wrote about rotating a matrix, which is different from a rotation matrix. Read the proof by Mathew which is simpler than mine, and it even looks like what I would write on paper with all the subscripts and superscripts.

My next embarrassing public humiliation was when I asked for advice on field of view (FOV). I was called on my article by two people no less (thanks to David and Jason aka xero)… That article sprung up from a university assignment, and was one of those questions where I never really got an answer. Like the one on using pointer arithmetic instead of array syntax. Wait, I didn’t write about that one…

In October, I wrote what I think was my crowning achievement then, the article on the use of bilinear interpolation in image rotation. It required the combination of a few pieces of information to work:

  • Knowledge of raster, Cartesian and polar coordinate systems
  • Linear interpolation and as a corollary, bilinear interpolation
  • The “direction” of assignment

Strangely, the post on the digital clock puzzle came up moderately frequently in search results. I guess a lot of people were stumped… Great answer by Steven, though I couldn’t award him any prizes. I’ll have to get my hands on some noteworthy gifts…

I also started to get involved in the Singapore social media slash blogging scene. Got to know some really nice people, and there were also a few programmers too!

Then I tackled the hitherto unimaginable math problem on swinging doors. It was interesting. It was spontaneous. It was … alright, I was a bit bored. I also made a major mistake while discussing that, which I corrected with another post. Talk about barber paradoxes…

I finally came to terms with the lengthy name of my blog, and shortened what I am to being a Polymer. I still want to publish something more on it, maybe a manifesto. Still collecting my thoughts on this…

And I was a guest in a Tech56 podcast, a local production about technology and general geeky stuff. I was also at their 100th episode celebration/podcast event.

On the topic of podcasts, I submitted a question which was answered in Stack Overflow podcast episode 33. I asked for an opinion on reducing costs (in a software business, since Jeff and Joel probably won’t know much about the industry of the company I’m working at). In summary, the answer was to stop worrying about reducing costs and start thinking about increasing value.

Recently, I talked about digital image processing. It was something I wanted to write about for a long time, but never really got down to it. I also didn’t do justice to the topic, and I originally planned for something more fleshed out. I’ll leave it as it is till I can’t stand it anymore and I’ll follow up on it. And that image processing course I took was one of the most interesting classes in my entire university life.

And that’s 2008 for me. Have fun with the rest of December, and I’ll see you next year.

Enjoyed reading this? Share it!
  • StumbleUpon
  • del.icio.us
  • Reddit
  • Slashdot
  • Facebook
25 December, 2008 | Written by Vincent Tan Leave a Comment

You might already know how Christmas is equal to Halloween. You don’t? Well, I came across this some time ago, and it took me a few moments to figure out how Christmas can be equal to Halloween. Now, let me prove to you the truthfulness of that statement.

We have Christmas on 25 December. Let’s put that here:
DEC 25
= 25 [let's focus on the day, ok?]
= 24 + 1 [it's obvious I know...]
= (8^1) * 3 + (8^0) * 1 [some fancy arithmetic]
= 31 [of base 8. Much easier to work with than base 3]
= OCT 31 [let's use the short form of octal]

Wait a minute, OCT 31 looks awfully familiar… Hey it’s Halloween, which falls on 31 October! Thus is Christmas equal to Halloween.

Q.E.D.

Alright, in case you’re not following, the “proof” transformed Christmas and Halloween into their date representations. The date representations happen to be of the form “base-short-form number”. So Christmas became decimal 25, and Halloween became octal 31.

Here’s a lesson to take away. Sometimes, the problem you’re working on is easier to solve when it’s transformed into another representation. For example, rotating an image is easier when you transform all the coordinates from raster to Cartesian to polar, and then rotate in polar coordinates. Or change a colour in RGB format into HSL, so you can change colour just by varying the “hue” part.

That’s it for now. Happy holidays!

Enjoyed reading this? Share it!
  • StumbleUpon
  • del.icio.us
  • Reddit
  • Slashdot
  • Facebook