Skip to content

Instantly share code, notes, and snippets.

marchelbling / primitives_indices
Last active August 29, 2015 14:04
osg gdb scripts
View primitives_indices
set $id=0
set $numVertices = geom.getVertexArray()->getNumElements()
while $id < geom.getNumPrimitiveSets()
set $primitive = geom.getPrimitiveSet($id)
set $primitive_size = $primitive->getNumIndices()
printf "processing primitive n.%d (mode: %d, type: %d, size: %d)", $id, $primitive->getMode(), $primitive->getType(), $primitive_size
set $ii = 0
while $ii < $primitive_size
if $primitive->index($ii) >= $numVertices
printf "primitive %d has wrong index (%d >= %d) at index %d", $id, $primitive->index($ii), $numVertices, $ii
marchelbling / panda.rb
Last active August 29, 2015 14:10 — forked from bsag/panda.rb
View panda.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'commander/import'
program :version, '0.1'
program :description, 'Converts markdown documents into a variety of default formats using Pandoc'
CMD = "pandoc"
BIB = "$HOME/Dropbox/Documents/bibtex/all-refs.bib"
marchelbling /
Last active August 29, 2015 14:16
CS essentials

Data structures





marchelbling /
Created March 12, 2015 06:50
Introduction to Named Pipes


A very useful Linux feature is named pipes which enable different processes to communicate.

Introduction to named pipes

One of the fundamental features that makes Linux and other Unices useful is the “pipe”. Pipes allow separate processes to communicate without having been designed explicitly to work together. This allows tools quite narrow in their function to be combined in complex ways.

A simple example of using a pipe is the command:

marchelbling /
Created June 9, 2015 05:44
Docker jumpstart


Docker is a tool for packaging and shipping apps. Based on the idea of a shipping container, it provides a standardized way for developers or system administrators to create lightweight images, or collections of images, for each element of an application, and then easily and quickly deploy the image. Since the image is standardized, it can be uniformly deployed on development or production, leading to a much simpler workflow, faster development time for the dev team, and lower management overhead for the ops team.

First, a quick overview of a few things Docker is:

  • An open source tool that places a layer on top of Linux containers (cgroups and namespaces) to make it simple to package and ship complex apps
  • A tool for creating a layered filesystem; each layer is versioned and can be shared across running instances, making for much more lightweight deployments
  • A company behind the project, as well as a site called the "Docker Hub" for sharing containers
marchelbling /
Created August 7, 2015 04:03
Siggraph 2015
marchelbling / constness.cpp
Created August 17, 2012 10:57
Dummy code to check that a const object attributes are const
View constness.cpp
#include <iostream>
class A
A (int a = 0) : m_a (a)
{ }
~A ()
marchelbling / stringcompress.cpp
Created August 17, 2012 11:31
simple string compressor
View stringcompress.cpp
// compress("AABBBCCCCCAADDDD") == "2A3B5C2A4D"
// compress("PPPQRRRSTTQQS") == "3PQ3RS2T2QS"
// compress("uvw") == "uvw"
void _format(std::ostringstream& out, size_t counter, char current)
marchelbling / objectcoercion.cpp
Created August 17, 2012 11:34
Object coercion flow in C++
View objectcoercion.cpp
#include <iostream>
class B;
class A
A ()
{ std::cout << "A::A ()" << std::endl; }