Skip to content

Instantly share code, notes, and snippets.

View kauppim's full-sized avatar

Mikael Kauppinen kauppim

  • Vantaa, Finland
View GitHub Profile
@kauppim
kauppim / csv_org.py
Created September 5, 2012 14:17
A small and ugly program for organizing collections of .csv data, for Python v. 2.6.x
import sys
import csv
if len(sys.argv) >= 4:
try:
file1 = open(sys.argv[1], "r")
keyw = sys.argv[2]
file2 = open(sys.argv[3], "w")
datat = csv.DictReader(file1)
@kauppim
kauppim / awesome-hash.c
Created May 16, 2012 08:04
Implemented awesome-hash without any advanced error handling.
#include <assert.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include "awesome-hash.h"
uint64_t hashGenerate(const char* input, size_t length) {
assert(input);
uint64_t FNV_Offset_Basis = 14695981039346656037;
@kauppim
kauppim / awesome-hash.h
Created May 16, 2012 07:38
Header file example for awesome-hash
#ifndef KAUPPIM_AWESOME-HASH_H
#define KAUPPIM_AWESOME-HASH_H
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
uint64_t hashGenerate(const char* input, size_t length);
#endif