Skip to content

Instantly share code, notes, and snippets.

View hakunin's full-sized avatar

Michal Hantl hakunin

  • Ostrava, Czech Republic
  • 19:32 (UTC -12:00)
View GitHub Profile
-- instruction
tm_i s c w m n a | a == "state" = s
| a == "char" = c
| a == "write" = w
| a == "move" = m
| a == "next" = n
-- TM instruction set, gives correct instruction if state and char given
-- Priklady resene v ramci cviceni c. 4
-- ====================================
--
-- 1) Vyhledani maximalni hodnoty ve stromu
-- Implementujte pro tri varianty stromu uvedene na prednasce
-- funkci, ktera vrati nejvyssi hodnotu obsazenou v uzlech stromu.
-- Uvazujte strom s nejobecnejsim moznym typem prvku (tj. ne pouze Int).
data Tree1 a = Leaf1 a
| Branch1 (Tree1 a) (Tree1 a)
module Deque (Deque (First, Bottom), addFirst, addLast) where
import Prelude hiding (print)
data Deque a = First a (Deque a)
| Bottom
print :: (Show a)=> Deque a -> String
print Bottom = "Prazdny"
print (First f Bottom) = (show f)
module TuringMachine where
-- Tape ------------------------------------------------------------------------
-- constructor
tape symbols = Tapes EOT (load_tape symbols) R
load_tape [] = EOT
load_tape (symbol:symbols) =
(Symbol (Char symbol)) (load_tape symbols)
class FlightRouteDisplay {
function __construct($path) {
$this->path = $path;
}
function render()
{
$id = "route".(rand(100000, 999999));
# How learning Haskell changed my programming skill
# Pascal's triangle BEFORE Haskell:
def triangle_before_haskell iterations
rows = []
iterations.times { |r|
new_row = [1]
if r >= 1
% Author: Michal Hantl, han345
% Date: 27/04/2010
% resici algoritmus ------------------------------------------------------------
solve_post(List1, List2, Sequence):-
sequence([], [], List1, List2, List1, List2, Sequence, 1, [], [], 32).
michal@domov:~/dev/other/redcar$ jruby -S rake build
(in /home/michal/dev/other/redcar)
ant jar -f vendor/java-mateview/build.xml
Buildfile: vendor/java-mateview/build.xml
clean:
debug:
[echo] using platform: [linux]
[echo] |-- compile classpath
michal@domov:~/dev/other/redcar$ jruby -S rake build
(in /home/michal/dev/other/redcar)
ant jar -f vendor/java-mateview/build.xml
Buildfile: vendor/java-mateview/build.xml
clean:
[delete] Deleting directory /home/michal/dev/other/redcar/vendor/java-mateview/bin
debug:
[echo] using platform: [linux]
<!DOCTYPE html>
<link href="//fonts.googleapis.com/css?family=Yanone+Kaffeesatz:200,300,400,700" rel="stylesheet" type="text/css" >
<style>
body {
font-family: 'Yanone Kaffeesatz', serif;
}
h1 {
font-size:4em;
}