Author: shaovoon
-
H264 Video Encoder for OpenGL
Download the source from GitHub Though this long article has more lines than the encoder library itself, this is a very simple and easy to read and understand article. If you have read my other articles before, you will be comfortable to know I do not write complicated stuff. Table of Contents Introduction Running the […]
-
Pull Request at GitHub
Well, they say GitHub is a social-media site for programmers. It provides a way of collobration and contribution for programmers via pull request. If you are just using GitHub to download source code, you are not using it to the fullest potential. I often have users message/email me about some small fix they did for […]
-
Floating Point and Integer Arithmetic Benchmark
Introduction This is not much of a tip, just a posting of benchmark result to compare integer and floating point arithmetic timing. All the integer and floating point types used in Benchmark are 64bit. Timing is based on looping 100 million times. Clarification: SmallInt and SmallDouble refers to small values (10-10000) stored in int64_t and […]
-
C++: Simple Permutation and Combination Parallelism
Primary Motivation Single Threaded Permutation Multi-Threaded Permutation Single Threaded Combination Multi-Threaded Combination Primary Motivation My Github repository, Boost Concurrent Permutations and Combinations on CPU, has been up since January 2017. However, download is close to none while my older single threaded next_combination has plenty of downloads. So I figured it must be the code usage […]
-
Improved Next Combination with State
To speed up next_combination, we can store the state of generated combination so that it does not have to find which current combination elements correspond to the bigger collection. One way to do it is to store this state inside a class but this violates the design of STL algorithms. Another way to do it, […]
-
Making HTTP REST Request in C++
Introduction Today, I am going to show you on how to make HTTP request to a REST server using C++ Requests library by Huu Nguyen. Mr Nguyen is heavily influenced by Python Requests design philosoply when writing C++ Requests. Those who had used or familiar with Python Requests, should feel right at home with C++ […]
-
C++11: Compile-time Conditional Types
Introduction C++11 introduces std::conditional to give C++ developer the flexibility to choose a type based on the compile-time condition. If the boolean parameter of the std::conditional is true, then the delved type is class T or else it is class F. Below is an example on how to use std::conditional. Before to use std::conditional, we […]
-
Design Patterns in Modern C++ Book
Just as I was scouring Amazon for new C++ book. I came across this Design Patterns book with examples based on Modern C++ by Dmitri Nesteruk. A quick look at content table uncovers the null object pattern, curiously recurring template pattern and SOLID design principles in addition to the classic design patterns in the GoF […]
-
Use STL copy, Not memcpy to Copy Array
Many C++ developers like to use memcpy() to copy POD arrays to extract the maximum performance during the copy. See the POD structure below. What if a new unsuspecting developer adds a string member and is not aware that the code uses memcpy() to do copying? memcpy() only makes shallow copies. The code no longer […]