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 Data.Array.Repa | |
data Complex a = Complex { re, im :: !a } | |
instance Num a => Num (Complex a) where | |
(Complex a b) + (Complex c d) = Complex (a + c) (b + d) | |
(Complex a b) - (Complex c d) = Complex (a - c) (b - d) | |
(Complex a b) * (Complex c d) = Complex (a*c - b*d) (a*d + b*c) | |
abs _ = undefined | |
signum _ = undefined |
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
#include <stdlib.h> | |
#include <math.h> | |
//#include <SDL/SDL.h> | |
#define WIDTH 640 | |
#define HEIGHT 420 | |
#define BLK_W WIDTH | |
#define BLK_H HEIGHT / 3 | |
struct l_node |
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
! Xft settings | |
Xft.dpi: 96 | |
! URxvt settings | |
URxvt*scrollBar: off | |
URxvt*foreground: #DDCCBB | |
URxvt*background: #101010 | |
URxvt*font: xft:terminus:size=12:antialias=true | |
URxvt.perl-ext-common: default,matcher | |
URxvt.urlLauncher: /usr/bin/firefox |
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 QuasiQuotes #-} | |
import Control.Monad | |
import Data.Array.Repa (Array, DIM2, All(..), Any(..), (:.)(..), U) | |
import qualified Data.Array.Repa as R | |
import Data.Array.Repa.Stencil | |
import Data.Array.Repa.Stencil.Dim2 | |
import Data.Monoid (Endo(..), mappend, mconcat) | |
import System.Random |
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
## KEYBINDS | |
set -g prefix C-a | |
unbind C-b | |
set -g status-keys vi | |
setw -g mode-keys vi | |
unbind l | |
unbind s | |
unbind w | |
unbind v |
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
// client conf | |
akka { | |
loglevel = "DEBUG" | |
actor { | |
provider = "akka.remote.RemoteActorRefProvider" | |
} | |
remote { | |
transport = "akka.remote.netty.NettyRemoteTransport" | |
log-sent-messages = on | |
log-received-messages = on |
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 #-} | |
{-# LANGUAGE OverlappingInstances #-} | |
import Control.Applicative | |
import Control.Concurrent | |
import Control.Concurrent.STM | |
import Data.Dynamic | |
import Data.Monoid | |
import Data.Word | |
import qualified Data.Foldable as F |
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 Arrows, GADTs #-} | |
data Par a b where | |
Pure :: (a -> b) -> Par a b | |
Seq :: Par a b -> Par b c -> Par a c | |
Par :: (a -> (a1, a2)) -> Par a1 b1 -> Par a2 b2 -> ((b1, b2) -> b) -> Par a b | |
instance Category Par where | |
id = Pure id |
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.Applicative | |
import Control.Monad | |
import Data.Monoid | |
data SignalT m a | |
= Skip (m (SignalT m a)) | |
| Emit a (m (SignalT m a)) | |
instance Monad m => Functor (SignalT m) where | |
fmap f = go |
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
int32_t JumpConsistentHash(uint64_t key, int32_t num_buckets) | |
{ | |
int64_t b = -1, j = 0; | |
while (j < num_buckets) { | |
b = j; | |
key = key * 2862933555777941757ULL + 1; | |
j = (b + 1) * (double(1LL << 31) / double((key >> 33) + 1); | |
} | |
return b; | |
} |
OlderNewer