Skip to content

Instantly share code, notes, and snippets.

@n-bar
n-bar / init.el
Last active October 28, 2018 09:49
.emacs.d/init.el on windows
(server-start)
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
@n-bar
n-bar / try_distance_corr.py
Created July 17, 2016 13:24 — forked from josef-pkt/try_distance_corr.py
distance covariance and correlation
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 15 14:00:29 2012
Author: Josef Perktold
License: MIT, BSD-3 (for statsmodels)
http://en.wikipedia.org/wiki/Distance_correlation
Yaroslav and Satrajit on sklearn mailing list
@n-bar
n-bar / custom.css
Created July 15, 2016 07:46
Jupyter Theme
/*
Name: Oceans16 Dark (modified to light)
Author: Kyle Dunovan (http://github.com/dunovank)
*/
a {font-family: 'Helvetica', sans-serif; }
div#notebook, div.CodeMirror, div.output_area pre, div.output_wrapper, div.prompt, div.CodeMirror pre {font-family:'Fira Code', monospace; font-size: 11pt;}
/* Hiding the ipython log */
# https://ru.wikibooks.org/wiki/Реализации_алгоритмов/Расстояние_Левенштейна#Python
def distance(a, b):
"Calculates the Levenshtein distance between a and b."
n, m = len(a), len(b)
if n > m:
# Make sure n <= m, to use O(min(n,m)) space
a, b = b, a
n, m = m, n
current_row = range(n+1) # Keep current and previous row, not entire matrix
@n-bar
n-bar / Lesson_1_1.sql
Last active March 19, 2019 08:01
Specialist. SQL Level 2
--1. Задачи на операции с одной таблицей (без джойнов и подзапросов):
--a) В каких категориях имеется несколько товаров от одного и того же поставщика?
SELECT CategoryID
FROM Products
GROUP BY CategoryID, SupplierID
HAVING Count(ProductID) > 1;
--b) Сколько было куплено штук товара, принесшего компании максимальную выручку?
SELECT TOP 1 sum(Quantity) sumQuantity