Skip to content

Instantly share code, notes, and snippets.

#define SIZE "5"
*#include- include/color.h
#define RANK "6"
*
* The file with all the declarations for running color traces.
* The variable RANK tells how many Adjoint invariants of how many
* non-adjoint invariants can occur simultaneously. For 14 vertices
* this number is maximally 4 (4 loops in a non-adjoint representation)
*
* Note: One needs version 3 of FORM to run this.
@tueda
tueda / gen-supp.sh
Created May 22, 2024 23:06
Generate Valgrind suppression file.
#!/bin/bash
# Save Valgrind output to a temporary file
valgrind_output=$(mktemp)
# Run Valgrind and save its output to the temporary file
# Capture only standard error output
valgrind --leak-check=full --gen-suppressions=all "$@" 2> "$valgrind_output" 1>/dev/null
# Output the suppression entries to standard output
var args = WScript.Arguments;
if (args.length !== 1) {
WScript.Echo("Please drag and drop an Excel file onto this script.");
WScript.Quit();
}
var filePath = args(0);
try {
On Highfirst;
*--#[ jodavies_include :
* Paste denexpand.prc
* Expand a "den" function DEN in the variable EP. This is useful in cases
* where we have isolated the dependence on the EP symbol, and cannot merge
* everything into a common PolyRatFun without exceeding MaxTermSize.
@tueda
tueda / docker_ip_range.md
Last active May 16, 2024 02:55
Dockerとイントラネットが衝突したときの対処法 #docker #config
ip addr
docker network inspect bridge

Workaround

/etc/docker/daemon.json

{
#!/bin/sh
for f in "$@"; do
git blame -e "$f"
done | awk -F'<' '{print $2}' | awk -F'>' '{print $1}' | sort | uniq -c | sort -nr
# Returns NaN.
function nan() {
return "+NaN" + 0
}
# Returns the binomial coefficient.
# It works, at least, when either n or k is a non-negative integer.
function binom(n, k, tmp) {
if (n == k || k == 0) {
return 1
=LAMBDA(
LET(
upRange, INDIRECT(ADDRESS(1, COLUMN()) & ":" & ADDRESS(ROW() - 1, COLUMN())),
lastNumber, LOOKUP(2, 1 / ISNUMBER(upRange), upRange),
IF(ISNUMBER(lastNumber),
lastNumber + 1,
""
)
)
)
@tueda
tueda / makeImage.m
Created December 25, 2023 14:15
Save a plot on WolframCloud.
(* cf. https://mathematica.stackexchange.com/a/278798 *)
makeImage[g_] := Block[{$ImageResolution = 300},
Export[CloudObject["output.png"], g, "PNG"];
Show[g]
];