>> Single Point of Failure >>


Recent Entries



Popular Tags

Art Blog Blogging Book Books C++ C/C++ Calvin Cartoon Complaints Daughter Definition Development Event Experiment Family Favorites Firefox Focus Fun Google Humor Introspection Life Linux Movie Movies Music Organization Photo Photography Programming Python Reading Software Tips Tools Travel TV Ubuntu Vacations Video Water White Work

A Puzzle…

Ξ November 6th, 2010 | → 0 Comments |
Programming |, , , |


The Exceptional C++ book series by Herb Sutter are amazing. The three books* provide (sometimes not so easy but) very interesting puzzles related to the possible uses of modern C++ programming. Its perfect to the passionate programmer, and you can be sure to learn and enjoy the time spent reading these books.
Here is an excerpt from Item 4 of More Exceptional C++, which intends to find a mechanism to check, at compile time, that a given class D is derived from a base class B.

template<typename D, typename B>
class IsDerivedFrom
{
  class No { };
  class Yes { No no[2]; };

  static Yes Test( B* ); // declared, but not defined
  static No Test( … ); // declared, but not defined

public:
  enum{ Is = sizeof(Test(static_cast(0))) == sizeof(Yes) };
};

I have to admit that it took me a while to understand what the hell was going on in this piece of code. Can you see how this solved the issue? Very clever, right!?

 


* Exceptional C++, More Exceptional C++ and Exceptional C++ Style

 


Literally: Blood and Guts!

Ξ November 3rd, 2010 | → 0 Comments |
Fun |, , , |




 

The best laugh I had in a couple of months. Great action, blood and guts movie!

 


Companions

Ξ November 1st, 2010 | → 0 Comments |
Hobbies |, , , , |


 


Looking for something different…

Ξ November 1st, 2010 | → 0 Comments |
Programming |, , , , |


Not being a total fanatic about any particular programming language, my go-to language is C++. In my daily affair, both C++ and plain-old C (with a little bit of Java on-the-side) are the usual tools of the traid. Althought these three languages rule the populairty charts (e.g. http://langpop.com/), there is always a fear of becoming to focused on a given technology. 

In order broaden the horizon, I’ve been thinking of experimenting something different. Of course that are lots to choose from right here, but I’ll be focussing in one of the following:

 - Python – a scripting language that becomes very usefull when automating daily tasks (this is certainly a plus)

 - Smalltalk – an object oriented language not very well known (at least by me), but there is a lot of good books on the subject of Design Patterns that grown from this language.

 - Objective-C – it would be interesting to see what this language brings to the table, and understand the differences to the closely related C/C++

 - Ruby, Scala, Haskell, Erlang – currently, just names that I recognize as programming languages but that I don’t know much about.

 - Fortran – knowing this one would be interesting, since I deal with a lot of “scientific programming” modules. Not! :-)

At this moment, Python seems the best choice, but Smalltalk and Ojective-C also seem strangely attractive. First step, do some prospecting about the three in the shorlist… I’ll be searching available resources, community, documentation. I’ll let you know how it goes.

 

 


On the nightstand...