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 flask import Flask | |
app = Flask(__name__) | |
@app.route('/привет') | |
def hello_world(): | |
return 'Hello World!' | |
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 cummedian_line(a): | |
""" | |
По строке (a_i) строит последовательность медиан | |
result_i == a[:i+1].median() | |
http://stackoverflow.com/a/10657732 | |
Аж O(nlog(n))!!! | |
""" | |
class minheap(list): |
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
#!/bin/sh -e | |
sudo sed -i 's/Надежный/Надёжный/g; s/надежный/надёжный/g; s/Ненадежный/Ненадёжный/g; s/ненадежный/ненадёжный/g;' /opt/google/chrome/locales/ru.pak |
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
void replaceAll(string &source, string search, string replace) { | |
size_t position = 0; | |
while ((position = source.find(search, position)) != string::npos) { | |
source.replace(position, search.length(), replace); | |
position += replace.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
Размещение: | |
|ч|е|т|ы| | |
|д|о|е|р| | |
|и|н|д|в| | |
|и|р|т|а| | |
Пояснение: | |
|4|4|4|4| |
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
def train_test_split(xs, ys, test_size=0.25, random_state=0): | |
n = len(xs) | |
n_test = math.ceil(n * test_size) | |
n_train = n - n_test | |
random_state = np.random.RandomState(random_state) | |
# random partition | |
permutation = random_state.permutation(n) | |
indexes_test = permutation[:n_test] | |
indexes_train = permutation[n_test:n_test + n_train] |
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
echo 65 >/proc/sys/net/ipv4/ip_default_ttl |
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
Sub InsertPivotTable() | |
'Macro By ExcelChamps | |
'Add header to first column, because PivotTable doesn't work with empty columns | |
[A1].Value = "Id" | |
'Declare Variables | |
Dim PSheet As Worksheet | |
Dim DSheet As Worksheet | |
Dim PCache As PivotCache |
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
license: mit |
OlderNewer