This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <fcntl.h> | |
#include <sysexits.h> | |
#include <unistd.h> | |
char * strcat(char *dest, char *src) | |
{ | |
while (*dest) dest++; | |
while (*dest++ = *src++); | |
return --dest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
@pytest.fixture(scope="module") | |
def test(request): | |
try: | |
# set up | |
pass | |
except: | |
# tear down | |
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int pow2(int val) | |
{ | |
return val * val; | |
} | |
int* map(int (*func)(int), int *arr, int len) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import random | |
try: | |
ask = raw_input | |
except NameError: | |
ask = input | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Just for fun.""" | |
import sys | |
from OpenGL.GL import ( | |
glClear, | |
glClearColor, | |
glRotatef, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> 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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Pavel Kulyov | |
email = pkulev@croc.ru | |
[core] | |
editor = "emacs -nw" | |
diff = auto | |
status = auto | |
branch = auto | |
interactive = auto | |
excludesfile = /home/pkulev/.gitignore |