Skip to content

Instantly share code, notes, and snippets.

View allenh1's full-sized avatar

Hunter L. Allen allenh1

  • Apex.AI
  • Media, PA
View GitHub Profile
@allenh1
allenh1 / .emacs
Last active February 4, 2019 00:03
;;; Package --- emacs setup
;;
;;; Commentary:
;; not much goin on here, I think.
;;
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
;;; Code:
@allenh1
allenh1 / gazebo-9.4.1-ogre-1-10-support.patch
Created December 12, 2018 15:50
Adds support for Gazebo 9.4.1 with Ogre >= 1.10
From 41c9d23389d5a6bc8ef51b2f2f44ff78f34df80f Mon Sep 17 00:00:00 2001
From: "Hunter L. Allen" <hallen@kns.com>
Date: Tue, 11 Dec 2018 19:02:12 -0500
Subject: [PATCH 5/5] Add OGRE >= 1.10 support for Ogre::SharedPtr (which is
now just a std::shared_ptr)
---
gazebo/gui/model/EditorMaterialSwitcher.cc | 18 +++++--
gazebo/rendering/Camera.cc | 16 ++++++
gazebo/rendering/DepthCamera.cc | 22 ++++++++-
@allenh1
allenh1 / deboostify_boost_bind_function.sh
Last active November 7, 2018 16:07
deboostify_bind_function.sh
#!/bin/bash
file_list=$(find src -name \*.h -print -o -name \*.cpp -print -o -name \*.inl -print)
((len=0))
for i in ${file_list}; do
((len=$len + 1))
done
echo "boost::bind -> std::bind..."
@allenh1
allenh1 / deboostify_tuples.sh
Last active October 16, 2018 18:51
Remove boost::tuple
#!/bin/bash
file_list=$(find src -name \*.h -print -o -name \*.cpp -print)
echo "boost::tuple -> std::tuple..."
for i in ${file_list}; do
sed -b -i -E -r -e 's/boost\/tuple\/tuple.hpp/tuple/g' $i
sed -b -i -E -r -e '/boost\/tuple\/tuple_comparison.hpp/d' $i
sed -b -i -E -r -e 's/boost::tuple/std::tuple/g' $i
@allenh1
allenh1 / mini_dump_example.cpp
Created August 8, 2018 17:58
An example of how to create a Mini Dump on Windows
#include <functional>
#include <iostream>
#include <windows.h>
#include <dbghelp.h>
template<typename Callback>
struct ScopeExit
{
explicit ScopeExit(Callback p_func)
@allenh1
allenh1 / fix_line_endings.cpp
Last active August 21, 2018 15:43
Fix line endings for C++ files
// Copyright 2018 Hunter L. Allen
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@allenh1
allenh1 / check_installed.r
Created May 15, 2018 22:07
How to check if something is installed in R
check.installed <- function(pkgname) {
is.element(pkgname, installed.packages()[ , 1])
}
## Verify that mosaic is installed!
if (!check.installed("mosaic")) {
install.packages("mosaic");
}
library(mosaic)
@allenh1
allenh1 / regen-log.txt
Created April 19, 2018 03:45
regenerate package w/superflore
$ superflore-gen-ebuilds --only ar_track_alvar --ros-distro indigo
>>>> Working in temporary directory /tmp/tmpyvm_71hi
>>>> Creating new branch gentoo-bot-GFYYqGgSCZ...
>>>>
>>>> Regenerating package 'ar_track_alvar'...
>>>> Successfully generated installer for package 'ar_track_alvar'.
>>>> Pulling docker image 'allenh1/ros_gentoo_base:latest'...
>>>> Running docker image...
>>>> Generating manifests...
>>>> Working in temporary directory /tmp/tmplupkjf2k
@allenh1
allenh1 / rivz_stack_smashing
Created February 28, 2018 03:16
Detected Stack Smashing in RViz
$ valgrind ./rviz
==7156== Memcheck, a memory error detector
==7156== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==7156== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==7156== Command: ./rviz
==7156==
[ INFO] [1519787717.744579925]: rviz version 1.12.15
[ INFO] [1519787717.758823504]: compiled against Qt version 5.9.4
[ INFO] [1519787717.760321540]: compiled against OGRE version 1.9.0 (Ghadamon)
==7156== Syscall param epoll_ctl(event) points to uninitialised byte(s)
$ python3 ./setup.py --command-packages=stdeb.command bdist_deb
running bdist_deb
running sdist_dsc
running egg_info
writing entry points to superflore.egg-info/entry_points.txt
writing top-level names to superflore.egg-info/top_level.txt
writing superflore.egg-info/PKG-INFO
writing requirements to superflore.egg-info/requires.txt
writing dependency_links to superflore.egg-info/dependency_links.txt
reading manifest file 'superflore.egg-info/SOURCES.txt'