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 | |
MSGID=$(grep -i '^message-id' | head -n 1 | sed -e 's/Message-I[Dd]: /:/') | |
hsgtd add "$@" "$MSGID" |
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 DeriveDataTypeable #-} | |
data HillKey = HkId | |
| HkMainNameInfo | |
-- and many more | |
| HkLatitude | |
| HkLongitude | |
deriving (Data, Typeable) | |
showKey :: HillKey -> String |
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 | |
export http_proxy=proxy.brighton.ac.uk:80 | |
cd ${HOME}/darcs.net | |
echo ====================================================================== | |
echo building | |
echo ====================================================================== | |
cabal configure -ftest | |
cabal build | |
echo ====================================================================== | |
echo unit tests |
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 | |
FAST_MACHINE=stanley | |
env | grep SSH_AGENT_PID | |
SSH_AGENT_CHECK_STATUS=$? | |
if [ $SSH_AGENT_CHECK_STATUS -ne 0 ]; then | |
eval `ssh-agent` | |
ssh-add | |
fi |
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
Config { font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*" | |
, bgColor = "#777777" | |
, fgColor = "#ee9a00" | |
, position = Top | |
, commands = [ Run Date "%a %_d %b %Y %H:%M" "date" 600 | |
, Run Com "/home/me/opt/bin/count-gtd" ["ACTION"," "] "gtd-action" 600 | |
, Run Com "/home/me/opt/bin/count-gtd" ["WAITING"," "] "gtd-waiting" 600 | |
, Run StdinReader | |
] | |
, sepChar = "%" |
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 Control.Monad.Writer | |
import Control.Monad.Maybe | |
type FooM a = MaybeT (Writer [String]) a | |
test = | |
do print (runIt warningFail) -- I want [ 'failure' ] | |
print (runIt warningSuccess) -- I want [ 'success' ] | |
print (runIt (warningFail >> warningSuccess)) -- I want [ 'failure' ] | |
print (runIt (warningSuccess >> warningFail)) -- I want [ 'success', 'failure' ] | |
where |
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
Index: src/uimacnew/ReconItem.m | |
=================================================================== | |
--- src/uimacnew/ReconItem.m (revision 390) | |
+++ src/uimacnew/ReconItem.m (working copy) | |
@@ -824,8 +824,7 @@ | |
{ | |
if (!_parentImages) { | |
_parentImages = [[NSMutableDictionary alloc] init]; | |
- _veryLightGreyColor = [[NSColor colorWithCalibratedRed:0.9 green:0.9 blue:0.9 alpha:1.0] retain]; | |
- // [NSColor lightGrayColor] |
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
./heapgraph < example | dot -T pdf -o example.pdf |
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
-- Rabhi and Lapalme, Algorithms: A Functional Programming Approach, pg 80 | |
data BinTree a = Empty | NodeBT a (BinTree a) (BinTree a) deriving Show | |
ex = NodeBT 42 (NodeBT 4 Empty Empty) (NodeBT 2 Empty Empty) | |
comp'' x Empty = (Empty, 0) | |
comp'' x (NodeBT v lf rt) = ( NodeBT (fromIntegral v / fromIntegral x) p1 p2 | |
, v + s1 + s2 ) | |
where |
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 FlexibleInstances #-} | |
module NLTG.NormaliseScores where | |
import System.Random | |
import Test.QuickCheck | |
-- | Given a lower and upper bound and a set of scores | |
-- Stretch the scores so that at least one of the bounds is reached | |
-- @normalise (-10,10) [-3,5,4] == [-6,10,8]@ | |
normalise :: (Ord a, Fractional a) => (a,a) -> [a] -> [a] |
OlderNewer