Skip to content

Instantly share code, notes, and snippets.

View lambdaofgod's full-sized avatar
🤗
opensource

Jakub Bartczuk lambdaofgod

🤗
opensource
View GitHub Profile
// Kuba 'lambdaofgod' Bartczuk
// stack implemented in assembly language from Elements of Computing Systems (Nisan & Schocken)
// http://www.nand2tetris.org
// didnt even read the whole book (actually a bummer)
@R0 // initialize 0th register to 0
M=0
(STACK)
@lambdaofgod
lambdaofgod / linear_reg.R
Last active August 29, 2015 14:05
Linear regression in R
# Kuba 'lambdaofgod' Bartczuk
# linear regression in R
# implemented with normal equation (check wikipedia)
# 17.08.2014
# TO DO:
# - add normalization
# - add visualization
# loading data
# nothing interesting to see here...
@lambdaofgod
lambdaofgod / algs.scala
Last active August 29, 2015 14:06
Algorithm design techniques as high-level functions
/* Kuba "lambdaofgod" Bartczuk
technique based on example from "Algorithms a functional approach"
sort of example of divide-and-conquer - mergesort
to do - dynamic programming
*/
def divideAndConquer[T1,T2](simple : T1 => Boolean,
solve : T1 => T2,
divide : T1 => List[T1],
combine : (T1,List[T2]) => T2,
/*
Kuba 'lambdaofgod Bartczuk
lambda calculus to combinatory logic (and back)
Warning : if you want to check out the idea itself you'll be better off
reading solution in Haskell.
TO DO
- de Bruijin notation
- parsing for some reasonable concrete syntax
@lambdaofgod
lambdaofgod / while.scala
Last active August 19, 2016 11:29
while language interpreter
/*
Kuba 'lambdaofgod Bartczuk
basically completed 10.01.2015
while language interpreter
syntax:
V - variables
N - numbers
Prim = N | V
; REVERSE INPUT STRING
0 * * l 1
1 _ # r 3
3 1 # l 21 ; move on right
3 0 # l 20
3 _ _ l 5
3 * * r 3
@lambdaofgod
lambdaofgod / bioinfo.hs
Created July 16, 2015 00:32
Some bioinformatics stuff for Rosalind
module Chapter1 where
--import Data.Map
import Control.Monad
import Data.List
import Data.Char
data Base = A | G | C | T deriving(Eq, Show)
bases = [A,G,C,T]
type DNA = [Base]
@lambdaofgod
lambdaofgod / timed.scala
Created August 8, 2015 11:14
Function for running time estimation
def timed[T](body: =>T): Double = {
val start = System.nanoTime
dummy = body
val end = System.nanoTime
((end - start)/1000)/1000.0
}
@lambdaofgod
lambdaofgod / Interpreter.scala
Last active April 29, 2019 17:15
While language interpreter
/*
Kuba 'lambdaofgod Bartczuk
basically completed 10.01.2015, refactored 08.2016
while language interpreter
syntax:
V - variables
N - numbers
@lambdaofgod
lambdaofgod / cloudera.md
Last active December 31, 2016 10:05
running cloudera from docker

Run container

docker run --hostname=quickstart.cloudera --privileged=true -t -i -p 8888:8888 -p 80:80 -p 7180:7180 -p 18080:18080 -p 50070:50070 cloudera/quickstart /usr/bin/docker-quickstart

see where all these ports came from

go to localhost

run manager (in container)