Skip to content

Instantly share code, notes, and snippets.

@kirelagin
kirelagin / group.py
Created September 18, 2011 23:45
Group properties checker
#!/usr/bin/env python3
from abc import ABCMeta, abstractmethod
class Biop(metaclass=ABCMeta):
_set = None
@property
def set(self):
@kirelagin
kirelagin / pcms_left.py
Created December 2, 2011 12:33
PCMS2 contest status and time remaining
#!/usr/bin/env python2
import sys
import datetime
from mustaine.client import HessianProxy
SERVICE_URL = 'http://neerc.ifmo.ru:8081/pcms/party'
LOGIN = '<login>'
PASSWORD = '<password>'
@kirelagin
kirelagin / doc9303.py
Created December 3, 2011 15:24
ICAO Doc 9303 checksum calculator
#!/usr/bin/env python3
from itertools import cycle
def chksum(val):
def tonum(v):
if len(v) == 1:
if v == '<':
return 0
@kirelagin
kirelagin / flusher.c
Created March 17, 2012 16:34
Flusher for myreverse testing
/***
* Flusher by Kirill Elagin <[email protected]> [http://kirelagin.ru/]
*
* Use it this way:
* ./flusher < testfile | ./myreverse
* Exclamation marks in input file will flush the buffer.
**/
#include <stdio.h>
#include <time.h>
@kirelagin
kirelagin / letter.txt.diff
Created April 17, 2012 22:33
Rainy letter about ttfv
--- letter.txt.orig 2012-04-18 02:21:35.122840949 +0400
+++ letter.txt 2012-04-18 02:29:19.317062201 +0400
@@ -2,9 +2,9 @@
Как-то по так получилось, что по моей неосторожности намечается такой
длинный до самого упора пока все не разъедутся семинар и крэш-курс по
-теории типов и релейтер штукам.
+теории типов и релейтед штукам.
У этого мероприятия есть домашняя страница:
-http://oxij.org/activity/ttfv/ на которой имеются ссылки на всякие
@kirelagin
kirelagin / integrate.hs
Created May 22, 2012 17:57
Teorver task2
import Data.Functor
import Data.Vector (fromList)
import qualified Data.Vector as V
import Statistics.Sample
import System.Random
import System.Random.Mersenne.Pure64
import Text.Printf
import Statistics.Distribution (quantile)
import Statistics.Distribution.Normal
@kirelagin
kirelagin / area.hs
Created May 22, 2012 21:48
Teorver task1
import Data.Functor
import System.Random
import System.Random.Mersenne.Pure64
import Text.Printf
import Statistics.Distribution (quantile)
import Statistics.Distribution.Normal
import Statistics.Distribution.Uniform
module Main where
import Control.Arrow
import Control.Monad.State
import Data.List
import Data.Map (Map)
import qualified Data.Map as M
import Data.Set (Set)
import qualified Data.Set as S
import Language.Haskell.Exts (prettyPrint, parseModuleWithMode, ParseResult (..), preludeFixities, ParseMode (..), Extension (..))
@kirelagin
kirelagin / fat32info.sh
Created September 15, 2012 23:01
Script to extract useful information from FAT32 header
#!/usr/bin/env sh
# Display information about internal layout of a FAT32 filesystem.
#
# Script directly reads data from FAT32 header. This might be useful
# for aligning fs structures to speed up flash drive access.
#
# http://kirelagin.ru/p/gist/3730254
#
# -- Kirill Elagin <[email protected]>
@kirelagin
kirelagin / Huffman.lhs
Created October 13, 2012 21:44
Very simple implementation of Huffman coding in Haskell
> module Huffman where
> import Control.Arrow
> import Data.List
> import qualified Data.Map as M
> import Data.Function
This typeclass is supposed to make life _a bit_ easier.