Skip to content

Instantly share code, notes, and snippets.

@asmeurer
asmeurer / gist:805330
Created February 1, 2011 02:55
Attempt to build PyQt4-Mac
Aaron-Meurer:PyQt-mac-gpl-4.8.3 aaronmeurer$PATH=/usr/bin:/usr/local/Trolltech/Qt-4.4.3/bin:/usr/sbin:${PATH} systempython configure.py --verbose
Determining the layout of your Qt installation...
/usr/bin/qmake -spec macx-g++ -o qtdirs.mk qtdirs.pro
yes
make -f qtdirs.mk
g++ -c -pipe -g -gdwarf-2 -Wall -W -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Qt4.7/mkspecs/macx-g++ -I. -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/usr/include -I. -F/Library/Frameworks -o qtdirs.o qtdirs.cpp
g++ -headerpad_max_install_names -o qtdirs.app/Contents/MacOS/qtdirs qtdirs.o -F/Library/Frameworks -L/Library/Frameworks -framework QtCore
qtdirs.app/Contents/MacOS/qtdirs
This is the GPL version of PyQt 4.8.3 (licensed under the GNU General Public
License) for Python 2.7.1 on darwin.
@asmeurer
asmeurer / Wikipedia1.html
Created May 1, 2011 17:28
Wikipedia source test
<!DOCTYPE html>
<!-- Sysops: Please do not edit the main template directly; update /temp and synchronise. -->
<html lang="mul" dir="ltr">
<head>
<meta charset="utf-8" />
<title>Wikipedia</title>
<meta name="title" content="Wikipedia" />
<meta name="description" content="Wikipedia, the free encyclopedia that anyone can edit." />
@asmeurer
asmeurer / gist:987535
Created May 23, 2011 20:31
str(list) calls __repr__ instead of __str__
>>> class MyClass(object):
... def __repr__(self):
... return "repr"
... def __str__(self):
... return "str"
...
>>> repr(MyClass())
'repr'
>>> str(MyClass())
'str'
In [6]: meijerg((1, 2), (a, 4), (5,), [], x)
Out[6]:
G1,2 ⎛1, 2 a, 4 │ ⎞
4,1 ⎝ 5 │ x⎠
In [7]: meijerg((1/x, 2), (a, 4), (5,), [], x)
Out[7]:
⎛1 │ ⎞
╭─╮1, 2 ⎜─, 2 a, 4 │ ⎟
│╶┐ ⎜x │ x⎟
@asmeurer
asmeurer / gist:993982
Created May 26, 2011 20:18
poly vs. Poly
In [25]: %timeit Poly(p)
1 loops, best of 3: 735 ms per loop
In [26]: %timeit poly(p)
10 loops, best of 3: 97.2 ms per loop
In [27]: print p
_z0*(-6*_z0 + 6)**2*(-3*_z0 + 3)*(6*_z0 - 6)*(-8*_z0**2 + 16*_z0 - 8)*(8*_z0**2 - 16*_z0 + 8)*(-240*_z0**3 + 720*_z0**2 - 720*_z0 + 240)*(80*_z0**3 - 240*_z0**2 + 240*_z0 - 80)*(1280*_z0**4 - 5120*_z0**3 + 7680*_z0**2 - 5120*_z0 + 1280)**2*(-12800*2**(1/3)*_z0**2*(-634*_z0 - 104)*(6*_z0 - 6)**3*(-4*_z0**2 + 8*_z0 - 4)**3*(-240*_z0**3 + 720*_z0**2 - 720*_z0 + 240)**2*(-48*_z0**3 + 144*_z0**2 - 144*_z0 + 48)**2*(_z0**4 - 4*_z0**3 + 6*_z0**2 - 4*_z0 + 1)**2*(640*_z0**4 - 2560*_z0**3 + 3840*_z0**2 - 2560*_z0 + 640) + 7680*2**(1/3)*_z0**2*(-23*_z0 - 4)*(6*_z0 - 6)**3*(-4*_z0**2 + 8*_z0 - 4)**3*(144*_z0**2 - 288*_z0 + 144)*(-240*_z0**3 + 720*_z0**2 - 720*_z0 + 240)**2*(_z0**4 - 4*_z0**3 + 6*_z0**2 - 4*_z0 + 1)**2*(640*_z0**4 - 2560*_z0**3 + 3840*_z0**2 - 2560*_z0 + 640)*(1280*_z0**4 - 5120*_z0**3 + 7680*_z0**2 - 5120*_z0 + 1280) - 19200*2**(1/3)*_z0**2*(6*_z0 - 6)**3*(8*_z0
diff --git a/sympy/polys/polytools.py b/sympy/polys/polytools.py
index cb94fb9..588a1b3 100644
--- a/sympy/polys/polytools.py
+++ b/sympy/polys/polytools.py
@@ -5103,7 +5103,7 @@ def groebner(F, *gens, **args):
else:
return G
-def poly(expr, **args):
+def poly(expr, *gens, **args):
@asmeurer
asmeurer / gist:994066
Created May 26, 2011 20:58
gsoc diff
diff --git a/sympy/polys/polytools.py b/sympy/polys/polytools.py
index cb94fb9..588a1b3 100644
--- a/sympy/polys/polytools.py
+++ b/sympy/polys/polytools.py
@@ -5103,7 +5103,7 @@ def groebner(F, *gens, **args):
else:
return G
-def poly(expr, **args):
+def poly(expr, *gens, **args):
[tox]
envlist = py24,py25-32,py25-64,py26-32,py26-64,py27-32,py27-64,py27-64-gmpy,py26-64-gmpy,py25-64-gmpy, py24-32-gmpy, py25-32-gmpy, py26-32-gmpy, py27-32-gmpy
[testenv:py27-32]
basepython=/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
commands = python setup.py test
[testenv:py27-64]
basepython=/sw/bin/python2.7
commands = python setup.py test
@asmeurer
asmeurer / gist:1008684
Created June 5, 2011 05:29
64-bit Python risch_integrate(logarithms)
In [1]: for i in range(100):
...: print risch_integrate(Add(*(log(x**j) for j in range(i))), x)
...:
0
0
-x + x*log(x)
-3*x + 3*x*log(x**2)/2
-6*x + 3*x*log(x**2)
-10*x + 5*x*log(x**4)/2
-15*x + 15*x*log(x**4)/4