Google Chrome 2.0 Beta Released

OS News announced yesterday that Google Chrome 2.0 Beta was just released. I’ve been searching for the perfect browser for my new Acer Aspire One for a couple of weeks now and ended up settling on the stable version of Chrome. It works well because:

Simple C++ String Conversions

The boost::lexical_cast<> utility is a handy way of converting objects to and from strings, providing a mechanism that many scripting languages have built in. lexical_cast works with any C++ type that has ostream and istream operators defined for it, that is, any object that cout << object; or cin >> object; would work with. This boost facility also does intelligent things such as throwing a bad_cast exception if the operation causes an error flag on the stream to be set. I use boost::lexical_cast<> throughout my code at work for things like serialization of objects for human readable communications. It is also sprinkled liberally throughout my code for handling things like quick debug logging:

Reflections on Trusting Trust - by Ken Thompson

In 1984 the Communications of the ACM published an article, Reflections on Trusting Trust. Which is an amazing, and disturbing read about software trust. The article begins with the exercise, “create a program which can replicate itself.” This leads deftly to the idea of modifying a compiler such that every time code is compiled it adds a security vulnerability. The author points out that this kind of problem in a compiler could and would be found rather quickly. However, it takes a compiler to compile a new compiler.

Formatting a Comma Delimated List Redux

A few weeks back, I posited the question, “What is the best way to format a comma delimited list?” After seeing all of the succinct ways to accomplish this in other languages, I got a little jealous and decided to write this C++ algorithm which acts about the same. I feel like there must be a c++ standard library way of doing this that I’m some how overlooking.

Real World Haskell: Chapter 4

Chapter 4 of Real World Haskell begins with some details about functions with side effects and interacting with the outside world. Normally, a Haskell function is pure and may not have any side effects outside of itself. However, it is necessary to allow for side effects for reading and writing files, including standard input and output. The “do” keyword is used when we may have interactions with the outside world.

Programming Puzzle: What is the best way to format a comma delimited list?

Say you have a list, array, vector, storage format doesn’t matter:

Templated Constructors in C++: Using the "explicit" Keyword

Sometimes, in the course of C++ template based programming it might be desirable to have a constructor that is templated, like the following contrived exampled:

Prefer .at() to [ ] When Accessing C++ Vectors

I’m sure I will get some dissenting views posted in comments regarding this, but I just came to this conclusion while trying to track down a memory bug in the past few days. First of all, what’s the difference? Take the follow code to set up our scenario:

Duty and Beyond Review Posted

[img_assist nid=365 title=Duty and Beyond Screenshot desc= link=popup align=right width=320 height=200]Well, it’s official. My first game review for Adventure Gamers was published today. It was a learning experience getting it out there, being the first time I have had to work with an editor. The review is for an amateur adventure called “Duty and Beyond” the game is worth playing if you have any interest in adventure games. Amateur adventures, by the way, will be my specialty at Adventure Gamers. I hope to get out at least a few reviews a year.

Overloading && and || Operators in C++

Short answer: don’t do it! Long answer: As the C++ example from the article on Real World Haskell Chapter 1-2 showed: