Skip to content

Instantly share code, notes, and snippets.

View lilyball's full-sized avatar

Lily Ballard lilyball

View GitHub Profile
kevin@Erebor:~> sudo port install nethack
Password:
---> Fetching nethack
---> Attempting to fetch nethack-343-src.tgz from http://distfiles.macports.org/nethack
---> Verifying checksum(s) for nethack
---> Extracting nethack
---> Applying patches to nethack
---> Configuring nethack
---> Building nethack with target all
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_Users_kevin_Dev_macports_dports_games_nethack/work/nethack-3.4.3" && make all " returned error 2
This is a test
@lilyball
lilyball / sieve.ml
Created August 23, 2008 03:35
An implementation of the Sieve of Eratosthenes in OCaml
type primality = Prime | Composite | Unknown
type sieve = primality array
exception Out_of_bounds
let make n =
if n < 2 then invalid_arg "Sieve.make"
else
let sieve = Array.make n Unknown in
sieve.(0) <- Composite;
sieve.(1) <- Composite;
{-
http://projecteuler.net/index.php?section=problems&id=80
It is well known that if the square root of a natural number is
not an integer, then it is irrational. The decimal expansion of
such square roots is infinite without any repeating pattern at all.
The square root of two is 1.41421356237309504880..., and the digital
sum of the first one hundred decimal digits is 475.
Building target “Downloader” of project “Downloader” with configuration “Debug” — (8 errors)
cd "/Users/Sal/Desktop/iPhone Dev/Downloader"
setenv MACOSX_DEPLOYMENT_TARGET 10.5
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.0 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.sdk "-L/Users/Sal/Desktop/iPhone Dev/Downloader/build/Debug-iphonesimulator" "-F/Users/Sal/Desktop/iPhone Dev/Downloader/build/Debug-iphonesimulator" -filelist "/Users/Sal/Desktop/iPhone Dev/Downloader/build/Downloader.build/Debug-iphonesimulator/Downloader.build/Objects-normal/i386/Downloader.LinkFileList" -mmacosx-version-min=10.5 -framework Foundation -framework UIKit -framework CoreGraphics -o "/Users/Sal/Desktop/iPhone Dev/Downloader/build/Debug-iphonesimulator/Downloader.app/Downloader"
Undefined symbols:
"_crc3
@lilyball
lilyball / NSData_MD5.h
Created January 24, 2009 22:25
MD5 hash of NSData
#import <Foundation/Foundation.h>
@interface NSData (NSData_MD5)
- (NSString *)md5;
@end
module Main
where
import Data.List
import Text.Printf
import Control.Monad
import Control.Monad.MC
-- runGame returns True if Bob rolls a 6 on his second turn
-- Sue cannot roll a 6 or the premise of the problem is invalid.
import Text.Printf
import Control.Monad
import Control.Monad.MC
-- runGame returns True if Bob rolls a 6 on his second turn
-- Sue cannot roll a 6 or the premise of the problem is invalid.
-- Therefore don't even model her rolls.
runGame :: MC Bool
runGame = do
We couldn’t find that file to show.
@lilyball
lilyball / fnmatch.go
Created January 9, 2010 04:16
fnmatch implementation for Go
// Provide string-matching based on fnmatch.3
package fnmatch
// There are a few issues that I believe to be bugs, but this implementation is
// based as closely as possible on BSD fnmatch. These bugs are present in the
// source of BSD fnmatch, and so are replicated here. The issues are as follows:
//
// * FNM_PERIOD is no longer observed after the first * in a pattern
// This only applies to matches done with FNM_PATHNAME as well
// * FNM_PERIOD doesn't apply to ranges. According to the documentation,