Skip to content

Instantly share code, notes, and snippets.

View mpatraw's full-sized avatar

Michael Patraw mpatraw

View GitHub Profile
@mpatraw
mpatraw / Linnorm.java
Last active May 16, 2018 21:03 — forked from tommyettinger/Linnorm.java
Linnorm benchmarks
public final class Linnorm {
private static long state = 0L;
private static long random()
{
long z = (state = state * 0x41C64E6DL + 1L);
z = (z ^ z >>> 28) * 0xAEF17502108EF2D9L;
return z ^ z >>> 30;
}
public static void main(String[] args) {
long out = 0L;
@mpatraw
mpatraw / .git-commit-template.txt
Created March 11, 2016 04:34 — forked from adeekshith/.git-commit-template.txt
A Git commit template to make it easy to enforce a good and uniform commit message style across teams.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@mpatraw
mpatraw / main.c
Last active August 29, 2015 14:11
Daily Programmer #193 Easy
#include <ctype.h>
#include <stdio.h>
#include <string.h>
static struct {
const char *acronym;
const char *expansion;
} pairs[] = {
{"lol", "laugh out loud"},
@mpatraw
mpatraw / main.c
Last active August 29, 2015 14:10
Daily Programmer #191 Intermediate
#include <assert.h>
#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define N 10
@mpatraw
mpatraw / main.c
Last active August 29, 2015 14:10
Daily Programmer #191 Easy
#include <assert.h>
#include <ctype.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* Longest word to ever appear in literature: Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphioparaomelitokatakechymenokichlepikossyphophattoperisteralektryonoptekephalliokigklopeleiolagoiosiraiobaphetraganopterygon */
#define WSIZE 172
@mpatraw
mpatraw / main.f
Last active August 29, 2015 14:10
Daily Programmer #190 Hard
include mini-oof.fs
: 2fdup ( f1 f2 -- f1 f2 f1 f2 ) fover fover ;
: -frot ( f1 f2 f3 -- f3 f1 f2 ) frot frot ;
: 2f/ ( f1 f2 f3 f4 -- f1/f3 f2/f4 )
frot fswap f/ -frot f/ fswap ;
object class
method init
method conjugate
@mpatraw
mpatraw / p2p.c
Created October 22, 2014 18:10
Simple P2P example using ENet.
/*
* p2p.c
*/
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <enet/enet.h>