tag:blogger.com,1999:blog-65687441969826342892024-02-18T21:16:39.252-08:00Ondřej ČertíkAnonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.comBlogger35125tag:blogger.com,1999:blog-6568744196982634289.post-20336036964494413882013-08-04T00:40:00.002-07:002013-08-04T00:48:05.502-07:00How to support both Python 2 and 3<p>I'll start with the conclusion: making backwards incompatible version of a language is a terrible idea, and it was bad a mistake. This mistake was somewhat corrected over the years by eventually adding features to both Python 2.7 and 3.3 that actually allow to run a single code base on both Python versions --- which, as I show below, was discouraged by both Guido and the official Python documents (though the latest <a href="http://docs.python.org/dev/howto/pyporting.html">docs</a> mention it)... Nevertheless, a single code base fixes pretty much all the problems and it actually is fun to use Python again. The rest of this post explains my conclusion in great detail. My hope is that it will be useful to other Python projects to provide tips and examples how to support both Python 2 and 3, as well as to future language designers to keep languages backwards compatible.</p>
<p>When Python 3.x got released, it was pretty much a new language, backwards incompatible with Python 2.x, as it was not possible to run the same source code in both versions. I was extremely unhappy about this situation, because I simply didn't have time to port all my Python code to a new language.</p>
<p>I read the <a href="http://www.python.org/dev/peps/pep-3000/#compatibility-and-transition">official documentation</a> about how the transition should be done, quoting:</p>
<blockquote>
<p>You should have excellent unit tests with close to full coverage.</p>
<ol>
<li>Port your project to Python 2.6.</li>
<li>Turn on the Py3k warnings mode.</li>
<li>Test and edit until no warnings remain.</li>
<li>Use the 2to3 tool to convert this source code to 3.0 syntax. Do not manually edit the output!</li>
<li>Test the converted source code under 3.0.</li>
<li>If problems are found, make corrections to the 2.6 version of the source code and go back to step 3.</li>
<li>When it's time to release, release separate 2.6 and 3.0 tarballs (or whatever archive form you use for releases).</li>
</ol>
</blockquote>
<p>I've also read Guido's blog <a href="http://www.artima.com/weblogs/viewpost.jsp?thread=208549">post</a>, which repeats the above list and adds an encouraging comment:</p>
<blockquote>
<p>Python 3.0 will break backwards compatibility. Totally. We're not even aiming for a specific common subset.</p>
</blockquote>
<p>In other words, one has to maintain a Python 2.x code base, then run <code>2to3</code> tool to get it converted. If you want to develop using Python 3.x, you can't, because all code must be developed using 2.x. As to the actual porting, Guido says in the above post:</p>
<blockquote>
<p>If the conversion tool and the forward compatibility features in Python 2.6 work out as expected, steps (2) through (6) should not take much more effort than the typical transition from Python 2.x to 2.(x+1).</p>
</blockquote>
<p>So sometime in 2010 or 2011 I started porting <a href="http://sympy.org">SymPy</a>, which is now a pretty large code base (<code>sloccount</code> says over 230,000 lines of code, and in January 2010 it said almost 170,000 lines). I remember spending a few full days on it, and I just gave up, because it wasn't just changing a few things, but pretty fundamental things inside the code base, and one cannot just do it half-way, one has to get all the way through and then polish it up. We ended up using one full Google Summer of Code project for it, you can read the <a href="https://github.com/sympy/sympy/wiki/GSoC-2011-Report-Vladimir-Peric%3A-Porting-to-Python-3">final report</a>. I should mention that we use metaclasses and other things, that make such porting harder.
Conclusion: this was definitely not "the typical transition from Python 2.x to 2.(x+1)".</p>
<p>Ok, after months of hard work by a lot of people, we finally have a Python 2.x code base that can be translated using the <code>2to3</code> tool and it works and tests pass in Python 3.x.</p>
<p>The next problem is that Python 3.x is pretty much like a ghetto --
you can use it as a user, but you can't develop in it. The <code>2to3</code> translation takes over 5 minutes on my laptop, so any interactivity is gone. It is true that the tool can cache results, so the next pass is somewhat faster, but in practice this still turns out to be much much worse than any compilation of C or Fortran programs (done for example with <code>cmake</code>), both in terms of time and in terms of robustness.
And I am not even talking about pip <a href="https://github.com/pypa/pip/issues/701">issues</a> or setup.py <a href="https://github.com/sympy/sympy/pull/2262">issues</a> regarding calling <code>2to3</code>.
What a big mess... Programming should be fun, but this is not fun.</p>
<p>I'll be honest, this situation killed a lot of my enthusiasm for Python as a platform. I learned modern Fortran in the meantime and with admiration I noticed that it still compiles old F77 programs without modification and I even managed to compile a 40 year old pre-F77 code
with just minimal modifications (I had to port the code to F77). Yet modern Fortran is pretty much a completely different language, with all the fancy features that one would want. Together with my colleagues I created a <a href="http://fortran90.org">fortran90.org</a> website, where you can compare Python/NumPy side by side with modern Fortran, it's pretty much 1:1 translation and a similar syntax (for numerical code), except that you need to add types of course. Yet Fortran is fully backwards compatible. What a pleasure to work with!</p>
<p>Fast forward to last week. A heroic effort by <a href="https://github.com/flacjacket">Sean Vig</a> who ported SymPy to single code base (<a href="https://github.com/sympy/sympy/pull/2318">#2318</a>) was merged. Earlier this year similar pull requests by other people have converted NumPy (<a href="https://github.com/numpy/numpy/pull/3178">#3178</a>,
<a href="https://github.com/numpy/numpy/pull/3191">#3191</a>,
<a href="https://github.com/numpy/numpy/pull/3201">#3201</a>,
<a href="https://github.com/numpy/numpy/pull/3202">#3202</a>,
<a href="https://github.com/numpy/numpy/pull/3203">#3203</a>,
<a href="https://github.com/numpy/numpy/pull/3205">#3205</a>,
<a href="https://github.com/numpy/numpy/pull/3208">#3208</a>,
<a href="https://github.com/numpy/numpy/pull/3216">#3216</a>,
<a href="https://github.com/numpy/numpy/pull/3223">#3223</a>,
<a href="https://github.com/numpy/numpy/pull/3226">#3226</a>,
<a href="https://github.com/numpy/numpy/pull/3227">#3227</a>,
<a href="https://github.com/numpy/numpy/pull/3231">#3231</a>,
<a href="https://github.com/numpy/numpy/pull/3232">#3232</a>,
<a href="https://github.com/numpy/numpy/pull/3235">#3235</a>,
<a href="https://github.com/numpy/numpy/pull/3236">#3236</a>,
<a href="https://github.com/numpy/numpy/pull/3237">#3237</a>,
<a href="https://github.com/numpy/numpy/pull/3238">#3238</a>,
<a href="https://github.com/numpy/numpy/pull/3241">#3241</a>,
<a href="https://github.com/numpy/numpy/pull/3242">#3242</a>,
<a href="https://github.com/numpy/numpy/pull/3244">#3244</a>,
<a href="https://github.com/numpy/numpy/pull/3245">#3245</a>,
<a href="https://github.com/numpy/numpy/pull/3248">#3248</a>,
<a href="https://github.com/numpy/numpy/pull/3249">#3249</a>,
<a href="https://github.com/numpy/numpy/pull/3257">#3257</a>,
<a href="https://github.com/numpy/numpy/pull/3266">#3266</a>,
<a href="https://github.com/numpy/numpy/pull/3281">#3281</a>,
<a href="https://github.com/numpy/numpy/pull/3191">#3191</a>, ...) and SciPy (<a href="https://github.com/scipy/scipy/pull/397">#397</a>) codes as well.
Now all these projects have just one code base and it works in all Python versions (2.x and 3.x) without the need to call the <code>2to3</code> tool.</p>
<p>Having a single code base, programming in Python is fun again. You can choose any Python version, be it 2.x or 3.x, and simply submit a patch. The patch is then tested using <a href="https://travis-ci.org/">Travis-CI</a>, so that it works in all Python versions. Installation has been simplified (no need to call any <code>2to3</code> tools and no more hacks to get <code>setup.py</code> working).</p>
<p>In other words, this is how it should be, that you write your code once, and you can use any supported language version to run it/compile it, or develop in. But for some reason, this obvious solution has been discouraged by Guido and other Python documents, as seen above. I just looked up the latest official Python <a href="http://docs.python.org/dev/howto/pyporting.html">docs</a>, and that one is not upfront negative about a single code base. But it still does not recommend this approach as <em>the</em> one. So let me fix that: I do recommend a single code base as <em>the</em> solution.</p>
<p>The newest Python documentation from the last paragraph also mentions</p>
<blockquote>
<p>Regardless of which approach you choose, porting is not as hard or time-consuming as you might initially think.</p>
</blockquote>
<p>Well, I encourage you to browse through the pull requests that I linked to above for SymPy, NumPy or SciPy. I think it is very time consuming, and that's just converting from <code>2to3</code> to single code base, which is the easy part. The hard part was to actually get SymPy to work with Python 3 (as I discussed above, that took couple months of hard work), and I am pretty sure it was pretty hard to port NumPy and SciPy as well.</p>
<p>The docs also says:</p>
<blockquote>
<p>It /single code base/ does lead to code that is not entirely idiomatic Python</p>
</blockquote>
<p>That is true, but our experience has been, that with every Python version that we drop, we also delete lots of ugly hacks from our code base. This has been true for dropping support for 2.3, 2.4 and 2.5, and I expect it will also be true for dropping 2.6 and especially 2.7, when we can simply use the Python 3.x syntax. So not a big deal overall.</p>
<p>To sum this blog post up, as far as I am concerned, pretty much all the problems with supporting Python 2.x and 3.x are fixed by having a single code base. You can read the pull requests above to see how to implemented things (like metaclasses, and other fancy stuff...). Python is still quite the same language, you write your code, you use a Python version of your choice and things will just work. Not a big deal overall. The official documentation should be fixed to recommend this approach, and deprecate the other approaches.</p>
<p>I think that Python is great and I hope it will be used more in the future.</p>
<blockquote>
<p>Written with <a href="http://benweet.github.io/stackedit/">StackEdit</a>.</p>
</blockquote>Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com0tag:blogger.com,1999:blog-6568744196982634289.post-19687604740472613732013-07-01T20:03:00.002-07:002013-07-02T11:05:05.379-07:00My impressions from the SciPy 2013 conferenceI have attended the <a href="https://conference.scipy.org/scipy2013/">SciPy 2013 conference</a> in Austin, Texas. Here are my impressions.<br />
<br />
Number one is the fact that the <a href="http://ipython.org/notebook.html">IPython notebook</a> was used by pretty much everyone. I use it a lot myself, but I didn't realize how ubiquitous it has become. It is quickly becoming the standard now. The IPython notebook is using Markdown and in fact it is better than Rest. The way to remember the "[]()" syntax for links is that in regular text you put links into () parentheses, so you do the same in Markdown, and append [] for the text of the link. The other way to remember is that [] feel more serious and thus are used for the text of the link. I stressed several times to <a class="g-profile" href="http://plus.google.com/105051551851350439748" target="_blank">+Fernando Perez</a> and <a class="g-profile" href="http://plus.google.com/110706953761515533762" target="_blank">+Brian Granger</a> how awesome it would be to have interactive widgets in the notebook. Fortunately that was pretty much preaching to the choir, as that's one of the first things they plan to implement good foundations for and I just can't wait to use that.<br />
<br />
It is now clear, that the IPython notebook is <i>the</i> way to store computations that I want to share with other people, or to use it as a "lab notebook" for myself, so that I can remember what exactly I did to obtain the results (for example how exactly I obtained some figures from raw data). In other words --- instead of having sets of scripts and manual bash commands that have to be executed in particular order to do what I want, just use IPython notebook and put everything in there.<br />
<div>
<br /></div>
Number two is that how big the conference has become since the last time I attended (couple years ago), yet it still has the friendly feeling. Unfortunately, I had to miss a lot of talks, due to scheduling conflicts (there were three parallel sessions), so I look forward to seeing them on video.<br />
<br />
<a class="g-profile" href="http://plus.google.com/111657756858197263626" target="_blank">+Aaron Meurer</a> and I have done the <a href="https://conference.scipy.org/scipy2013/tutorial_detail.php?id=101">SymPy tutorial</a> (see the link for videos and other tutorial materials). It's been nice to finally meet <a class="g-profile" href="http://plus.google.com/109882876523836932473" target="_blank">+Matthew Rocklin</a> (very active SymPy contributor) in person. He also had an interesting presentation<br />
about symbolic matrices + Lapack code generation. <a class="g-profile" href="http://plus.google.com/110966557175293116547" target="_blank">+Jason Moore</a> presented PyDy.<br />
It's been a great pleasure for us to invite <a class="g-profile" href="http://plus.google.com/112898427768461421869" target="_blank">+David Li</a> (still a high school student) to attend the conference and give a presentation about his work on <a href="http://sympygamma.com/">sympygamma.com</a> and <a href="http://live.sympy.org/">live.sympy.org</a>. <br />
<br />
It was nice to meet the Julia guys, <a class="g-profile" href="http://plus.google.com/104556984762576706263" target="_blank">+Jeff Bezanson</a> and <a class="g-profile" href="http://plus.google.com/106011176106265292073" target="_blank">+Stefan Karpinski</a>. I contributed the Fortran benchmarks on the Julia's website some time ago, but I had the feeling that a lot of them are quite artificial and not very meaningful. I think Jeff and Stefan confirmed my feeling. Julia seems to have quite interesting type system and multiple dispatch, that SymPy should learn from.<br />
<br />
I met the VTK guys <a class="g-profile" href="http://plus.google.com/117876587154330177046" target="_blank">+Matthew McCormick</a> and <a class="g-profile" href="http://plus.google.com/101821293118663904053" target="_blank">+Pat Marion</a>. One of the keynotes was given by <a class="g-profile" href="http://plus.google.com/105850319012996814544" target="_blank">+Will Schroeder</a> from Kitware about publishing. I remember him stressing to manage dependencies well as well as to use BSD like license (as opposed to viral licenses like GPL or LGPL). That opensource has pretty much won (i.e. it is now clear that that is the way to go).<br />
<br />
I had great discussions with <a class="g-profile" href="http://plus.google.com/110321315348047026192" target="_blank">+Francesc Alted</a>, <a class="g-profile" href="http://plus.google.com/106486100774697058597" target="_blank">+Andy Terrel</a>, <a class="g-profile" href="http://plus.google.com/101681894269884323551" target="_blank">+Brett Murphy</a>, <a class="g-profile" href="http://plus.google.com/106311201257953729437" target="_blank">+Jonathan Rocher</a>, <a class="g-profile" href="http://plus.google.com/104443012252347946160" target="_blank">+Eric Jones</a>, <a class="g-profile" href="http://plus.google.com/110081663265512493333" target="_blank">+Travis Oliphant</a>, <a class="g-profile" href="http://plus.google.com/113023052893273684980" target="_blank">+Mark Wiebe</a>, <a class="g-profile" href="http://plus.google.com/111480164393314519931" target="_blank">+Ilan Schnell</a>, <a class="g-profile" href="http://plus.google.com/104831275312843762750" target="_blank">+Stéfan van der Walt</a>, <a class="g-profile" href="http://plus.google.com/108585099026155174191" target="_blank">+David Cournapeau</a>, <a class="g-profile" href="http://plus.google.com/116439624339414215461" target="_blank">+Anthony Scopatz</a>, <a class="g-profile" href="http://plus.google.com/105656345164808608690" target="_blank">+Paul Ivanov</a>, <a class="g-profile" href="http://plus.google.com/105753151742916635749" target="_blank">+Michael Droettboom</a>, <a class="g-profile" href="http://plus.google.com/102862681530523589739" target="_blank">+Wes McKinney</a>, <a class="g-profile" href="http://plus.google.com/101985752635828670051" target="_blank">+Jake Vanderplas</a>, <a class="g-profile" href="http://plus.google.com/115993532093165217430" target="_blank">+Kurt Smith</a>, <a class="g-profile" href="http://plus.google.com/105827017409315158569" target="_blank">+Aron Ahmadia</a>, <a class="g-profile" href="http://plus.google.com/110786793649177800375" target="_blank">+Kyle Mandli</a>, <a class="g-profile" href="http://plus.google.com/103293634823298090368" target="_blank">+Benjamin Root</a> and others. <br />
<br />
<br />
It's also been nice to have a chat with <a class="g-profile" href="http://plus.google.com/105603936345485877784" target="_blank">+Jason Vertrees</a> and other guys from <a href="https://www.schrodinger.com/">Schrödinger</a>.<br />
<br />
One other thing that I realized last week at the conference is that pretty much everyone agreed on the fact that NumPy should act as the default way to represent memory (no matter if the array was created in Fortran or other code) and allow manipulations on it. Faster libraries like <a href="http://blaze.pydata.org/">Blaze</a> or <a href="http://blog.enthought.com/general/enthought-awarded-1m-doe-sbir-grant-to-develop-open-source-python-hpc-framework/">ODIN</a> should then hook themselves up into NumPy using <a href="http://en.wikipedia.org/wiki/Multiple_dispatch">multiple dispatch</a>. Also SymPy would then hook itself up so that it can be used with array operations natively. Currently SymPy does work with NumPy (see our <a href="https://github.com/sympy/sympy/blob/master/sympy/external/tests/test_numpy.py">tests</a> for some examples what works), but the solution is a bit fragile (it is not possible to override NumPy behavior, but because NumPy supports general objects, we simply give it SymPy objects and things mostly work).<br />
<br />
Similar to this, I would like to create multiple dispatch in SymPy core itself, so that other (faster) libraries for symbolic manipulation can hook themselves up, so that their own (faster) multiplication, expansion or series expansion would get called instead of the SymPy default one implemented in pure Python.<br />
<br />
Other blog posts from the conference:<br />
<ul>
<li>Aaron's <a href="http://asmeurersympy.wordpress.com/2013/07/02/scipy-2013/">post</a></li>
<li>Fernando's <a href="http://blog.fperez.org/2013/07/in-memoriam-john-d-hunter-iii-1968-2012.html">post</a></li>
</ul>
Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com0tag:blogger.com,1999:blog-6568744196982634289.post-73747220014465144852012-06-04T18:18:00.000-07:002012-06-04T18:18:17.332-07:00How to convert scanned images to pdfFrom time to time I need to convert scanned documents to a pdf format.<br />
<i><br /></i><br />
<i>Usage scenario 1</i>: I scan part of a book (i.e. some article) on a school's scanner that sends me 10 big separate color pdf files (one pdf per page). I want to get one nice, small (black and white) pdf file with all the pages.<br />
<i><br /></i><br />
<i>Usage scenario 2</i>: I download a web form, print it, fill it in, sign it, scan it on my own scanner using Gimp and now I want to convert the image into a nice pdf file (either color or black & white) to send back over email.<br />
<br />
<i>Solution</i>: I save the original files (be it pdf or png) into a folder and use git to track it. Then create a simple reduce script to convert it to the final format (view it as a pipeline). Often I need to tweak one or two parameters in the pipeline.<br />
<br />
Here is a script for scenario 1:<br />
<script src="https://gist.github.com/2871625.js?file=reduce2.sh">
</script>
<br />
And here for scenario 2:<br />
<script src="https://gist.github.com/2871625.js?file=reduce1.sh">
</script>
<br />
There can be several unexpected surprises along the way. From my experience:<br />
<br />
<ul>
<li>If I convert png directly to tiff, sometimes the resolution can be wrong. The solution is to always convert to ppm (color) or pbm (black and white) first, which is just a simple file format containing the raw pixels. This is the "starting" format (so first I need to convert the initial pdf or png into ppm/pbm) and then do anything else. That proved to be very robust.</li>
<li>The <span style="font-family: 'Courier New', Courier, monospace;">tiff2pdf</span> utility proved to be the most robust way to convert an image to a pdf. All other ways that I have tried failed in one way or another (resolution, positioning, paper format and other things were wrong....). It can create multiple pages pdf files, set paper format (US Letter, A4, ...) and so on.</li>
<li>The linux <span style="font-family: 'Courier New', Courier, monospace;">convert</span> utility is a robust tool for cropping images, converting color to black and white (using a threshold for example) and other things. As long as the image is first converted to ppm/pbm. In principle it can also produce pdf files, but that didn't work well for me.</li>
<li>I sometimes use the <a href="http://unpaper.berlios.de/">unpaper</a> program in the pipeline for some automatic polishing of the images.</li>
</ul>
<div>
In general, I am happy with my solution. So far I was always able to get what I needed using this "pipeline" method.</div>Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com9tag:blogger.com,1999:blog-6568744196982634289.post-78816111692860977992012-01-26T10:49:00.000-08:002012-01-26T10:51:28.645-08:00When double precision is not enoughI was doing some finite element (FE) calculation and I needed the sum of the lowest 7 eigenvalues of a symmetric matrix (that comes from the FE assembly) to converge to at least 1e-8 accuracy (so that I can check calculation done by some other solver of mine, that calculates the same but doesn't use FE). In reality I wanted the rounded value to 8 decimal digits to be correct, so I really needed 1e-9 accuracy (but it's ok if it is let's say 2e-9, but not ok if it is 9e-9). With my FE solver, I couldn't get it to converge more than to roughly 5e-7 no matter how hard I tried. Now what?<br />
<br />
When doing the convergence, I take a good mesh and keep increasing "p" (the polynomial order) until it converges. For my particular problem, it is fully converged for about p=25 (the solver supports the order up to 64). Increasing "p" further will not increase the accuracy anymore, and the accuracy stays at the level 5e-7 for the sum of the lowest 7 eigenvalues. For optimal meshes, it converges at p=25, for not optimal meshes, it converges for higher "p", but in all cases, it doesn't get below 5e-7.<br /><br />
I know from experience, that for simpler problems, the FE solver can easily converge to 1e-10 or more using double precision. So I know it is doable, now the question is what the problem is: there<br />
are a few possible reasons:<br />
<br />
<ul>
<li>The FE quadrature is not accurate enough</li>
<li>The condition number of the matrix is high, thus LAPACK doesn't return very accurate eigenvalues</li>
<li>Bug in the assembly/solver (like single/double corruption in Fortran, or some other subtle bug)</li>
</ul>
When using the same solver for simpler potential, it converged nicely to 1e-10. So this suggests there is no bug in the assembly or solver itself. It is possible that the quadrature is not accurate enough, but again, if it converges for simple problem, it's probably not it. So it seems it is the ill conditioned matrix, that causes this. So I printed the residuals (that I simply calculated in Fortran using the matrix and the eigenvectors returned by LAPACK), and it only showed 1e-9. For simpler problems, it can go to 1e-14 easily. So that must be it. How do we fix it?<br />
<br />
Obviously by making the matrix less ill conditioned, which is caused by the mesh for the problem (the ratio of the longest/shortest elements is 1e9) but for my problem I really needed such a mesh. So the other option is to increase the real number accuracy.<br />
<br />
In Fortran all real variables are defined as real(dp), where dp is an integer defined at a single place in the project. There are several ways to define it, but it's value is 8 for gfortran and it means double precision.
So I increased it to 16 (quadruple precision), recompiled. Now the whole program calculates in quadruple precision (more than 30 significant digits). I had to recompile LAPACK using the "-fdefault-real-8" gfortran option, that promotes all double precision numbers to quadruple precision, and I used the "d" versions (double precision, now promoted to quadruple) of LAPACK routines.
<br /><br />
I rerun the calculation ---- and suddenly LAPACK residuals are around 1e-13, and the solver converges to 1e-10 easily (for the sum of the lowest 7 eigenvalues). Problem solved.
<br /><br />
Turning my Fortran program to quadruple precision is as easy as changing one variable and recompiling. Turning LAPACK to quadruple precision is easy with a single gfortran flag (LAPACK uses the old f77 syntax for double precision, if it used real(dp), then I would simply change it as for my program). The whole calculation got at least 10x slower with quadruple. The reason is that gfortran runtime uses the libquadmath library, that simulates quadruple precision (as current CPUs only support double precision natively).
<br /><br />
I actually discovered a few bugs in my program (typically some constants in older code didn't use the "dp" syntax, but had the double precision hardwired). Fortran warns about all such cases, when the real variables have incompatible precision.
<br /><br />
It is amazing how easy it is to work with different precision in Fortran (literally just one change and recompile). How could this be done with C++? This wikipedia <a href="http://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format">page</a> suggests, that "long double" is only 80bit in most cases (quadruple is 128bit), but gcc offers __float128, so it seems I would have to manually change all "double" to "__float128" in the whole C++ program (this could be done with a single "sed" command).Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com8tag:blogger.com,1999:blog-6568744196982634289.post-68250084185378620442010-11-18T18:10:00.000-08:002010-11-18T18:52:55.589-08:00Google Code vs GitHub for hosting opensource projects<a href="http://cython.org/">Cython</a> is now considering options where to move the main (mercurial) repository, and <a href="http://www.math.washington.edu/~robertwb/">Robert Bradshaw</a> (one of the main Cython developers) has asked me about my experience with regards to <a href="http://code.google.com/hosting/">Google Code</a> and <a href="http://github.com/">GitHub</a>, since we use both with <a href="http://sympy.org/">SymPy</a>.<br /><br />Google Code is older, and it was the first service that provided free (virtually unlimited) number of projects that you could easily and immediately setup. At that time (4 years ago?) that was something unheard of. However, the GitHub guys in the meantime not only made this available too, but also implemented features, that (as far as I know) no one offers at all, in particular hosting your own pages at your own domain (but at GitHub's servers, some examples are <a href="http://sympy.org">sympy.org</a> and <a href="http://docs.sympy.org/">docs.sympy.org</a>), commenting on git branches and pull requests <span style="font-style:italic;">before</span> the code gets merged in (I am 100% convinced that this is the right approach, as opposed to comment on the code <span style="font-style:italic;">after</span> it gets in), allow to easily fork the repository and it has simply more social features, that the Google Code doesn't have.<br /><br />I believe that managing an opensource project is mainly a social activity, and GitHub's social features really make so many things easier. From this point of view, GitHub is clearly the best choice today.<br /><br />I think there is only one (but potentially big) problem with GitHub, that its issue tracker is very bad, compared to the Google Code one. For that reason (and also because we already use it), we keep our issues at Google Code with SymPy.<br /><br />The above are the main things to consider. Now there are some little things to keep in mind, that I will briefly touch below: Google Code doesn't support git and blocks access from Cuba and other countries, when you want to change the front page, you need to be an admin, while at GitHub I simply add push access to all sympy developers, so anyone just pushes a patch to this repository: <a href="https://github.com/sympy/sympy.github.com">https://github.com/sympy/sympy.github.com</a>, and it automatically appears on our front page (<a href="http://sympy.org/">sympy.org</a>), with Google Code we had to write long pages (in our docs) about how to send patches, with GitHub we just say, send us a pull request, and point to: <a href="http://help.github.com/pull-requests/">http://help.github.com/pull-requests/</a>. In other words, GitHub takes care of teaching people how to use git and figure out how to send patches, and we can concentrate on reviewing the patches and pushing them in. <br /><br />Wikipages at github are maintained in git, and they provide the webfrontend to it as <a href="https://github.com/github/gollum">opensource</a>, so there is no vendor lock-in. Anyone with github account can modify our wiki pages, while the Google Code pages can only be modified by people that I add to the Google Code project, which forced us to install mediawiki on my linode server (hosted at <a href="http://linode.com/">linode.com</a>, which by the way is an excellent VPS hosting service, that I have been using for couple of years already and I can fully recommend it), and I had to manage it all the time, and now we are moving our pages to the github wiki, so that I have one less thing to worry about.<br /><br />So as you can see, I, as admin, have less things to worry about, as github manages everything for me now, while with Google Code, I had to manage lots of things on my linodes.<br /><br />One other thing to consider is that GitHub is only for git, but they also provide svn and hg access (both push and pull, they translate the repository automatically between git and svn/hg), I never really used it much, so I don't know how stable this is. As I wrote <a href="http://ondrejcertik.blogspot.com/2010/10/git-has-won.html">before</a>, I think that git is the best tool now for maintaining a project, and I think that github is now the best choice to host it (except the issue tracker, where Google Code is better).Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com16tag:blogger.com,1999:blog-6568744196982634289.post-89336682591958594622010-10-31T00:26:00.000-07:002010-10-31T00:40:59.989-07:00git has wonI switched to git from mercurial about two years ago. See here why I <a href="http://ondrejcertik.blogspot.com/2008/08/i-am-switching-from-mercurial-to-git.html">switched</a> and here my experience <a href="http://ondrejcertik.blogspot.com/2008/12/experience-with-git-after-4-months.html">after 4 months</a>. Back then I was unsure, whether git will win, but I thought it has a bigger momentum. Well, I think that now it's quite clear that git has already won. Pretty much everybody that I collaborate with is using git now.<br /><br />I use github everyday, and now thanks to github <a href="http://help.github.com/pull-requests/">pull requests</a>, I think it's the best collaboration platform out there (compared to Google Code, Sourceforge, Bitbucket or Launchpad).<br /><br />I think it's partly because the github guys have a clear vision of what has to be done in order to make collaboration more easier and they do it, but more importantly that git branches is the way to go, as well as other git features, that are "right" from the beginning (branches, interactive rebase, and so on), while other VCS like bzr and mercurial simply either don't have them, or are getting them, but it's hard to get used to it (for example mercurial uses the "mercurial queues", and I think that is the totally wrong approach to things).<br /><br />Anyway, this is just my own personal opinion. I'll be happy to discuss it in the comments, if you disagree.Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com22tag:blogger.com,1999:blog-6568744196982634289.post-11617440025488854832010-07-19T22:57:00.000-07:002010-07-20T00:00:39.254-07:00Theoretical Physics Reference BookToday I fulfilled my old dream --- I just created my first book! Here is how it looks like:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgasBbsj2FFU4dAOC05yYuBabfevpeMCIWxAVmRwIHgRYdrd-3BtiskVXk_pL6A-WVj5ehLxjUccc40fTEfyr49-I648lTuHmcKJn-kKIiNpdmv727Owv0YR5OFptjtjXhIjpyfN7qisNIG/s1600/Jul_19_2010_3169.jpg"><img style="cursor:pointer; cursor:hand;width: 300px; height: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgasBbsj2FFU4dAOC05yYuBabfevpeMCIWxAVmRwIHgRYdrd-3BtiskVXk_pL6A-WVj5ehLxjUccc40fTEfyr49-I648lTuHmcKJn-kKIiNpdmv727Owv0YR5OFptjtjXhIjpyfN7qisNIG/s400/Jul_19_2010_3169.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5495867261164653778" /></a><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjw5jUVDxhoNPJG9i9wo0OwZ2VjAbUylZCEDIELN2QwLS-z_GR3fQv6U08XJmpXuGYzoLKo_Hbc90RIpzxtd1vZ2l_r8HjnXbftGghRYyBZWOuvFJOH-rl-etQgWvVV3WEGRHeybllv8Q31/s400/Jul_19_2010_914.jpg" style="cursor:pointer; cursor:hand;width: 400px; height: 300px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5495867250591418786" /><br />More images<br /><a href="http://picasaweb.google.com/ondrej.certik/TheoreticalPhysicsReference">here</a>.<br /><br />Here is the source code of the book: <a href="http://github.com/certik/theoretical-physics">http://github.com/certik/theoretical-physics</a>, the repository contains a branch 'master' with the code and 'gh-pages' with the generated html pages, that are hosted at github, at the url <a href="http://theoretical-physics.net">theoretical-physics.net</a>.<br /><br />Then I published the book at Lulu: <a href="http://www.lulu.com/product/hardcover/theoretical-physics-reference/11612144">http://www.lulu.com/product/hardcover/theoretical-physics-reference/11612144</a>, I wanted a hardcover book, so I setup a project at Lulu, used some Lulu templates for the cover and that was it. Lulu's price for the book is $19.20 (166 black & white pages, hardcover), then I can set my own price and the rest of the money probably goes to me. I set the price to $20, because Lulu has free shipping for orders $20 or more. You can also download the pdf (for free) at the above link (or just use my git repository). So far this didn't cost me anything.<br /><br />I have then ordered the book myself (just like anybody else would, at the above address) and it arrived today. It's a regular hardcover book. Beautiful, you can browse the pictures above. It smells deliciously (that you have to believe me). And all that it cost me was $19.20.<br /><br />As for the contents itself, you can browse it online at <a href="http://theoretical-physics.net">theoretical-physics.net</a>, essentially it's most of my physics notes, that I collected over the years. I'd like to treat books like software --- release early release often. This is my first release and I would call it beta. The main purpose of it was to see if everything goes through, how long it takes (the date inside the book is July 4, 2010, I created and ordered it on July 5, got the physical book on July 19) and what the quality is (excellent). I also wanted to see how the pages correspond to the pdf (you can see for yourself on the photos, click on the picasa link above).<br /><br />Now I need to improve the first pages a bit, as well as the last pages, improve the index, write some foreword and so on. I also need to think how to better organize the contents itself and generally improve it. I also need to figure out some versioning scheme, so far this is version 0.1. I think I'll do edition 1, edition 2, edition 3, and so on. And whenever I feel that I have added enough new content, I'll just publish it as a new edition. So if you want to buy it, I suggest to wait for my 1.0 version, that will have the mentioned improvements.<br /><br />It'd be also cool to have all the editions online somehow and create nice webpages for it (currently theoretical-physics.net points directly to the book html itself).<br /><br />So far the book is just text. I still need to figure out how to handle pictures and also whether or not to use program examples (in Python, using sympy, scipy, etc.). So far I am inclining not to put there any program codes, as then I don't need to maintain them.<br /><br />Overall I am very pleased with the quality, up to some minor issues that I mentioned above, everything else end up just fine. I think we have come a long way from the discovery of the <a href="http://en.wikipedia.org/wiki/Printing_press">printing press</a>. Anybody can now create a book for free, and if you want to hold the hardcopy in your hands, it costs around $20. You don't need to order certain amounts of books, nor partner with some publisher etc. I think that's just awesome.Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com12tag:blogger.com,1999:blog-6568744196982634289.post-5919328100928752102009-12-13T19:38:00.000-08:002009-12-13T20:49:51.310-08:00ESCO 2010 conferenceAn interesting conference <a href="http://hpfem.org/events/esco-2010/">2nd European Seminar on Coupled Problems</a> (ESCO) will be held on June 28 — July 2, 2010 in Pilsen, Czech Republic.<br />Among the <a href="http://hpfem.org/events/esco-2010/topics/">topics</a> are solving PDEs and applications and using Python for scientific computing. In particular, <a href="http://gael-varoquaux.info/">Gaël Varoquaux</a> is the keynote speaker.<br /><br />Unfortunately, it was later <a href="http://blog.jarrodmillman.com/2009/11/scipy-2010-coming-to-austin-tx-628-74.html">announced</a> that the SciPy 2010 conference is going to be at the same time, which is really unfortunate. But here are some reasons why you should consider going to ESCO 2010 instead:<br /><ul><li>If you like numerical calculations (finite elements, differences, volumes, ...) and solving partial differential equations and other problems and also programming in Python, together with C/C++ or Fortran, you will have a chance to meet some of the top people in the field. SciPy conference usually has people who solve PDEs (e.g. SciPy 09 had about 6), but ESCO 2010 will have about 60. So ESCO wins.</li><br /><li><a href="http://ntc.zcu.cz/en/staff/cimrman_r.html">Robert Cimrman</a>, who you probably know from the scipy and numpy mailinglists, also the author of the <a href="http://code.google.com/p/sfepy/">sfepy</a> FEM package in Python, lives in Pilsen, so he'll gladly show you some good Pilsen pubs. SciPy 2010 is going to be in Austin and while Austin has cool pubs too, I must be fair and I liked that (I was there at the <a href="http://ondrejcertik.blogspot.com/2008/03/sage-days-8.html">Sage 08 days</a>), but it's just not comparable, the beer is better in Pilsen, it's a historic city and there are more pubs.</li><br /><li>Pilsen is close to Prague, so you will have the chance to visit it. You should walk in the old town, have couple beers etc. Here you can see some photos that <a href="http://gael-varoquaux.info/journal/prague/index.html">Gaël took</a> when we met in Prauge. Again, this is incomparable with <a href="http://www.smallplanetguide.com/rentals/images/austin/soco_view.jpg">Austin</a>.</li><br /><li>It is held in the <a href="http://www.prazdroj.cz//en/come-and-visit/pilsen-brewery/lease-of-premises">Pilsner Urquell Brewery</a>. When <a href="http://hpfem.math.unr.edu/people/pavel/">Pavel Šolín</a> announced that at the SciPy 09 conference, <a href="http://blog.jarrodmillman.com/">Jarrod</a> asked "Ah, in a beer pub?". So let me be clear. The word <a href="http://en.wikipedia.org/wiki/Pilsener">pilsner</a> (type of the beer) is coming from the Czech city Pilsen (Plzeň in Czech). Pilsner Urquell is not some beer pub (e.g. even Reno where I live now has a beer pub), it's The Brewery. Austin is a cool place (and Texas steaks are really good), but as you can see now, it absolutely cannot compete with Pilsen.<br /></li></ul><br /><br />If you have time, I can fully recommend to go to ESCO 2010.Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com4tag:blogger.com,1999:blog-6568744196982634289.post-88681154797583964412009-08-24T22:18:00.001-07:002009-08-24T23:04:31.069-07:00SciPy 2009 ConferenceI attended the <a href="http://conference.scipy.org/">SciPy 2009</a> conference last week at Caltech. <br /><br />When I first presented about <a href="http://sympy.org/">SymPy</a> at the scipy 07 conference exactly 2 years ago, it was just something that we started, so noone really used that. Last week, there were already 6 other people at the conference who contributed one or more patches to SymPy: Robert Kern, Andrew Straw, Pauli Virtanen, Brian Granger, Bill Flynn, Luke Peterson.<br /><br />I gave a SymPy <a href="http://www.archive.org/details/scipy09_advancedTutorialDay1_4">tutorial</a>, <a href="http://www.archive.org/details/scipy09_day1_13-Ondrej_Certik">main presentation</a> and <a href="http://dlpeterson.com/blog/">Luke</a> gave a <a href="http://pydy.org">PyDy</a> + SymPy <a href="http://www.archive.org/details/scipy09_day1_17-Lightning_talks_5-8">lightning talk</a> (seek to 16:04).<br /><br />I also gave my experience with designing a traits GUI for FEM <a href="http://www.archive.org/details/scipy09_day1_18-Lightning_talks_9-13">lightning talk</a> (seek to 5:35).<br /><br />My advisor <a href="http://hpfem.math.unr.edu/people/pavel/">Pavel Solin</a> gave a <a href="http://www.archive.org/details/scipy09_day2_03-Pavel_Solin">talk</a> about <a href="http://hpfem.org/main/hermes.php">Hermes</a> and <a href="http://femhub.org/">FEMhub</a> and other things that we do in <a href="http://hpfem.org/">our group in Reno</a>.<br /><br />Besides that, it was awesome to meet all the guys from the scientific Python community, meet old friends and also get to know other people that I only knew from the lists. I was pleased to meet there people who solve PDE using Python, we had many fruitful discussions together, and as a result, I already created FEMhub spkg packages for <a href="http://www.ctcms.nist.gov/fipy/">FiPy</a>, other will follow. Our aim is to create a nice interface to all of them, so that we can easily test a problem in any PDE package and see how it performs.<br /><br />Overall, my impression is very positive. I am very glad I chose Python as my main language many years ago, all the essential parts are now getting there, e.g. numerics (numpy, scipy, ...), symbolic (sympy, Sage, ...), 2d plotting (matplotlib, ...), 3d plotting (mayavi), GUI (traits UI, which supports both GTK, QT on linux and native widgets on Mac and Windows, and Sage notebook for web), excellent documentation tool with equations support (Sphinx), lots of supporting libraries, like sparse solvers and then very easy way to wrap C/C++ code using Cython and to speed up critical parts of the Python code using Cython. It's not that each of those libraries is the best in the world --- in fact, not a single one is --- but together as an ecosystem, plus the high level of (free) support on the lists for all of those libraries, this in my opinion makes Python a number one choice for scientific computing, together with C, C++ and sometimes Fortran for CPU intensive tasks and/or legacy libraries.Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com4tag:blogger.com,1999:blog-6568744196982634289.post-50633690885402107152009-05-10T12:14:00.000-07:002009-05-10T12:47:29.401-07:00My experience with running an opensource projectNir Aides, the author of the excellent <a href="http://winpdb.org/">winpdb</a> debugger, sent me the following email on September 21, 2008, so I asked him if I can copy his email and reply in form of a blog post (so that other people can comment and join the discussion) and he agreed. It took me almost a year to reply, but I made it. :)<br /><br /><blockquote>Hi Ondrej,<br /><br />How are you?<br /><br />I am about to publish a new free software project, a new simple PHP framework, and I am interested in your advice.<br /><br />You started <a href="http://sympy.org/">SymPy</a> and were able to make other people join you and develop it with you.<br />How did you do it?<br />How did it happen?<br />Did you actively call for other people or they spontaneously showed interest and joined you?<br />Are the other major contributor people who were your friends before you started the project?<br />Did you need to create or manage the project in a particular way to make it attractive to other people?<br />Are there things you are aware of that promote collaboration or demote it?<br /><br />I was never successful in doing the same with Winpdb, which while it became reasonably popular, no one has ever joined me to develop it, except for a notable tutorial contribution by Chris Lasher which was developed independently.<br /><br />Now with the new project, I am wondering what are my chances of making other people try it and take it on. On the one hand it is a new and fresh code base in an interesting field, on the other hand, why would anyone bother to spend their energy on this new project when they have Symfony or Drupal?<br /><br />What do you think?<br /><br />BTW, Ohloh believes you have a median of 19,000 lines of changed code per month since the start of their log. Can this be true? Is this humanly possible? According to it SymPy has over 1,000,000 lines of code? I can't understand these numbers. Winpdb has about 25,000 lines after 3 years of development. And from my experience 1,000,000 lines of code projects need about 20-50 full time developers to work on for 2-5 years which is about 40-250 man years. And as if this is not enough you are listed as owner in a dozen other projects in Google code and have enough time to become an awarded scientist. How is this possible?<br /><br /><a href="http://www.ohloh.net/p/sympy/contributors/">http://www.ohloh.net/p/sympy/contributors/</a><br /><br />BTW2, do you still use Winpdb? If you find yourself using it less, can you say what are the reasons, or what it would take to make it more useful?<br /><br />BTW3, How is SymPy doing?<br /><br />Cheers,<br />Nir</blockquote><br /><br /><br />So my most honest answer how to run a successful opensource project is: I don't know.<br /><br />But nevertheless I tried to summarize some of my ideas and experience and some guidelines that I try to follow, maybe it will be useful to you Nir, or anyone else.<br /><br />First of all, there has to be a public mailinglist (easily accessible), public bug tracker, nice webpage, easy to find downloads, frequent releases (once a month is good, but in the worst case at least 4 times a year) and a set of guidelines to follow in order to contribute. So that's a must, if the project doesn't have the above, it's almost impossible to become successful. However, that is just a start, just a playground. There are still many projects that have the above and yet they totally fail to attract developers.<br /><br />So I think the most important principle is that I always think how to employ other people in what I do. If I have some plan in my head how to do something, e.g. how to move some things forward, I always create exact steps and put it to issues, or our mailinglist, so that each step can be done by someone who is completely new to sympy. So I try to look at things from other people's perspective and think -- ok, I quite like this SymPy project and I'd like to get this done (for example a new release, or something fixed, or implemented), but I have no idea how to start and what exactly needs to be done.<br /><br />So what I try to do if someone comes to our list and asks for something, is that I create a new issue for it and think how I would fix it if I had time. Then write the necessary steps in the issue and invite the submitter to fix it and I offer help with explaining anything and guiding. Now there are two things that can happen. Either the submitter has time and a will to go forward and in this case he starts wrestling with it and whenever he has some code or a question, I need to find time, review it and offer some way out. Or the submitter is too busy, in which case the instructions simply rest in the issues and the next time someone asks for the feature, the instructions are already there. I don't have estimates how frequent either case is.<br /><br />When I am working on something myself, I try not to code privately, but also put up issues first and put the steps needed in the issues, so that it's easy for other people to join in.<br /><br />In general, the most precious value for me is the fact that someone else had to sit down at his computer and wrote the patch. So I do everything possible to get new (or more) people interested in the development. Some people think that only super programmers can do a decent job and it's useless to invest time in people that may just have started with Python. They are wrong. Among the SymPy developers (around 65 people total have contributed patches so far at the time of writing this post), we have all kinds of people. We have people from high school, we have a retired US army engineer, we have physicists, mathematicians, biologists, engineers, teachers, or just hobbyists, who do it for fun. Unfortunately, we do not have many women (I think no patch that made it into sympy was contributed by a woman, but I may be wrong), so if anyone has any ideas how to get more women involved, let me know (I know we have several women fans, so that's a good start:). We have people whose first open source project they ever contributed to was sympy and people who are new to Python.<br /><br />Many times the first patch that a new potential developer submits is not perfect, usually it's faster for me to write it myself, than to help with the first patch, however my rule is to always help the submitter do that. Sometimes he sends a second patch, or a third, and usually it needs less and less work on my side and it already pays off, because he is then able to fix things himself, if he discovers a bug and sympy has just won a one more contributor.<br /><br />So I came to the conclusion that all that is needed is an enthusiasm. You don't even have to know Python (as you can learn all these things on the way) and you can still do useful things for us and really spare our time.<br /><br />To answer another question from Nir's email, SymPy has about 130000 lines of code and another about 20000 lines of tests, so I think those stats are wrong. Also the changed lines of code is in my opinion wrong, we usually have about 250 new patches per release (this depends how often we release and other things).<br /><br />Yes, I am involved in couple other projects, e.g. Debian, Sage, ipython, scipy, <a href="http://hpfem.org/">hpfem.org</a> (and couple more), basically everything that has to do with numeric simulation and Python, but my activity there varies. The most time consuming thing in the last couple years was definitely school, I was finishing my master in Theoretical Physics in Prague and then moved to the Nevada/Reno and I just finished my first semester here at PhD in Chemical Physics, and sometimes it was just crazy, e.g. I finished teaching at 7pm and instead of going home and sleep, I stayed in my office, fixed 10 sympy issues that were holding off a release, finished at 1am, went home (by bike, since I don't have a car yet), slept couple hours and then did just school again for a week, other people reviewed the issues in the meantime, and then I made the release (instead of sleeping again). In the last semester it was not unusual that I got home at 1am every week day, then slept most of Saturday to catch up, on Sunday I did some laundry and shopping, and the rest of time I did grading and homeworks for all my classes and teaching, no time for anything else (e.g. no friends, no girls, no rest, no hobby, no opensource stuff, nothing). So sometimes one has to work pretty hard to get through it, but fortunately it's behind me finally, if all goes well, I should be just doing research from now on and have a real life too. Also I am sorry I didn't manage to reply sooner. :)<br /><br />To answer the other questions: <blockquote>Are the other major contributor people who were your friends before you started the project?</blockquote> No, not a single major contributor was my friend before I started the project. Every single one of them become a developer using the procedure I described above, e.g. first showed on the list or in the issues, and maybe even the very first patch was not a high quality one (and if I was stupid and arrogant, or didn't see the big potential, I would just ignore them). But when given a chance, they became extremely good developers and sympy would simply just not be here without them.<br /><br /><blockquote>Did you actively call for other people or they spontaneously showed interest and joined you?</blockquote> I very much encourage everyone to contribute, but the initial interest must be in them, e.g. they at least have to show around the mailinglist/issues, so that I know about them. But once I know they are interested in some issue, yes, I try to invite them to fix it, with my help.<br /><br />One observation I made is that I have to always think in the spirit "how to earn new money, not how to spare the money I already have", e.g. when applied to sympy, how to get new developers, how to develop the new great things etc. Even if I am super busy as I was, I still have to think this way. Once I start thinking how to conserve and preserve what we already have, I am done, finished and that's the road to hell.<br /><br />If I am open, positive, full of energy, I can see people joining me and we can do great things together. It probably sounds obvious, but it was not for me, when for example some people I worked with, started their own projects, when I got busy, and started to compete, instead of helping sympy out. And I felt betrayed, after so much work that I invested into it and started to become protective. And then I realised that's wrong. I can never stop other people do what they want to do. If they want to have their own project, they will have it. If they don't want to help sympy out, they won't (and what is more important, there is nothing wrong with either of that). It's that simple and being protective only makes things worse.<br /><br />There is also a question of the license that you use for the project, e.g. one should basically only choose between BSD (maybe also MIT or Apache), LGPL and GPL (there are also several versions of the GPL licenses). Unfortunately the fact is, that there are people who will never contribute a code under a permissive BSD license (because it's not protecting their work enough) and there are also other people who really want to code to be BSD (or other permissive license) so they can sell it and they don't need to consult with lawyers what they are or aren't allowed to do and also so that they can combine it with any other code (opensource or not). It also depends if one wants to combine (and distribute) other codes together. So choosing a license is also important. I believe that for sympy BSD is the best and for other projects (like Sage) GPL is the best and one has to decide on a case by case basis. For Winpdb, I would make it BSD too, since you can get more people using it.<br /><br />To conclude, SymPy is a little more than 2 years old, and it has been a great ride so far and more things are coming, e.g. this summer we have 5 Google Summer of Code students and people are starting it to use in their research and we plan to use it in our codes at <a href="http://hpfem.math.unr.edu/">our group</a> here in Reno too, so things look promising. I am really glad, we managed to build such a community, so that when I am busy, as I was the last semester, other people help out with patches, reviews and other things, so that the project doesn't stall and when I got rid of my school duties now, we can move things forward a lot.<br /><br />So maybe you can get inspired by some of the ideas above. I am also interested in any discussion about this (feel free to post a comment below, or send me an email, or just write to a sympy list about what you think).Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com6tag:blogger.com,1999:blog-6568744196982634289.post-86756753878934356732009-03-17T14:12:00.000-07:002009-03-17T16:32:53.008-07:00Newtonian Mechanics with SymPy<a href="http://dlpeterson.com/">Luke Peterson</a> from UC Davis came to visit me in Reno and we spent the last weekend hacking on the Python Dynamics package that uses <a href="http://sympy.org/">SymPy</a> to calculate equations of motion for basically any rigid body system.<br /><br />On Friday we did some preliminary work, mostly on the paper, Luke showed me his rolling torus demo that he did with the proprietary <a href="http://www.autolev.com/">autolev</a> package. We set ourselves a goal to get this implemented in SymPy by the time Luke leaves and then we went to the <a href="http://www.atlantiscasino.com/">Atlantis casino</a> together with my boss Pavel and other guys from the <a href="http://www.dri.edu/">Desert Research Institute</a> and I had my favourite meal here, a big burger, fries and a beer.<br /><br />On Saturday we started to code and had couple lines of the autolev torus script working. Then we went on the bike ride from Reno to California. I took some pictures with Luke's iphone:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7HcRccG0_6XUcIfu1V6rVCTCemJO8w-oltGBZB76eMRtSZPabpYyAzuaS_ndQMciDyNd8V8Q_iD1FML3-IC9Qnv0-sHRmHnu7WNVTQOJ4Gm6AFsL5n5Ybx_2D1bSbCpB8Zd2qzJkscmz1/s1600-h/Lukes+iPhone+pics+041.jpg"><img style="cursor: pointer; width: 182px; height: 136px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7HcRccG0_6XUcIfu1V6rVCTCemJO8w-oltGBZB76eMRtSZPabpYyAzuaS_ndQMciDyNd8V8Q_iD1FML3-IC9Qnv0-sHRmHnu7WNVTQOJ4Gm6AFsL5n5Ybx_2D1bSbCpB8Zd2qzJkscmz1/s400/Lukes+iPhone+pics+041.jpg" alt="" id="BLOGGER_PHOTO_ID_5314269145531440290" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuWakMGTKF98R7iJaw_BXulwaMhWRTQWn_Br4-V1yrQE_wBQRdADfrfEegOyNNE9a9d-U-Lm6EODkNly_vIDuPCRnuTgW8XVy4SFouNyRohwtRyPVqFxMhIO2XBo52YqvtdaT4ZWohUaEn/s1600-h/Lukes+iPhone+pics+034.jpg"><img style="cursor: pointer; width: 183px; height: 137px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuWakMGTKF98R7iJaw_BXulwaMhWRTQWn_Br4-V1yrQE_wBQRdADfrfEegOyNNE9a9d-U-Lm6EODkNly_vIDuPCRnuTgW8XVy4SFouNyRohwtRyPVqFxMhIO2XBo52YqvtdaT4ZWohUaEn/s400/Lukes+iPhone+pics+034.jpg" alt="" id="BLOGGER_PHOTO_ID_5314269136015505234" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_lgBQt9vmxFB0zrheoY2YNIBhtDhbtAL0qnNJzLT9UjgU5tk0QxKeUDLsMd5AaBjRuoew8TOpZMPsmO3g8JjrJ1zDwXST_j7OsjegwJE3zKgsecrkYCCkUzCP1yA4Z8cX-HAsmU5UDZ-E/s1600-h/Lukes+iPhone+pics+031.jpg"><img style="cursor: pointer; width: 183px; height: 137px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_lgBQt9vmxFB0zrheoY2YNIBhtDhbtAL0qnNJzLT9UjgU5tk0QxKeUDLsMd5AaBjRuoew8TOpZMPsmO3g8JjrJ1zDwXST_j7OsjegwJE3zKgsecrkYCCkUzCP1yA4Z8cX-HAsmU5UDZ-E/s400/Lukes+iPhone+pics+031.jpg" alt="" id="BLOGGER_PHOTO_ID_5314268888791214258" border="0" /></a><br /><br />Those mountains are in California and we went roughly to the snow line level and back:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0FIx4-OOlK9DXlfYRSnf2Koz9sqppVxklTc6oEdDhqIKVy57mYTsnk3XaGi1asvB8eOoBJZfoh3mL1bVMf20Zx04qg37Ze7DfBeEW38FKm-GfJzkCpG0sJz4TF2CbaIGkUdWBG-H5YNwd/s1600-h/Lukes+iPhone+pics+036.jpg"><img style="cursor: pointer; width: 189px; height: 234px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0FIx4-OOlK9DXlfYRSnf2Koz9sqppVxklTc6oEdDhqIKVy57mYTsnk3XaGi1asvB8eOoBJZfoh3mL1bVMf20Zx04qg37Ze7DfBeEW38FKm-GfJzkCpG0sJz4TF2CbaIGkUdWBG-H5YNwd/s400/Lukes+iPhone+pics+036.jpg" alt="" id="BLOGGER_PHOTO_ID_5314269142103885570" border="0" /></a><br />This is Nevada side:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAZfVZBrnnGW7Wcvx1hoqt9i_-yHWz7lV7l2zAUjoQX_kGK9e2iy9nLDd_O4Igsm3o6rBrjjZtWzQv1crChAEgy8XS5DRPsfmNtxH-0xjVQ6dobwL9eOb6hqfqmmzKenchbrpP9m8FaoQ1/s1600-h/Lukes+iPhone+pics+028.jpg"><img style="cursor: pointer; width: 195px; height: 258px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAZfVZBrnnGW7Wcvx1hoqt9i_-yHWz7lV7l2zAUjoQX_kGK9e2iy9nLDd_O4Igsm3o6rBrjjZtWzQv1crChAEgy8XS5DRPsfmNtxH-0xjVQ6dobwL9eOb6hqfqmmzKenchbrpP9m8FaoQ1/s400/Lukes+iPhone+pics+028.jpg" alt="" id="BLOGGER_PHOTO_ID_5314268885988442306" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGnF6iSyNtv6NvPOwNlKcy-l1s89FtE3PmFuuNGRm0Lt0BDuJRHhkdkAQExHL35n_GXwGcMvN_GSZknfJYYo1XQzlVGdVSaso2G3hYTDCqV4QOsrh868hQQJr0U_X-soRc-6khyphenhyphenZDexLub/s1600-h/Lukes+iPhone+pics+010.jpg"><img style="cursor: pointer; width: 345px; height: 259px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGnF6iSyNtv6NvPOwNlKcy-l1s89FtE3PmFuuNGRm0Lt0BDuJRHhkdkAQExHL35n_GXwGcMvN_GSZknfJYYo1XQzlVGdVSaso2G3hYTDCqV4QOsrh868hQQJr0U_X-soRc-6khyphenhyphenZDexLub/s400/Lukes+iPhone+pics+010.jpg" alt="" id="BLOGGER_PHOTO_ID_5314268876326040546" border="0" /></a><br /><br />That was fun. Then we worked hard and by the evening we had a dot product and a cross product working, so we went to an Irish pub to have couple beers and I had my burger as usual.<br /><br />On Sunday we spent the whole day and evening coding and we got the equations of motion working. On Monday we worked very hard again:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilB29qkC6kplBa8h5FPs0tAJncb7nuSYMf8vAnYAaHK5ewPI2nh4JJJRJqJtfqZUjOyrwgQYhqw66VBydV2DAduVfXuycz8IJgKkBuUjJNYVdfkO_wGBZub-gYXZOzqr67QEHjL5-tOPa7/s1600-h/Lukes+iPhone+pics+007.jpg"><img style="cursor: pointer; width: 286px; height: 381px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilB29qkC6kplBa8h5FPs0tAJncb7nuSYMf8vAnYAaHK5ewPI2nh4JJJRJqJtfqZUjOyrwgQYhqw66VBydV2DAduVfXuycz8IJgKkBuUjJNYVdfkO_wGBZub-gYXZOzqr67QEHjL5-tOPa7/s400/Lukes+iPhone+pics+007.jpg" alt="" id="BLOGGER_PHOTO_ID_5314268870545152994" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBoTvLJWvjzSQglBWc59Gf3J8sAqzkICWbqqduKJBXhYGims0XjHoSOwyLx0uLzxglpurIsUj2z0GmhcFSFmB4jx4vcuQZyM_HLD08xybDso3sraIWXU2uji31a6s0WIlnmQe3QQaTL8oQ/s1600-h/Lukes+iPhone+pics+056.jpg"><img style="cursor: pointer; width: 287px; height: 382px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBoTvLJWvjzSQglBWc59Gf3J8sAqzkICWbqqduKJBXhYGims0XjHoSOwyLx0uLzxglpurIsUj2z0GmhcFSFmB4jx4vcuQZyM_HLD08xybDso3sraIWXU2uji31a6s0WIlnmQe3QQaTL8oQ/s400/Lukes+iPhone+pics+056.jpg" alt="" id="BLOGGER_PHOTO_ID_5314269149442728610" border="0" /></a><br /><br />and fixed some remaining nasty bugs. I taught Luke to use git, so our code is at: <a href="http://github.com/hazelnusse/pydy">http://github.com/hazelnusse/pydy</a>, for the time being we call it pydy and after we polish everything, we'll probably put it into sympy/physics/pydy.py. If you run rollingtorus.py, you get this plot of the trajectory of the torus in a plane:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0VaqpDRl6f2VdUf8J4ghm3owZ_GTK2HOcENQnfOjoB2I0wxegBniVzKWEEOpCLp4MVnq9ICq0ESDUmI1sPX7-byOeQHmDa-wtHHgKQKZoLi2xujYAsOGY_94wtbM9ljNF04yCHDXeltj-/s1600-h/rollingtorus-xy.png"><img style="cursor: pointer; width: 400px; height: 300px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0VaqpDRl6f2VdUf8J4ghm3owZ_GTK2HOcENQnfOjoB2I0wxegBniVzKWEEOpCLp4MVnq9ICq0ESDUmI1sPX7-byOeQHmDa-wtHHgKQKZoLi2xujYAsOGY_94wtbM9ljNF04yCHDXeltj-/s400/rollingtorus-xy.png" alt="" id="BLOGGER_PHOTO_ID_5314294354298991490" border="0" /></a><br />It's basically if you throw a coin on the table, e.g. this model takes into account moments of inertia, yaw (heading), lean, spin and the x-y motion in the plane. Depending on the initial conditions, you can get many different trajectories, e.g for example:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQyWcoNBHdUJX8_UYt3GQ5KtCTcak-25j14uKoVQiSEMz05EipXP13q-PnYbPGpYT4bQqG5Kx1Kxbu5XTGxef0EHzwBuMG0b9y6thT_Q3ugP6UouBFAaWfdia4LE0eq04gpmqst-lRRhc5/s1600-h/rollingtorus-xy2.png"><img style="cursor: pointer; width: 400px; height: 300px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQyWcoNBHdUJX8_UYt3GQ5KtCTcak-25j14uKoVQiSEMz05EipXP13q-PnYbPGpYT4bQqG5Kx1Kxbu5XTGxef0EHzwBuMG0b9y6thT_Q3ugP6UouBFAaWfdia4LE0eq04gpmqst-lRRhc5/s400/rollingtorus-xy2.png" alt="" id="BLOGGER_PHOTO_ID_5314295922025517746" border="0" /></a><br />or:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ4zZLkFfdbB47YYvTvIJH0iHySvI-YEz4N5xnnH-mTkYTUcXEio2SliFizspiR8Fo0nhMACp3pwtvLQ3zlDD5lQfIYkKvxb2ydlp-2OjW7wR6rygcTroqsxV8WAjQ71sIsq-pcj1Ol9iy/s1600-h/rollingtorus-xy3.png"><img style="cursor: pointer; width: 400px; height: 300px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ4zZLkFfdbB47YYvTvIJH0iHySvI-YEz4N5xnnH-mTkYTUcXEio2SliFizspiR8Fo0nhMACp3pwtvLQ3zlDD5lQfIYkKvxb2ydlp-2OjW7wR6rygcTroqsxV8WAjQ71sIsq-pcj1Ol9iy/s400/rollingtorus-xy3.png" alt="" id="BLOGGER_PHOTO_ID_5314295923724551362" border="0" /></a><br /><br />This is very exciting, as the code is very short, and most of the things that Luke needs are needed for all the other applications of sympy, e.g. a good printing of equations and vectors (both in the terminal and in latex), C code generation, fast handling of expressions, nice ipython terminal for experimentation, plotting, etc.<br /><br />Together with the atomic physics package that we <a href="http://ondrejcertik.blogspot.com/2008/10/google-mentor-summit-iii.html">started to develop</a> with Brian sympy will soon be able to cover some basic areas of physics. Other areas are general relativity (there is some preliminary code in examples/advanced/relativity.py) and quantum field theory and Feynman diagrams - for that we need someone enthusiastic that needs this for his/her research --- if you are interested, drop me an email, you can come to Reno (or work remotely) and we can get it done.<br /><br />My vision is that sympy should be able to handle all areas of physics, e.g. it needs good assumptions (if you want to help out, please help us test Fabian's patches <a href="http://groups.google.com/group/sympy-patches/browse_thread/thread/0b6fd5402e729f58">here</a>), then faster core, we have a pretty good optional <a href="http://ondrejcertik.blogspot.com/2008/08/sympy-core-in-cython-general-cas-design.html">Cython core</a> here, so we'll be merging it after the new assumptions are in place. Then sympy should have basic modules for most areas in physics so that one can get started really quickly. From our experience so far in sympy/physics, those modules will not be big, as most of the functionality is not module specific.Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com6tag:blogger.com,1999:blog-6568744196982634289.post-69099769279155250752008-12-23T17:03:00.000-08:002008-12-23T17:15:14.955-08:00Experience with git after 4 monthsI <a href="http://ondrejcertik.blogspot.com/2008/08/i-am-switching-from-mercurial-to-git.html">switched</a> to git from mercurial about 4 months ago. As Matt Mackall (the main author of mercurial) has <a href="http://selenic.com/pipermail/mercurial/2008-August/020876.html">pointed</a> out, my arguments were partially just excuses for the switch, because everything could be fixed in mercurial as well (eventually). On the other hand, I really wasn't expecting to switch when I invested time and energy to learn mercurial. Also because I thought that git doesn't have such a nice documentation, has a steep learning curve and the community is hostile, because it is developed by the kernel people who are famous for sometimes being not so nice on the mailinglists (as I now found out, none of these are true). I was getting annoyed by small things one by one, after finally I said to myself enough is enough, let's just switch. <br /><br />So as to the steep learning curve --- it took me a day or two to being able to do what I want, so it seems to me it's really easy to learn once you know some distributed vcs. I found out the documentation is much better than in mercurial --- in git one just types "git help command" and a full man page fires up with lot's of information and examples. In mercurial, one just gets a couple lines (compared to git) of help in the terminal, without examples. Also the first (actually second) thing I noticed is that "git log" (and other commands like "git diff") doesn't scroll out my terminal, but uses "less" automatically -- that's just great. The first thing I noticed is that git <span style="font-style:italic;">is</span> superfast for almost every operation, especially it's noticeable with "git diff". As to the community, I only had a chance to send a few emails to the git list, so I cannot really say, but so far it's very responsive and friendly.<br /><br />However, those are just little things that can (and I am sure they will) be fixed in mercurial as well. What is a big thing are branches, especially remote branches. One just fetches a remote repository and then works with it like with any other local branch, e.g. one can switch to it, or just "git log some_remote_branch" to see what is in there. One can easily compare them etc. With mercurial, I was using "hg out" and "hg in" commands to see what changes I will pull or push, but those commands require internet connection, so it really sucks and it's slow. In mercurial, I was using different directories for different branches, but that's just extremely inconvenient and also slow (creating a new branch is just a matter of adding one file, not copying the whole repository --- for example with the <a href="http://code.google.com/p/sympy/">sympy</a> hg repository, I often had to wait several seconds to clone a repo, while with the git repository it's just instant) and big (in terms of megabytes).<br /><br />The bible of Mercurial, the hgbook <a href="http://hgbook.red-bean.com/hgbookch8.html#x12-1650008.5">says</a>:<br /><blockquote>In most instances, isolating branches in repositories is the right approach.</blockquote><br />But I think it's the wrong approach. The only argument for doing this that I accept is that sometimes you are not sure which branch you are in in git --- well, I use <a href="http://log.damog.net/2008/12/two-git-tips/">this</a> trick (actually, just read the documentation of __git_ps1 in /etc/bash_completion.d/git), so my bash line always says which branch I am in using the red color. I never do any mistakes with this.<br /><br />Anyways, I could continue like this (e.g. check out "git svn", "git rebase -i" and many other things), but you can read why git is better for example <a href="http://whygitisbetterthanx.com/">here</a>, no need to repeat here. I am very happy now and I can only recommend to learn git.<br /><br />So let me also say some things that are worse in git --- one thing that could be improved are URLs of the gitweb (hgweb urls are neat, gitweb urls use "?id=..." stuff). Another thing is that the debian package git is not git! You need to install git-core to get git (but this seems to be getting fixed). <br /><br />There is also an interesting <a href="http://lists.debian.org/debian-python/2008/12/msg00000.html">discussion</a> happening right now in the debian-python mailinglist about switching the <a href="http://wiki.debian.org/Teams/PythonModulesTeam">DPMT</a> repositories to git. I think almost all opinions (for and against) were already stated, but if you have some opinion that wasn't yet said, please do so.Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com2tag:blogger.com,1999:blog-6568744196982634289.post-30021073710802593802008-10-28T08:23:00.000-07:002008-10-28T08:28:05.727-07:00Google Mentor Summit IIIOn Sunday I checked out from the hotel and enjoyed the breakfast, basically the same as the first picture <a href="http://ondrejcertik.blogspot.com/2007/11/sunday-morning.html">here</a>. Which is cool, the best way to start a day is with a good breakfast in the morning.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj94qzromTHoZp3HF1qgcTXITbr_AApX8C62PDQD89JNZ9bwDvljLsH6aDZsXP5R0xXaTZxNf9tj10Txvj2Wp5ONOemj1wn1QaYnOpUhpjNIyvaiiOBcJlYgOpDb7ELlUzx-l9wALxigXo8/s1600-h/00007.jpg"><img style="cursor: pointer; width: 400px; height: 267px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj94qzromTHoZp3HF1qgcTXITbr_AApX8C62PDQD89JNZ9bwDvljLsH6aDZsXP5R0xXaTZxNf9tj10Txvj2Wp5ONOemj1wn1QaYnOpUhpjNIyvaiiOBcJlYgOpDb7ELlUzx-l9wALxigXo8/s400/00007.jpg" alt="" id="BLOGGER_PHOTO_ID_5262213851531221426" border="0" /></a><br /><br />At Google I finally met with <a href="http://web.cecs.pdx.edu/%7Ebart/">Bart Massey</a>, who works at the Portland State University where I was an intern (in 2005) and also he was sponsoring one SymPy GSoC student in 2007.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyk9s7ijaMV6fwDowIsES1KUQbxuo1UdKWBGOVdkFC8aU2RXgpMQl5rM_DI_TtNUii5l7EkmL1dymWMCQf_Lgri8WtRUZ29lkrJmJ9YWoNkZVIO-1sujOReX1vDvIWJr-tfS28z7g7z6NI/s1600-h/00024.jpg"><img style="cursor: pointer; width: 400px; height: 267px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyk9s7ijaMV6fwDowIsES1KUQbxuo1UdKWBGOVdkFC8aU2RXgpMQl5rM_DI_TtNUii5l7EkmL1dymWMCQf_Lgri8WtRUZ29lkrJmJ9YWoNkZVIO-1sujOReX1vDvIWJr-tfS28z7g7z6NI/s400/00024.jpg" alt="" id="BLOGGER_PHOTO_ID_5262213868079181666" border="0" /></a><br />Then we started to port SymPy to Jython with Philip Jenvey. I first installed openjdk-6, which is in Debian main, then checked out Jython svn, typed "ant" and it just worked. This is so awesome, that we finally have a truly opensource and fully working java implementation in Debian. Philip fixed some bugs already, so SymPy imports just fine. Most of the tests run, but also quite a lot still fail.<br /><br />We managed to isolate two bugs: <a href="http://bugs.jython.org/issue1158">issue 1158</a> and <a href="http://bugs.jython.org/issue1159">1159</a>. Then there was an annoying recursion bug, that took us several hours to dig into and I then had to leave at 6pm without a clue. But Philip kept saying, I just need to look more at the java stacktraces that Jython was generating and I'll figure it out. And he did! The next morning he filed an <a href="https://codespeak.net/issue/pypy-dev/issue412">issue 412</a> in the PyPy tracker, because they seem to have the same problem. There are subtle differences in how to handle __mul__ and __rmul__ methods that are not well documented, so it works in CPython but fails in Jython/PyPy. I think we can fix that in SymPy too in the meantime, so I am very excited, because it seems SymPy will work on top of Jython soon.<br /><br />There was also a git vs hg session with both hg and git developers. Since I recently switched from hg to git for all stuff where I can choose the vcs, it was very interesting for me. And I must say I am glad I switched. Mercurial works fine enough and with the recent rebase feature I think it is usable, but git just has a bigger momentum at the moment and it just doesn't get in my way.<br /><br />During the day Steve sent an email to the GSoC list that Dirk forgot his jacket in the hotel room, so I said to myself, haha, that's a pity. And then I realized, oh shit, I left my jacket there as well. They didn't have it in the evening when I stopped there, but fortunately they sent me an email yesterday that they found it, so I'll stop there on my way back.<br /><br />We also took couple of group pictures, here is just my lame attempt (I am sure people will soon post better ones):<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrZwTUWlTfLIV4Tt8GYQQOtM9oO4K_C7Sn5bfYlqmCYyZd5K_Azh-1Oy3ywKWcVZU4n4ewPFGAwPRWSZ56wvzsZjIG2SjNwwJpAKu76m7PgM1xJ8uI2Ygfh4dKkJY3aRN3-nqmFWhT3ax9/s1600-h/00025.jpg"><img style="cursor: pointer; width: 400px; height: 267px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrZwTUWlTfLIV4Tt8GYQQOtM9oO4K_C7Sn5bfYlqmCYyZd5K_Azh-1Oy3ywKWcVZU4n4ewPFGAwPRWSZ56wvzsZjIG2SjNwwJpAKu76m7PgM1xJ8uI2Ygfh4dKkJY3aRN3-nqmFWhT3ax9/s400/00025.jpg" alt="" id="BLOGGER_PHOTO_ID_5262213884112415330" border="0" /></a><br /><br />On Monday morning I met with Fernando Perez, the author of ipython, he know works with Jarrod. Then I rented a car and came to visit <a href="http://www.calpoly.edu/%7Ephys/faculty_pages/bgranger.html">Brian Granger</a> and his family in San Luis Obispo.<br /><br />We went to the beach in the evening:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIgP2tOL30uLt7iGWQg1BGxoWHmEMMLee-xS3hwXJxyrXxOf02VKCPcP9UJqE_eXlW2CPgc7k_yRQItJgpQ7g1HkkocF9PZ_eFZL-9dhrG2Ir3HfuRh3xaJGHbTT2vaq_qNOthMi7Bp_iw/s1600-h/00033.jpg"><img style="cursor: pointer; width: 400px; height: 267px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIgP2tOL30uLt7iGWQg1BGxoWHmEMMLee-xS3hwXJxyrXxOf02VKCPcP9UJqE_eXlW2CPgc7k_yRQItJgpQ7g1HkkocF9PZ_eFZL-9dhrG2Ir3HfuRh3xaJGHbTT2vaq_qNOthMi7Bp_iw/s400/00033.jpg" alt="" id="BLOGGER_PHOTO_ID_5262213897964186322" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR18NW6cFF9nST-S2ta3jgNTiKC0Q4ozLlKa5tyKPbheoHWyT2knFqtcJuY2f54MSroXqQDBRFIpPVBHEMZBsPKtWKGX6o_LrG9xUHrsCs3nQ2kUjtQAc9LqyZP4uvyiGDn7JGY0dZJ5-S/s1600-h/00040.jpg"><img style="cursor: pointer; width: 400px; height: 267px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR18NW6cFF9nST-S2ta3jgNTiKC0Q4ozLlKa5tyKPbheoHWyT2knFqtcJuY2f54MSroXqQDBRFIpPVBHEMZBsPKtWKGX6o_LrG9xUHrsCs3nQ2kUjtQAc9LqyZP4uvyiGDn7JGY0dZJ5-S/s400/00040.jpg" alt="" id="BLOGGER_PHOTO_ID_5262213906095288274" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm9M_tNxZnUiv67lTTCWCO_ZChDfsAGe94WDQeclrEMVb-yjH83YFGgujnmWEsFULeYK29OJyvxsJE-ABQ_ISHISbwc1hYbgzEWlm_wg_ktq_Bc1icSIE5AZqm8JEnE2TnF97H6vEBz51v/s1600-h/00046.jpg"><img style="cursor: pointer; width: 400px; height: 267px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm9M_tNxZnUiv67lTTCWCO_ZChDfsAGe94WDQeclrEMVb-yjH83YFGgujnmWEsFULeYK29OJyvxsJE-ABQ_ISHISbwc1hYbgzEWlm_wg_ktq_Bc1icSIE5AZqm8JEnE2TnF97H6vEBz51v/s400/00046.jpg" alt="" id="BLOGGER_PHOTO_ID_5262214527491513810" border="0" /></a><br /><br />And had a dinner together. Brian showed me his options pricing example he did with SymPy, so I made him create an <a href="http://code.google.com/p/sympy/issues/detail?id=1175">issue 1175</a> with the code.<br />Then we played with the <a href="http://ipython.scipy.org/doc/rel-0.9.1/html/parallel/index.html">parallel stuff</a> that Brian contributed to ipython and we tried sympy with it and to our disappointment, we found pickling bugs in sympy, it works with protocol 0, but not protocol 2, see the <a href="http://code.google.com/p/sympy/issues/detail?id=1176">issue 1176</a> and <a href="http://code.google.com/p/sympy/issues/detail?id=1177">1177</a>. This almost smells like a bug in Python itself, but I need to investigate that later more deeply.<br /><br />Today is Tuesday and we'll work on doing atomic physics calculations with sympy. See also Brian's <a href="http://groups.google.com/group/sympy/msg/fa1908231383f533">email</a> to the sympy list about it.Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com0tag:blogger.com,1999:blog-6568744196982634289.post-78244842867319512542008-10-26T08:47:00.000-07:002008-10-26T09:31:10.380-07:00Google Mentor Summit IIOn Saturday morning I met <a href="http://www.einval.com/%7Esteve/">Steve McIntyre</a> and <a href="http://dirk.eddelbuettel.com/">Dirk Eddelbuettel</a>, Steve took us by car to Google. Well, it was overwhelming.<br /><br />For example we met there two other Debian developers, <a href="http://jbailey.livejournal.com/">Jeff Bailey</a> and <a href="http://algebraicthunk.net/%7Edburrows/">Daniel Burrows</a>. There are developers from all the famous projects, like git, Wine, Turbogears, Jython, ... There are still people I wanted to meet but didn't manage yesterday, need to fix that today. My plan is to get SymPy running on top of Jython, or at least do some more progress to take the advantage, that Philip Jenvey from Jython is here. Also I wanted to fix some RC bugs in Debian when Steve is here, to make some progress on my NM finally. We'll see how it goes.<br /><br />There was also an excellent presentation from people behind Android. One thing I was curious if it's going to run native C applications, like Python and it seems it will happen eventually, all the sources are out there, so someone just needs to push it forward. Another very cool thing they did that I was always looking for is <a href="http://android.git.kernel.org/?p=tools/gerrit.git;a=shortlog">Gerrit</a> for reviewing patches (see <a href="http://review.source.android.com/">review.source.android.com</a> for example how it looks like) -- basically a fork of Guido's codereview, but it has many nice features, like automatically applying the patch to the git repository as a new topic branch and one can then easily pull it, as well as review it over the web interface. When I get back to Prague I am going to install this for SymPy.Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com1tag:blogger.com,1999:blog-6568744196982634289.post-4566663269531900042008-10-25T07:24:00.000-07:002008-10-25T08:23:18.205-07:00Google Mentor Summit II flew via Atlanta and had only about an hour to my next flight to San Francisco, so after my last <a href="http://ondrejcertik.blogspot.com/2008/03/sage-days-8.html">experience</a>, when I went to the immigration, got stuck in the line for more than an hour and then had to run to catch my flight, I decided to try a different strategy this time: first run to the immigration and then walk to my gate. Unfortunately I was sitting near the back of the plane and I got out among the last ones. Fortunately, it was several hundreds meters to the immigration, so I run as fast as I could and I managed to get there as the first one and everything took about 5 minutes. That was just awesome, I finally figured this out.<br /><br /><a href="http://jarrodmillman.blogspot.com/">Jarrod</a> was waiting for me at the airport, went to his place. Here's his cat:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHQy5H3M2jNzmpx1xvGSWjkaXseb-sKhepjrMu1lUx5ffEDHMqGUPWjNfzz-L9qfuqN-uTdaIVeTT3mxFmX6Lq_CoZ6Ww9VAueAFVMMbRmbEPPGaXR3Bl87MBVxypsUsE_sR5460gXCTqo/s1600-h/00022.jpg"><img style="cursor: pointer; width: 400px; height: 267px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHQy5H3M2jNzmpx1xvGSWjkaXseb-sKhepjrMu1lUx5ffEDHMqGUPWjNfzz-L9qfuqN-uTdaIVeTT3mxFmX6Lq_CoZ6Ww9VAueAFVMMbRmbEPPGaXR3Bl87MBVxypsUsE_sR5460gXCTqo/s400/00022.jpg" alt="" id="BLOGGER_PHOTO_ID_5261102422435136818" border="0" /></a><br /><br />On Friday we did some work and then went to the Golden Gate, the traffic was quite dense:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7ng0Di1cr02E9WMAVg_J2mXDqjhiJ6hBfN943BAQbpV4QRvNjEoOv0dcgM14QEcz3aMLQ3_rrIhw3Rz6E-mKH5Am8e43pQuqvaK9RcNxcvRIL73JqZe7aSWXZ2ypY7q903DsJARYxRRje/s1600-h/00045.jpg"><img style="cursor: pointer; width: 400px; height: 267px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7ng0Di1cr02E9WMAVg_J2mXDqjhiJ6hBfN943BAQbpV4QRvNjEoOv0dcgM14QEcz3aMLQ3_rrIhw3Rz6E-mKH5Am8e43pQuqvaK9RcNxcvRIL73JqZe7aSWXZ2ypY7q903DsJARYxRRje/s400/00045.jpg" alt="" id="BLOGGER_PHOTO_ID_5261102429739633266" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVANlCKvFE6C8r_BfAMThqSTcFHC-OCaSz_3HslwJHPt3R6MXcIBersSU9HnQ1ijOSMAJ8YNwqo2rSkNy-YnAcTV-aR8Iafp3GDXav2pErqmW2BLb7JsjczBGGtW04TQYUkssc4XCDxWiw/s1600-h/00056.jpg"><img style="cursor: pointer; width: 400px; height: 267px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVANlCKvFE6C8r_BfAMThqSTcFHC-OCaSz_3HslwJHPt3R6MXcIBersSU9HnQ1ijOSMAJ8YNwqo2rSkNy-YnAcTV-aR8Iafp3GDXav2pErqmW2BLb7JsjczBGGtW04TQYUkssc4XCDxWiw/s400/00056.jpg" alt="" id="BLOGGER_PHOTO_ID_5261102434868314530" border="0" /></a><br /><br />Alcatraz:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjiLW-xpqZaQZ9kfeyZLa-hYTAED_4klJIcXNIWJmf-_5nx_VB4YhYmBDUhRWHwlHzE47wPBS86DeyiNRFIbuHW6aaPtLKo1C5oP911K42IRL7dAio7f_zmihuXgLQaxSWYiA3gGg1_HJD/s1600-h/00060.jpg"><img style="cursor: pointer; width: 400px; height: 267px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjiLW-xpqZaQZ9kfeyZLa-hYTAED_4klJIcXNIWJmf-_5nx_VB4YhYmBDUhRWHwlHzE47wPBS86DeyiNRFIbuHW6aaPtLKo1C5oP911K42IRL7dAio7f_zmihuXgLQaxSWYiA3gGg1_HJD/s400/00060.jpg" alt="" id="BLOGGER_PHOTO_ID_5261102460174062514" border="0" /></a><br /><br />San Francisco:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijBmIzOzlGiFmzfByyvwGnUtw-h00RNzBkhhBGyiT29kTDyn7-uCRx_C7cWZEjwxYS7TEu8FZ6kQ1rH9_-4PWD-1L1OIQNC8CEupl_GwDzI2D7gD0jzlGECJdYmL-vLt7hj_ekYiLbbHSe/s1600-h/00058.jpg"><img style="cursor: pointer; width: 400px; height: 267px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijBmIzOzlGiFmzfByyvwGnUtw-h00RNzBkhhBGyiT29kTDyn7-uCRx_C7cWZEjwxYS7TEu8FZ6kQ1rH9_-4PWD-1L1OIQNC8CEupl_GwDzI2D7gD0jzlGECJdYmL-vLt7hj_ekYiLbbHSe/s400/00058.jpg" alt="" id="BLOGGER_PHOTO_ID_5261102449385236402" border="0" /></a><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEE-PrNqz3MmOqHYeuuRsN-HjWkce-AGP65a1WIrs72RoL5mr7-Bwrvzai6zvJIJU4zo7M5VnADJmhnQ2pyyYsSfgsO9ZWFJmoqo32zncGsKm9z51Xu_3C-0TvgQDvwG9N4b1x4fR9koVG/s1600-h/00065.jpg"><img style="cursor: pointer; width: 400px; height: 267px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEE-PrNqz3MmOqHYeuuRsN-HjWkce-AGP65a1WIrs72RoL5mr7-Bwrvzai6zvJIJU4zo7M5VnADJmhnQ2pyyYsSfgsO9ZWFJmoqo32zncGsKm9z51Xu_3C-0TvgQDvwG9N4b1x4fR9koVG/s400/00065.jpg" alt="" id="BLOGGER_PHOTO_ID_5261103808014210050" border="0" /></a><br /><br />Then we had a cofee in San Francisco and went to Silicon Valey, Jarrod drove me around a little bit to see SLAC, Stanford campus and other things. In the evening we went to the common pub with other mentors and Google guys, where we for example met with <a href="http://www.math.washington.edu/%7Erobertwb/">Robert Bradshaw</a>.<br /><br />Today I am looking forward to meet with all the people I know from mailinglists, Debian and other places.Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com1tag:blogger.com,1999:blog-6568744196982634289.post-89177464289503299562008-09-22T08:59:00.000-07:002008-09-22T09:34:36.492-07:00master studiesI did it! :) I defended my thesis and passed master finals from theoretical physics at <a href="http://www.mff.cuni.cz/toISO-8859-2.en/">Charles University</a> in Prague couple hours ago.<br /><br />After almost dropping out of my school exactly a year ago for not having enough credits to go to the next year, I gave myself an obligation to finish my school on time. I worked very hard the last year, I had to do 8 exams, some of them very hard, requiring more than a week of thorough learning and 9 seminars, requiring a lot of work too and also a master thesis, for which I had to had working finite element solvers and together with <a href="http://code.google.com/p/sympy/">SymPy</a> it took all my time and energy. I even had to cancel my trip to Austin and Caltech for the SciPy conference. But I finished my school after all, I am very happy about it.<br /><br />Last year, two of my friends bet $100 between themselves that I will not finish on time. Jarda, who believed in me is now at Princeton doing his Ph.D. <a href="http://www.facebook.com/people/Matous_Ringel/720476546">Matouš</a>, who didn't believe in me, will now pay $100 to Jarda. I think that life is fair.:)<br /><br />Now I'll be visiting pubs quite often and then I'll fix some long standing issues in SymPy, hopefully finish my Debian task & skills (to finally become a Developer couple months after that) and finally do useful stuff for my research with a fresh head now.Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com8tag:blogger.com,1999:blog-6568744196982634289.post-15668188541300333802008-08-16T23:14:00.000-07:002008-08-16T23:45:41.039-07:00I am switching from Mercurial to gitAfter a long night of debugging and while preparing, reviewing and pushing final patches before a <a href="http://code.google.com/p/sympy/">SymPy</a> release, I got this:<br /><pre><br />$ hg qpush <br />applying 1645.diff<br />Unable to read 1645.diff<br />** unknown exception encountered, details follow<br />** report bug details to http://www.selenic.com/mercurial/bts<br />** or mercurial@selenic.com<br />** Mercurial Distributed SCM (version 1.0.1)<br />Traceback (most recent call last):<br /> File "/usr/bin/hg", line 20, in <module><br /> mercurial.dispatch.run()<br /> File "/var/lib/python-support/python2.5/mercurial/dispatch.py", line 20, in run<br /> sys.exit(dispatch(sys.argv[1:]))<br /> File "/var/lib/python-support/python2.5/mercurial/dispatch.py", line 29, in dispatch<br /> return _runcatch(u, args)<br /> File "/var/lib/python-support/python2.5/mercurial/dispatch.py", line 45, in _runcatch<br /> return _dispatch(ui, args)<br /> File "/var/lib/python-support/python2.5/mercurial/dispatch.py", line 364, in _dispatch<br /> ret = _runcommand(ui, options, cmd, d)<br /> File "/var/lib/python-support/python2.5/mercurial/dispatch.py", line 417, in _runcommand<br /> return checkargs()<br /> File "/var/lib/python-support/python2.5/mercurial/dispatch.py", line 373, in checkargs<br /> return cmdfunc()<br /> File "/var/lib/python-support/python2.5/mercurial/dispatch.py", line 356, in <lambda><br /> d = lambda: func(ui, repo, *args, **cmdoptions)<br /> File "/var/lib/python-support/python2.5/hgext/mq.py", line 1942, in push<br /> mergeq=mergeq)<br /> File "/var/lib/python-support/python2.5/hgext/mq.py", line 833, in push<br /> top = self.applied[-1].name<br />IndexError: list index out of range<br /></pre><br />I am using:<br /><pre><br />$ hg --version <br />Mercurial Distributed SCM (version 1.0.1)<br /><br />Copyright (C) 2005-2008 Matt Mackall <mpm@selenic.com> and others<br />This is free software; see the source for copying conditions. There is NO<br />warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.<br /></pre><br /><br />And I just got pissed off and I am switching to git for good. I've been using mercurial every day since about November 2007, and I think I am quite proficient in it. But we were missing some features, like recording a patch by hunks (git add -p), so <a href="http://wiki.sympy.org/wiki/Kirill_Smelkov">Kirill Smelkov</a> (another SymPy developer) just implemented this to mercurial queues, it is now included in hg 1.0. But I am constantly beaten by stupid bugs, mercurial broke into pieces several times already (<a href="http://www.selenic.com/pipermail/mercurial/2008-July/020438.html">last time</a> with hg bisect, before it with mercurial queues and file renaming), that just should not happen in a production version. Another problem is that hgweb is constantly using 100% of CPU on my server whenever someone clicks to see the contents of the README file. Again I can spend time debugging it, but I will just use git and if it works, I'll stay with it.<br /><br />I started learning git recently and it is just better in every aspect. Bigger community, it has all the features that I was always missing in mercurial (like rebase, hunks recording, diff diff --color-words, better gitk). And it's superfast. <br /><br />Unless I find some showstopper bugs in git too, I don't think I am coming back.<br /><br />We'll have to create a live mercurial mirror of SymPy, so that people can continue using mercurial, but I'll myself just be using git. We wrote a simple translation table for anyone using mercurial to get started:<br /><br /><a href="http://wiki.sympy.org/wiki/Git_hg_rosetta_stone">http://wiki.sympy.org/wiki/Git_hg_rosetta_stone</a><br /><br />I love Python and I like that Mercurial is just a small C core and the rest is in Python, but for some reason, it still has the baby bugs, that should have been fixed years ago and why should we spend our time fixing and improving Mercurial, if other people have already done the job for us (and usually a better job than I could do) in git?<br /><br />Another reason for switching is that in Debian, mercurial is not used for packages, while git is used a lot.Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com5tag:blogger.com,1999:blog-6568744196982634289.post-69053153387367307772008-05-24T12:48:00.000-07:002008-05-24T15:27:18.298-07:00Ubuntu Developer Summit in PragueLast weekend <a href="http://ondrejcertik.blogspot.com/2008/05/fosscamp-friday.html">I was</a> at FOSSCamp. Since I live in Prague I wanted to go to <a href="https://wiki.ubuntu.com/UDS-Intrepid">Ubuntu Developer Summit</a> (UDS) each day, but unfortunately I had some exams, so I only went on Wednesday and Friday.<br /><br />On Wednesday I first met <a href="http://liw.fi/">Lars Wirzenius</a>:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE1rKP4Rwx2JIwBjrFeAb_yEwIoM7rnRfrs_0NRuHZyaut_KvD7s1PahZJmDsI1wemyWilbVXkNb65riYk7vdX_5sLYQ6Eul4bEIzxeH-ykrzSU0Okdv6QV0rWDZ07z22JJMdZtRsXaPHm/s1600-h/21052008356.jpg"><img style="cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE1rKP4Rwx2JIwBjrFeAb_yEwIoM7rnRfrs_0NRuHZyaut_KvD7s1PahZJmDsI1wemyWilbVXkNb65riYk7vdX_5sLYQ6Eul4bEIzxeH-ykrzSU0Okdv6QV0rWDZ07z22JJMdZtRsXaPHm/s400/21052008356.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5204036208488379698" /></a><br /><br />we agreed to go to pub in the evening. Then I did a little work, there was quite a nice view from the window (<a href="http://en.wikipedia.org/wiki/Prague_Castle">Prague castle</a> on the horizon):<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpTz8rA9jznBi0QvNxzlPe9v_cIadm2NZ6u50p8tKcoy27w9UbBPOe7I2tgDdd86IpAvii-qLRe1Z7Gp2aETL6sdUmFrRbFQml6HD4RKwIHB_6Ni4OraEDIDtPfIL8L8Jx0F8Hc1sP3yDM/s1600-h/21052008357.jpg"><img style="cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpTz8rA9jznBi0QvNxzlPe9v_cIadm2NZ6u50p8tKcoy27w9UbBPOe7I2tgDdd86IpAvii-qLRe1Z7Gp2aETL6sdUmFrRbFQml6HD4RKwIHB_6Ni4OraEDIDtPfIL8L8Jx0F8Hc1sP3yDM/s400/21052008357.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5204038162698499458" /></a><br /><br />and I went to the #ubuntu-devel-summit IRC channel and pinged <a href="https://wiki.ubuntu.com/ScottKitterman">Scott Kitterman</a>, whom I new from the <a href="http://wiki.debian.org/Teams/PythonModulesTeam">Debian Python Modules Team</a> (DPMT), but didn't know how he looks like. We met and once I knew Scott, it was easy to get around, so he introduced me to <a href="http://www.youtube.com/watch?v=a-GXOHhCu2U">Steve Langasek</a> (pronounced Langášek). We agreed to go to pub as well. Steve lives in Portland, OR, where I spent the summer 2005 and Scott is from Baltimore where I spent the summer 2006.<br />Then I also met Riku Voipio, <a href="http://mhb.ath.cx/">Martin Böhm</a>, <a href="http://www.async.com.br/~kiko/">Christian Reis</a> (whom I asked if it's possible to support Debian unstable on <a href="https://launchpad.net/ubuntu/+ppas">Ubuntu Personal Package Archives</a> and he said that it will probably happen, so that's really cool -- I also offered my help with this) and others, so in the end, there were 14 of us going to the pub, so I chose again the same pub as with the FOSSCamp people and it seems it tasted good again:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNFRpcx3HzQVySDV_V-fW94gdrw9-Br4gcQma7iZsUpj5Q5KFrCZL058BNL75CTKCRurBEc8dZ_1tCu8yWxKGyePKe_o3I-RTwUIc8VQt7QM5246mjzZ6Hp2nu3DjzoefZnHRMRDhZQ99j/s1600-h/21052008360.jpg"><img style="cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNFRpcx3HzQVySDV_V-fW94gdrw9-Br4gcQma7iZsUpj5Q5KFrCZL058BNL75CTKCRurBEc8dZ_1tCu8yWxKGyePKe_o3I-RTwUIc8VQt7QM5246mjzZ6Hp2nu3DjzoefZnHRMRDhZQ99j/s400/21052008360.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5204036212783347010" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiu1SKi6cE16vI8FT67XtCQQibb6YfWkZ5O_wjjt_DBf6MS6UzY9zIzbqSSfqeiyE9pV490JVdCkYUjh2rT-JdlNX7pg35yIrkUKN6N-oIiJVB3nAa1LpApC0jAUJ6KBCXrACUEZCc8C7dh/s1600-h/21052008359.jpg"><img style="cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiu1SKi6cE16vI8FT67XtCQQibb6YfWkZ5O_wjjt_DBf6MS6UzY9zIzbqSSfqeiyE9pV490JVdCkYUjh2rT-JdlNX7pg35yIrkUKN6N-oIiJVB3nAa1LpApC0jAUJ6KBCXrACUEZCc8C7dh/s400/21052008359.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5204036212783347026" /></a><br /><br />Notice the <a href="http://ekucharka.net/vsechny-video-recepty/svickova-na-smetane/">svíčková na smetaně</a> above, my favourite meal. Good choice Scott. :)<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqyljH8kxF7XlBbWEE21ynoO_IczLW0ZfCqQMSomuDerGNnzd3eM5bni7gEmMZYkzo2XFybM9xYjaN4Zh4vEdLPwKwTz2UbuBdHOLC0oQaPOJ8GvG4UGpHefIWiXMvF5pQdneRj-yL0VBC/s1600-h/21052008362.jpg"><img style="cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqyljH8kxF7XlBbWEE21ynoO_IczLW0ZfCqQMSomuDerGNnzd3eM5bni7gEmMZYkzo2XFybM9xYjaN4Zh4vEdLPwKwTz2UbuBdHOLC0oQaPOJ8GvG4UGpHefIWiXMvF5pQdneRj-yL0VBC/s400/21052008362.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5204036221373281650" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitoCsksNQIaLiNWqZJ_6RvTEV7DTcMDrSIMyP9-Qqipfn_K2OlANvzGoAeytyJiUnpbCh8SNCZowzkjrXFMGINUOj1R55QKDAr7Nz56SnDxd_-bApJy2huc4x3mi0jCkIR8XOUHm26yZIP/s1600-h/21052008361.jpg"><img style="cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitoCsksNQIaLiNWqZJ_6RvTEV7DTcMDrSIMyP9-Qqipfn_K2OlANvzGoAeytyJiUnpbCh8SNCZowzkjrXFMGINUOj1R55QKDAr7Nz56SnDxd_-bApJy2huc4x3mi0jCkIR8XOUHm26yZIP/s400/21052008361.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5204036217078314338" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhZUK7Vcm1cMt6lEZTZOetxBskvfw2nLh_rKOAZ6lbtcAH5uT0jpMssWoumLL5WubY5LxSkZw9UX62HM6MW5wbR6FNtH9bu64usNv2NOodFPNUkmAU7YoUKsJj20xwt1PkB9ImQqOGrsxK/s1600-h/21052008363.jpg"><img style="cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhZUK7Vcm1cMt6lEZTZOetxBskvfw2nLh_rKOAZ6lbtcAH5uT0jpMssWoumLL5WubY5LxSkZw9UX62HM6MW5wbR6FNtH9bu64usNv2NOodFPNUkmAU7YoUKsJj20xwt1PkB9ImQqOGrsxK/s400/21052008363.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5204038441871373730" /></a><br /><br />Ok, that was on Wednesday. On Friday I arrived at around 3pm, looked at the schedule table and noticed that <a href="https://launchpad.net/~doko">Matthias Klose</a> should be at UDS too, so I started IRC and pinged him. Fortunately, <a href="http://emilio.pozuelo.org/">Emilio Pozuelo Monfort</a>, whom I know from DPMT as well, replied first so we met, it was cool and he showed where Matthias is. I am very glad I met him, so we discussed python-central and python-support packages and why we have them both, also with Scott later on.<br /><br />When I was waiting for Matthias, I sat next to <a href="https://wiki.ubuntu.com/Nxvl">Nicolas Valcárcel</a>, started my laptop and begun looking at some <a href="http://code.google.com/p/sympy/">SymPy</a> bugs and Nicolas noticed that and said -- "You are developing SymPy?", I said "Yes.", flattered. And he showed me a bug with plotting and Compiz, so we immediately <a href="http://code.google.com/p/pyglet/issues/detail?id=296">reported</a> that to pyglet. <br /><br />In the evening people continued to some kind of a party, but unfortunately, I was already going to some other pub. <br /><br />Overall, even though I was there for only two afternoons, it was just awesome and I utterly enjoyed meeting all the people I knew from mailinglists and IRC.Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com0tag:blogger.com,1999:blog-6568744196982634289.post-5494272749070492052008-05-20T08:25:00.000-07:002008-05-20T08:25:46.432-07:00Installing a printer in DebianI finally bought a new toner to my old <a href="http://www.minolta-qms.com/products/monochrome/pp1250E/index.asp">Minolta 1250e</a> that I didn't use for a few years (because I was lazy to fix it) and I was surprised how easy it is to install it these days:<br /><br />1. plugged the USB cable from the printer to my laptop<br />2. wajig install cupsys foomatic-db-engine<br />3. sudo ln -s /usr/bin/foomatic-ppdfile /usr/lib/cups/driver<br />4. On http://localhost:631/ I added the new printer in cupsys, it showed my printer over USB, I selected it and then I chose the correct PPD.<br /><br />And everything just works. The only nontrivial part is the step 3, that was suggested in /usr/share/doc/foomatic-db-engine/USAGE.gz:<br /><pre><br />If the printers of the Foomatic database do not appear, check whether the<br />link to foomatic-ppdfile is in /usr/lib/cups/driver:<br /><br />lrwxrwxrwx 1 root root 25 Apr 19 18:13 foomatic -> /usr/bin/foomatic-ppdfile<br /><br />If not, create it manually.<br /></pre><br />Without it, I didn't see the right PPD in the step 4. Maybe it'd be a nice idea to do this automatically (either when installing foomatic-db-engine or cupsys), or am I missing something?<br /><br />As to the PPDs, one can get all printer IDs by:<br /><pre><br />$ foomatic-ppdfile -A<br /></pre><br />and the PPD for my printer by<br /><pre><br />$ foomatic-ppdfile -p Minolta-PagePro_1250E<br /></pre><br />However, it's not necessary in the above howto.Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com0tag:blogger.com,1999:blog-6568744196982634289.post-23977373657393233632008-05-16T16:16:00.000-07:002008-05-16T16:17:02.880-07:00FOSSCamp, FridaySince I live in Prague, it's basically compulsory to go to <a href="http://www.fosscamp.org/">FOSSCamp</a>. Yesterday I went with <a href="http://lucas-nussbaum.net/">Lucas</a> to some pubs + sightseeing, today we went in a larger group to this pub:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhivsOYAlIrZjyAcnTaJp6KmgmHH0lUO6VXk1ciN_2GPDmDnVslWt-wzbtXdlQeA8CCwJphSz9_j6Fbm2FzthfhdbGU34a7H-nYFqMQqEYMTFNuG510QfkOt1S1WImB4rYv6vH00S_h6ajb/s1600-h/16052008355.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhivsOYAlIrZjyAcnTaJp6KmgmHH0lUO6VXk1ciN_2GPDmDnVslWt-wzbtXdlQeA8CCwJphSz9_j6Fbm2FzthfhdbGU34a7H-nYFqMQqEYMTFNuG510QfkOt1S1WImB4rYv6vH00S_h6ajb/s400/16052008355.jpg" alt="" id="BLOGGER_PHOTO_ID_5201113361299370994" border="0" /></a><br />and we had a couple of good Czech meals with <a href="http://en.wikipedia.org/wiki/Pilsner_Urquell">Plzeň beer</a>:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg66ydliyPKBRLKUdAOQ3RvJOjbclzfjhTlIDtrsLOtZRNpA8tO2sklD8IY4u3AsPPmtAkYI3O6t7n8HaNHCDFrkCtmwEsIs68InQU6DZ6nfW67aYXXEX-Hq-uA-Jhc9pOZ-9v2Cz2CjMaK/s1600-h/16052008349.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg66ydliyPKBRLKUdAOQ3RvJOjbclzfjhTlIDtrsLOtZRNpA8tO2sklD8IY4u3AsPPmtAkYI3O6t7n8HaNHCDFrkCtmwEsIs68InQU6DZ6nfW67aYXXEX-Hq-uA-Jhc9pOZ-9v2Cz2CjMaK/s400/16052008349.jpg" alt="" id="BLOGGER_PHOTO_ID_5201113369889305602" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ9xFPZ0CB5zw89ljbUpD3Pi6bnyB9pF4zi3xgdaRhqx256JdST2VCOre3pD_MtmOsz533a4uxeA4vUhiWmTg0Lc1a0IPAEs2orB1SsM1qTSRAhUzFx1ij95xHJdyfS0pEno4RQmdoepP5/s1600-h/16052008350.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ9xFPZ0CB5zw89ljbUpD3Pi6bnyB9pF4zi3xgdaRhqx256JdST2VCOre3pD_MtmOsz533a4uxeA4vUhiWmTg0Lc1a0IPAEs2orB1SsM1qTSRAhUzFx1ij95xHJdyfS0pEno4RQmdoepP5/s400/16052008350.jpg" alt="" id="BLOGGER_PHOTO_ID_5201113369889305618" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimaMlCxT8MF_K8d6bXiFSIzrnFPA7Ciy8hXNv4c0GTSxg0qlOy0CxNU-XJ-xvQakivEgDt1HZcjoLS7uiMG7_oOmHg8ZsOnRL9Qej2-Z1f5PdThRDyBXGAwCafGPUW87NXG0hi8ahvhwNk/s1600-h/16052008351.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimaMlCxT8MF_K8d6bXiFSIzrnFPA7Ciy8hXNv4c0GTSxg0qlOy0CxNU-XJ-xvQakivEgDt1HZcjoLS7uiMG7_oOmHg8ZsOnRL9Qej2-Z1f5PdThRDyBXGAwCafGPUW87NXG0hi8ahvhwNk/s400/16052008351.jpg" alt="" id="BLOGGER_PHOTO_ID_5201113374184272930" border="0" /></a><br /><br />Seems it tasted good:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgF8hoc8ogWE5kRzZSp1gEv2WWB_ltA0poEsiD4C50MwGGH2ioPw0Sl9tAANlt0C6Z8qxutX_XWv_ItUkDUo-x8XCBAsa55TYpJEk0GPRwI2vdssoMgWgyZY8nEK0PGkHLwB_voT4YfFKgm/s1600-h/16052008354.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgF8hoc8ogWE5kRzZSp1gEv2WWB_ltA0poEsiD4C50MwGGH2ioPw0Sl9tAANlt0C6Z8qxutX_XWv_ItUkDUo-x8XCBAsa55TYpJEk0GPRwI2vdssoMgWgyZY8nEK0PGkHLwB_voT4YfFKgm/s400/16052008354.jpg" alt="" id="BLOGGER_PHOTO_ID_5201113378479240242" border="0" /></a>Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com2tag:blogger.com,1999:blog-6568744196982634289.post-31607044951358296562008-05-07T01:38:00.000-07:002008-05-07T01:38:08.621-07:00snapshot.debian.net saved me againOn one computer I am taking care of, I suddenly started getting:<br /><pre><br />$ ps2pdf fa_808.ps fa_808.pdf<br />/usr/bin/ps2pdfwr: line 45: exec: gs: not found<br /></pre><br />What's wrong? <br /><pre><br />$ ls /usr/bin/gs<br />ls: cannot access /usr/bin/gs: No such file or directory<br />$ wajig find-file /usr/bin/gs<br />ghostscript: /usr/bin/gs<br />$ wajig list ghostscript<br />ii ghostscript 8.61.dfsg.1-1 The GPL Ghostscript PostScript/PDF interpret<br />ii ghostscript-x 8.61.dfsg.1-1 The GPL Ghostscript PostScript/PDF interpret<br /></pre><br />That is really weird, the file /usr/bin/gs is simply missing, even though I have the ghostscript package installed. Ok, let's reinstall it:<br /><pre><br />$ wajig reinstall ghostscript<br />Reading package lists... Done<br />Building dependency tree <br />Reading state information... Done<br />The following packages were automatically installed and are no longer required:<br /> libwine-capi libstdc++5 libopenal0a xgnokii libglut3 libcapi20-3<br /> libggi-target-x lib64gfortran2 libsvg1 lib64gomp1 libggi2 libgii1<br /> libgii1-target-x libxine1-gnome cups-pdf lib64objc2<br />Use 'apt-get autoremove' to remove them.<br />The following extra packages will be installed:<br /> akregator gs kaddressbook kaddressbook-plugins kalarm kandy kappfinder karm<br /> kate kcontrol kdebase-bin kdebase-data kdelibs-data kdelibs4c2a<br /> kdepim-kfile-plugins kdepim-kio-plugins kdepim-kresources kdepim-wizards<br /> kdesktop kghostview kicker kitchensync kleopatra kmplayer kmplayer-common<br /> kpersonalizer ksplash libarts1c2a libgnutls26 libgs8 libilmbase6 libkcal2b<br /> libkdepim1a libkleopatra1 libkmime2 libkonq4 libkpimidentities1 libktnef1<br /> libopenexr6<br />Suggested packages:<br /> kdeaddons-doc-html ntpdate ntp-simple perl-suid egroupware ffmpeg xawtv<br /> gnutls-bin<br />The following packages will be REMOVED:<br /> digikam kde-amusements kde-core kdeaddons kdebase kdebase-kio-plugins kdepim<br /> kmail kmailcvt kmplayer-plugin knights konq-plugins konqueror<br /> konqueror-nsplugins korn smb4k<br />The following NEW packages will be installed:<br /> gs libgnutls26 libilmbase6 libopenexr6<br />The following packages will be upgraded:<br /> akregator ghostscript kaddressbook kaddressbook-plugins kalarm kandy<br /> kappfinder karm kate kcontrol kdebase-bin kdebase-data kdelibs-data<br /> kdelibs4c2a kdepim-kfile-plugins kdepim-kio-plugins kdepim-kresources<br /> kdepim-wizards kdesktop kghostview kicker kitchensync kleopatra kmplayer<br /> kmplayer-common kpersonalizer ksplash libarts1c2a libgs8 libkcal2b<br /> libkdepim1a libkleopatra1 libkmime2 libkonq4 libkpimidentities1 libktnef1<br />36 upgraded, 4 newly installed, 16 to remove and 683 not upgraded.<br />Need to get 53.1MB of archives.<br />After this operation, 42.9MB disk space will be freed.<br />Do you want to continue [Y/n]? n<br />Abort.<br /></pre><br />Oops, unstable is broken at the moment. Ok, what now? Well, <a href="http://snapshot.debian.net">snapshot.debian.net</a> comes to rescue again. Find "ghostcript", version "8.61.dfsg.1-1" and here we are:<br /><pre><br />$ wget http://snapshot.debian.net/archive/2008/03/02/debian/pool/main/g/ghostscript/ghostscript_8.61.dfsg.1-1_i386.deb<br />$ wajig install ./ghostscript_8.61.dfsg.1-1_i386.deb<br /></pre><br />And all is fine now:<br /><pre><br />$ ls /usr/bin/gs<br />/usr/bin/gs<br /></pre>Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com0tag:blogger.com,1999:blog-6568744196982634289.post-19360473920143252332008-03-25T18:21:00.000-07:002008-03-25T18:23:31.336-07:00SymPy accepts Google Summer of Code applications<a href="http://code.google.com/p/sympy/">SymPy</a> is a pure Python library for symbolic mathematics. Last year SymPy had 5 excellent students and this year we are <a href="http://code.google.com/p/sympy/wiki/GSoC2008">accepting</a> students again.<br />Why should you apply? And why to SymPy?<br /><br />Well, let me give you some reasons:<br /><br /><ul><li>First of all, it's fun. To get some idea, read the <a href="http://code.google.com/p/sympy/wiki/GSoC2007">GSoC2007 SymPy page</a>, where you can find out what the last year students did and especially read their reports, where they describe their impressions from the summer, how they tackled problems and their overall conclusions.</li><li>It's not just about coding, we enjoy the social part too. There is a great community around numpy, scipy, ipython, matplotlib, Sage and similar tools and if you do scientific computing with Python, you gain a lot just being part of it, because you learn new things from the others.</li><li>I currently live in <a href="http://en.wikipedia.org/wiki/Prague">Prague</a> (most people say it's a beautiful city, but I actually like Los Angeles, or the Bay Area:), if there are enough interested people, we can make a coding sprint here (plus of course some sightseeing+pubs). Anyone with a good commit history is welcome to stay at my apartment. :)<br /></li><li>You earn $4500, some of which I suggest to spend on travelling to conferences/workshops, here are some tips: <a href="http://www.scipy.org/SciPy2008">SciPy2008</a> (see also <a href="http://www.scipy.org/SciPy2007">SciPy2007</a>), <a href="http://www.scipy.org/EuroSciPy2008">EuroSciPy2008</a>, Sage Days (you can read my impressions from <a href="http://ondrejcertik.blogspot.com/2007/11/sage-days-6.html">SD6</a> and <a href="http://ondrejcertik.blogspot.com/2008/03/sage-days-8.html">SD8</a>), watch the numpy/scipy mailinglists for announcement of other meetings.<br /></li></ul><br /><br />Read also the <a href="http://groups.google.com/group/sympy/browse_thread/thread/c5b1a293802e2e25">current status and motivation</a> of SymPy and it's relation to Sage. If you want to apply, all the necessary information is on our <a href="http://code.google.com/p/sympy/wiki/GSoC2008">wiki page</a>.<br /><br />Nevertheless, if you decide SymPy is not for you, but still you'd like to do GSoC project in a similar area, there are other good options too - one is <a href="http://scipy.org/">SciPy/NumPy</a>, the other is <a href="http://sagemath.org/">Sage</a>. Unfortunately Sage <a href="http://mabshoff.blogspot.com/2008/03/sage-vs-gsoc-2008.html">was not accepted</a> as a mentorship organization, but it has several good projects too, some of which you can do for example under the umbrella of the Python Software Foundation.<br /><br />One of them is <a href="http://groups.google.com/group/sage-devel/browse_thread/thread/445135eab8ccd3af/">improving the Sage notebook</a>. If you've never seen that - download Sage, start it (./sage), type "notebook()" and a nice Mathematica like notebook will popup in the browser. It allows collaborative editing ala Google Docs and many other things. If you'd like to work on it, reply to the <a href="http://groups.google.com/group/sage-devel/browse_thread/thread/445135eab8ccd3af/">email</a> on sage-devel.Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com0tag:blogger.com,1999:blog-6568744196982634289.post-15373812633029335902008-03-06T14:50:00.000-08:002008-03-06T14:51:40.982-08:00Sage Days 8Between February 29 and March 4, 2008 I attended the <a href="http://wiki.sagemath.org/days8">Sage Days 8</a>, hosted at the <a href="http://www.enthought.com/">Enthought</a> headquarters in Austin, Texas. This was my 5th time in the USA and it was a marvelous experience, as with all my visits in the states.<br /><br />As usual, I had some adventures in Atlanta, that interested readers can find at the end of this post. Anyway, on the Austin's airport I met Peter and his wife Crystal, Fernando, Benjamin, Jarrod, Eric and Clement. We went to have a dinner and then me and Clement were staying at Peter's house:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWgR-3omFPeu-UhBISwTfCUpEpBufvYUCtqwd_RYfzvHQ1wlZj2t4W8t5p6eMLq4c0ALB3JdTszdXQ9BTt2ZGFh7YZReS7LPGaBXr2kT6hdzd9nKOGLv9fPVqBIMUs5e3dB3P_HnKz4ZnT/s1600-h/29022008331.jpg"><img style="cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWgR-3omFPeu-UhBISwTfCUpEpBufvYUCtqwd_RYfzvHQ1wlZj2t4W8t5p6eMLq4c0ALB3JdTszdXQ9BTt2ZGFh7YZReS7LPGaBXr2kT6hdzd9nKOGLv9fPVqBIMUs5e3dB3P_HnKz4ZnT/s400/29022008331.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5174488332687291666" /></a><br /><br />You can see the neighbor's cat and Peter's dog Trinity behind the window. The next day we went to Enthought, that was providing us with a breakfast and a lunch each day - and it was delicious. After the breakfast, we gathered in the room and introduced ourselves. Enthought rents 3/4 of the 21th floor in the Bank of America building, so when I looked left I saw:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijtf9UsGNhSN-8hnSSog5VoYEk8HIAJcI4-0CWEQ8mEi7kQK0CVi7AEg7pXx4MwtDQKWRyKBJrms6ofXDlDqQS6J-52Hnv4WOOJmVgbwPLnjTZAckD9hvIy1Pc6R7sHVfcndjNbZaHJHQg/s1600-h/29022008333.jpg"><img style="cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijtf9UsGNhSN-8hnSSog5VoYEk8HIAJcI4-0CWEQ8mEi7kQK0CVi7AEg7pXx4MwtDQKWRyKBJrms6ofXDlDqQS6J-52Hnv4WOOJmVgbwPLnjTZAckD9hvIy1Pc6R7sHVfcndjNbZaHJHQg/s400/29022008333.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5174490493055841570" /></a><br /><br />When I looked behind I saw:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPLtZaO1VwFEM0D3WuaZRxaN6_VXAZzbkRhrh1pNqcCTGhRPcMEE4faWlcIr9bQ7wnLNqUnx3rYz2jDrCsZfkro2aATVEtSxwabpSzu2cUQLqOHB7Ht_hA0a5UW7H-6QD9SOLdHTKr8TCy/s1600-h/29022008332.jpg"><img style="cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPLtZaO1VwFEM0D3WuaZRxaN6_VXAZzbkRhrh1pNqcCTGhRPcMEE4faWlcIr9bQ7wnLNqUnx3rYz2jDrCsZfkro2aATVEtSxwabpSzu2cUQLqOHB7Ht_hA0a5UW7H-6QD9SOLdHTKr8TCy/s400/29022008332.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5174490497350808882" /></a><br /><br />and in front of me, I saw all the participants (I took <a href="http://picasaweb.google.com/ondrej.certik/SageDays8">photos</a> of all participants together with names). As you can see, there were really good people in there, like Travis (creator of NumPy), William (main author of Sage), Eric (CEO of Enthought), Fernando (author of IPython), Jarrod (the release manager of SciPy), Michael (the release manager of Sage) etc. See also the Fernando's <a href="http://video.google.com/videoplay?docid=-3122487088315342993&hl=en">welcome speech</a> and the <a href="http://video.google.com/videoplay?docid=-5264024938148088338&hl=en">video</a> of each of us introducting himself.<br /><br />The views from the windows are terrific. I enjoyed working on each of the 4 sides of the skyscraper with completely different scenery, or when the sun is going down, that's also very cool. <br /><br />We spent the whole Friday doing presentations, some of which you can find <a href="http://wiki.sagemath.org/days8/schedule">here</a>. Then we went to Eric's house to have a big dinner together.<br /><br />On Saturday, Sunday and Monday we were all hacking on many different things. I joined Fernando, Benjamin, Brian and Stefan on ipython1, Travis was implementing a new type (gmp integer) in NumPy, William wrote a manipulate command in Sage, Eric did the same in Traits, Gary and Michael implemented parallel testing of Sage, ...<br /><br />On Tuesday we had final status reports and people left in the afternoon. In the evening we went with Clement to have a dinner and then we visited some bars on the 6th street, having a beer in each.<br /><br />On Wednesday I visited John and Roy from the <a href="http://www.cfdlab.ae.utexas.edu/">Computational Fluid Dynamics Lab</a> at the University of Texas, Austin, who wrote the <a href="http://libmesh.sourceforge.net/">libMesh</a> library, that I extensively used and also created a Debian <a href="http://packages.debian.org/source/sid/libmesh">package</a> of. It was very influential to see the libMesh "from behind", also John and Roy are cool people (not mentioning the Debian tradition of having good relations with upstream:). Then I visited some professors at the same campus, after which I went into the <a href="http://en.wikipedia.org/wiki/Texas_State_Capitol">Capitol</a> and then I took the bus to the <a href="http://www.simon.com/mall/default.aspx?ID=223">Barton Creek Square Mall</a> to buy some <a href="http://www.apple.com/ipodshuffle/">ipods</a> and jeans, so that I can say I have jeans from Texas. BTW, the ipod works excellent in Debian - I plugged it in and it just shows on my Gnome desktop. It's true that naively dragging mp3 files on it didn't make it play, but these <a href="http://www.geocities.com/kymacpherson/ipod/linux_ipod.html">instructions</a> made it work.<br /><br />On Thursday I fixed the remaining release blockers in SymPy and made a new release. In the evening, I am going to meet <a href="http://www.ph.utexas.edu/~aswin/">Aswin</a>, he also uses SciPy and also is a friend of <a href="http://linuxgazette.net/authors/appaiah.html">Kumar</a>, who is now maintaining python-numpy and python-scipy Debian packages with me (Kumar also knows <a href="http://www.aero.iitb.ac.in/~prabhu/">Prabhu</a>, the author of <a href="http://code.enthought.com/mayavi2/">Mayavi2</a> hosted at Enthought, so it's all connected). <br /><br />Anyway, the whole workshop was an excellent experience for me. I learned a lot of new things and being able to speak with people who wrote tools that I use almost everyday is important. We also extensively discussed the future of all the projects (Sage, SciPy, NumPy, IPython, Cython, SymPy). See my summarizing <a href="http://groups.google.com/group/sympy/browse_thread/thread/c5b1a293802e2e25/">email</a> to the SymPy mailinglist.<br /><br />Another thing, that I find very interesting is that Microsoft is financing the windows port of Sage, that will make basically anything that uses Python/Cython/C/Fortran very easy to install on windows (just a spkg package in sage). I find it really cool that MS is not only supporting but even financing a truly opensource project.<br /><br />Finally the promised adventure in Atlanta: we took off the Prague airport on February 28th with a 2 hours delay (due to some paperwork as we were told by the captain). As I had 3 hours in Atlanta for the connection to Austin and I had to go through immigration, it was clear that I'll miss it. But I was not surprised, last time I was flying through Atlanta, they canceled my flight to LA completely. We arrived in Atlanta an hour and a half before my departure, then I was waiting for about an hour at immigration, it was incredibly slow. When I had around 20 min to departure, I had to ask people standing in front of me if they let me in, they were very nice and did. I was leaving immigration 10 min to my departure, then I was running to get my luggage and myself through customs and screening, it was 5 min to my departure when I ran down to the display with departure times. Then I was sprinting like hell to the terminal D to only see the clerk doing some final paperwork with all the people already boarded and the jetway door shut. After a little persuading he let me in too, fortunately there was still one seat left, so I made it. You can imagine my pleasant surprise in Austin when I discovered, that my luggage made it too, considering that I handed it to the Atlanta's airport personnel exactly 10 min prior the departure.Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com3tag:blogger.com,1999:blog-6568744196982634289.post-68692861225006022342008-02-26T17:00:00.000-08:002008-02-26T09:10:32.415-08:00XFS is 20x slower than ext3 (with default settings)Is XFS that bad? Well, at least with default settings, XFS on Debian seems to be blown away by ext3 completely in terms of speed. I don't mind 1.5x slowdown, maybe even 2x, but 20x is a show stopper. I am already using ext3 for any pbuilder builds, because it's a difference to wait for 30s with XFS, compared to 3s with ext3 to extract the base image. And I'll probably switch to ext3 completely, unless someone finds a way how to fix this.<br /><br />I recently got burned by this when running <a href="http://sagemath.org">Sage</a> on my computer, because it compiles a lot of Python files when started for the first time. Normally it should take roughly 15s, but instead it took 6 minutes on my comp and then it triggered a so far undiscovered bug in Sage, that I <a href="http://groups.google.com/group/sage-support/browse_thread/thread/f7a874e6762467e3">reported</a>.<br /><br /><a href="http://mabshoff.blogspot.com/">Michael Abshoff</a>, the release manager of Sage, <a href="http://groups.google.com/group/sage-support/msg/96896d266c89f331">suggested</a> that something is <a href="http://en.wikipedia.org/wiki/FUBAR">FUBAR</a> (Fucked Up Beyond Any Recognition) on my shiny Debian amd64 sid system running on <a href="http://www.intel.com/products/processor/core2quad/index.htm">Intel Core Quad</a>, so I said no way, because I really care about this machine, as I use it for larger finite elements calculations and other stuff (like compiling huge deb packages in parallel, like <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=462631">paraview</a>). <br /><br />So I <a href="http://groups.google.com/group/sage-support/msg/41ad72703a3163cf">offered</a> a bet, that I give him an access to this compter, he finds the problem and if it's a problem in my Debian configuration, I'll write to this blog that I am lame, while if it's a problem in Sage, he will write to his blog that he is lame. And I was smiling to myself, how good I am and that I will have some fun too reading <a href="http://planet.sagemath.org/">planet.sagemath.org</a> with the top post from Michael saying that he is lame.<br /><br />But then I remembered my old struggle with cowbuilder and XFS and I stopped smiling. See e.g. this <a href="http://wiki.debian.org/cowbuilder_benchmark">wiki</a> I created half a year ago. Something is FUBAR with XFS and Debian. I also asked on the Czech server <a href="http://root.cz">Root</a>, that is famous for having a lot of experts willing to share their knowledge, and it was quickly revealed, that the problem is with the "nobarrier" option of XFS (my post is <a href="http://www.root.cz/diskuse/2321/">here</a>, but it's in Czech).<br /><br />First, on that amd64 machine, the above problem was fixed after issuing this command:<br /><pre><br />mount -o remount,rw,nobarrier /dev/sda3 /home/<br /></pre><br />(notice the "nobarrier" option). You can <a href="http://lkml.org/lkml/2006/5/22/278">read</a> some background behind this on the lkml list. Unfortunately, I also have my laptop, and there I already use this "nobarrier" option, and it doesn't help at all. I just created a new ext3 partition and verified that on my laptop, ext3 is around 10x faster than XFS with nobarrier (that was supposed to fix this). I use the latest 2.6.24 kernel from unstable on both.<br /><br />Time to move from XFS to ext3 on my laptop? Seems like that. I'll leave XFS on the other machine, because I know some other peole have good experience with XFS and the "nobarrier" option seems to fix the problem there.<br /><br />But as to the bet, yeah, I am lame and I should still learn a lot from Michael. :)Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com8tag:blogger.com,1999:blog-6568744196982634289.post-12351425802085313612008-01-03T07:40:00.000-08:002008-01-03T11:05:50.709-08:00SymPy/sympycore (pure Python) up to 5x faster than Maxima (future of Sage.calculus?)According to <a href="http://groups.google.com/group/sympycore/browse_thread/thread/8062076c7bc8807d">this</a> test, <a href=http://code.google.com/p/sympycore/>sympycore</a> is from 2.5x to 5x faster than Maxima. This is an absolutely fantastic result and also a perfect certificate for Python in scientific computing. Considering that we compare pure Python to LISP.<br /><br />Ok, this made us excited, so we dugg deeper and ran more benchmarks. But first, let me say a few general remarks. I want a fast CAS (Computer Algebra System) in Python. General CAS, that people use, that is useful, that is easily extensible (!), that is not missing anything, that is comparable to Mathematica and Maple -- and most importantly -- I want it now and I don't care about 30 years horizons (I won't be able to do any serious programming in 30 years anyway). All right. How to do that? Well, many people tried... And failed. The only opensource CAS system, that has any chance of becoming the opensource CAS, in my own opinion, is <a href="http://sagemath.org/">Sage</a>. You can read more about my impressions form Sage <a href="http://ondrejcertik.blogspot.com/2007/11/sage-days-6.html">here</a>. I am actually only interested in mathematical physics, so basically Sage.calculus. Currently Sage uses Maxima, because Maxima is old, proven, working system and it's reasonably fast and quite reliable, but written in LISP. Some people like LISP. I don't and I find it extremely difficult to extend Maxima. Also even though Maxima is in LISP, it uses it's own language for interacting with the user (well, that's not the way). I like python, so I want to use Python. Sage has written Python wrappers to Maxima, so Sage can do almost everything that Maxima can, plus many other things. Now. But the Sage.calculus has issues.<br /><br />First, I don't know how to extend the wrappers with some new things, see my <a href="http://groups.google.com/group/sage-devel/msg/906f9b991c68de06">post</a> in the sage-devel for details, it's almost 2 months old with no reaction, which shows that it's a difficult issue (or nonsense:)).<br /><br />And second, it's slow. For some examples that Sage users have found out, even <a href="http://code.google.com/p/sympy/">SymPy</a>, as it is now, is 7x <a href="http://groups.google.com/group/sage-support/msg/8f1a7ed5a49df1a0">faster</a> than Sage and sympycore 23x faster and with the recent speed improvements 40x faster than Sage.<br /><br />So let's improve Sage.calculus. How? Well, no one knows for sure, but<br />I believe in my original idea of pure Python CAS (SymPy), possibly with some parts rewritten in C. Fortunately, quite a lot of us believe that this is the way.<br /><br />What is this sympycore thing? In sympy, we wanted to have something now, instead of tomorrow, so we were adding a lot of features, not looking too much on speed. But then Pearu Peterson came and said, guys, we need speed too. So he rewrote the core (resulting in 10x to 100x speedup) and we moved to the new core. But first, the speed isn't sufficient, and second it destabilized SymPy a lot (there are still some problems with caching and assumptions half a year later). So with the next package of speed improvements, we decided to either port them to the current sympy, or wait until the new core stabilizes enough. So the new new core is called sympycore now, currently it only has the very basic arithmetics (and derivatives and simple integrals), but it's very fast. It's mainly done by Pearu. But for example the latest speed improvement using sexpressions was invented by Fredrik Johansson, another SymPy developer and the author of <a href="http://code.google.com/p/mpmath/">mpmath</a>.<br /><br />OK, let's go back to the benchmarks. First thing we realized is that Pearu was using CLISP 2.41 (2006-10-13) and compiled Maxima by hand in the above timings, but when I tried Maxima in Debian (which is compiled with GNU Common Lisp (GCL) GCL 2.6.8), I got different results, Maxima did beat sympycore.<br /><br />SymPyCore:<br /><pre><br />In [5]: %time e=((x+y+z)**100).expand()<br />CPU times: user 0.57 s, sys: 0.00 s, total: 0.57 s<br />Wall time: 0.57<br /><br />In [6]: %time e=((x+y+z)**20 * (y+x)**19).expand()<br />CPU times: user 0.25 s, sys: 0.00 s, total: 0.25 s<br />Wall time: 0.25<br /></pre><br />Maxima:<br /><pre><br />(%i7) t0:elapsed_real_time ()$ expand ((x+y+z)^100)$ elapsed_real_time ()-t0;<br />(%o9) 0.41<br />(%i16) t0:elapsed_real_time ()$ expand ((x + y+z)^20*(x+z)^19)$ elapsed_real_time ()-t0;<br />(%o18) 0.080000000000005<br /></pre><br /><br />So when expanding, Maxima is comparable to sympycore (0.41 vs 0.57), but for general arithmetics, Maxima is 3.5x faster. We also compared GiNaC (resp. swiginac):<br /><pre><br />>>> %time e=((x+y+z)**20 * (y+x)**19).expand()<br />CPU times: user 0.03 s, sys: 0.00 s, total: 0.03 s<br />Wall time: 0.03<br /></pre><br /><br />Then we compared just the (x+y+z)**200:<br /><pre><br />sympycore:<br />>>> %time e=((x+y+z)**200).expand()<br />CPU times: user 1.80 s, sys: 0.06 s, total: 1.86 s<br />Wall time: 1.92<br />swiginac:<br />>>> %time e=((x+y+z)**200).expand()<br />CPU times: user 0.52 s, sys: 0.02 s, total: 0.53 s<br />maxima:<br />(%i41) t0:elapsed_real_time ()$ expand ((x + y+z)^200)$ elapsed_real_time ()-t0;<br />(%o43) 2.220000000000027<br /></pre><br /><br />Where GiNaC still wins, but sympycore beats Maxima, but the timings really depend on the algorithm used, sympycore uses Millers algorithm which is the most efficient.<br /><br />So then we tried a fair comparison: compare expanding x * y where x and y are expanded powers (to make more terms):<br /><pre><br /><pearu> sympycore:<br /><pearu> >>> from sympy import *<br /><pearu> >>> x,y,z=map(Symbol,'xyz')<br /><pearu> >>> xx=((x+y+z)**20).expand()<br /><pearu> >>> yy=((x+y+z)**21).expand()<br /><pearu> >>> %time e=(xx*yy).expand()<br /><pearu> CPU times: user 2.21 s, sys: 0.10 s, total: 2.32 s<br /><pearu> Wall time: 2.31<br /><pearu> swiginac:<br /><pearu> >>> xx=((x+y+z)**20).expand()<br /><pearu> >>> yy=((x+y+z)**21).expand()<br /><pearu> >>> %time e=(xx*yy).expand()<br /><pearu> CPU times: user 0.30 s, sys: 0.00 s, total: 0.30 s<br /><pearu> Wall time: 0.30<br /><pearu> maxima:<br /><pearu> (%i44) xx:expand((x+y+z)^20)$<br /><pearu> (%i45) yy:expand((x+y+z)^21)$<br /><pearu> (%i46) t0:elapsed_real_time ()$ expand (xx*yy)$ elapsed_real_time ()-t0;<br /><pearu> (%o48) 0.57999999999993<br /></pearu></pearu></pearu></pearu></pearu></pearu></pearu></pearu></pearu></pearu></pearu></pearu></pearu></pearu></pearu></pearu></pearu></pearu></pearu></pre><br />So, sympycore is 7x slower than swiginac and 3x slower than maxima. We are still using pure Python, so that's very promising. <br /><br />When using sexpr functions directly then 3*(a*x+..) is 4-5x faster than Maxima in Debian/Ubuntu. So, the headline of this post is justified. :)<br /><br /><span style="font-weight: bold;">Conclusion</span><br /><br />Let's build the car. Sage has the most features and it is the most complete car. It has issues, some wheels need to be improved (Sage.calculus). Let's change them then. Maybe SymPy could be the new wheel, maybe not, we'll see. SymPy is quite a reasonable car for calculus (it has plotting, it has exports to latex, nice, simple but powerfull command line with ipython and all those bells and whistles and it can also be used as a regular python library). But it also has issues, one wheel should be improved. That's the sympycore project.<br /><br />All those smaller and smaller wheels show, that this is indeed the way to go, but very important thing is to put them back in the car. I.e. sympycore back to sympy and sympy back to Sage and integrate them well. While also leaving them as separate modules, so that users, that only need one particular wheel, can use them.Anonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.com2