Skip to content

Instantly share code, notes, and snippets.

@ibtaylor
ibtaylor / # yaml-cpp - 2018-02-02_15-12-44.txt
Created February 2, 2018 20:13
yaml-cpp on macOS 10.12.6 - Homebrew build logs
Homebrew build logs for yaml-cpp on macOS 10.12.6
Build date: 2018-02-02 15:12:44
@ibtaylor
ibtaylor / BenchTimer.h
Last active February 27, 2017 20:48
crude sophus interpolation benchmark
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2008-2010 Gael Guennebaud <gael.guennebaud@inria.fr>
// Copyright (C) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
@ibtaylor
ibtaylor / c89p90p2001.h
Created April 7, 2012 04:29
silly header with comments documenting c89 P90 P2001 c standard types and functions for reference
#ifndef __C89P90P2001_H__
#define __C89P90P2001_H__
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TODO:
add C11 additions
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
@ibtaylor
ibtaylor / gist:2016514
Created March 11, 2012 13:50
ghc 7.4.1 in os x lion
#
# Warning, if you prepended macports paths to your PATH, you may have issues.
#
# which ar => /usr/bin/ar
# which gcc => /usr/bin/gcc
# which ld => /usr/bin/ld
#
# maybe others are important too..
#
@ibtaylor
ibtaylor / redirects_to.sh
Created August 28, 2011 02:49
recursively follow http redirects displaying each url
#!/bin/bash
[ $# != 1 ] && exit
url=$1
echo "$url"
curl -sLI "$url" | sed -n -e 's/^Location: //p' -e 's/\r//g'
@ibtaylor
ibtaylor / Huffman.hs
Created June 14, 2011 03:40
Simple Huffman Encode/Decode in Haskell
{-# LANGUAGE BangPatterns #-}
--module Data.Huffman where
module Main where
import Data.Char (intToDigit)
import Data.List (insertBy, foldl', sortBy)
import Data.Maybe (fromJust)
import Data.Ord (comparing)
import qualified Data.Binary.BitPut as P
import qualified Data.Binary.Strict.BitGet as G
ngrams :: Int -> Text -> [Text]
ngrams !n =
foldr f [] . T.tails
where
f e a
| len == n = gram : a
| otherwise = a
where
!len = T.length gram
!gram = T.take n e
@ibtaylor
ibtaylor / OpenalUtil
Created October 31, 2010 14:52
Some code I wrote to make playing with openal easier
module Sound.OpenAL.Util
( withDevice
, withDefaultDeviceAndContext
, createBuffer
, createBufferData
, createBufferFromData
, createBufferFromSample
, whileSourceIsPlaying
, sleep
, getSamplingRate
@ibtaylor
ibtaylor / E1.hs
Created October 20, 2010 14:28
project euler #1
{-# LANGUAGE BangPatterns, MagicHash #-}
module Main where
import Criterion.Main
import GHC.Base
import GHC.Prim
import Criterion.Config
import Criterion.Main
import Data.Monoid
import qualified Criterion.MultiMap as M
@ibtaylor
ibtaylor / E2.hs
Created October 20, 2010 02:01
project euler #2
{-# LANGUAGE BangPatterns #-}
{-
Each new term in the Fibonacci sequence is generated by adding the previous two
terms. By starting with 1 and 2, the first 10 terms will be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
Find the sum of all the even-valued terms in the sequence which do not exceed
four million.