Skip to content

Instantly share code, notes, and snippets.

Christopher Crouzet christophercrouzet

Block or report user

Report or block christophercrouzet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
christophercrouzet / countargs.h
Created Sep 14, 2019
Counting Variadic Macro Arguments in C99 and C++
View countargs.h
Credits: Jens Gustedt
#include <stdio.h>
#define EXPAND(x) x
#define CONCAT_(a, b) a##b
christophercrouzet /
Created Dec 24, 2016
Quick and dirty prototype of a naive animation bake implementation for Autodesk Maya.
#!/usr/bin/env mayapy
import itertools
import math
import random
import timeit
from maya import cmds, OpenMaya, OpenMayaAnim
christophercrouzet /
Last active Oct 1, 2017
Failed attempt at the exercise level 3.1 “Find the Access Codes“ from Google's Foobar challenge.
#!/usr/bin/env python2.7
"""Find the Access Codes
In order to destroy Commander Lambda's LAMBCHOP doomsday device, you'll need
access to it. But the only door leading to the LAMBCHOP chamber is secured with
a unique lock system whose number of passcodes changes daily. Commander Lambda
gets a report every day that includes the locks' access codes, but only she
knows how to figure out which of several lists contains the access codes. You
need to find a way to determine which list contains the access codes once
christophercrouzet /
Last active Jan 18, 2017
Quick and dirty Maya skin load/save
# Relies on
import collections
import json
from maya import OpenMaya, OpenMayaAnim, cmds
import banana.maya
christophercrouzet /
Created Aug 24, 2016
Python's asynchronous queues vs synchronous pipes.
#!/usr/bin/env python3
import logging
import multiprocessing
_LOGGER = multiprocessing.log_to_stderr()
christophercrouzet / incrementindices.h
Created Apr 26, 2015
Compile-time multidimensional indices incrementer
View incrementindices.h
#include <cstddef>
#include <type_traits>
#include <m3ta/at>
#include <m3ta/concatenate>
#include <m3ta/integersequence>
#include <m3ta/popback>
christophercrouzet / strides.h
Last active Aug 29, 2015
Compute the strides of a n-dimensional array either at compile or run time.
View strides.h
#ifndef STRIDES_H
#define STRIDES_H
#include <cstddef>
#include <m3ta/concatenateintegersequences>
#include <m3ta/integersequence>
#include <m3ta/reverseintegersequence>
christophercrouzet / multidimensionalarray.h
Last active Nov 30, 2018
Nested initializer lists for multidimensional arrays in C++11.
View multidimensionalarray.h
#include <array>
#include <cstddef>
#include <type_traits>
#include <m3ta/nestedinitializerlists>
#include <m3ta/pass>
christophercrouzet / gist:b3e4567c4fd3a9fe9b8c
Last active Aug 29, 2015
Check if a function that can be called with a specific set of arguments exists.
View gist:b3e4567c4fd3a9fe9b8c
#include <iomanip>
#include <iostream>
#include <string>
#include <type_traits>
#include <utility>
template<typename T>
struct Functions;
christophercrouzet / distance.h
Last active Aug 29, 2015
Compute the distance in ulps between floating-point numbers in C++11.
View distance.h
#ifndef DISTANCE_H
#define DISTANCE_H
#include <algorithm>
#include <cassert>
#include <cmath>
#include <limits>
#include "floatingpointtraits.h"
You can’t perform that action at this time.