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 TemplateHaskell, QuasiQuotes, EmptyDataDecls, TypeFamilies, FlexibleContexts, GADTs, OverloadedStrings #-} | |
module Entities where | |
import Database.Persist | |
import Database.Persist.TH | |
import Data.Text | |
share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persist| | |
Group | |
title Text |
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
aggregates <- function(formula, data=NULL, FUNS){ | |
if(class(FUNS)=="list"){ | |
f <- function(x) sapply(FUNS, function(fun) fun(x)) | |
}else{f <- FUNS} | |
temp <- aggregate(formula, data, f) | |
out <- data.frame(temp[,-ncol(temp)], temp[,ncol(temp)]) | |
colnames(out)[1] <- colnames(temp)[1] | |
return(out) | |
} |
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
module Ridders where | |
import qualified Data.Map as M | |
import Control.Monad.State | |
type R = Double | |
ridders :: R -> R -> R -> (R -> R) -> Maybe R | |
ridders ε a b fn = evalState (go a b) M.empty | |
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 OverloadedStrings #-} | |
import Control.Monad | |
import Control.Applicative | |
import Data.Binary | |
import qualified Data.Map as M | |
import Network.Socket hiding (recv) | |
import qualified Data.ByteString as B | |
import qualified Data.ByteString.Lazy as L | |
import Network.Socket.ByteString (recv, sendAll) |
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 DeriveGeneric, TypeSynonymInstances, FlexibleInstances, DeriveDataTypeable #-} | |
module TimeTracker where | |
import Control.Monad | |
import qualified Control.Exception as E | |
import Control.Concurrent | |
import Control.Concurrent.STM | |
import qualified Data.ByteString.Lazy as BL | |
import qualified Data.Map as M |
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 scala.collection.mutable.ListBuffer | |
import scala.io.Source | |
/** | |
* Created by portnov on 01.08.15. | |
*/ | |
object HelloWorld { | |
case class Word(wordIdx : Int, wordInt : List[Int]) |
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
module Chan2 where | |
import Control.Concurrent | |
type Chan2 rq rs = Chan (rq, MVar rs) | |
call :: Chan2 rq rs -> rq -> IO rs | |
call chan rq = do | |
mvar <- newEmptyMVar | |
writeChan chan (rq, mvar) |
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
FROM ubuntu:16.04 | |
MAINTAINER Ilya Portnov <[email protected]> | |
RUN apt-get update && \ | |
apt-get install -y sbcl build-essential \ | |
wget subversion autoconf libgmp-dev | |
RUN cd /usr/src/ && \ | |
wget http://prdownloads.sourceforge.net/sbcl/sbcl-1.3.6-source.tar.bz2?download && \ | |
tar xf sbcl-1.3.6-source.tar.bz2\?download && \ |
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
FROM ubuntu:16.04 | |
MAINTAINER Ilya Portnov <[email protected]> | |
#RUN DEBIAN_FRONTEND=noninteractive locale-gen en_US.UTF-8 && \ | |
# DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales | |
# Not essential, but wise to set the lang # Note: Users with other languages should set this in their derivative image | |
#ENV LANGUAGE en_US.UTF-8 | |
#ENV LANG en_US.UTF-8 | |
#ENV LC_ALL en_US.UTF-8 |
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
$ sudo apt-get install -y docker.io | |
$ docker build -t jupyter . | |
# drink a cup of tea, then eat lunch, then walk your dog, then... | |
$ docker run --name jupyter -d -p 8888:8888 -v ~/notebooks:/notebooks jupyter | |
$ x-www-browser http://localhost:8888 |
OlderNewer