2007

Fun with C# generics: down-casting to a generic type

Today, I am writing about a design problem related to C# generics that I’ve seen arise a few times. The problem occurs when we need to manipulate a generic class given a reference to its non-generic base class. For example, if a generic class Node<T> inherits from a non-generic class Node, and we are holding a Node reference to a Node<T> object, we cannot just cast the object to Node<T> because we do not have access to T.

I realize that the description is a bit abstract; let’s look at an example right away! It may look like a bit of code, but the classes are very simple and do just what you’d expect:

Continue reading »

It’s official: I exist

google.pngSays who? Google search engine, none other. Yesterday, I searched for my name, and my blog appeared as the fourth link. That surprised me, because I did not intend to make the blog public before I have some content here. As far as I know, nobody links here so far, so I didn’t expect Google to find me. Maybe they automatically index newly registered domains?

Continue reading »

French internet kiosk made my life difficult

On the Paris Charles de Gaulle airport, I encountered this internet kiosk:

Continue reading »

Salesmen never lie

It was an early morning when I received a call from one of the numerous firms that sell preparation materials for the various IT certification exams. The call woke me up, and perhaps because of my initial confusion, I did not hang up as quickly as I would normally do. Encouraged that he was still on the line, the salesperson began telling me about the life-changing effects of certifications. In the heat of his passionate speech, he exclaimed:

Continue reading »