How to

"Use Unicode Character Set" in CMake generated Visual Studio projects

It's strange, but default generated projects are configured to use Multibyte instead of Unicode option.

Hopefully, it's very easy to fix. Just add this line in your top CMakeLists.txt file.

add_definitions(-DUNICODE -D_UNICODE)

Not a problem at all anymore.

PS. As it turned out, there is discussion about it in the CMake mailing list on the last month. Stupid me had to reinvent the wheels.

How to convert string to int (or int to string)

Have I already told that Boost is incredibly useful thing? For example, to easily convert number into the string, you can use lexical_cast like:  read more »

How to change Drupal node content type without loosing PageRank and incoming links

Suppose, you have a very popular "simple article" on your Drupal-powered site. May be, this is a "page", with a lot's of comments and incoming links. Suppose, you have decided to add a couple of child articles to it. To form the tree-like structure like in the Book module. You'll not be able to do this since only "book" pages can be a root of the book. This is only one of the cases when you have to change the content type of the existing node.  read more »

How to create a closed time period with boost::posix_time

Boost date_time library provides very good interface to work with a temporal data. But because of the requirements for iterators compability, the periods are represented as a half-opened values. When passing the begin and end to the constructor, the second parameter will not belong to the created interval.  read more »

Syndicate content