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
is_outlier = lambda group: (np.abs(group - group.mean()) > 2 * group.std()).astype(int) | |
factors = df.select_dtypes(exclude=[np.number]).columns.tolist() | |
df['is_outlier'] = df.groupby(factors).transform(is_outlier) |
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
"use strict"; | |
function _toConsumableArray(arr) { | |
if (Array.isArray(arr)) { | |
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { | |
arr2[i] = arr[i]; | |
} | |
return arr2; | |
} else { | |
return Array.from(arr); |
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
"use strict"; | |
var currying = function currying(fn) { | |
var fun = function fun() { | |
for (var _len = arguments.length, orig = Array(_len), _key = 0; _key < _len; _key++) { | |
orig[_key] = arguments[_key]; | |
} | |
var inner = function inner() { | |
for (var _len2 = arguments.length, val = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { |
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 | |
multipliers=[2, 4, 10, 3, 5, 9, 4, 6, 8] | |
N10=0 | |
result="" | |
random.seed() | |
for i in range(0, 9): | |
N = random.randint(0, 9) |
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/python | |
import argparse | |
import requests | |
def send_request(params): | |
r = requests.post('http://online-generators.ru/ajax.php', data=params) | |
return r.text |
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
group 'test.thrift' | |
version '1.0-SNAPSHOT' | |
apply plugin: 'java' | |
allprojects { | |
apply plugin: "idea" | |
} | |
sourceCompatibility = 1.5 |
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 | |
multipliers=[2, 4, 10, 3, 5, 9, 4, 6, 8] | |
N10=0 | |
result="" | |
random.seed() | |
for i in range(0, 9): | |
N = random.randint(0, 9) |
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
transpose :: [[a]] -> [[a]] | |
transpose xs | any (\ys -> length ys == 0) xs = [] | |
| otherwise = [h] ++ transpose t | |
where (h, t) = (map head xs, map tail xs) | |
-- *Main> transpose [[1, 2, 3], [4, 5, 6], [7, 8, 9]] | |
-- [[1,4,7],[2,5,8],[3,6,9]] |
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 mysql:5.6 | |
ENV MYSQL_ALLOW_EMPTY_PASSWORD=yes | |
COPY ./mydb.sql /tmp/mydb.sql | |
RUN service mysql start && \ | |
echo "CREATE DATABASE mydb DEFAULT CHARACTER SET UTF8" | mysql -uroot && \ | |
mysql -uroot mydb < /tmp/mydb.sql |
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 BinTree a = Empty | |
| Node a (BinTree a) (BinTree a) | |
deriving (Eq, Ord) | |
treeFromList :: (Ord a) => [a] -> BinTree a | |
treeFromList [] = Empty | |
treeFromList (x:xs) = Node x (treeFromList (filter (< x) xs)) | |
(treeFromList (filter (> x) xs)) | |
instance (Show a) => Show (BinTree a) where |