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
local api = vim.api | |
local scrollview = require('scrollview') | |
local group = 'gitsigns' | |
local add = scrollview.register_sign_spec({ | |
group = group, | |
highlight = 'GitSignsAdd', | |
symbol = ' ', | |
}).name |
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 python3 | |
""" | |
Display a table of GPU availability on a Slurm server. | |
Usage: | |
$ scontrol -M gpu show node | gpu_avail.py | |
""" | |
import sys |
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
" The amount of time, in milliseconds, until scrollbar hides after scrolling. | |
let s:hide_delay = 800 | |
" Time of the last WinScrolled event | |
let s:scroll_time = 0 | |
" Keep track of pending updates. Ignore updates if there are already pending | |
" updates, to prevent lag. | |
let s:pending = 0 |
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
import java.util.ArrayList; | |
import java.util.HashSet; | |
import java.util.List; | |
import java.util.Set; | |
public class Anagrams { | |
public static List<String> anagrams(String s) { | |
List<String> output = new ArrayList<String>(); | |
if (s.length() == 0) | |
return output; |
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 <cassert> | |
#include <cstdlib> | |
#include <iostream> | |
#include <set> | |
#include <string> | |
#include <vector> | |
#include "revdoor.hpp" | |
using namespace std; |
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 <functional> | |
#include <iostream> | |
#include <numeric> | |
#include <vector> | |
#include <unordered_map> | |
using namespace std; | |
typedef unsigned long ulong; |
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
import kmeans1d | |
x = [4.0, 4.1, 4.2, -50, 200.2, 200.4, 200.9, 80, 100, 102] | |
k = 4 | |
clusters, centroids = kmeans1d.cluster(x, k) | |
print(clusters) # [1, 1, 1, 0, 3, 3, 3, 2, 2, 2] | |
print(centroids) # [-50.0, 4.1, 94.0, 200.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
from distutils.spawn import find_executable | |
import glob | |
import os | |
import random | |
import shutil | |
import subprocess | |
import sys | |
STYLE_IMAGES_PATH = 'paint-by-numbers/test' | |
CONTENT_IMAGE_PATH = 'boston.jpg' |
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 <assert.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
/* | |
* Calculates factorial. | |
* Overflow is not checked/handled. | |
*/ | |
int factorial(int x) { | |
assert(x >= 0); |
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 | |
from __future__ import print_function | |
# Images can be converted to video with ffmpeg. | |
# > ffmpeg -pattern_type glob \ | |
# -i "*.png" \ | |
# -vcodec libx264 \ | |
# output.avi |
NewerOlder