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 main (void) { | |
char str[] = "password"; | |
int i = 0; | |
/* for pointer arithmetic */ | |
char *ptr = str; | |
while (*ptr && (*ptr += (i++))) | |
ptr++; | |
printf("%s\n", str); |
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 main (void) { | |
char str[] = "password"; | |
int i = 0; | |
/* for pointer arithmetic */ | |
char *ptr = str; | |
while (*ptr && (*ptr += (i++))) | |
ptr++; | |
printf("%s\n", str); |
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
module Chain where | |
infixl 2 .> | |
infixr 1 .>> | |
{-| Chain operator. | |
Chain functions in a do-like (monadic bind)-like style. | |
`f .> g` will return a function that will apply f, then apply g. | |
It can be alternatively be defined as: `f .> g = g . f` which is just | |
`flip (.)`. |
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
module Queue where | |
data Queue a = Queue [a] [a] | |
deriving (Show, Eq) | |
emptyQueue :: Queue a | |
emptyQueue = Queue [] [] | |
push :: a -> Queue a -> Queue a | |
push x (Queue d e) = Queue d (x:e) |
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
{-# LANGUAGE DeriveFunctor #-} | |
{-# LANGUAGE TypeOperators #-} | |
module ADTAlgebra where | |
type Algebra f a = f a -> a | |
type Coalgebra f a = a -> f a | |
type Bialgebra f a = (Algebra f a, Coalgebra f a) |
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 -xe | |
SYSTEM=$(uname) | |
case $SYSTEM in | |
Darwin) | |
export PUBLIC=/data/Home/Dropbox/ghc | |
;; | |
Linux) | |
export PUBLIC=/srv/dropbox/ghc | |
;; |
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
Show hidden characters
{ | |
"add_to_PATH": | |
[ | |
"/usr/local/bin/", | |
"~/.cabal/bin" | |
], | |
"auto_build_mode": "normal", | |
"enable_auto_build": false, | |
"enable_auto_lint": true, | |
"enable_ghc_mod": true, |
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
# Worm Scraper by Arc | |
# Use pandoc to convert into something nicer. | |
import re | |
from bs4 import BeautifulSoup | |
from urllib2 import urlopen | |
url = "http://parahumans.wordpress.com/category/stories-arcs-1-10/arc-1-gestation/1-01/" |
OlderNewer