This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Singleton { | |
public: | |
static Singleton& Instance() { | |
static Singleton instance; | |
return instance; | |
} | |
private: | |
Singleton() = default; | |
~Singleton() = default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
avconv -i 2015Oct07_104821_spm.mp4 -i 2015Oct07_104821_vio.mp4 -filter_complex "[0:v:0]pad=iw*2:ih[bg]; [bg][1:v:0]overlay=w" output.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename T> | |
struct HasConstIterator { | |
private: | |
typedef char Yes; | |
typedef struct { | |
char array[2]; | |
} No; | |
template<typename C> static Yes Test(typename C::const_iterator*); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef MULTIAGENT_MAPPING_COMMON_THREADSAFE_QUEUE_H_ | |
#define MULTIAGENT_MAPPING_COMMON_THREADSAFE_QUEUE_H_ | |
#include <atomic> | |
#include <memory> | |
#include <pthread.h> | |
#include <queue> | |
#include <string> | |
#include <sys/time.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From Kenton Varda: http://stackoverflow.com/questions/2340730/are-there-c-equivalents-for-the-protocol-buffers-delimited-i-o-functions-in-ja | |
bool writeDelimitedTo( | |
const google::protobuf::MessageLite& message, | |
google::protobuf::io::ZeroCopyOutputStream* rawOutput) { | |
// We create a new coded stream for each message. Don't worry, this is fast. | |
google::protobuf::io::CodedOutputStream output(rawOutput); | |
// Write the size. | |
const int size = message.ByteSize(); | |
output.WriteVarint32(size); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
view_controller_msgs::CameraPlacement camera_placement; | |
camera_placement.interpolation_mode = | |
view_controller_msgs::CameraPlacement::LINEAR; | |
camera_placement.target_frame = "map"; | |
ros::NodeHandle node_handle("~"); | |
ros::Publisher cp_publisher = | |
node_handle.advertise<view_controller_msgs::CameraPlacement>( | |
"/rviz/camera_placement", 10, true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class C { | |
public: | |
class Key { | |
friend std::shared_ptr<C> make_c(); | |
Key() {} | |
}; | |
C(const Key &); | |
//... | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Define source, target, maxdepth and cd to source | |
source="/tmp/source" | |
target="/tmp/target" | |
depth=1 | |
cd "${source}" | |
# Set the maximum number of concurrent rsync threads | |
maxthreads=30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /Users/slynen/Desktop/mex_C++_maci64.xml 2014-10-20 15:45:15.000000000 +0200 | |
+++ /Users/slynen/Desktop/mex_C++_maci64_patched.xml 2014-10-20 18:27:14.000000000 +0200 | |
@@ -1,7 +1,7 @@ | |
<?xml version="1.0" encoding="UTF-8" ?> | |
<config | |
- Name="Xcode Clang++" | |
- ShortName="Clang++" | |
+ Name="Clang-OMP" | |
+ ShortName="Clang-OMP" | |
Manufacturer="Apple" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stolen and altered from here: http://stackoverflow.com/questions/20321988/error-enabling-openmp-ld-library-not-found-for-lgomp-and-clang-errors/21789869#21789869 | |
INTEL_OPENMP_LATEST_BUILD_LINK=https://www.openmprtl.org/sites/default/files/libomp_20140926_oss.tgz | |
CLANG_INCLUDE=~/clang_omp/llvm/include | |
CLANG_BIN=~/clang_omp/llvm/build/Release/bin | |
CLANG_LIB=~/clang_omp/llvm/build/Release/lib | |
OPENMP_INCLUDE=~/clang_omp/libomp_oss/exports/common/include | |
OPENMP_LIB=~/clang_omp/libomp_oss/exports/mac_32e/lib.thin | |
cd ~/ |
NewerOlder