Skip to content

Instantly share code, notes, and snippets.

@gagern
gagern / mx4488948.txt
Last active July 16, 2022 14:08
Assigning card suits to 𝔽₃ℙ²
https://math.stackexchange.com/a/4493218/35416
For each of the 52 incidences (columns), this table
shows the line coordinates, point coordinates, and
352 different suite assignments. The first 8 of
these have a 13-fold symmetry, the others don't.
0000000000000000111111111111111111112222222222222222
0000111111112222000000001111111122220000111111112222
1111000011111111000011110000111111111111000011111111
This file has been truncated, but you can view the full file.
https://math.stackexchange.com/q/4141558/35416
0 = (-d + R)*a^2
+ (-2*L)*a
+ (-d + R)
or
0 = (-c + L)*a^2
+ (-c - L)
https://math.stackexchange.com/a/4134048/35416
0 = (4*h^2 - 8*h*R + 4*R^2)*N^4
+ (-4*b^2*h - 4*e^2*h + 4*f^2*h - 12*h^3 + 4*b^2*R + 4*e^2*R - 4*f^2*R + 36*h^2*R - 40*h*R^2 + 16*R^3)*N^3
+ (b^4 + 2*b^2*e^2 + e^4 + 2*b^2*f^2 - 2*e^2*f^2 + f^4 + 16*b*e*f*h + 10*b^2*h^2 + 14*e^2*h^2 - 10*f^2*h^2 + 13*h^4 - 16*b*e*f*R - 20*b^2*h*R - 28*e^2*h*R + 20*f^2*h*R - 52*h^3*R + 8*b^2*R^2 + 16*e^2*R^2 - 12*f^2*R^2 + 88*h^2*R^2 - 72*h*R^3 + 24*R^4)*N^2
+ (-8*b*e^3*f - 2*b^4*h - 6*e^4*h - 4*b^2*f^2*h - 2*f^4*h - 24*b*e*f*h^2 - 8*b^2*h^3 - 12*e^2*h^3 + 8*f^2*h^3 - 6*h^5 + 2*b^4*R + 6*e^4*R + 4*b^2*f^2*R + 2*f^4*R + 48*b*e*f*h*R + 24*b^2*h^2*R + 36*e^2*h^2*R - 24*f^2*h^2*R + 30*h^4*R - 24*b*e*f*R^2 - 20*b^2*h*R^2 - 44*e^2*h*R^2 + 28*f^2*h*R^2 - 68*h^3*R^2 + 4*b^2*R^3 + 20*e^2*R^3 - 12*f^2*R^3 + 84*h^2*R^3 - 56*h*R^4 + 16*R^5)*N
+ (b^4*e^2 - 2*b^2*e^4 + e^6 + 2*b^2*e^2*f^2 + 2*e^4*f^2 + e^2*f^4 + 8*b*e^3*f*h + b^4*h^2 + 3*e^4*h^2 + 2*b^2*f^2*h^2 + f^4*h^2 + 8*b*e*f*h^3 + 2*b^2*h^4 + 3*e^2*h^4 - 2*f^2*h^4 + h^6 - 8*b*e^3
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gagern
gagern / CodeList.html
Created June 22, 2020 12:27
Hoedown code list issue
<p>Original problem:</p>
<ol>
<li><p>First item.</p></li>
<li><pre><code>Some code.
More code.
</code></pre>
<p>There is code here.</p></li>
</ol>
@gagern
gagern / switches.py
Last active June 2, 2020 10:16
Spinning switches
#!/usr/bin/python3
# https://github.com/shainer/spinning-switches citing a problem from
# “So you think you've got problems?” by Alex Bellos.
# This is optimizing for minimum number of operations in the worst case.
def allrot(x):
return [((x << i) | (x >> (4 - i))) & 0b1111 for i in range(4)]
def normal(x):
This file has been truncated, but you can view the full file.
dpkg-buildpackage -us -uc -ui -i -b
dpkg-buildpackage: info: source package sagemath
dpkg-buildpackage: info: source version 8.8-1~mvg1
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by Martin von Gagern <Martin.vGagern@gmx.net>
dpkg-source -i --before-build .
dpkg-buildpackage: info: host architecture amd64
dpkg-source: info: using options from sagemath/debian/source/options: --tar-ignore=debian/ccache --extend-diff-ignore=^(sage/m4/sage_spkg_configures.m4)
debian/rules clean
dh clean --with=python2,sphinxdoc
@gagern
gagern / MX2434673a.cc
Last active October 7, 2017 11:43
Numeric experiment on averge distance between points in Sierpinski triangle
// Numeric experiment for https://math.stackexchange.com/q/2434673/35416
#include <cmath>
#include <random>
#include <iostream>
#include <iomanip>
// Barycentric coordinates
struct vec {
double c[3];
@gagern
gagern / apachewrap.c
Created February 9, 2017 12:31
Run apache as non-root on privileged port
/*
* Copyright 2013 Martin von Gagern
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@gagern
gagern / emerge-blender.txt
Created January 25, 2017 20:29
Blender fails to emerge, can't seem to get USE flag in there
# USE=python_targets_python3_5 emerge --nodeps -1 blender
!!! Problem resolving dependencies for media-gfx/blender
!!! The ebuild selected to satisfy "blender" has unmet requirements.
- media-gfx/blender-2.78a-r1::gentoo USE="boost bullet dds doc elbeem ffmpeg fftw game-engine jack jpeg2k nls openexr openmp sdl sndfile tiff -collada -colorio -cuda -cycles -debug -headless -jemalloc -libav -llvm -man -ndof -openal -opencl -openimageio -opensubdiv -openvdb -player -test -valgrind" ABI_X86="64" PYTHON_TARGETS="-python3_5"
The following REQUIRED_USE flag constraints are unsatisfied:
python_targets_python3_5