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
# coding=utf-8 | |
""" | |
The outgoing calls information for the "Megafon" mobile operator | |
""" | |
import xml.etree.ElementTree as ElementTree | |
import re |
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
Show hidden characters
[ | |
{ "keys": ["ctrl+shift+/"], "command": "toggle_setting", "args": {"setting": "word_wrap"} }, | |
{ "keys": ["ctrl+alt+left"], "command": "jump_back" }, | |
{ "keys": ["ctrl+alt+right"], "command": "jump_forward" } | |
] |
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
{ | |
"always_show_minimap_viewport": true, | |
"close_windows_when_empty": false, | |
"color_scheme": "Packages/Theme - Afterglow/Afterglow.tmTheme", | |
"dictionary": "Packages/Language - Russian/ru_RU.dic", | |
"draw_minimap_border": true, | |
"ensure_newline_at_eof_on_save": true, | |
"fade_fold_buttons": true, | |
"fallback_encoding": "Cyrillic (Windows 1251)", | |
"font_face": "Consolas", |
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
""" | |
Rects overlapping | |
A rect representation: | |
rect = [x1, y1, x2, y2] | |
""" | |
def range_overlap(a_min, a_max, b_min, b_max): | |
return not ((a_min > b_max) or (a_max < b_min)) |
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 <cuda.h> | |
#include <stdio.h> | |
void cudasafe(int error, char* message, char* file, int line) { | |
if (error != cudaSuccess) { | |
fprintf(stderr, "CUDA Error: %s : %i. In %s line %d\n", message, error, file, line); | |
exit(-1); | |
} | |
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
""" | |
Прореживание облака 2D-точек по минимальному расстоянию между точками | |
Реализация "в лоб" с использованием KD-Tree | |
""" | |
import numpy as np | |
import scipy.spatial as spatial | |
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
$ tar -zxvf cudnn-7.0-linux-x64-v4.0-prod.solitairetheme8 | |
$ cd cuda | |
$ sudo cp include/cudnn.h /usr/local/include | |
$ sudo cp lib64/libcudnn.* /usr/local/lib |
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 itertools | |
def slide(seq, n=2): | |
"""Returns a sliding window (of width n) over data from the sequence | |
s -> (s0, s1, ..., s[n-1]), (s1, s2, ..., sn), ... | |
""" | |
it = iter(seq) | |
result = tuple(itertools.islice(it, n)) | |
if len(result) == n: |
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
from mpl_toolkits.mplot3d import Axes3D | |
from mpl_toolkits.mplot3d.art3d import Poly3DCollection | |
import matplotlib.pyplot as plt | |
# x y z | |
a = (1, 1, 1) # p1 | |
b = (2, 2, 2) # p2 | |
x, y, z = 0, 1, 2 |
OlderNewer