Skip to content

Instantly share code, notes, and snippets.

View sherm1's full-sized avatar

Michael Sherman sherm1

  • Toyota Research Institute
  • Palo Alto, California, USA
View GitHub Profile
@sherm1
sherm1 / sync-output.txt
Created August 29, 2018 01:04
Clion non-incremental sync on Sherm's puget
Syncing project: Full Sync (full)...
Updating VCS...
Running Bazel info...
Command: bazel info --tool_tag=ijwb:CLion --curses=no --color=yes --experimental_ui=no --progress_in_terminal_title=no --
Command: git diff --name-status --no-renames 9f8a3379c42e94890ce2cacda2e8d57c99aa5ca0
Computing VCS working set...
@sherm1
sherm1 / MBTree.h
Last active October 31, 2016 16:51
Prototype for multiple instantiations managed by a single system
#pragma once
#include <cmath>
#include <memory>
#include <utility>
#include <vector>
#include "System.h"
template <typename T> class MBTree;
@sherm1
sherm1 / nvi_and_multiple_inheritance.cc
Last active May 12, 2016 05:50
Multi-inheritance & NVI
// Demonstrates mild multiple inheritance and Non-Virtual Interface.
// The base classes cannot be pure interfaces; they have private data
// and code, but unambiguous semantics. The only slightly-odd behavior
// is that a static_cast of a derived class to one of the bases shifts
// its memory address (see below).
#include <iostream>
using std::cout; using std::endl;
// A base class.
class Continuous {
@sherm1
sherm1 / Study.h
Last active September 30, 2015 23:14
Non-virtual interface naming comparison
//==============================================================================
// STUDY
//==============================================================================
/** This is the abstract base class for all Simbody studies.
...
The %Study class has a public interface for users of Studies, and a pure virtual
protected interface for implementors of Studies. **/
class Study {
public:
/** Destructor is virtual to support derived class cleanup. **/
@sherm1
sherm1 / CMakeLists.txt
Last active August 29, 2015 14:05
Demonstration of ClonePtr in an std::map
# Generic CMakeLists.txt for making a Simbody-using executable.
# This shows how to use the provided SimbodyConfig.cmake to locate a Simbody
# installation on your machine so you can use it from your own code.
# You will most likely want to copy some of these lines into your own
# CMakeLists.txt rather than use this one verbatim.
cmake_minimum_required(VERSION 2.8)
project(cloneptr)
# List your source and header files here.
set(my_source_files cloneptr.cpp)