Twelve weeks of Racket and CS:APP

Please note that this post has been created more than 3 months ago. It might contain inaccurate or stale (or both!) information. Use with caution!

As promised, this is a wrap up of my experience concentrating for (slightly more than) 12 weeks on only 2 subjects. For this first stint, I chose to learn Racket and to read Computer Systems: A Programmer’s Perspective. Not long ago I have lost interest in providing ultimate motivations for what I do in my free time; I’ll just stick to what happened. (I can’t promise I won’t motivate everything else, which is not ultimate.)

Read More

Kicking the tires

Please note that this post has been created more than 3 months ago. It might contain inaccurate or stale (or both!) information. Use with caution!

In the hot, cruel desert of this space, wind howled in solitude. A stone statue lay on the ground like a man asleep, succumbing to its own weight, mental and physical. For more than one year, no stirring. The sun shines on again today. A wanderer passes by on a camel, and looks at the strange statue. He swears that he saw it moving.

Read More

Unit testing with Google Test

Please note that this post has been created more than 3 months ago. It might contain inaccurate or stale (or both!) information. Use with caution!

In a previous post, I have written a brief introduction to CppTest, and given some motivation as to why you should be using unit tests if you are not already. This week, I wanted to throw a glance at the competition, so I tried Google Test. I still don’t like macros, but these look actually useful.

Read More

Unit testing with cpptest

Please note that this post has been created more than 3 months ago. It might contain inaccurate or stale (or both!) information. Use with caution!

Unit testing is a fundamental activity in software development, even if not as widespread as it should. As C++ has been around for quite some time, several libraries are available for carrying out this activity. This week I’ve had a look at cpptest. In the future, I plan to compare compare it to another pretty popular test library, googletest.

Read More

The SQLite3 C++ API

Please note that this post has been created more than 3 months ago. It might contain inaccurate or stale (or both!) information. Use with caution!

I was looking for some practice with DBs, and my choice fell on the SQLite project, maybe only because it looked lighter than PostgreSQL, which I also plan to play with. My first general impression about the API is that it looks a little too much C-oriented, even though I am not sure whether this is a good or a bad thing, and I am ignorant about the latitude of choice an engineer has when designing an API that has to interact with applications written in either C or C++.

Read More

Hash tables

Please note that this post has been created more than 3 months ago. It might contain inaccurate or stale (or both!) information. Use with caution!

Before C++11, hash tables could be used in C++ only with some tricks. The only associative container available in the STL used to be the std::map (along with its sibling, the multimap). This class, however, is implemented as a binary search tree, and does not provide a way to customize a hash function. What hurt me most was that you didn’t have the great performances offered by a true hash map: almost constant time insert, delete, and search (depending on how good is the hash function). You insert in O(log N) time. You find in O(log N) time. Too bad.

Read More

STL Algorithms, part 5

Please note that this post has been created more than 3 months ago. It might contain inaccurate or stale (or both!) information. Use with caution!

In the previous post in the series, we have analyzed more algorithms from the STL considered to be part of the non-modifying sequence operations. In this post, we are going to show some use case for algorithms which fall into the modifying sequence operations.

Read More