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
function(diff_lists) | |
set(multiValueArgs LIST_A LIST_B) | |
cmake_parse_arguments(DIFF "" "" "${multiValueArgs}" ${ARGN} ) | |
list(SORT DIFF_LIST_A) | |
list(SORT DIFF_LIST_B) | |
set(LIST_A_TXT "${CMAKE_CURRENT_SOURCE_DIR}/list_a.txt") | |
file(WRITE "${LIST_A_TXT}" "") | |
foreach(name ${DIFF_LIST_A}) | |
file(APPEND "${LIST_A_TXT}" "${name}\n") |
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
## Diffs two files. Aborts if the diff fails | |
function(diff_files file_a file_b) | |
execute_process(COMMAND diff ${file_a} ${file_b} | |
RESULT_VARIABLE DIFF_RESULT) | |
if (DIFF_RESULT) | |
execute_process(COMMAND meld "${file_a}" "${file_b}") | |
message(FATAL_ERROR "Diffing failed: ${file_a} ${file_b}") | |
else() | |
message("Successful diff: ${file_a} ${file_b}") |
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
// add this to the script editor in google sheets | |
// this hook is called when a table (cell) is edited | |
function onEdit(e) { | |
// get the sheet that is worked on | |
var s = SpreadsheetApp.getActiveSheet(); | |
// cell that is edited | |
var r = s.getActiveCell(); | |
// uncomment for some messages for debugging | |
//Browser.msgBox(e.range.getColumn()); | |
//Browser.msgBox(s.getName()); |
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 | |
source /ros_entrypoint.sh | |
ip=$(hostname -I) | |
export ROS_IP=$ip | |
export ROS_MASTER_URI=http://172.17.0.2:11311 | |
echo $ROS_IP | |
echo $ROS_MASTER_URI | |
bash |
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 | |
# If scan-build (clang static analyzer) can't analyze the code properly | |
# setting the analyzer implizitely can help | |
analyzerPath=$(realpath "$(dirname $(which clang))/../libexec") | |
cmake -G Ninja \ | |
-DCMAKE_CXX_COMPILER="$analyzerPath/c++-analyzer" \ | |
-DCMAKE_C_COMPILER="$analyzerPath/ccc-analyzer" \ |
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
# put this file in the top source dir (CMAKE_SOURCE_DIR) | |
# see: https://cmake.org/cmake/help/latest/module/CMakeGraphVizOptions.html | |
set(GRAPHVIZ_EXTERNAL_LIBS FALSE) | |
# only dependencies between libraries | |
set(GRAPHVIZ_EXECUTABLES FALSE) |
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
#!/usr/bin/env python | |
import sys | |
filename = sys.argv[1] | |
f = open(filename, 'r') | |
data = f.read() |
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
# Example for a include-what-you-use mapping | |
[ | |
{ include: ["<bits/std_function.h>", private, "<functional>", public ] }, | |
{ include: ["<bits/shared_ptr.h>", private, "<memory>", public] }, | |
{ include: ["<boost/asio/ip/impl/address.ipp>", private, "<boost/asio/ip/address.hpp>", public] }, | |
{ include: ["<ext/alloc_traits.h>", private, "<type_traits>", public] }, | |
{ include: ["<bits/exception.h>", private, "<exception>", public ] }, | |
{ include: ["<boost/asio/detail/impl/reactive_socket_service_base.ipp>", private, "<boost/asio/socket_base.hpp>", public] }, | |
# Use regex with '@' at the beginning | |
{ include: ["@<boost/signals2/detail/.*>", private, "<boost/signals2.hpp>", public] }, |
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
clear | |
graphics_toolkit('qt') | |
# 2D Graph | |
x = [-10:0.1:10]; | |
y = 50*sin(x).+x.^2+x; | |
figure(1) | |
plot(x,y, "linewidth", 2) | |
grid |
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
#include <stdio.h> | |
/* Multidimensional arrays are stored with the last index as least significant, | |
i.e. changing fastest. | |
from: http://www.agner.org/optimize/calling_conventions.pdf */ | |
#define x_dim 5 | |
#define y_dim 3 | |
int array[x_dim][y_dim]= {{1, 2, 3}, | |
{4, 5, 6}, |