Steps: Add root to queue If left child not null, add it to queue If…
CMake command
Set variable Basic usage of SET
1 2 |
SET(GCC_PATH /usr/bin/gcc) # SET variable "GCC_PATH" to "/usr/bin/gcc" |
To include existing variables in the SET…
Google C++ style guide
Filenames should be all lowercase with underscores (_) or dashes (-) hello_world.cc All types like classes,…
C++ 11
Auto type
1 2 3 4 5 6 7 |
// BEFORE for(vector<Person>::iterator it = personVec.begin(); it != personVec.end(); it++) {...} // IN C++ 11 for(auto it = personVec.begin(); it != personVec.end(); it++) {...} |
Auto type + Ranged-based for loop
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
// BEFORE int i = 0; for(vector<Person>::iterator it = personVec.begin(); it != personVec.end(); it++, i++){ personVec[i].printName(); } // IN C++ 11 *Work only for container with begin() and end() // Read only access for(auto person : personVec){ person.printName(); } // To write for(auto& person : personVec){ person.name = "Overwritten"; } |
Initializer list
1 2 3 4 5 6 7 |
// BEFORE personVec.push_back(person1); personVec.push_back(person2); personVec.push_back(person3); // IN C++ 11 personVec = { person1, person2, person3 } |
…
[Method]alloc_and_fill_notify_pkt
Depending on the ethertype, by using rte_pktmbuf_append, the following component will be packed into the…
Gatekeeper [Network setup]
DPDK(network setup) Add two virtual network interfaces in settings in Virtual Box
1 2 3 4 5 |
"Network > Adapter x" Attached to : Bridged Adapter "Advanced" Adapter Type : Intel PRO/1000 MT Server (82545EM) |
Check if…
Gatekeeper setup (DPDK)
Background The system has been built using these four Linux distributions.
1 2 3 4 |
Fedora 27 Kali Linux Arch Linux Kbuntu (KDE version of Ubuntu) |
Thank to…
Recover corrupted USB from format of other OS to windows
Call diskpart utility In Windows cmd.exe
1 |
diskpart |
To see the list of disk attached…
Bitwise operation
Initialize char with zeros
1 2 |
char testing = 0; // 0000 0000 (testing) |
Align bits from the right
1 2 3 |
testing |= 3 // 0000 0000 (before) // 0000 0011 (after) |
Shift bits to the…
fscanf problems with double
Trying to get input from the FILE* stream with image processing filter. Example One:…