Short (72 chars or less) summary
More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).
Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
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
" An example for a vimrc file. | |
" | |
" Maintainer: Bram Moolenaar <Bram@vim.org> | |
" Last change: 2008 Jul 02 | |
" | |
" To use it, copy it to | |
" for Unix and OS/2: ~/.vimrc | |
" for Amiga: s:.vimrc | |
" for MS-DOS and Win32: $VIM\_vimrc | |
" for OpenVMS: sys$login:.vimrc |
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
To make Pageant automatically run and load keys at startup: | |
- Find the location of pageant.exe | |
- Windows key + R to open the 'run' dialog box | |
- Type: 'shell:startup' in the dialog box | |
- Create a shortcut to the pageant.exe and put into this startup folder. |
Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or just head straight to the command line:
# Clone your fork to your local machine
git clone git@github.com:USERNAME/FORKED-PROJECT.git
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
# Based on oneAPI description | |
# Both from C order | |
n, m = A.shape | |
ldm, lda = n, 3 | |
ku, kl = 1, 1 | |
B = np.zeros((lda, ldm)) | |
for j in range(n): | |
k = ku - j | |
for i in range(max(0, j-ku), min(m, j + kl + 1)): | |
B[(k + i), j] = A[i, j] |
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 diagonal_form(a, upper = 1, lower= 1): | |
""" | |
a is a numpy square matrix | |
this function converts a square matrix to diagonal ordered form | |
returned matrix in ab shape which can be used directly for scipy.linalg.solve_banded | |
""" | |
n = a.shape[1] | |
assert(np.all(a.shape ==(n,n))) | |
ab = np.zeros((2*n-1, n)) |
https://docs.microsoft.com/en-us/windows/wsl/tutorials/wsl-containers#install-docker-desktop
https://docs.microsoft.com/en-us/windows/wsl/use-custom-distro
(set as default linux: wsl --set-default CentOS-7)
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
%%time | |
from itertools import combinations as _combu | |
import numpy as np | |
from scipy.optimize import linprog | |
def inversions(X): | |
# build inequalities | |
A = [v2 - v1 for v2, v1 in _combu(X, 2)] |
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
/******** Header Files ********/ | |
#include <iostream> | |
#include <sstream> | |
#include <stdio.h> | |
#include <string.h> | |
#include <string> | |
#include <vector> | |
#include <queue> |
NewerOlder