This file contains hidden or 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
scoreFromLine = fromJust . readDouble . (!! 3) . L.split (c2w '#') |
This file contains hidden or 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
;; Three handy settings for the Python mode: | |
;; | |
;; - Set indentation to two spaces. | |
;; - Interpret as Python 3 code. | |
;; - Autoindent when pressing return. | |
;; | |
(add-hook 'python-mode-hook | |
(lambda () | |
(setq python-indent 2 | |
python-default-version 3) |
This file contains hidden or 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
tzFold :: (a -> TreePos Full b -> a) -> a -> TreePos Full b -> a | |
tzFold f acc t = | |
foldSiblings $ foldChildren $ f acc t | |
where | |
foldChildren acc' = | |
case firstChild t of | |
Just c -> tzFold f acc' c | |
Nothing -> acc' | |
foldSiblings acc' = | |
case next t of |
This file contains hidden or 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 Data.Char (isNumber, isUpper) | |
import Data.List (genericLength, genericTake) | |
import Text.Printf (printf) | |
data FeatureValue = | |
FeatureValue { | |
feature :: String, | |
value :: Double | |
} deriving (Show) |
This file contains hidden or 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
prefix :: Integer -> String -> [FeatureValue] | |
prefix n = | |
map (flip FeatureValue 1 . printf "prefix(%s)") . prefixes n | |
suffix :: Integer -> String -> [FeatureValue] | |
suffix n = | |
map (flip FeatureValue 1 . printf "suffix(%s)") . prefixes n . reverse | |
prefixes :: Integer -> String -> [String] | |
prefixes n word = do |
This file contains hidden or 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
capitalization :: String -> [FeatureValue] | |
capitalization (x:_) | |
| isUpper x = [FeatureValue "capitalized" 1] | |
| otherwise = [FeatureValue "capitalized" 0] |
This file contains hidden or 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
feature :: [String -> [FeatureValue]] -> [FeatureValue] | |
features templates word = do | |
template <- templates | |
feature <- template word | |
return feature |
This file contains hidden or 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
nCapitals :: String -> [FeatureValue] | |
nCapitals = | |
return . FeatureValue "capitals" . genericLength . filter isUpper | |
nNumbers :: String -> [FeatureValue] | |
nNumbers = | |
return . FeatureValue "numbers" . genericLength . filter isNumber |
This file contains hidden or 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.Trans.Class (lift) | |
import Data.Enumerator (Enumeratee, Step(..), Stream(..), runIteratee) | |
import qualified Data.Enumerator.List as EL | |
intersperse :: (Monad m) => a -> Enumeratee a a m b | |
intersperse v = first | |
where | |
first (Continue k) = do | |
h <- EL.head | |
case h of |
This file contains hidden or 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
--- dbxml-2.5.16/dbxml/configure.orig 2011-10-12 13:14:17.000000000 +0200 | |
+++ dbxml-2.5.16/dbxml/configure 2011-10-12 13:18:28.000000000 +0200 | |
@@ -2656,10 +2656,10 @@ | |
DB_UTIL_PATH="<replace_with:_path_to_db_build>/build_unix" | |
# Check for a DB install tree | |
-if test `ls "$with_berkeleydb"/lib/libdb-*.la 2>/dev/null | wc -l` -gt 0 ; then | |
+if test `ls "$with_berkeleydb"/lib/libdb-5.3*.a 2>/dev/null | wc -l` -gt 0 ; then | |
{ echo "$as_me:$LINENO: checking for Berkeley DB version from install tree" >&5 | |
echo $ECHO_N "checking for Berkeley DB version from install tree... $ECHO_C" >&6; } |
OlderNewer