Skip to content

Instantly share code, notes, and snippets.

@gagern
gagern / emerge.log
Created January 3, 2017 17:15
emerge output showing conflicts between imagemagick and graphicsmagick
# # See https://forums.gentoo.org/viewtopic-t-1050078.html and https://bugs.gentoo.org/show_bug.cgi?id=554070
# emerge --pretend --verbose --update --deep --newuse media-gfx/imagemagick media-gfx/graphicsmagick @world 2>&1
These are the packages that would be merged, in order:
Calculating dependencies .. ... ...... .............. ... . . ... ... . ..... .. ........... .. . ............ .. ...... done!
[ebuild U ] app-arch/xz-utils-5.2.3::gentoo [5.2.2::gentoo] USE="nls threads -static-libs" ABI_X86="32 (64) (-x32)" 1.456 KiB
[ebuild U ] sys-devel/gnuconfig-20170101::gentoo [20161104::gentoo] 49 KiB
[ebuild U ] sys-process/lsof-4.89-r1::gentoo [4.89::gentoo] USE="ipv6 -examples -rpc (-selinux) -static" 767 KiB
@gagern
gagern / Condition.txt
Last active October 12, 2016 11:20
Extremal curvature of a Bezier curve
See http://math.stackexchange.com/q/1954845/35416
A Bézier curve has extremal curvature if the parameter is a root of the following polynomial:
t^7*(-4*x1^2*x2^2*y1^2 + 24*x1*x2^3*y1^2 - 36*x2^4*y1^2 + 16*x1^2*x2*x3*y1^2 - 120*x1*x2^2*x3*y1^2 + 216*x2^3*x3*y1^2 - 16*x1^2*x3^2*y1^2 + 192*x1*x2*x3^2*y1^2 - 468*x2^2*x3^2*y1^2 - 96*x1*x3^3*y1^2 + 432*x2*x3^3*y1^2 - 144*x3^4*y1^2 - 8*x1^2*x2*x4*y1^2 + 56*x1*x2^2*x4*y1^2 - 96*x2^3*x4*y1^2 + 16*x1^2*x3*x4*y1^2 - 176*x1*x2*x3*x4*y1^2 + 408*x2^2*x3*x4*y1^2 + 128*x1*x3^2*x4*y1^2 - 552*x2*x3^2*x4*y1^2 + 240*x3^3*x4*y1^2 - 4*x1^2*x4^2*y1^2 + 40*x1*x2*x4^2*y1^2 - 88*x2^2*x4^2*y1^2 - 56*x1*x3*x4^2*y1^2 + 232*x2*x3*x4^2*y1^2 - 148*x3^2*x4^2*y1^2 + 8*x1*x4^3*y1^2 - 32*x2*x4^3*y1^2 + 40*x3*x4^3*y1^2 - 4*x4^4*y1^2 - 4*x2^2*y1^4 + 16*x2*x3*y1^4 - 16*x3^2*y1^4 - 8*x2*x4*y1^4 + 16*x3*x4*y1^4 - 4*x4^2*y1^4 + 8*x1^3*x2*y1*y2 - 48*x1^2*x2^2*y1*y2 + 72*x1*x2^3*y1*y2 - 16*x1^3*x3*y1*y2 + 120*x1^2*x2*x3*y1*y2 - 144*x1*x2^2*x3*y1*y2 - 216*x2^3*x3*y1*y2 - 48*x1^2*x3^2*y1*y2 - 72*x1*x
@gagern
gagern / MX1925479a.svg
Created September 13, 2016 20:00
Affine plane of order 4
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gagern
gagern / SO39144006a.sh
Created August 26, 2016 18:34
Example git history setup
# Steps to reproduce the example from
# http://stackoverflow.com/q/39144006/1468366
git init .
echo a > txt
git add txt
git commit -m a
echo a > txt; git commit -a -m a
echo b > txt; git commit -a -m b
echo c > txt; git commit -a -m c
html,body,div,span,label{
margin: 0px;
padding: 0px;
border: none;
}
div.marker {
width: 6px;
height: 6px;
border-radius: 3px;
@gagern
gagern / fontconfig-error.txt
Created June 1, 2016 19:51
Exception due to missing fontconfig
java.lang.NullPointerException
at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264)
at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219)
at sun.awt.FontConfiguration.init(FontConfiguration.java:107)
at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:774)
at sun.font.SunFontManager$2.run(SunFontManager.java:431)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.SunFontManager.<init>(SunFontManager.java:376)
at sun.awt.FcFontManager.<init>(FcFontManager.java:35)
at sun.awt.X11FontManager.<init>(X11FontManager.java:57)
@gagern
gagern / polycycle.sage
Created May 27, 2016 00:32
Cycles of regular polygons
# http://math.stackexchange.com/q/1798630/35416
def polycycle(n, collected):
cf = CyclotomicField(n)
zeta = cf.gen()
corner = -2*(1 + zeta)/(1 + zeta + 1 + 1/zeta)
center = [corner*zeta^k for k in range(n)]
gra = []
for m in range(3, 7):
mn = (m - 2)*n
@gagern
gagern / EventDump.java
Created May 11, 2016 07:19
Dump KeyEvents from a JTextPane
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.text.*;
class EventDump extends KeyAdapter {
public static void main(String[] args) {
new EventDump();
}
@gagern
gagern / MX1721496a.sage
Created April 1, 2016 01:38
Compute two cocircularities for Math Stack Exchange question 1721496
sage: # http://math.stackexchange.com/q/1721496/35416
sage: # After Möbius transformations, the problem has 7 real degrees of freedom
sage: PR1.<x,y,c,e,f,m,n> = ZZ[]
sage: # We cancel common factors after almost every step to keep the polynomials shorter
sage: def simpl(v):
... try:
... return v.parent()(v / gcd(v.list()))
... except:
... return v
sage: # Möbius geometry: a circle is a 4 element vector of the form
@gagern
gagern / convex-hull-1.diff
Created March 22, 2016 16:36
Diff related to CindyJS #304
diff --git a/src/js/quick-hull-3d/COPYRIGHT b/src/js/quick-hull-3d/COPYRIGHT
deleted file mode 100644
index b478c5e..0000000
--- a/src/js/quick-hull-3d/COPYRIGHT
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * Copyright John E. Lloyd, 2004. All rights reserved. Permission to use,
- * copy, modify and redistribute is granted, provided that this copyright
- * notice is retained and the author is given credit whenever appropriate.