Skip to content

Instantly share code, notes, and snippets.

View gicmo's full-sized avatar
💭
🧠

Christian Kellner gicmo

💭
🧠
View GitHub Profile
@gicmo
gicmo / countex.py
Created February 17, 2017 16:48
Count file extensions recursivly
#!/usr/bin/env python
# Do What the Fuck You Want to Public License
# for Olli with love, for his birthday
from __future__ import print_function
import argparse
import os
import os.path
import sys
// gcc -I/usr/include -lfprint -o ftest fptest.c
// before: dnf install libinput-devel
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <libfprint/fprint.h>
static struct fp_dev *active;
@gicmo
gicmo / nix-dataframe.cpp
Created November 26, 2016 20:02
NIX DataFrame Proof of Concept
//NIX DataFrame test
#include <nix.hpp>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include "backend/hdf5/h5x/H5DataType.hpp"
#include "backend/hdf5/h5x/H5Group.hpp"
#include "backend/hdf5/h5x/H5DataSet.hpp"
@gicmo
gicmo / jniUtil.cpp
Created February 26, 2016 23:52
javacpp generated code for nix-java's util
// Generated by JavaCPP version 1.1
#ifdef __APPLE__
#define _JAVASOFT_JNI_MD_H_
#define JNIEXPORT __attribute__((visibility("default")))
#define JNIIMPORT
#define JNICALL
#include "nix.hpp"
#include <chrono>
#include <thread>
#include <nix/base/Entity.hpp>
/*
struct cleaner {
cleaner(const std::vector<std::reference_wrapper<nix::base::ImplContainer<nix::base::IEntity>>> &x) : e(x){ };
@gicmo
gicmo / findboost.py
Last active August 26, 2016 19:36
Find boost python
#!/usr/bin/env python
# coding=utf-8
from __future__ import print_function
from __future__ import division
import os
import re
import sys
from collections import namedtuple
@gicmo
gicmo / parse_val.cc
Created September 13, 2015 21:38
POC to parse a value+uncertainty+unit string
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
namespace odml2 {
ssize_t u8_nbytes(uint8_t bytes) {
std::bitset<8> bs(bytes);
@gicmo
gicmo / u8to32.cc
Created April 14, 2015 14:51
poor man's utf8 → utf32
ssize_t u8_nbytes(uint8_t bytes) {
std::bitset<8> bs(bytes);
size_t i;
for (i = 0; i < bs.size(); i++) {
if (bs[7 - i] == 0) {
break;
}
}
@gicmo
gicmo / fitsine.py
Created March 31, 2015 17:47
Fit a sine using least squares
#!/usr/bin/env python
import numpy as np
import scipy.optimize as optimize
import matplotlib.pylab as plt
import csv
import argparse
def main():
parser = argparse.ArgumentParser(description='iris - sine fitter')
@gicmo
gicmo / CMakeLists.txt
Created March 31, 2015 07:32
CMake for Qt5 projects with qcustomplot skeleton
cmake_minimum_required(VERSION 2.8.11)
project(testproject)
message($ENV{QT5_DIR})
if($ENV{QT5_DIR})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "$ENV{QT5_DIR}/lib/cmake")
endif()
# Find includes in corresponding build directories