Skip to content

Instantly share code, notes, and snippets.

View ischurov's full-sized avatar

Ilya V. Schurov ischurov

View GitHub Profile
@ischurov
ischurov / decode_escaped_cp866.py
Created December 25, 2016 20:36
A helper function useful to decode cp866-encoded filenames in tar archives.
def decode_escaped_cp866(s):
out = []
for token in re.finditer(r"%([0-9A-F]{2})|(.)", s):
if token.group(1) is not None:
out.append(bytes([int(token.group(1), 16)]))
elif token.group(2) is not None:
out.append(token.group(2).encode('utf-8'))
return b"".join(out).decode('cp866')
print(decode_escaped_cp866("%8C%A0%E0%A8%EF - %84%87"))
@ischurov
ischurov / Untitled5.ipynb
Created February 4, 2017 15:45
parse data from mkrf.ru
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ischurov
ischurov / Untitled63.ipynb
Created March 4, 2017 21:42
nbviewer widget test
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ischurov
ischurov / index.html
Created July 24, 2017 16:01
pass object to javascript via json in flask
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hello, World</title>
</head>
<body>
<p>Hello, <span id="username"></span></p>
<script>
var user = JSON.parse('{{ user | tojson | safe}}');
@ischurov
ischurov / district_to_district.ipynb
Created August 8, 2017 20:53
district_to_district
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ischurov
ischurov / district_to_district_2017_Moscow.csv
Last active August 8, 2017 20:57
Соответствие между УИКами и избирательными округами на муниципальных выборах в Москве в 2017 году, источник данных http://www.moscow_city.vybory.izbirkom.ru, см. также https://gist.github.com/ischurov/773a464801ba15a52aea02c9d227a135
municipal_district voting_district polling_station
Академический 3 2118
Академический 1 2119
Академический 1 2120
Академический 1 2121
Академический 1 2122
Академический 1 2123
Академический 1 2124
Академический 1 2125
Академический 2 2126
@ischurov
ischurov / matrix_derivative.qq
Last active September 21, 2017 10:48
Matrix derivative (preview)
\meta
\title Производные и градиенты
\author Илья Щуров
\affiliation НИУ ВШЭ
\project
Машинное обучение для факультета экономики, 2017-18 учебный год
\url http://wiki.cs.hse.ru/Машинное_обучение_(факультет_экономических_наук)
\lang ru
В машинном обучении часто приходится находить производные и градиенты от
@ischurov
ischurov / math-ml-intro.ipynb
Last active October 12, 2017 16:03
math-ml-intro.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ischurov
ischurov / hw python.ipynb
Created October 8, 2017 08:47
hw python numpy
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ischurov
ischurov / Untitled.ipynb
Last active October 21, 2017 11:59
web scrapping day 2.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.