Skip to content

Instantly share code, notes, and snippets.

View robosina's full-sized avatar
👋
Hi

Saeed Masoomi robosina

👋
Hi
View GitHub Profile
@moyang
moyang / VTable Notes on Multiple Inheritance in GCC C++ Compiler v4.0.1.md
Last active November 27, 2023 13:10
VTable Notes on Multiple Inheritance in GCC C++ Compiler v4.0.1

VTable Notes on Multiple Inheritance in GCC C++ Compiler v4.0.1

http://www.cse.wustl.edu/~mdeters/seminar/fall2005/mi.html#basics

The Basics: Single Inheritance

As we discussed in class, single inheritance leads to an object layoutwith base class data laid out before derived class data. So if classes A and B are defined as:

@lebedov
lebedov / cuda_cpp_class.cu
Created April 24, 2017 21:56
How to "wrap" a CUDA kernel with a C++ class.
// How to "wrap" a CUDA kernel with a C++ class; the kernel must be defined outside of
// the class and launched from within a class instance's method.
#include <iostream>
#include <cuda.h>
#include <cuda_runtime.h>
#define LEN 10
__global__ void kernel(int *a, int *b, unsigned int N);
@fm4dd
fm4dd / gcc compiler optimization for arm systems.md
Last active May 26, 2024 10:24
GCC compiler optimization for ARM-based systems

GCC compiler optimization for ARM-based systems

2017-03-03 fm4dd

The gcc compiler can optimize code by taking advantage of CPU specific features. Especially for ARM CPU's, this can have impact on application performance. ARM CPU's, even under the same architecture, could be implemented with different versions of floating point units (FPU). Utilizing full FPU potential improves performance of heavier operating systems such as full Linux distributions.

-mcpu, -march: Defining the CPU type and architecture

These flags can both be used to set the CPU type. Setting one or the other is sufficient.

@jiahaowu
jiahaowu / log-system.cpp
Created February 26, 2017 23:41
example of using boost log, which includes stdout, file output, log rotation, message format
#include <boost/log/core.hpp>
#include <boost/log/expressions.hpp>
#include <boost/log/sinks/text_file_backend.hpp>
#include <boost/log/sources/record_ostream.hpp>
#include <boost/log/sources/severity_logger.hpp>
#include <boost/log/trivial.hpp>
#include <boost/log/utility/setup/common_attributes.hpp>
#include <boost/log/utility/setup/console.hpp>
#include <boost/log/utility/setup/file.hpp>
@SteveRuben
SteveRuben / client.cpp
Created October 21, 2015 08:30
Multiple streaming in c++ using opencv; OpenCV video streaming over TCP/IP
/**
* OpenCV video streaming over TCP/IP
* Client: Receives video from server and display it
* by Steve Tuenkam
*/
#include "opencv2/opencv.hpp"
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>