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
plotSpectrum1 lattice n m = toFile def file $ do | |
layout_title .= "Spectrum of '" ++ name ++ "'" | |
layout_x_axis . laxis_title .= "momentum k (" ++ show m ++ " points)" | |
layout_y_axis . laxis_title .= "energy E" | |
setColors $ colorGradient blue (length rows) | |
forM_ rows $ \row -> plot (line "band" [row]) | |
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
------------------------------------------------------------ | |
/Users/apfelmus/.ihaskell/ipython/bin/pip run on Sun Jan 19 23:56:41 2014 | |
Obtaining ipython from git+https://github.com/ipython/ipython.git@9c922f54af799704f4000aeee94ec7c74cada194#egg=ipython-dev | |
Cloning https://github.com/ipython/ipython.git (to 9c922f54af799704f4000aeee94ec7c74cada194) to /Users/apfelmus/.ihaskell/ipython/src/ipython | |
Found command 'git' at '/opt/local/bin/git' | |
Running command /opt/local/bin/git clone -q https://github.com/ipython/ipython.git /Users/apfelmus/.ihaskell/ipython/src/ipython | |
Running command /opt/local/bin/git submodule update --init --recursive -q | |
Running command /opt/local/bin/git tag -l |
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 Rank2Types #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
import Data.Traversable (sequenceA) | |
import Reactive.Banana | |
import Reactive.Banana.Frameworks | |
newtype Wrapper = Wrapper (forall t. Moment t (Event t () -> Behavior t Integer)) | |
main :: IO () |
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 RecordWildCards #-} | |
import Data.Monoid | |
import Control.Monad | |
import qualified Graphics.UI.Threepenny as UI | |
import Graphics.UI.Threepenny | |
data Input = Input |
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
-- debug log for querying http://localhost:100000/video.mp4 with Chrome | |
Listening on http://0.0.0.0:10000/ | |
Can't open log file "log/access.log". | |
Exception: log/access.log: openFile: does not exist (No such file or directory) | |
Logging to stderr instead. **THIS IS BAD, YOU OUGHT TO FIX THIS** | |
Can't open log file "log/error.log". | |
Exception: log/error.log: openFile: does not exist (No such file or directory) |
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.Word | |
import qualified Data.ByteString as B | |
type ByteString = B.ByteString | |
data Tree = Leaf [Word8] | Branch Tree Tree deriving (Eq,Show) | |
parse :: ByteString -> Tree | |
parse xs = case view xs of | |
Cons 0 xs -> case view xs of | |
Cons length xs -> Leaf . B.unpack $ B.take (fromIntegral . toInteger $ length) xs |
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
/* Eval | |
Evaluate the given thunk t into head normal form. | |
If the "thunk" we get isn't actually a thunk, just return it. | |
*/ | |
function E(t) { | |
if(t instanceof Thunk) { | |
if(t.f) { | |
t.x = t.f(); | |
t.f = 0; | |
} |
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
peach:~ apfelmus$ haste-boot | |
Downloading base libs from ekblad.cc | |
Reading package info from stdin ... done. | |
Reading package info from stdin ... done. | |
Reading package info from stdin ... done. | |
Reading package info from stdin ... done. | |
Attempting to clone/update: git://github.com/valderman/fursuit.git | |
Cloning into fursuit... | |
remote: Counting objects: 134, done. | |
remote: Compressing objects: 100% (74/74), done. |
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
{------------------------------------------------------------------------------ | |
reactive-banana | |
Implementation of an "industry strength" game loop with fixed time step | |
and variable fps. | |
See also http://gafferongames.com/game-physics/fix-your-timestep/ | |
-------------------------------------------------------------------------------} | |
{-# LANGUAGE NoMonomorphismRestriction #-} | |
module Main 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
<html> | |
<head> | |
<title>Test</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" /></script> | |
<script type="text/javascript" charset="utf-8"> | |
// onLoad Handler | |
$(function () { | |
$('#form').submit( function() { | |
$.post('/submit', { x : $('#x').val() }, function (result) { | |
$('#x').val(result); |
NewerOlder