Skip to content

Instantly share code, notes, and snippets.

We couldn’t find that file to show.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int bit_for(char n) {
return 1 << (n - 'a');
}
int has_bit(int bits, char n) {
return (bits & bit_for(n));
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void main(void) {
int num_problems;
int problem;
char* welcome = "welcome to code jam";
unsigned int ret[strlen(welcome)];
const int wel_len = strlen(welcome);
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
enum dir {North, West, East, South, NONE};
unsigned int look_alt(int h, int w, int H, int W, enum dir dir, unsigned int *al
t_map) {
#define ALT(m,n) *(alt_map + (m) * W + (n))
if (dir == North) {
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
enum dir {North, West, East, South, NONE};
unsigned int look_alt(int h, int w, int H, int W, enum dir dir, unsigned int *alt_map) {
#define ALT(m,n) *(alt_map + (m) * W + (n))
if (dir == North) {
if (h == 0)
require 'rubygems'
require 'grit'
include Grit
repo = Repo.new(".")
def date(head)
head.commit.committed_date
end

function-data/relation mapper

スキーマ

table mail {
    id int primary key,
    from_addr varchar[50],
    date datetime,
    mailbox varchar[50]

}

@pirapira
pirapira / Alg.v
Created May 4, 2011 13:54
Category of T-algebra in ConCaT
Require Import ConCaT.CATEGORY_THEORY.FUNCTOR.Functor.
Section alg_def.
Variables (A : Category) (T : Functor A A).
Structure Alg_ob : Type := {Ob_alg_ob : A; Mor_alg_ob : T Ob_alg_ob --> Ob_alg_ob}.
Section alg_arrow_def.
@pirapira
pirapira / gist:1045282
Created June 24, 2011 17:47
find the owner
Parameter person thing : Set.
Parameter own: person -> thing -> Prop.
Parameter capitalist: forall (x: thing), exists p:person, own p x.
Parameter bottle: thing.
Definition owner: person.
Admitted.
@pirapira
pirapira / gist:1045359
Created June 24, 2011 18:23
found the owner
Parameter person :Set.
Parameter thing: Set.
Parameter bottle: thing.
Parameter own: person -> thing -> Prop.
Parameter capitalist: forall (x: thing), { p:person & own p x }.
Definition owner: person.
generalize (capitalist bottle).
intros.