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 itertools | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.spatial import Delaunay | |
points = np.array([ | |
[0, 0], | |
[0, 2], | |
[2, 0], | |
[0.5, 0.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
/* | |
Dependencies: LAPACK | |
Ubuntu: sudo apt-get install liblapack3 liblapack-dev | |
Compile: g++ -o barycentric barycentric.cpp -O3 -Wall -Wextra -pedantic -std=gnu++11 -llapack | |
*/ | |
#include <iostream> | |
#include <cassert> |
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
toroidal <- function(points, values) { | |
d <- ncol(points) | |
shifts <- sapply( | |
1:d, | |
function(x) { max(points[, x]) - min(points[, x]) } | |
) | |
directions <- c(0, 1, -1) | |
all_shifts <- expand.grid( | |
lapply( |
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 | |
# -*- encoding: utf-8 -*- | |
from functools import reduce | |
from math import sqrt | |
from random import random | |
class MyRandomizer: |
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 | |
# -*- coding: utf-8 -*- | |
from sympy import pollard_rho | |
from sympy.core.numbers import igcd | |
from sympy.ntheory import sqrt_mod, nthroot_mod, isprime, factorint | |
from sympy.ntheory.modular import crt | |
with open('bbs.txt', 'r') as f: | |
xs = [int(x.rstrip()) for x in f.readlines()] |
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 | |
# -*- coding: utf-8 -*- | |
import numpy as np | |
from sympy import Poly, Symbol | |
from scipy.signal import fftconvolve | |
x = Symbol('x') | |
k = 19937 |
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 | |
# -*- coding: utf-8 -*- | |
import numpy as np | |
from functools import cmp_to_key | |
from pylab import * | |
from scipy import stats | |
def standard_simplex_draw_point(n): |
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 | |
# -*- coding: utf-8 -*- | |
import bisect | |
import numpy as np | |
from functools import total_ordering | |
from numpy.random import normal | |
from pylab import * | |
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 <algorithm> | |
#include <iostream> | |
#include <vector> | |
#include <csignal> | |
using std::cout; | |
using std::endl; | |
using vint = std::vector<int>; | |
int const kBase = 100; |
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
Add an option to use the existing Xorg session with | |
chrome-remote-desktop. | |
The original idea of the patch: https://superuser.com/a/850359 | |
--- a/chrome-remote-desktop 2024-03-27 16:03:20.518579015 +0000 | |
+++ b/chrome-remote-desktop 2024-03-27 16:17:58.241912847 +0000 | |
@@ -110,6 +110,8 @@ | |
X_LOCK_FILE_TEMPLATE = "/tmp/.X%d-lock" | |
FIRST_X_DISPLAY_NUMBER = 20 |
OlderNewer