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
#!/usr/bin/env python | |
import sys | |
import math | |
import re | |
""" Find the index of the single difference between two strings """ | |
def find_char_difference(str1, str2) : | |
if len(str1) != len(str2) : | |
return None; |
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 <errno.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#ifndef ENOMEM | |
#define ENOMEM 12 | |
#endif |
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> | |
typedef struct ll { | |
int value; | |
struct ll *next; | |
} ll; | |
void print_list(ll *list_head) | |
{ |
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 <time.h> | |
/* TODO: resume.h */ | |
typedef struct { | |
char * company; | |
char * location; | |
char * title; |
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 Data.List (elemIndex) | |
import Data.Maybe (fromJust) | |
-- A pile of coins is just an Int describing how many coins are in the pile | |
type CoinPile = Int | |
-- A state in the coin game is just a number of piles | |
type CoinState = [CoinPile] | |
-- A player is either Me or You | |
data Player = Me | You deriving (Eq) |
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 <limits.h> | |
#include <stdio.h> | |
#define DEPTH (7) | |
long int max(long int a,long int b){return(a>b?a:b);} | |
long int min(long int a,long int b){return(a<b?a:b);} | |
short player(); | |
short ai(); |
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
class NCR { | |
// Take the factorial of an integer | |
public static int factorial(int num) | |
{ | |
int fact = 1; | |
for (int i = 1; i <= num; i++) | |
fact = fact*i; | |
return fact; | |
} |
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 | |
# subtree merge with branches | |
rm -rf commcare-hq core-hq | |
git clone git://github.com/dimagi/commcare-hq.git | |
git clone git://github.com/dimagi/core-hq.git | |
cd core-hq |
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
#!/usr/bin/env python | |
""" | |
Trigram tool that takes text input and creates a random output based | |
on the N-grams of the input. | |
""" | |
import argparse | |
from sys import stdin | |
from random import choice |
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
#!/usr/bin/env python3 | |
import glob | |
from PIL import Image | |
from random import shuffle | |
from sys import argv | |
# The maximum size an individual image can be | |
MAXSIZE = (640,480) |
OlderNewer