Skip to content

Instantly share code, notes, and snippets.

@kbumsik
kbumsik / ipad_monitor.sh
Last active October 10, 2024 19:41
Using iPad as a 2nd monitor on Linux with VNC.
#!/bin/bash
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# <[email protected]> wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return. - Bumsik Kim
# ----------------------------------------------------------------------------
# Configuration
WIDTH=1024 # 1368 for iPad Pro
@johnmyleswhite
johnmyleswhite / cor_-1_to_1.R
Last active April 26, 2017 23:14
non_robust_correlations.R
n <- 100000L
x <- rnorm(n, 0, 1)
y <- -x
cor(x, y)
for (z in c(10, 100, 1000, 10000, 100000)) {
rho <- cor(c(-z, x, z), c(-z, y, z))
print(paste0("z = ", z, "; rho = ", rho))
@kylebgorman
kylebgorman / wagnerfischerpp.py
Last active March 3, 2023 17:27
Wagner-Fischer Levenshtein distance, now with a means to generate all possible optimal alignments.
# Copyright (c) 2013-2022 Kyle Gorman
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#