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
#include <cmath> | |
#include <iostream> | |
template <class T> | |
class Maybe { | |
public: | |
Maybe(T val) : value(val), ok(true) {} | |
Maybe() : ok(false) {} | |
explicit operator bool() const { return ok; } |
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
\documentclass{article} | |
% General document formatting | |
\usepackage[margin=0.5in]{geometry} | |
\usepackage[parfill]{parskip} | |
\usepackage[utf8]{inputenc} | |
\usepackage[T2A]{fontenc} | |
\usepackage[english,russian]{babel} | |
% Related to math | |
\usepackage{amsmath,amssymb,amsfonts,amsthm} |
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
# https://jeankossaifi.github.io/tensorly/unfolding.html | |
def unfold(tensor, mode=0): | |
""" | |
Returns the mode-`mode` unfolding of `tensor` | |
""" | |
return np.rollaxis(tensor.T, -mode-1).reshape((tensor.shape[mode], -1)) | |
# Then goto http://www.alexejgossmann.com/tensor_decomposition_tucker/ |
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
var sh = WScript.CreateObject("WScript.Shell") | |
var posh = sh.Exec('powershell -Command -') | |
var i=posh.StdIn; | |
i.WriteLine('Get-PSProvider') | |
i.Close() | |
var o = posh.StdOut.ReadAll() | |
var e = posh.StdErr.ReadAll() | |
WScript.Echo('1>', o) | |
WScript.Echo('2>', e) |
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
REM Allow git credentials to be saved in Windows Credential Manager | |
git config --global credential.helper wincred |
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
// Check Admin rights | |
var out = GetObject("winmgmts://./root/default:StdRegProv") .EnumKey(1 << 31 | 3, "S-1-5-20") | |
WScript.Echo("Admin =", !out) |
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
Vagrant.configure("2") do |config| | |
config.vm.box = "debian/jessie64" | |
config.vm.provider "virtualbox" do |v| | |
v.linked_clone = true | |
end | |
config.vm.provision "shell", inline: <<-SHELL | |
sudo apt-get remove -y rpcbind exim4-base | |
SHELL |
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
openssl ecparam -genkey -name secp384r1 -param_enc explicit -out key.pem | |
openssl req -new -sha256 -key key.pem -batch -subj /CN=test -out csr.csr | |
openssl req -x509 -sha256 -days 365 -key key.pem -in csr.csr -out certificate.pem |
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
REM https://github.com/felixrieseberg/windows-build-tools | |
npm install --global windows-build-tools |