Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View pkulev's full-sized avatar

Pavel Kulyov pkulev

View GitHub Profile
@pkulev
pkulev / db.ml
Created November 15, 2016 16:49
(* A phone number is a sequence of four integers. *)
type phone_number = int * int * int * int;;
(* A contact has a name and a phone number. *)
type contact = {
name : string;
phone_number : phone_number
};;
(* Here is a dumb contact. *)
@pkulev
pkulev / keybase.md
Last active September 21, 2016 12:33

Keybase proof

I hereby claim:

  • I am pkulev on github.
  • I am pkulev (https://keybase.io/pkulev) on keybase.
  • I have a public key ASDtmt6Ak8BNbWiJk6NoQooz07HBpdpAhm0VHmd-4Hft4Ao

To claim this, I am signing this object:

[user]
name = Pavel Kulyov
email = pkulev@croc.ru
[core]
editor = "emacs -nw"
diff = auto
status = auto
branch = auto
interactive = auto
excludesfile = /home/pkulev/.gitignore
# Path to your oh-my-zsh installation.
export ZSH=/home/pkulev/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="obraun"
# Uncomment the following line to use case-sensitive completion.
#!/usr/bin/env python
from OpenGLContext import testingcontext # noqa
from OpenGLContext.arrays import array
from OpenGL.arrays import vbo
from OpenGL.GL import (
shaders,
glEnableClientState,
glDisableClientState,
glDrawArrays,
"""Data frame for convinient work and renderings multipage data."""
import math
class DataFrame(list):
"""Data represents as granulated list of lists.
DataFrame is a list, thus you can access elements directly like
with original list structure: dataframe[index] -> element
Also you can granulate (more than once) list of frames by frame length
>>> def normalize(vector):
... normalized = []
... for elem in vector:
... normalized.append(elem / 255.)
... return normalized
...
>>> normalize((1,2,3))
[0.00392156862745098, 0.00784313725490196, 0.011764705882352941]
>>> normalize((0, 0, 0))
[0.0, 0.0, 0.0]
@pkulev
pkulev / omg.py
Last active March 22, 2016 12:42
#!/usr/bin/env python
"""Just for fun."""
import sys
from OpenGL.GL import (
glClear,
glClearColor,
glRotatef,
@pkulev
pkulev / sim.py
Last active March 14, 2016 14:01
#!/usr/bin/env python
import random
try:
ask = raw_input
except NameError:
ask = input
#include <stdio.h>
#include <stdlib.h>
int pow2(int val)
{
return val * val;
}
int* map(int (*func)(int), int *arr, int len)
{