Skip to content

Instantly share code, notes, and snippets.

View Sibirtsev's full-sized avatar
💭
C++

Alexey Sibirtsev Sibirtsev

💭
C++
View GitHub Profile
@Sibirtsev
Sibirtsev / i3.conf
Last active August 29, 2015 14:21 — forked from diyan/i3.conf
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@Sibirtsev
Sibirtsev / percentile.sh
Created August 18, 2016 04:54 — forked from lewisd32/percentile.sh
Calculate percentile in bash
#!/bin/bash
# stdin should be integers, one per line.
percentile=$1
tmp="$(tempfile)"
total=$(sort -n | tee "$tmp" | wc -l)
# (n + 99) / 100 with integers is effectively ceil(n/100) with floats
count=$(((total * percentile + 99) / 100))
head -n $count "$tmp" | tail -n 1
rm "$tmp"
@Sibirtsev
Sibirtsev / vector.py
Created September 15, 2016 03:24 — forked from rldotai/vector.py
Pure Python Vector class
"""
A simple implementation of vectors in Python modelled after tuples, but having
altered some of the operations to be closer to vector arithmetic.
It targets Python 3.5+ in order to support __matmul__, allowing for dot
products, which I have heard are important in linear algebra.
We check for whether it is operating on a number in order to implement
broadcasting; otherwise it performs the operations elementwise.
We also use `zip_longest` because it performs an implicit check for sequences
of unequal length; it pads the iteration with `None`, which will raise an error

###Полезные ссылки:

Сам по себе модуль хорошо документирован.

###Описание Word2Vec - штука, принимающая на вход массив из предложений(являющихся массивом из слов) и возвращающая некий объект. Этот некий объект реализует интерфейс dict, где ключами являются слова. И несколько методов, о которых расскажу дальше.

@Sibirtsev
Sibirtsev / Caffe Ubuntu 15.10.md
Created October 25, 2016 09:42 — forked from wangruohui/Caffe Ubuntu 15.10.md
Compile and run Caffe on Ubuntu 15.10

Ubuntu 15.10 have been released for a couple of days. It is a bleeding-edge system coming with Linux kernel 4.2 and GCC 5. However, compiling and running Caffe on this new system is no longer as smooth as on earlier versions. I have done some research related to this issue and finally find a way out. I summarize it here in this short tutorial and I hope more people and enjoy this new system without breaking their works.

Install NVIDIA Driver

The latest NVIDIA driver is officially included in Ubuntu 15.10 repositories. One can install it directly via apt-get.

sudo apt-get install nvidia-352-updates nvidia-modprobe

The nvidia-modprobe utility is used to load NVIDIA kernel modules and create NVIDIA character device files automatically everytime your machine boots up.

Reboot your machine and verify everything works by issuing nvidia-smi or running deviceQuery in CUDA samples.

@Sibirtsev
Sibirtsev / bash_prompt.sh
Created November 30, 2016 11:17 — forked from insin/bash_prompt.sh
Set color bash prompt according to active virtualenv, git branch and return status of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
// Finds unused indexes in a mysql database
SELECT
t.TABLE_SCHEMA,
t.TABLE_NAME,
s.INDEX_NAME,
s.COLUMN_NAME,
s.SEQ_IN_INDEX,
( SELECT MAX(SEQ_IN_INDEX)
FROM INFORMATION_SCHEMA.STATISTICS s2
@Sibirtsev
Sibirtsev / Pandas and Seaborn.ipynb
Created February 26, 2017 13:05 — forked from 5agado/Pandas and Seaborn.ipynb
Data Manipulation and Visualization with Pandas and Seaborn — A Practical Introduction
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Sibirtsev
Sibirtsev / semantic-ui-form-theme.html.twig
Created March 27, 2017 03:44 — forked from TorbenKoehn/semantic-ui-form-theme.html.twig
Symfony/Twig Semantic UI Form Theme
{% use 'form_div_layout.html.twig' %}
{% block form_start -%}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' ui form')|trim}) %}
{{- parent() -}}
{%- endblock form_start %}
{# Widgets #}
{% block form_widget_simple -%}
@Sibirtsev
Sibirtsev / README.md
Created March 28, 2017 06:07 — forked from dergachev/README.md
Vagrant tutorial

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM