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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
_SIGN_TABLE = ('-', '')
christophercrouzet / main.c
Created Nov 16, 2019
Designated Initializer Macro for C99 and C++
View main.c
#include <stdio.h>
/* -------------------------------------------------------------------------- */
#define EXPAND(x) x
#define CONCAT_(a, b) a##b
#define CONCAT(a, b) CONCAT_(a, b)
#define ARG( \
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 May 27, 2020
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 28, 2020
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>
You can’t perform that action at this time.