This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int (*fn[2])(int); | |
int fib(int n) { return (*fn[n < 2])(n); } | |
int fibSeed(int n) { return 1; } | |
int fibRecur(int n) { return fib(n - 1) + fib(n - 2); } | |
void fibInit(void) { | |
fn[0] = fibRecur; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
from functools import wraps | |
from flask import Flask, request, Response | |
app = Flask(__name__) | |
# Read in the private key and instantiate xiongxiong | |
with open('privateKeyFile') as keyFile: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var or = function(/* args */) { | |
if (arguments.length) { | |
var x = !!arguments[0], | |
xs = Array.prototype.slice.call(arguments, 1); | |
return x || or.apply(undefined, xs); | |
} else { | |
return false; | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generated by OpenSesame 2.9.6 (Hesitant Heisenberg) | |
# Tue Aug 04 21:11:15 2015 (nt) | |
# <http://www.cogsci.nl/opensesame> | |
set background "black" | |
set bidi "no" | |
set canvas_backend "legacy" | |
set compensation "0" | |
set coordinates "relative" | |
set description "Default description" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Output | |
TARGET = my_binary | |
# OS X default is a GCC frontend to LLVM | |
# Real GCC can be installed via, e.g., Homebrew | |
CC = gcc | |
LD = ld | |
# List of library dependencies | |
# pkg-config can be installed via, e.g., Homebrew |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <sys/types.h> | |
/** | |
@brief Human file size | |
@param size File size in bytes | |
@return Base 2 prefixed file size string | |
This isn't as complete as Gnulib's `human_readable`, but it does the | |
job without any allocation or messing around |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Change the group and group permissions for everything, recursively, in the cwd | |
find . | tee >(xargs chgrp -h NEW_GROUP) | xargs chmod -h g+rw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.stdio, std.random, core.time; | |
void main() { | |
int data[32768]; | |
foreach(ref x; data) | |
x = uniform(0, 256); | |
data.sort; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.stdio, core.time; | |
class msTimer { | |
TickDuration start; | |
this() { reset(); } | |
long split() { return (TickDuration.currSystemTick() - start).msecs(); } | |
void reset() { start = TickDuration.currSystemTick(); } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import random | |
class PrimeBuilder: | |
_p = set() | |
_maxChecked = 0 | |
def __init__(self, p = {2, 3, 5}): | |
self._p = p | |
self._maxChecked = max(p) |
OlderNewer