View HHHT.m
hhhh_transition_matrix = [ | |
0.5 0.5 0.5 0.5 0 0; | |
0.5 0 0 0 0 0; | |
0 0.5 0 0 0 0; | |
0 0 0.5 0 0 0; | |
0 0 0 0.5 0 0; | |
0 0 0 0 1 1 | |
]; | |
hhht_transition_matrix = [ |
View decodeqr
#!/bin/bash | |
DECODEQR_TMPDIR=$(mktemp --tmpdir=$TMPDIR -d) | |
if [ $? -eq 0 -a ! -z "$DECODEQR_TMPDIR" ]; then | |
#mkfifo $DECODEQR_TMPDIR/tmp.png | |
gnome-screenshot -f $DECODEQR_TMPDIR/tmp.png | |
zbarimg --quiet $DECODEQR_TMPDIR/tmp.png | |
rm -rf $DECODEQR_TMPDIR | |
fi |
View ddclient.service
[Unit] | |
Description=ddclient service | |
After=network.target | |
[Service] | |
ExecStart=/usr/local/sbin/ddclient -file /etc/ddclient/ddclient.conf -daemon 300 -foreground -pid /dev/null | |
User=ddclient | |
Restart=always | |
RestartSec=300 |
View LogFollower.hs
{-# LANGUAGE ScopedTypeVariables #-} | |
module LogFollower where | |
import Control.Concurrent (threadDelay) | |
import Control.Exception | |
import Data.ByteString.Char8 as BS | |
import Data.ByteString.Lazy as BL | |
import Data.IORef | |
import Data.Function(fix) |
View Setup.hs
import Distribution.Simple | |
import Distribution.Simple.Setup | |
import Distribution.Simple.LocalBuildInfo | |
import Distribution.PackageDescription | |
import Distribution.Version | |
import Text.Groom | |
-- This checks the direct dependency of the bytestring package being | |
-- compiled against to set the bytestring_has_itoa_c and |
View pgtest.c
// This is a demonstration of binary input into postgres using libpq. It | |
// is based on postgresql-9.0.2/src/test/examples/testlibpq3.c | |
// | |
// Create a table appropriate to this test in a database as follows: | |
// | |
// CREATE TABLE test (name BYTEA); | |
// | |
// See also http://article.gmane.org/gmane.comp.lang.haskell.cafe/85116 | |