Skip to content

Instantly share code, notes, and snippets.

View sumerman's full-sized avatar
🔮
DATABASE, DATABASE, JUST LIVING IN A DATABASE

Valery Meleshkin sumerman

🔮
DATABASE, DATABASE, JUST LIVING IN A DATABASE
View GitHub Profile
@sumerman
sumerman / flatten.hs
Created January 19, 2011 07:44
Test Pastie
data BiTree a = Leaf a | BiTree a (BiTree a) (BiTree a) deriving Show
{-flatten :: BiTree a -> [a]-}
{-flatten (BiTree v l r)= [v] ++ flatten l ++ flatten r-}
{-flatten (Leaf v) = [v]-}
flatten' :: BiTree a -> [a] -> [a]
flatten' (Leaf v) res = v:res
flatten' (BiTree v l r) res = v:flatten' l (flatten' r res)
@sumerman
sumerman / shared_ptr.hpp
Created December 4, 2010 12:22
Simple non-intrusive refc-smart-pointer
/*
* shared_ptr.h
*
* Created by Valeryi Meleshkin.
*
*/
#ifndef __SHARED_PTR__
#define __SHARED_PTR__
(gdb) p x < 1
$7 = true
(gdb) p x < (bx + block()->size())
$8 = false
(gdb) p (bx + block()->size())
$9 = 1
(gdb)
-------
%% delta(x speed), -//-y, px (lim=px*x),-//- py
{Scale, Sdurat} = gen_scale(linear(1), linear(1), 2, 2),
{Irotate, Rdurat} = gen_rotate(linear(2), 4.5), %% delta(speed), p (lim = p*360)
Rotate = delay(Sdurat, Irotate),
{Itrans, Tdurat} = gen_translate(pow(2), 3.7),
Trans = delay(Sdurat + Rdurat, Itrans),
Trigger = delay(Sdurat + Rdurat + Tdurat, gen_trigger(TrigFunc)),