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
#!/bin/bash | |
# Find two dependency atoms referring to the same package | |
# See https://github.com/cschwan/sage-on-gentoo/pull/371 | |
shopt -s extglob | |
inherit() { :; } | |
replace_all_version_separators() { :; } | |
delete_version_separator() { :; } |
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
# See http://math.stackexchange.com/q/684834/35416 for details | |
var('a b x y r d') | |
var('R1', latex_name='R') | |
var('R2', latex_name="R'") | |
# The following two antiderivatives were found by Wolfram Alpha | |
upperArc(x) = -(b*arctan((b*x)/(sqrt(b^2-r^2)*sqrt(r^2-x^2))))/sqrt(b^2-r^2)+(b*arctan(x/sqrt(b^2-r^2)))/sqrt(b^2-r^2)+arctan(x/sqrt(r^2-x^2)) | |
lowerArc(x) = (-sqrt(b^2-r^2)*arctan(x/sqrt(r^2-x^2))+b*arctan((b*x)/(sqrt(b^2-r^2)*sqrt(r^2-x^2)))+b*arctan(x/sqrt(b^2-r^2)))/sqrt(b^2-r^2) | |
y1 = cosh(R1) | |
r1 = sinh(R1) | |
y2 = (cosh(d)+sinh(d))*cosh(R2) |
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
# This is an attempt to obtain numeric results for | |
# http://math.stackexchange.com/q/688861/35416 | |
# but the computation is smbolic since I'll want a derivative later on | |
a = var('a', latex_name='\\alpha', domain='positive') | |
b = var('b', latex_name='\\beta', domain='positive') | |
a0 = RDF(0.14778) | |
b0 = RDF(0.77656) | |
SRmu.<mu> = SR[] | |
farpoint1 = vector([1, b, 0]) |
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
# Exact computation to solve http://math.stackexchange.com/q/688861/35416, | |
# heavily inspired by https://groups.google.com/d/msg/sci.math/LYtIdRhk2ac/mQtEBcgCjZkJ | |
def printPoly(name, poly): | |
print(name + ":") | |
print(poly.denominator()*poly) | |
print("") | |
# a and b are the alpha and beta from http://math.stackexchange.com/a/698656/35416. | |
# We use approximate values to choose the right alternatives in some situations. |
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
from __future__ import with_statement | |
import gdb | |
class EclUtil(object): | |
def __init__(self, *args, **kwargs): | |
super(EclUtil, self).__init__(*args, **kwargs) | |
self.cl_object = gdb.lookup_type("cl_object").strip_typedefs() | |
self.cl_objectp = self.cl_object.pointer() |
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
fstat(3, {st_mode=S_IFREG|0644, st_size=164, ...}) = 0 | |
lseek(3, 0, SEEK_CUR) = 0 | |
+lseek(3, 0, SEEK_CUR) = 0 | |
fstat(3, {st_mode=S_IFREG|0644, st_size=164, ...}) = 0 | |
-dup(3) = 4 | |
-mmap(NULL, 164, PROT_READ, MAP_SHARED, 3, 0) = 0x... | |
-open("so23434490out.txt", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 5 | |
-fstat(5, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 | |
-ioctl(5, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, 0x...) = -1 ENOTTY (Inappropriate ioctl for device) | |
-fstat(5, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 |
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
sage: # http://math.stackexchange.com/a/779318/35416 | |
sage: P1.<x,y,z,w> = QQ[] | |
sage: p = x^3+y^3+z^3+w*x*y*z | |
sage: px, py, pz = [P1(p.polynomial(v).differentiate()) for v in [x, y, z]] | |
sage: px | |
y*z*w + 3*x^2 | |
sage: pxy = px.resultant(py, x) | |
sage: pxz = px.resultant(pz, x) | |
sage: pxyz = pxy.resultant(pxz, y) | |
sage: f = pxyz.factor() |
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
def rotmat(a, t=(0,0,1), l=False): | |
# Rotate by a degrees, then shift origin to point t. | |
# If l=True then transform lines not points. | |
x, y, z = t | |
q = QQ(a/360) | |
w = QQbar.zeta(q.denominator())^(q.numerator()) | |
c = AA(z*w.real()) | |
s = AA(z*w.imag()) | |
m = matrix(AA, [[c, -s, x], [s, c, y], [0, 0, z]]) | |
if l: |
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
# Terms for http://math.stackexchange.com/a/1057500/35416 | |
+ 16 z1^2 u2^2 ar^4 | |
+ 32 z1^2 u2 v2 ar^4 | |
+ 16 z1^2 v2^2 ar^4 | |
+ 32 z1^2 u2^2 ar^2 ai^2 | |
+ 64 z1^2 u2 v2 ar^2 ai^2 | |
+ 32 z1^2 v2^2 ar^2 ai^2 | |
+ 16 z1^2 u2^2 ai^4 | |
+ 32 z1^2 u2 v2 ai^4 |
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
var fs = require("fs"); | |
var symbols = require("./src/symbols"); | |
var todo = 0; | |
var files = fs.readdirSync("static/fonts"); | |
files.forEach(function(file) { | |
if (file.substr(file.length - 4) !== ".ttx") | |
return; | |
++todo; | |
fs.readFile("static/fonts/" + file, "utf-8", doTTX.bind(null, file)); |
OlderNewer