Step 0:
Get Homebrew installed on your mac if you don't already have it
Step 1:
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
--Proposed solutions to problems 87,88 and 89 of "99 Haskell Problems" | |
--Not optimal but they work | |
--If you know haskell and want to solve some problems there are some missing at: | |
--http://www.haskell.org/haskellwiki/99_questions/80_to_89 | |
import Data.List | |
type Node = Int | |
type Edge = (Node,Node) | |
type Graph = ([Node],[Edge]) |
* | |
!*.m | |
!Makefile |
# unregister broken GHC packages. Run this a few times to resolve dependency rot in installed packages. | |
# ghc-pkg-clean -f cabal/dev/packages*.conf also works. | |
function ghc-pkg-clean() { | |
for p in `ghc-pkg check $* 2>&1 | grep problems | awk '{print $6}' | sed -e 's/:$//'` | |
do | |
echo unregistering $p; ghc-pkg $* unregister $p | |
done | |
} | |
# remove all installed GHC/cabal packages, leaving ~/.cabal binaries and docs in place. |
#! /usr/bin/env python | |
import redis | |
import random | |
import pylibmc | |
import sys | |
r = redis.Redis(host = 'localhost', port = 6389) | |
mc = pylibmc.Client(['localhost:11222']) |
class Stripe.TokenRequest extends Backbone.Model | |
validate: (attrs)-> | |
error = | |
if !attrs.name | |
attribute: "name" | |
message: "Please enter your name" | |
else if !attrs.email | |
attribute: "email" | |
message: "Invalid email" | |
else if !Stripe.validateCardNumber(attrs.number) |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.
file = [header CRLF] record (CRLF record)* [CRLF] | |
header = name (COMMA name)* | |
record = field (COMMA field)* | |
name = field | |
field = (escaped | non-escaped) | |
escaped = DQUOTE (TEXTDATA | COMMA | CR | LF | 2DQUOTE)* DQUOTE | |
2DQUOTE = DQUOTE DQUOTE | |
non-escaped = TEXTDATA* | |
COMMA = '\u002C' | |
CR = '\u000D' |
{-# LANGUAGE LambdaCase #-} | |
import Control.Applicative | |
import Control.Monad.State | |
import System.Random | |
data Tree a = Empty | Bin a (Tree a) (Tree a) | |
deriving Show | |
-- O(n) |