This file contains hidden or 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
#pragma once | |
template <typename T> | |
class Vector | |
{ | |
public: | |
Vector(size_t order); // constructor for squared-matrix | |
Vector(const Vector& other); // copy constructor | |
~Vector(); //destructor |
This file contains hidden or 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
// implement std::vector | |
template <typename T> | |
class Vector | |
{ | |
public: | |
// to keep it simpler, iterators are just T* | |
typedef T* iterator; | |
typedef T* reverse_iterator; |
This file contains hidden or 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
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
#include <assert.h> | |
#include <benchmark/benchmark.h> | |
static std::vector<int> CreateShuffledVector(unsigned n) | |
{ | |
std::vector<int> vect(n); | |
for (unsigned i=0; i<n; i++) vect[i] = i; |
This file contains hidden or 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 FooA | |
{ | |
public: | |
FooA(){} | |
double calculateAnswer(double val) | |
{ | |
static double prev_val_ = 0; | |
if( val == 0.0 ) return 0.0; | |
This file contains hidden or 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
#include "ros/ros.h" | |
#include "sensor_msgs/JointState.h" | |
#include "topic_tools/shape_shifter.h" | |
#include "ros/message_traits.h" | |
#include <sstream> | |
template <typename T> | |
void SerializeToByteArray(const T& msg, std::vector<uint8_t>& destination_buffer) | |
{ | |
const uint32_t length = ros::serialization::serializationLength(msg); |
This file contains hidden or 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 ubuntu:xenial | |
ARG DEBIAN_FRONTEND=noninteractive | |
RUN apt-get update | |
RUN apt-get install -y --no-install-recommends software-properties-common locate | |
RUN add-apt-repository ppa:beineri/opt-qt58-xenial -y | |
RUN apt-get update | |
RUN apt-get dist-upgrade -y | |
RUN apt-get install -y --no-install-recommends build-essential git cmake gettext snapcraft wget apt-utils |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE QtCreatorCodeStyle> | |
<!-- Written by QtCreator 4.2.1, 2017-05-04T11:28:11. --> | |
<qtcreator> | |
<data> | |
<variable>CodeStyleData</variable> | |
<valuemap type="QVariantMap"> | |
<value type="bool" key="AlignAssignments">true</value> | |
<value type="bool" key="AutoSpacesForTabs">false</value> | |
<value type="bool" key="BindStarToIdentifier">false</value> |
This file contains hidden or 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
struct CameraInfo{ | |
// whatever | |
}; | |
CameraInfo camera_info[5]; | |
void callbackImplementation(CameraInfo& cam_info, const sensor_msgs::Image::ConstPtr& msg) | |
{ |
This file contains hidden or 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
--- | |
BasedOnStyle: Google | |
AccessModifierOffset: -2 | |
ConstructorInitializerIndentWidth: 4 | |
AlignEscapedNewlinesLeft: false | |
AlignTrailingComments: true | |
AllowAllParametersOfDeclarationOnNextLine: false | |
AllowShortIfStatementsOnASingleLine: false | |
AllowShortLoopsOnASingleLine: false | |
AllowShortFunctionsOnASingleLine: None |
This file contains hidden or 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 RW_SPINLOCK_H | |
#define RW_SPINLOCK_H | |
#include<atomic> | |
#include<cassert> | |
#define SPIN_LOCK_UNLOCK 0 | |
#define SPIN_LOCK_WRITE_LOCK -1 | |
using std::memory_order_relaxed; |