tag:blogger.com,1999:blog-34733995172460443602024-03-13T22:57:30.522+01:00Harald SchillyUnknownnoreply@blogger.comBlogger37125tag:blogger.com,1999:blog-3473399517246044360.post-4920565769320507112018-04-24T16:40:00.003+02:002018-04-24T16:40:41.578+02:00SageMath GSoC 2018 Projects<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana, sans-serif;">We're happy to announce our list of <a href="https://summerofcode.withgoogle.com/organizations/6294052148871168/">Google Summer of Code</a> projects for 2018! Thank you to everyone involved, all students, mentors and of course, Google! </span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Sai Harsh Tondomker (David Coudert and Dima Pasechnik):</span><br />
<h3 style="text-align: left;">
<span style="font-family: Verdana, sans-serif;">Addition of SPQR-tree to graph module</span></h3>
<span style="font-family: Verdana, sans-serif;"><i>In this project, our goal is to extend the graph theory library in Sage by implementing functionality to find triconnected subgraphs, which will partition an undirected graph into 3-connected components and the construction of the corresponding SPQR-tree. These modules can later be used as pre-processing for several graph problems such as Hamiltonian Cycle, traveling salesman problem.</i></span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Meghana M Reddy (David Coudert and Dima Pasechnik):</span><br />
<h3 style="text-align: left;">
<span style="font-family: Verdana, sans-serif;">Addition of SPQR-trees to the graph module of Sage Math</span></h3>
<i><span style="font-family: Verdana, sans-serif;">The aim of the project is to code the linear time algorithm for partitioning a graph into 3-connected components and constructing the corresponding SPQR-tree of the graph. Further, this algorithm can be used as a subroutine for several other graph problems such as recognition of chordless graphs, hamiltonian cycle etc.</span></i><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Filip Ion (Johan Rosenkilde):</span><br />
<h3 style="text-align: left;">
<span style="font-family: Verdana, sans-serif;">Databases and bounds of codes</span></h3>
<i><span style="font-family: Verdana, sans-serif;">The following proposal detail some possible improvements of the coding theory component of SageMath. We aim to build databases of precomputed bounds and optimal examples of linear codes for each choice of parameters below a maximum range.</span></i><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Raghukul Raman (Travis Scrimshaw and Benjamin Hutz):</span><br />
<h3>
<span style="font-family: Verdana, sans-serif;">Rational Point on Varieties</span></h3>
<i><span style="font-family: Verdana, sans-serif;">This project aims at implementing basic algorithms for finding rational points on varieties. Classically algebraic variety is defined as the set of solutions of polynomial equations over a number field. A rational point of an algebraic variety is a solution of set of equations in the given field (rational field if not mentioned). Much of the number theory can be viewed as the study of rational point of algebraic varieties. Some of the great achievements of number theory amount to determining the rational points on particular curves. For example, Fermat’s last theorem is equivalent to the statement that for an integer n ≥ 3, the only rational point of the curve xn+yn=zn in P2 over Qare the obvious ones. Common variants of these question include determining the set of all points of V(K) of height up to some bound. The aim of this project is to implement some basic rational point finding algorithms (sieving modulo prime and enumeration) and extend these to product_projective_space scheme.</span></i><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Dario Asprone (Dima Pasechnik)</span><br />
<h3 style="text-align: left;">
<span style="font-family: Verdana, sans-serif;">Checking graph isomorphism using the Weisfeiler-Lehman algorithm</span></h3>
<i><span style="font-family: Verdana, sans-serif;">Currently SageMath checks for graph isomorphism through an internal package with a corresponding method, called isomorphic and contained in sage.groups.perm_gps.partn_ref.refinement_graphs. This method, in addition to being quite convoluted and without much documentation about its inner workings, was last updated in a significant manner in 2011.</span></i><br />
<i><span style="font-family: Verdana, sans-serif;">The project aims at creating a new package which implements an efficient in practice heuristic method to check if two graphs are isomorphic, using one of the members of the Weisfeiler-Lehman (WL) algorithm hierarchy. An attempt was made in the past at the same task (but with a narrower scope, limited to only implementing the second order version of the WL algorithm), but the code was found to contain a bug and was never implemented/removed from the codebase (see Trac #10482).</span></i><br />
<i><span style="font-family: Verdana, sans-serif;">To the best of my knowledge, this would be the first working open-source implementation of k-WL, for k > 1.</span></i><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-53044909951051119732017-05-05T18:02:00.002+02:002017-05-05T18:03:53.828+02:00SageMath GSoC 2017 Projects<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
<span style="font-family: inherit;">6 GSoC SageMath Projects</span></h2>
<span style="font-family: inherit;">During the past couple of summers, SageMath successfully managed many <a href="https://summerofcode.withgoogle.com/">Google Summer of Code</a> projects. This year we are again <a href="https://summerofcode.withgoogle.com/organizations/5790079692832768/"><b>happy to have six projects</b></a>:</span><br />
<span style="font-family: inherit;"><span style="font-family: "verdana" , sans-serif;"><br /></span>
</span><br />
<h3 style="text-align: left;">
<span style="font-family: inherit;">Implementing matroid classes and plotting improvements</span></h3>
<span style="font-family: inherit;">(Zachary Gershkoff / Stefan van Zwam)</span><br />
<blockquote class="tr_bq">
<span style="font-family: inherit;">This project seeks to implement several common matroid classes in SageMath, along with algorithms for their display and relevant computations. The graphic matroid class in particular will be implemented with a representative graph with methods for Whitney switching and minor operations. This will be accompanied by improvements to the graph theory library, with methods relevant to matroids enabled to support multigraphs. Other modules for this project include improved plotting of rank 3 matroids to eliminate false colinearities, computation of a matroid's automorphism group using SageMath's group theory libraries, and faster minor testing based on an existing trac ticket.</span></blockquote>
<h3 style="text-align: left;">
<span style="font-family: inherit;">Expanding the Functionality of Dynamical Systems</span></h3>
<div>
<span style="font-family: inherit;">(</span>Rebecca Lauren Miller / Paul Fili and Ben Hutz)</div>
<div>
<br /></div>
<div>
<blockquote class="tr_bq">
As a member of the sage-dynamics community, researchers have compiled a wishlist for algorithms and functionality they would like added. I would like to shorten the wish list for us.For my project I will be completing some desired additions to SAGE from the Sage Dynamics Wiki. I will implement Well’s Algorithm, strengthen the numerical precision in cannonical_height, as well as implement reduced_form for higher dimensions.</blockquote>
</div>
<div>
<h3 style="text-align: left;">
Improvement of Complex Dynamics in Sage</h3>
</div>
<div>
(Ben Barros / Adam Towsley and Ben Hutz)</div>
<div>
<blockquote class="tr_bq">
There are three major things that I would like to implement to improve the functionality of Sage in the area Complex Dynamics. The details of the project are summarized in the following list:<br />
<ul style="text-align: left;">
<li><b>Complex Dynamics Graphical package: </b>Integrate or implement a complex dynamics software such as Mandel into Sage. This will be done by creating an optional package for Sage. If there is enough demand, the package may become a standard package for Sage at some point.</li>
</ul>
<ul style="text-align: left;">
<li><b>Spider Algorithm:</b> The object of the Spider Algorithm is to construct polynomials with assigned combinatorics. For example, we may want to find a polynomial that has a periodic orbit of period 7. The Spider Algorithm provides a way for us to compute this polynomial efficiently. I plan to implement this algorithm into Sage.</li>
</ul>
<ul style="text-align: left;">
<li><b>Coercion: </b>If you have a map defined over Q, you should be able to take the image of a point over C (i.e. somewhere you have a well-defined embedding) without having to use the command "change_ring()". Something similar works for polynomials in Sage but it does not work for morphisms/schemes.</li>
</ul>
</blockquote>
</div>
<div>
<h3>
Linear-time Implementation of Modular Decomposition of Undirected and Directed Graphs</h3>
<div>
(Lokesh Jain / Dima Pasechnik)</div>
<blockquote class="tr_bq">
This project is aimed at providing linear time implementation for modular decomposition of graphs and digraphs. Modular decomposition is decomposition of graph into modules. A module is a subset of vertices and it is a generalization of connected component in graph. Let us take for example a module X. For any vertex v ∉ X it is either connected or not connected to every vertex of X. Another property of module is that a module can be subset of another module. There are various algorithms which have been published for modular decomposition of graphs. The focus in this project is on linear time complexity algorithms which can be practically implemented. The project further aims to use the modules developed for modular decomposition to implement other functionality like skew partitions. Skew partition is partition of graph into two sets of vertices such that induced graph formed by one set is disconnected and induced graph formed by other set is complement of the first. Modular decomposition is a very important concept in Graph Theory and it has a number of use cases. For instance it has been an important tool for solving optimization and combinatorics problems.</blockquote>
</div>
<div>
<br /></div>
<h3 style="text-align: left;">
Modular Decomposition of graphs and digraphs</h3>
<div>
(Maria Ioanna Spyrakoy / Dima Pasechnik)</div>
<div>
<blockquote class="tr_bq">
Modular decomposition of (di)graphs is a generalization of the concept of the decomposition of (di)graphs into connected components. Its current implementation in Sage relies on badly broken abandoned C code, and badly needs to be replaced by something that works and is not too slow. However, the only open-source implementations of some of these procedures are either in Java or in Perl, and thus aren't really useful for Sage.</blockquote>
</div>
<div>
<br /></div>
<div>
<b>Note:</b> A attentive reader might notice the similarity between those projects. They will be split regarding the type of graph and be coordinated to not overlap but to augment each other.</div>
<h3 style="text-align: left;">
Visualizing constructs in cluster algebras and quiver representations</h3>
<div>
(Bryan Wang / Travis Scrimshaw)</div>
<div>
<blockquote class="tr_bq">
I aim to implement visualizations of several key constructs in cluster algebras and quiver representations. The first is Auslander-Reiten quivers, for at least the A_n and D_n cases. The second is labelled endomorphism quivers and mutations within a cluster category, focusing on the A_n case. The third is posets of down-mutations for the A_n case. These features will be useful not only for research purposes, but also as nice examples to play around with and learn from. Aside from these features, I am interested in implementing features for the Quantum Cluster Algebras project.</blockquote>
</div>
<div>
<br /></div>
<div>
All the best for this summer, thank you to Google for making this possible, and sorry to all those candidates who didn't make it ...</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-48712590299304269442015-11-19T09:16:00.001+01:002015-11-19T09:16:24.181+01:00Sage Days 70 - Berkeley - November 2015<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "verdana" , sans-serif;"><a class="g-profile" href="https://plus.google.com/108676679876909469255" target="_blank">+Dennis Stein</a> brought his cameras and tools to Sage Days 70: </span><br />
<div style="text-align: center;">
<br /></div>
</div>
<div style="text-align: center;">
<iframe allowfullscreen="" frameborder="0" height="340" mozallowfullscreen="" src="https://player.vimeo.com/video/146207495" webkitallowfullscreen="" width="600"></iframe> </div>
<div style="text-align: center;">
<a href="https://vimeo.com/146207495">Sage Days 70 - Berkeley - November 2015</a> from <a href="https://vimeo.com/dstein">Dennis Stein</a> on <a href="https://vimeo.com/">Vimeo</a>.</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-12135771582117964152015-04-04T19:38:00.007+02:002015-04-04T19:44:16.681+02:00R's sapply in Numpy<div dir="ltr" style="text-align: left;" trbidi="on">
One quick blog entry about <span style="font-family: Courier New, Courier, monospace;">sapply</span> and <span style="font-family: Courier New, Courier, monospace;">numpy</span>:<br />
<br />
Usually, <span style="font-family: Courier New, Courier, monospace;">sapply</span> is equal to list comprehensions in Python.<br />
i.e. <span style="font-family: Courier New, Courier, monospace;">[f(x) for x in range(1, 10)]</span> is <span style="font-family: Courier New, Courier, monospace;">sapply(1:10, f)</span>.<br />
<br />
But: When you want to apply a function (mapping a number to a vector!) to a vector, you get a matrix. R's sapply does raise the rank of the output to two, while in Numpy you have to push the vector to a higher rank via the magical <span style="font-family: Courier New, Courier, monospace;">vector[:, np.newaxis]</span>.<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">In [1]: import numpy as np</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">In [2]: def f(x):</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> ...: return np.array([4,2,3,9.1,-1]) * x</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> ...: </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">In [3]: f(9)</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Out[3]: array([ 36. , 18. , 27. , 81.9, -9. ])</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">In [4]: vals = np.linspace(-1,1,20)</span><br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">In [5]: np.apply_along_axis(f, 1, <b>vals[:, np.newaxis]</b>)</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Out[5]: </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">array([[-4. , -2. , -3. , -9.1 , 1. ],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [-3.57894737, -1.78947368, -2.68421053, -8.14210526, 0.89473684],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [-3.15789474, -1.57894737, -2.36842105, -7.18421053, 0.78947368],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [-2.73684211, -1.36842105, -2.05263158, -6.22631579, 0.68421053],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [-2.31578947, -1.15789474, -1.73684211, -5.26842105, 0.57894737],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [-1.89473684, -0.94736842, -1.42105263, -4.31052632, 0.47368421],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [-1.47368421, -0.73684211, -1.10526316, -3.35263158, 0.36842105],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [-1.05263158, -0.52631579, -0.78947368, -2.39473684, 0.26315789],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [-0.63157895, -0.31578947, -0.47368421, -1.43684211, 0.15789474],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [-0.21052632, -0.10526316, -0.15789474, -0.47894737, 0.05263158],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [ 0.21052632, 0.10526316, 0.15789474, 0.47894737, -0.05263158],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [ 0.63157895, 0.31578947, 0.47368421, 1.43684211, -0.15789474],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [ 1.05263158, 0.52631579, 0.78947368, 2.39473684, -0.26315789],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [ 1.47368421, 0.73684211, 1.10526316, 3.35263158, -0.36842105],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [ 1.89473684, 0.94736842, 1.42105263, 4.31052632, -0.47368421],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [ 2.31578947, 1.15789474, 1.73684211, 5.26842105, -0.57894737],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [ 2.73684211, 1.36842105, 2.05263158, 6.22631579, -0.68421053],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [ 3.15789474, 1.57894737, 2.36842105, 7.18421053, -0.78947368],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [ 3.57894737, 1.78947368, 2.68421053, 8.14210526, -0.89473684],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [ 4. , 2. , 3. , 9.1 , -1. ]])</span><br />
<br />
It also works happily for an additional argument <span style="font-family: Courier New, Courier, monospace;">weights</span>, which will be defined in the variable <span style="font-family: Courier New, Courier, monospace;">w</span>.<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">In [6]: def f(x, <b>weights</b>):</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> return <b>weights</b> * x</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> ...: </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">In [7]: <b>w = np.array([-2,-1,5,1.1])</b></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">In [8]: np.apply_along_axis(f, 1, <b>vals[:, np.newaxis]</b>, <b>w</b>)</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">Out[8]: </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">array([[ 2. , 1. , -5. , -1.1 ],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [ 1.78947368, 0.89473684, -4.47368421, -0.98421053],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [ 1.57894737, 0.78947368, -3.94736842, -0.86842105],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [ 1.36842105, 0.68421053, -3.42105263, -0.75263158],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [ 1.15789474, 0.57894737, -2.89473684, -0.63684211],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [ 0.94736842, 0.47368421, -2.36842105, -0.52105263],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [ 0.73684211, 0.36842105, -1.84210526, -0.40526316],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [ 0.52631579, 0.26315789, -1.31578947, -0.28947368],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [ 0.31578947, 0.15789474, -0.78947368, -0.17368421],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [ 0.10526316, 0.05263158, -0.26315789, -0.05789474],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [-0.10526316, -0.05263158, 0.26315789, 0.05789474],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [-0.31578947, -0.15789474, 0.78947368, 0.17368421],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [-0.52631579, -0.26315789, 1.31578947, 0.28947368],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [-0.73684211, -0.36842105, 1.84210526, 0.40526316],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [-0.94736842, -0.47368421, 2.36842105, 0.52105263],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [-1.15789474, -0.57894737, 2.89473684, 0.63684211],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [-1.36842105, -0.68421053, 3.42105263, 0.75263158],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [-1.57894737, -0.78947368, 3.94736842, 0.86842105],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [-1.78947368, -0.89473684, 4.47368421, 0.98421053],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> [-2. , -1. , 5. , 1.1 ]])</span><br />
<div>
<br /></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-1117781098245413032014-12-24T19:08:00.001+01:002014-12-24T19:08:08.099+01:00Convert several IPython Notebooks to one huge PDF<div dir="ltr" style="text-align: left;" trbidi="on">
The <a href="http://ipython.org/notebook.html" target="_blank">IPython Notebook</a> is a neat interactive document. It mixes headings, formatted text (markdown), formulas, images/pictures and interactive code. This is very neat for creating well-documented code examples.<br />
<br />
To make ordinary publishing possible, <a href="http://ipython.org/ipython-doc/2/notebook/nbconvert.html" target="_blank">nbconvert</a> converts this interactive json-based file format to ordinary static HTML or LaTeX. The <a href="http://nbviewer.ipython.org/" target="_blank">nbviewer</a> website is a well known example for such a repository of HTML-notebooks.<br />
<br />
Converting to LaTeX is also very handy, because then you can compile them to static PDF files -- e.g. think of a proper report or article.<br />
<br />
So far I know, each input document is converted to only one output document. <b>For one of my projects, I wanted to merge a whole bunch of IPython Notebooks to one (very large) PDF document!</b> To achieve this, I've looked into the various <span style="font-family: "Courier New",Courier,monospace;">*.tplx</span> template file and started to build on top of them two new templates: <span style="font-family: "Courier New",Courier,monospace;">partial</span> and <span style="font-family: "Courier New",Courier,monospace;">master</span>. As the names suggest, <span style="font-family: "Courier New",Courier,monospace;">partial</span> is the template for each partial document, and <span style="font-family: "Courier New",Courier,monospace;">master</span> is essentially empty, but combines all partial documents in an orderly fashion.<br />
<br />
You can see this here: <a href="https://github.com/haraldschilly/python-fuer-mathematiker/tree/master/doc">github:haraldschilly/python-fuer-mathematiker</a><br />
<br />
In particular:<br />
<ul style="text-align: left;">
<li><a href="https://github.com/haraldschilly/python-fuer-mathematiker/blob/master/doc/res/partial.tplx">partial.tplx</a>: This removes all the preamble and heading stuff and sets the document class to the wonderful <a href="http://www.ctan.org/tex-archive/macros/latex/contrib/subfiles">subfiles LaTeX class</a>.</li>
<li><a href="https://github.com/haraldschilly/python-fuer-mathematiker/blob/master/doc/res/master.tplx">master.tplx</a>: This template contains the default header definitions (inherited from IPython's <span style="font-family: "Courier New",Courier,monospace;">base</span> template), adds some tweaks of my own (font family, margins, title, and subfiles master class) and an embedded Python script to magically gather all documents!</li>
</ul>
<i>How it works</i>: First, all partial IPython Notebook files are converted to LaTeX using the partial template. Then, the <span style="font-family: "Courier New",Courier,monospace;">master.tplx</span> contains a small embedded Python script, which iterates through all partial LaTeX files. They are named numerically as <span style="font-family: "Courier New",Courier,monospace;"><major>-<minor>-chaptername</minor></major></span>. This script inserts all those subdocuments and if there is an increments in the major-number, it inserts a <span style="font-family: "Courier New",Courier,monospace;">\chapter{...}</span> heading.<br />
<br />
To orchestrate all this, a <a href="https://github.com/haraldschilly/python-fuer-mathematiker/blob/master/doc/makefile">usual Makefile</a> checks for dependencies and finally uses latexmk with the <span style="font-family: "Courier New",Courier,monospace;">--shell-escape</span> switch (which is necessary to run the embedded Python). Works like a charm!<br />
<br />
I hope this is helpful for some of you.</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-55312969127113389352014-10-03T12:49:00.001+02:002014-10-03T12:49:31.165+02:00Mein Email an den VAP<div dir="ltr" style="text-align: left;" trbidi="on">
Habe soeben dies an vap1@aon.at gesendet:<br />
<blockquote class="tr_bq">
Mit Entsetzen muss ich heute <a href="http://derstandard.at/2000006347840/Provider-muessen-unverzueglich-Piratenseiten-kinoxto-und-movie4-sperren" target="_blank">lesen</a>, dass österreichweit eine
Blokadeinfrastruktur für Netzzensur errichtet wird. Ihr Mitwirken an
diesem Akt der Unmündigmachung aller Österreicher_innen ist eine
Skandal. Legen Sie mir bitte dar, welche Gesetze beim bloßen Download
exakt verletzt werden und in welcher Relation dies zu der angeprangerten
Bundesbürger_innenbevormundung steht. Die alten Wirtschaftsmodelle
haben ausgedient und Ihr VAP Verein ist eine reine Interessensvertreung
für große, längst überholte internationale Konzerne und im
Beamtenschimmel verfilzte österreichische Organisationen. Ich hoffe Sie
bekommen in den nächsten Wochen und Monaten reichlich Gegenwind zu
spüren. Willkommen im 21-ten Jahrhundert!<span class="sewo1z0z7u2c7yr"></span><span class="sewo1z0z7u2c7yr"></span><br /><br />In Vollendung,<br />ein Bundesbürger<br /><br />PS:<br /><br />Als Wochenendlektüre empfehle ich den Barbara Streisand Effekt:<br /><a href="https://en.wikipedia.org/wiki/Streisand_effect">https://en.wikipedia.org/wiki/Streisand_effect</a></blockquote>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-56744792877320446082014-09-17T19:48:00.001+02:002014-09-17T21:32:22.222+02:00Netflix in Ubuntu - part 2347 of \infinity<div dir="ltr" style="text-align: left;" trbidi="on">
Today, Netflix started in Austria. Well, I thought, give it a try. Too bad, it's really painful in my Linux box. So, if you also have Ubuntu 14.10:<br />
<br />
<ol style="text-align: left;">
<li>Get <a href="https://www.google.com/chrome/browser/beta.html" target="_blank">Chrome Beta 38</a> or higher</li>
<li>Update <b>libnss3</b> via running this in your terminal:<br /><span style="font-family: "Courier New",Courier,monospace;"><br /><span style="font-size: x-small;">for pkg in libnss3_3.17-1ubuntu1_amd64.deb libnss3-nssdb_3.17-1ubuntu1_all.deb libnss3-1d_3.17-1ubuntu1_amd64.deb<br />do<br /> wget http://archive.ubuntu.com/ubuntu/pool/main/n/nss/${pkg}<br />done</span></span>Then install it:<span style="font-family: "Courier New",Courier,monospace;"><br /><br /><span style="font-size: x-small;">$ sudo dpkg -i libnss*.deb</span></span></li>
<li>Install the <a href="https://chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg" target="_blank">User-Agent Switcher for Chrome</a><br />In its options (right-click on the icon) you have to add a new entry (besides the "String", nothing else really matters):<br /><br /><ul>
<li>Name: Netflix</li>
</ul>
<ul>
<li>String: <span style="font-family: "Courier New",Courier,monospace;">Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2114.2 Safari/537.36</span></li>
<li>Group: keep it empty</li>
<li> Indicator: FLX (for Net-Flix)</li>
</ul>
<br />After that, set it to be active on netflix.com automatically: On the left, in "Permanent Spoof List"... </li>
<li>Restart chrome, ... cross your fingers ... and enjoy.</li>
<li>Edit: you also have to set the profile properties in netflix to HTML5 (though, I think it still works without doing anything, because there is no silverlight anyways)</li>
</ol>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-70070069774979896712014-08-18T16:53:00.000+02:002014-08-18T20:32:02.387+02:00New combinatorial designs in Sage - by Nathann Cohen<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: center;">
This is a guest post by Nathann Cohen. </div>
<hr size="1" />
<br />
<h2>
New combinatorial designs in Sage</h2>
<div style="text-align: left;">
Below, these graphs are a decomposition of a $K_{13}$ (i.e. the complete graph on 13 points) into copies of $K_4$. Pick two vertices you like: they appear exactly once together in one of the $K_4$.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-1SBIfp8sEvk/U_IG5p8AdXI/AAAAAAAAcMc/nK8044Ld6aY/s1600/bidis.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-1SBIfp8sEvk/U_IG5p8AdXI/AAAAAAAAcMc/nK8044Ld6aY/s1600/bidis.png" height="400" width="398" /></a></div>
<div style="text-align: left;">
The second graph shows a decomposition of
a $K_{4,4,4}$ (i.e. the complete multipartite graph on $4\times 3$ points) into
copies of $K_3$. Pick two vertices you like from different groups: they
appear exactly once together in one of the $K_4$.</div>
<div style="text-align: left;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-2iuNNiHo9As/U_IG7AZEGrI/AAAAAAAAcMk/lfIOKmKHXDE/s1600/TDs.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-2iuNNiHo9As/U_IG7AZEGrI/AAAAAAAAcMk/lfIOKmKHXDE/s1600/TDs.png" height="365" width="400" /></a></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<div style="text-align: left;">
<br />
Sage
has gotten quite good at building such decompositions (a specific kind
of combinatorial designs) when they exist. This post is about them.</div>
</div>
<div style="text-align: left;">
<br /></div>
The first object belongs to a family called <b>Balanced Incomplete Block Designs (or $(n,k)$-BIBD)</b>, which are defined as "a collection $\mathcal S$ of sets, all of them with size $k$ (here $k=4$), such that any pair of points of a set $X$ with $|X|=n$ (here $n=13$) appears in exactly one set of $\mathcal S$".<br />
<br />
The second belongs to the family of <b>Transversal Designs (or $TD(k,n)$)</b> which have a similar definition: consider a set $X$ containing $k$ groups (here $k=3$) of $n$ vertices (here $n=4$). A collection $\mathcal S$ of sets, each of which contains one point from each group, is a $TD(k,n)$ if any two points from different groups appear together in exactly one set of $\mathcal S$.<br />
<r><br />
The main problem with combinatorial designs is to know where they exist. And that is not obvious. Sage does what it can on about that:
</r><br />
<ul>
<li> If you want it to build a $(14,4)$-BIBD, it will tell you that none exists.
</li>
<li> If you want it to build a $(16,4)$-BIBD, it will tell you that one exists.
</li>
<li> If you want it to build a $(51,6)$-BIBD, it will tell you that it just not know if there is one (and nobody knows better at the moment)
</li>
</ul>
Examples here:<br />
<br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">sage: designs.balanced_incomplete_block_design(14,4,existence=True)</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">False</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">sage: designs.balanced_incomplete_block_design(16,4,existence=True)</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">True</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">sage: designs.balanced_incomplete_block_design(51,6,existence=True)</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">Unknown</span></span><br />
<br />
For a developer (and design lover), the game consists in teaching Sage how to build all combinatorial designs that appear in some research paper. For BIBD as well as for Transversal Designs, on which a LOT of sweat was spent these last months.<br />
<br />
For Transversal designs the game is a bit different, as we know that a $TD(k-1,n)$ exists whenever a $TD(k,n)$ exists. Thus, the game consists in finding the largest integer $k_n$ such that a $TD(k_n,n)$ exists. This game is hardly new, and hardly straightforward: In the Handbook of Combinatorial Designs, one can find the table of such $k$ up to $n=10000$ (see <a href="http://books.google.fr/books?id=S9FA9rq1BgoC&dq=handbook%20combinatorial%20designs%20MOLS%2010000&pg=PA176">here</a>).<br />
<br />
The good thing about Sage is that it does not just claim that such a design exists: it also builds it, and there is no better existence proof than that (it is very very quick to check that a combinatorial design is valid).
The <i>other</i> good thing is that there is no common database for such data (the Handbook is not updated/printed every night), and that by teaching Sage all new designs found by researchers we build such a database. And it already contains designs that were not known when the Handbook was printed.<br />
<br />
Finally, the <i>other other</i> good thing about Sage is that it will soon be able to tell you where those designs <it> come from<it>. Indeed, the most powerful results in the field of Transversal Designs are of the shape "If there exists a $TD(k_1,n_1)$, and a $TD(k_2,n_2)$, ..., and a $TD(k_c,n_c)$, then you can combine them all to obtain a $TD(k,n)$ with $k=k(k_1,...,k_c)$ and $n=n(n_1,...,n_c)$". And it is never very clear how to inverse these functions: if you want to build a $TD(k,n)$, which integers $k_1,...,k_c,n_1,...,n_c$ should you pick ?<br /><br />
Sage knows. It must know it, in order to build these designs anyway. And you can find that data inside. And soon, we will teach it to give you the bibliographical references of the papers in which you can find the right construction to produce the $TD(k,n)$ that you want. And we will provide the right parameters. And the world will be at peace.<br /><br />
A couple of things before we part:
</it></it><br />
<ul>
<li>Transversal Designs (TD), Orthogonal Arrays (OA), and Mutually Orthogonal Latin Squares (MOLS) are all equivalent objects.
</li>
<li>We write a LOT of Transversal Designs code these days, so expect all this to improve very fast.
</li>
<li>You can learn what Sage knows of combinatorial designs <a href="http://www.sagemath.org/doc/reference/combinat/designs.html">right here</a>.
</li>
</ul>
Finally, there are far too many combinatorial designs for one man to learn. If you love combinatorial designs, come join us: <a href="http://www.labri.fr/perso/vdelecro/">Vincent Delecroix</a>, you, <a href="http://www.steinertriples.fr/ncohen/">and I</a> have code to write together. And if you know a related mathematical results that Sage ignores, come tell us: we could not have gone so far without the mathematical knowledge of <a href="https://research.unsw.edu.au/people/dr-julian-abel">Julian Abel</a>. And Sage does not know everything yet.<br />
<br />
Have fuuuuuuuuuuuuuuuuuuun !<br />
<br />
Nathann
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-68302843893858136852014-06-06T17:41:00.001+02:002015-01-03T23:18:22.633+01:00Blüte des Lebens - Georg Kostron<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: center;">
</h2>
<h3 style="text-align: left;">
Musik-kritische Ausführungen im Staccato.</h3>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://georgkostron.files.wordpress.com/2014/01/cover_vorschau.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://georgkostron.files.wordpress.com/2014/01/cover_vorschau.jpg" height="320" width="320" /></a></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<span style="color: #999999;"><i>Vorweg: dieser Text wird in Kürze ins Lateinische übersetzt.</i></span></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: left;">
<span style="font-size: small;"><i>"<a href="http://georgkostron.eu/" target="_blank">Blüte des Lebens</a>"</i> ist eine stimmgewaltige Kraftkomposition. Ausgetüftelte Klänge begleiten diversiv zusammengetragene Klangschnipsel und garnieren - begleitet durch zeitkritischen Text - den ausgeprägten Hang zum liebevollen Detail. Das Album thematisiert an dessen Höhepunkt das Geschraube und Gedrehen an den Knöpfen der absoluten Machtkontrolle in der zentralen Schaltzentrale. Kurz: der tüftelnde Monarch seines unendlich großen Reichs der Effektkiste ist politisch.</span></div>
<div style="text-align: left;">
<br /></div>
<h4 style="text-align: left;">
Song 01. Raumschiff Maria</h4>
<div style="text-align: left;">
Ein routinierter Klick auf das nach rechts blickende Abspieldreieck, es wummert kurz - Dissonanz -<span style="font-size: x-small;"> zu leise?</span> - kurzes Quietschen und sofort nach der Landung ist klar: dieses Album ist eingekochter Grüntee statt verdünntem Fruchtsaft. Der 1/4 Beat klopft hart ins Ohr, ist verwirrt ob des Textes und der vorsichtige Mitteleuropäer dreht ab Minute 2:30 sicherheitshalber etwas leiser. <a href="http://www.youtube.com/watch?v=AJWfLLwXHtU" target="_blank">Ist das etwas zum Beten?</a></div>
<div style="text-align: left;">
<br /></div>
<h4 style="text-align: left;">
Song 02. Rostiges Rösslein</h4>
<div style="text-align: left;">
Versöhnlicher, Chorgesang, Melodie - zurücklehnen. Aber spätestens das Textfragment "Geld arbeitet - <u>nicht</u>" lässt die untertönig bittere Note anklingen. "Zügellos", "Sporen", "Peitsche" und todesbleiche Reiter mahnen den Hörer. </div>
<div style="text-align: left;">
<br /></div>
<h4 style="text-align: left;">
Song 03. Der kleine Tiger</h4>
<div style="text-align: left;">
Katzen möchten im monotonen Alltag eingelullt, sicher in der Box hockend, den Tag absitzen. Textlastiges Crescendo, maximal aufgedrehte Stimmen und songstrukturierte Abwechslung konfrontieren sie. Das Album schafft sich Raum und dehnt ... aus. Inneres Unbehagen, Stress und Unentspannung statt schmeichelnder Wohlfühlklänge.</div>
<div style="text-align: left;">
<br /></div>
<h4 style="text-align: left;">
Song 04. Lick My Face (edit)</h4>
<div style="text-align: left;">
Besuch einer <a href="https://myspace.com/sophiai/music/song/lick-my-face-19773616-19574801" target="_blank">altbekannten Zeitgenössin</a> aus der "Sophia I" Phase. Musikalisch geben sich Elektronik, Instrument und die menschliche Mundschallöffnung die Hand. Sie zerren sdich gegeneinander in ihre jeweiligen Ecken, kurz kippt es in eine Ecke, nur um später explosiv zurückzuschnalzen.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<span style="color: #999999;">Verbraucherhinweis: Spätestens an dieser Stelle wird eine erste Verschnaufpause empfohlen.</span></div>
<div style="text-align: right;">
</div>
<h4 style="text-align: left;">
Song 05. Alle Welt</h4>
<div style="text-align: left;">
Vermeintlich poppig geht es weiter, aber der Refrain bestätigt: dies täuscht. Ein Abgesang auf das kollektive Weltbild. Inzwischen passen die sperrigen Klänge problemlos in den weit aufgemachten Raum. Es knarzt.</div>
<div style="text-align: left;">
<br /></div>
<h4 style="text-align: left;">
Song 06. Knapp vor Schaltraum</h4>
<div style="text-align: left;">
Herrlich! Das intellektuell stimulierende Latein dämpft die aufgewühlten animalistischen Emotionen, es trägt, man spürt: das Zentrum kommt für Wahr näher und man steht im Auge des Taifuns. Avantgardistische Elektronik, dann eine Orgel, ganz von der Ferne kanonenschussartige Paukenschläge.</div>
<div style="text-align: left;">
<br /></div>
<h4 style="text-align: left;">
Song 07. Süßes Kind</h4>
<div style="text-align: left;">
Fast fließend landet der Hörer in einem Liebeslied? Wer wird hier besungen? Die aufopfernde Schlusssteigerung dreht nochmals schnell am Sinn, erzeugt Verwirrung, die Entspannung ist schnell vorbei und schon ist 08 bereit für die Bühne.</div>
<div style="text-align: left;">
<br /></div>
<h4 style="text-align: left;">
Song 08. Schaltraum (edit)</h4>
<div style="text-align: left;">
Bitte Anschnallen. Treibender, hämmernder, minimalistischer Druck. Die Beats tänzeln mit sich selbst im trockenen Vakuum. Ein technokratisch editiertes Interludum entzieht jegliche Humanität, die elektrische Steuerung übernimmt das Ruder. Fast spirituelle Songskizzen beenden diesen Raubzug am Verstand. Wer hat ihn geraubt?</div>
<div style="text-align: left;">
<br /></div>
<h4 style="text-align: left;">
Song 09. Beistrich</h4>
<div style="text-align: left;">
Ein versöhnlich-humoristischer Aufgesang an die jugendliche Interpunktionskultur des Web 2.0.</div>
<div style="text-align: left;">
<br /></div>
<h4 style="text-align: left;">
Song 10. Wunderschön (edit)</h4>
<div style="text-align: left;">
Hitverdächtige Durtöne, Chöre, Mitsingmelodie, Geige, hin-und-her: heftig illussioniert, warm eingewickelt, was ist da los? Relativierende Schlagwörter gravitieren den Hörer wieder auf den rauhen Betonboden der Realität. Diese Blendung ist eine erfolgreiche.</div>
<div style="text-align: left;">
<br /></div>
<h4 style="text-align: left;">
Song 11. Küss den Tango</h4>
<div style="text-align: left;">
Der vielleicht treibendste Song des Albums. Kurzweilige Strukturzerlegungen und eingeworfene Schrägtöne bringen die schon gewohnte Unsicherheit wieder zurück. Auf-und-ab gesungene "Ah"s schrubben die bereits geröteten Großhirnfurchen wieder sauber. Es riecht nach Schweiß und Reinigungsmittel.<br />
<br /></div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
</div>
<h4 style="text-align: left;">
Song 12. Hans Tanz</h4>
<div style="text-align: left;">
Zurücklehnende Melodien, breit, kaugummiartig. Ein Akkordeon, etwas Echo, und diverse Aufforderungen an Hans verhallen im Hintergrund. Nachdenklichkeit macht sich breit. Ein gänsehautgarantierender Schlusschor.</div>
<div style="text-align: left;">
<br /></div>
<h4 style="text-align: left;">
Song 13. Der A</h4>
<div style="text-align: left;">
Nicht die Spur einer Scheu vor der Zahl 13. Es soll einfach weiter-so gehen, halt, ja, einfach weiter ... so. Hilflos gefangen im musikalischen Spinnennetz dieses Albums spannt sich ein weiterer Radialfaden in Richtung klassischem Clubsound. Tanz endlich. Im Kreis. Spätestens seit Snoweden wissen wir, dass sich auch Drohnen ständig im Kreis herum drehen.</div>
<div style="text-align: left;">
<br /></div>
<h4 style="text-align: left;">
Song 14. Tanzboutique</h4>
<div style="text-align: left;">
Der letzte Song. Ist Steigerung überhaupt noch möglich? Ein Schrei, Auftakt, 3, 2, 1. Was passiert hier? Ein sauber auskomponierter Song im deutsch-lateinischen Zwiegespräch wirft mit mehrdeutigen Fragmenten um sich. Dem Hörer wird ein kleine geheime Tür gezeigt: es ist der Notausgang in die Wirklichkeit.</div>
<div style="text-align: left;">
<br /></div>
<h4 style="text-align: left;">
Bonustrack. </h4>
<div style="text-align: left;">
Wer ein paar Minuten warten kann, wird mit einem acapellaartigem Songfragment belohnt. Es endet offen, ein Vorgeschmack auf einen Teil 2?<br />
<br />
<br />
<h4 style="text-align: left;">
Abschlussbeurteilung: </h4>
9 von 10 <a href="https://de.wikipedia.org/wiki/Aes_grave" target="_blank">Aes Grave</a>.<br />
<br />
<br />
<h4 style="text-align: left;">
Links:</h4>
<a href="https://www.facebook.com/undseinManager" target="_blank">f/undSeinManager</a> </div>
<div style="text-align: left;">
<br /></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-37484937721082830182014-04-22T00:14:00.001+02:002014-04-22T17:10:35.409+02:00Sage GSoC 2014 Projects<div dir="ltr" style="text-align: left;" trbidi="on">
This year, <a href="http://www.sagemath.org/" target="_blank">Sage</a> is happy to announce that it will be running five <a href="http://www.google-melange.com/gsoc/homepage/google/gsoc2014" target="_blank">Google Summer of Code</a> projects. Welcome everyone to the Sage community and all the best to your summer filled with exiting projects ;-)<br />
<br />
<b>EDIT</b>: <a href="http://www.lmona.de/" target="_blank">lmonade</a> related projects are <a href="http://martinralbrecht.wordpress.com/2014/04/22/lmonade-gsoc-2014-accepted-projects/" target="_blank">listed here</a>.<br />
<br />
<h3 style="text-align: left;">
Nikhil Peter Raj (Volker Braun):</h3>
<h2>
Improvements to the Sage Android App</h2>
<div style="text-align: left;">
This project aims to improve upon the existing app by improving both
internal structure and external user experience, the former by replacing
and redoing certain modules of the app (JSON Parsing, HTTP Requests and
Exception Handling) and the latter by redesigning the UI so it conforms
to the latest standards and specifications of Android Design, as well as
adding extra features to the code input such as Syntax Highlighting and
options to record and store custom inserts.</div>
<h3 style="text-align: left;">
Amit Jamadagni (Miguel Angel Marco-Buzunariz)</h3>
<h2 style="text-align: left;">
Knot theory implementation</h2>
The project mainly deals with the implementation of various links, knots presentations and calculating various related invariants. The main aim of the project is to achieve: Conversion between different representations of Knots and Links to mention a few: Gauss code to Braid Word, Braid word to DT code, Gauss code to DT code. Implementation of various invariants: Alexander Polynomial, Conway Polynomial. Stiefert Matrix, Jones Polynomial<br />
<h3 style="text-align: left;">
Jayant Apte (Stefan van Zwam)</h3>
<h2>
Efficient class-specific membership checks, extensions and visualization </h2>
<div style="text-align: left;">
First goal of this proposal is to implement efficient testing of a
matroid for membership of various classes and to perform single element
extensions of matroids that exploit the knowledge that a given matroid
belongs to a certain class, to have lower complexity. We also propose
implementation of visualization techniques and an application of matroid
theory in form of enumeration of network codes for a multisource
network coding problem which is one of the timely problems in
information theory.</div>
<h3 style="text-align: left;">
Simon Spicer (William Stein, Jonathan Bober)</h3>
<h2 style="text-align: left;">
Efficient exact analytic rank computation for elliptic curves in Sage</h2>
<div style="text-align: left;">
My project would be to implement functionality in Sage to compute the analytic rank of an elliptic curve exactly modulo standard conjectures, with better scaling than existing analytic rank estimation methods. This would necessitate both writing (significant amounts of) new Python and Cython code, as well as porting existing code into the Sage codebase.</div>
<h3 style="text-align: left;">
Daniel Bell (Ivan Andrus)</h3>
<h2 style="text-align: left;">
iSage - improving the Sage iOS apps </h2>
There are several aspects of the Sage iOS apps that needs to be refreshed, improved or implemented. I propose to develop the ability to interact with several Sage services from the app, as well refresh the user interface for the app.<br />
<br />
<br />
<h2>
</h2>
<div style="text-align: left;">
</div>
<h2 style="text-align: left;">
</h2>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-32982835451993995582014-02-07T18:28:00.000+01:002014-02-08T21:14:28.843+01:00My first Time-Lapse Experiment<div dir="ltr" style="text-align: left;" trbidi="on">
Well, my new camera (Panasonic DMC-GX7) has two features I've never had before: <b>stop-motion and time-lapse</b>. The only difference seems to be: the minimum time between the shots is either 1 second or 1 minute - and if there is an "open end" or a fixed number of pictures.<br />
<br />
Searching around online, the most important thing to do is to take the shots in <b>manual mode</b>. The reason is, that you do not want to have this flickering. So well, that's easy to do in manual mode: <b>exposure, aperture, ISO</b> and of course the <b>focus</b>. What I didn't read (or didn't notice), but should have done is to <b>also fix the white-balancing</b>! So, in case you want to try this, set it the white balancing to manual.<br />
<br />
One cool thing of doing this in stock motion on my camera is, that it automatically converts the images to a movie. Only for one sequence I had to do it on my computer, because the camera wasn't responsive or I've confused it. So, in case you are on a Ubuntu Linux like I am, here is what to do: First, don't bother with ffmpeg or avconv: they are too old and do not have the flag "-start_image" to set the first number of the counter. This sucks!<br />
<br />
So instead: <b>mencoder</b>:<br />
Start by moving all the images in a separate directory, then the "P*.JPG" regex pattern matches all your images in alphabetical order. Easy.<br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">$ mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:autoaspect:vqscale=3 -vf scale=1920:1080 -mf type=jpeg:fps=5 'mf://P*.JPG' -o OUTPUT.avi</span><br />
=> see update below<br />
<br />
If you have better ideas for the command-line, please post it. fps=5 is for the number of frames per second. I think the quality should be set higher, but no idea which of the switches does this in a sane way.<br />
<br />
Now enjoy these three YouTube videos from Vienna (Parlament and City-Hall):<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="https://i1.ytimg.com/vi/4bHM5V_aDQc/0.jpg" height="480" width="640"><param name="movie" value="https://www.youtube.com/v/4bHM5V_aDQc?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" /><param name="bgcolor" value="#FFFFFF" /><param name="allowFullScreen" value="true" /><embed width="640" height="480" src="https://www.youtube.com/v/4bHM5V_aDQc?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" type="application/x-shockwave-flash" allowfullscreen="true"></embed></object></div>
<span id="goog_432226839"></span><span id="goog_432226840"></span><br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='640' height='480' src='https://www.youtube.com/embed/jQ1crTOjlLg?feature=player_embedded' frameborder='0'></iframe></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='640' height='480' src='https://www.youtube.com/embed/4oHNVeRsrkU?feature=player_embedded' frameborder='0'></iframe></div>
<span id="goog_432226839"></span><span id="goog_432226840"></span><br />
<span id="goog_432226839"></span><span id="goog_432226840"></span><br />
<b><span id="goog_432226839">Update:</span></b><br />
<br />
<span id="goog_432226839">There is indeed a much better mencoder setting, using x264:</span><br />
<br />
<span style="font-family: "Courier New",Courier,monospace;"><span id="goog_432226839">$ mencoder -nosound 'mf://P*.JPG' -mf fps=10:type=jpeg -ovc x264 -x264encopts preset=slow:tune=animation:crf=20 -vf scale=1440:1080 -o time-lapse.avi </span></span><br />
<br />
Options (for more, check the manpage)<br />
<ul style="text-align: left;">
<li><span style="font-family: "Courier New",Courier,monospace;">fps=10</span>: 10 pix/second. 5 is also ok, 20 if you have really a lot of pics.</li>
<li><span style="font-family: "Courier New",Courier,monospace;">tune=animation</span>: sounds reasonable, there is also "film"</li>
<li><span style="font-family: "Courier New",Courier,monospace;">crf=20</span>: recommended switch for setting the quality, could also be 10 or 20, ...</li>
<li><span style="font-family: "Courier New",Courier,monospace;">-vf scale</span>: that could be something different, depends on what you have. (960x720)</li>
</ul>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-47528370954224294292013-11-06T22:14:00.000+01:002013-11-07T10:04:29.845+01:00When will Sagemath Cloud hit 100,000 user accounts?<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="https://cloud.sagemath.com/" target="_blank">The Sagemath Cloud</a> is an online environment for <a href="https://en.wikipedia.org/wiki/Computational_mathematics" target="_blank">computational mathematics</a>. Get an account, log in, and your web-browser transforms into almost everything you need to study algebra, calculus, numerics, statistics, number and game theory, (computational aspects of) physics, chemistry and all other quantitative sciences. It's built around all sorts of tools and utilities offered in a proper Linux environment. All files can be shared with collaborators and edited in real-time without stepping on each other's toes. Oh wait, there is also a LaTeX editor: given you know LaTeX, <a href="https://en.wikipedia.org/wiki/Qualitative_research" target="_blank">qualitative sciences</a> are also covered ;-)<br />
<br />
But beware, this posting will only talk about the very first: <u>accounts</u>. Below, I'll explain how I managed to create <a href="http://boxen.math.washington.edu/home/schilly/salvus/stats/stats.html" target="_blank">this page</a>, the plot below and how I let it update automatically every hour - all done solely by SMC!<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://boxen.math.washington.edu/home/schilly/salvus/stats/prediction.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="297" src="http://boxen.math.washington.edu/home/schilly/salvus/stats/prediction.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">SMC accounts over time</td></tr>
</tbody></table>
<br />
<br />
Sagemath Cloud is very public about what is happening on its servers. This <a href="https://cloud.sagemath.com/stats" target="_blank">stats link</a> gives you the raw data for the current overall load of the machines. What I did over the last weeks was the following: Every hour I've downloaded this stats json file, parsed it, accumulated some interesting numbers, and stored the processed data in a CSV file.<br />
<br />
I did all this in SMC, because it allows you to run your own <span style="font-family: "Courier New",Courier,monospace;">crontab</span> files. <a href="https://en.wikipedia.org/wiki/Cron" target="_blank">Cron</a> periodically goes through all kind of files to figure out if there is a job to do. Just enter a magical line in your own crontab file, and the given command is run whenever you tell it to do so. You do not have to be logged in!<br />
<br />
In my case, it's like this:<br />
First, edit your crontab file: <br />
<span style="font-family: "Courier New",Courier,monospace;">$ crontab -e</span><br />
Then enter this line:<br />
<span style="font-family: "Courier New",Courier,monospace;">0 * * * * python $HOME/get.py</span><br />
<br />
The <span style="font-family: "Courier New",Courier,monospace;">$HOME</span> is important, because you have to specify the full path where your script sits. (By the way, if you have to start something when the SMC server reboots, use the <span style="font-family: "Courier New",Courier,monospace;">@reboot</span> descriptor)<br />
<br />
So, what is <span style="font-family: "Courier New",Courier,monospace;">get.py</span> doing? It uses the wonderful <a href="http://www.python-requests.org/en/latest/" target="_blank">requests Python library</a> to retrieve and parse the stats url and extracts some data. Then it appends a line to a CSV file.<br />
<br />
Two minutes later (the crontab line starts with a "2"), another script is called which processes this CSV file. It reads the columns via <a href="http://pandas.pydata.org/" target="_blank">pandas</a>, properly parses the dates into time-series, and allows me to do all sorts of analysis, transformations and plots with it. For example, the plot shown above overlays the raw time series plot with <a href="http://statsmodels.sourceforge.net/devel/generated/statsmodels.regression.linear_model.OLS.html" target="_blank">OLS fits done by statsmodels</a> for selected time ranges (where it looks "flat"). We can see the growth trends clearly! Even more important, so far the growth increases and hence we are watching the exponential growth phase as part of the beginning of the usual <a href="https://en.wikipedia.org/wiki/Logistic_function" target="_blank">logistic growth</a>.<br />
<br />
The other plots <a href="http://boxen.math.washington.edu/home/schilly/salvus/stats/stats.html" target="_blank">on this statistics page</a> show aggregated time-series data. For example, the plot for the number of concurrent connections is also increasing and reassures that SMC is scaling well.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://boxen.math.washington.edu/home/schilly/salvus/stats/connections.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="256" src="http://boxen.math.washington.edu/home/schilly/salvus/stats/connections.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Concurrent connections to SMC</td></tr>
</tbody></table>
On this statistics page, there are also a few "dynamic" fields in the HTML content. This is done by <a href="http://jinja.pocoo.org/docs/" target="_blank">jinja2</a> in such a way, that the template "stats.tmpl" contains the HTML code and "mustache"-style variables. Jinja2 renders this template with some variables and that's it.<br />
<br />
<pre>import jinja2 as j2
env = j2.Environment(loader=j2.FileSystemLoader("."))
stats = env.get_template("stats.tmpl")
data = {
'date' : "%s UTC" % datetime.utcnow(),
'recent_data' : totals.ix[-24:].to_html()
}
with open("stats.html", "wb") as output:
output.write(stats.render(**data))
</pre>
The last step of the script is to actually publish the files to the webserver. That's rather straight forward. First and only once, create ssh keys via <span style="font-family: "Courier New",Courier,monospace;">ssh-keygen</span> without a password and then use <span style="font-family: "Courier New",Courier,monospace;">ssh-copy-id -i ~/.ssh/id_dsa.pub name@server</span> to copy over your keys. Subsequent ssh connections will be established without any questions asked, because the remote server knows your identity. I'm using <span style="font-family: "Courier New",Courier,monospace;">scp</span> to copy the files: <span style="font-family: "Courier New",Courier,monospace;">scp *.png stats.html name@remote-server:~/target/dir/</span><br />
<br />
Last but not least, when will SMC hit the 100,000 user mark? In less than 6 days the 10,000 mark should be crossed and I hope the trend continues into the upward direction.</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-9037297197925278452013-05-27T21:48:00.001+02:002013-05-28T10:45:18.989+02:00Sage announces 3 GSoC projects<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" id="docs-internal-guid-3b46c3a1-e77c-e9f1-db27-60ec2163a329" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Verdana,sans-serif;"><span style="background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"><a href="http://www.sagemath.org/">Sage</a>
is pleased to announce three <a href="http://www.google-melange.com/gsoc/org/google/gsoc2013/sage">Google Summer of Code</a> projects for 2013.
They focus on speed improvements of symbolic functions, simplifying the
distribution and installation procedure on Debian/Linux and ubiquitous
accessibility of Sage on the Android platform. </span></span></div>
<span style="font-family: Verdana,sans-serif;"><br /><span style="background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"></span></span>
<br />
<h1 dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 10pt;">
<span style="font-family: Verdana,sans-serif;"><span style="background-color: transparent; color: black; font-size: 21px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">Mathematical Functions Library</span></span></h1>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Verdana,sans-serif;"><a href="http://www.phas.ubc.ca/%7Eeviatarb/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">Eviatar Bach</span></a><span style="background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"> – University of British Columbia in Vancouver, Canada</span></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Verdana,sans-serif;"><span style="background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">(Mentor: Flavia Stan, Backup: Burcin Erocal)</span></span></div>
<span style="font-family: Verdana,sans-serif;"><br /><span style="background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"></span></span>
<br />
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Verdana,sans-serif;"><span style="background-color: transparent; color: black; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">Sage
interfaces with multiple third-party libraries, such as MPFR, GSL,
GP/PARI, mpmath, and Maxima, for numerical evaluation of special
functions. There are significant discrepancies between these backends in
the performance for numerical approximations of the same expression. An
initial benchmark reveals, for example, that calculating
spherical_bessel_J(1, 5.2) with SciPy is over 100 times faster than with
Maxima.</span></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Verdana,sans-serif;"><span style="background-color: transparent; color: black; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">The project has the following goals:</span></span></div>
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Verdana,sans-serif;"><span style="background-color: transparent; color: black; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">develop
a benchmark framework to determine which backend should be used by
default to evaluate a special function over a specific domain,</span></span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Verdana,sans-serif;"><span style="background-color: transparent; color: black; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">create symbolic wrappers for all the special functions that can be evaluated numerically by a package included in Sage,</span></span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Verdana,sans-serif;"><span style="background-color: transparent; color: black; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">create
a data structure for generalized hypergeometric functions and extend
the symbolic wrappers to obtain representations in terms of generalized
hypergeometric functions when possible,</span></span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Verdana,sans-serif;"><span style="background-color: transparent; color: black; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">implement
closure properties for holonomic functions as a next step to improve
the symbolic processing of special functions in Sage.</span></span></div>
</li>
</ol>
<span style="font-family: Verdana,sans-serif;"><br /><span style="background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"></span></span>
<br />
<h1 dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 10pt;">
<span style="font-family: Verdana,sans-serif;"><span style="background-color: transparent; color: black; font-size: 21px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">Overall improvement of the Sage Android application</span></span></h1>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Verdana,sans-serif;"><span style="background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">Rasmi Elasmar</span></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Verdana,sans-serif;"><span style="background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">(Mentor: Volker Braun, Backup: Harald Schilly)</span></span></div>
<span style="font-family: Verdana,sans-serif;"><br /><span style="background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"></span></span>
<br />
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Verdana,sans-serif;"><span style="background-color: transparent; color: black; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">Although there are already some existing efforts, Sage is still not easily accessible from the Android platform. The Sage Cell client/server infrastructure is an already existing step towards running Sage on a server and communicating back the results. The aim of this proposal is to fix, improve and update the Sage Android application to include new
features and functionality, as well as an improved interface for simpler
and improved usability. Android's new "Holo" style, sharing of calculations and results, and much more waits to be realized on Android for Sage.</span></span></div>
<span style="font-family: Verdana,sans-serif;"><br /><span style="background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"></span></span>
<br />
<h1 dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 10pt;">
<span style="font-family: Verdana,sans-serif;"><span style="background-color: transparent; color: black; font-size: 21px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">Get Sage ready for Linux distributions</span></span></h1>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Verdana,sans-serif;"><span style="background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">Felix Salfelder – Goethe Universität, Frankfurt, Germany</span></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Verdana,sans-serif;"><span style="background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">(Mentor: Tobias Hansen, </span></span><span style="font-family: Verdana,sans-serif;"><span style="background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">Julien Puydt, Jeroen Demeyer & John Palmieri )</span></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Verdana,sans-serif;"><a href="https://groups.google.com/forum/?fromgroups#%21topic/sage-devel/1HGbf4EZGb0" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;">sage-devel discussion</span></a><span style="background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"></span></span></div>
<span style="font-family: Verdana,sans-serif;"><br /><span style="background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"></span><span style="background-color: transparent; color: black; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">The
aim of this project is to detach the build process of Sage ("the
software") from Sage ("the distribution"). The goal is a build system
that works within the context of Sage as well as for any GNU/Linux
distribution that ships the dependencies for Sage. Distributions that
already ship Sage packages or plan to do so are Fedora and Debian. This
project is an important step towards making Sage packages in GNU/Linux
distributions feasible.</span></span><br />
<br />
<br />
<span style="font-family: Verdana,sans-serif;"><span style="background-color: transparent; color: black; font-size: 15px; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;">Sage warmly welcomes all three new students and wishes them all the best to learn something new and make an impact in Sage's future developments!</span><span style="background-color: transparent; color: black; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"><br /></span></span></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-27904700993569703182013-04-08T23:13:00.002+02:002013-04-08T23:13:32.473+02:00Sage part of Google's Summer of Code 2013<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana, sans-serif;">Good News, like last year Sage is once again part of Google's Summer of Code. This means, until April 22 at 19:00 UTC students can submit their applications and mentors will review them and do the matching.</span><div>
<span style="font-family: Verdana, sans-serif;"><br />Please share this with prospective students or think about being a mentor this year!<br /><br />links:</span></div>
<div>
<ul style="text-align: left;">
<li><a href="http://www.google-melange.com/gsoc/org/google/gsoc2013/sage" style="font-family: Verdana, sans-serif;">Sage's GSoC page</a></li>
<li><a href="http://goo.gl/l0CRl" style="font-family: Verdana, sans-serif;">Ideas</a><span style="font-family: Verdana, sans-serif;"> (check back for updates)</span></li>
</ul>
</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-29335957920310291912013-03-19T11:32:00.003+01:002013-03-19T11:42:56.288+01:00Sage 5.8<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana, sans-serif;"><b>Sage 5.8</b> has been <a href="https://groups.google.com/d/topic/sage-devel/De41-2OnowQ/discussion">released</a>, download it <a href="http://sagemath.org/download.html">here</a>.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Also, the <a href="http://sagemath.org/help.html">documentation page</a> has been updated to reflect the new thematic tutorials. I highly recommend to <a href="http://www.sagemath.org/doc/thematic_tutorials/index.html">browse through all those topics</a> to learn more about Sage's ever increasing scope.</span></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-86239077499780737792012-12-18T20:02:00.000+01:002012-12-18T20:02:14.272+01:00Git, Mercurial, Subversion trends<div dir="ltr" style="text-align: center;" trbidi="on">
In case you have to convince someone on which horse to bet:<br />
<br />
<br />
<script src="//www.google.com/trends/embed.js?hl=en-US&q=git,+svn,+subversion,+mercurial&geo=US&cmpt=q&content=1&cid=TIMESERIES_GRAPH_0&export=5&w=600&h=380" type="text/javascript"></script>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-42618976385391519332012-12-18T18:38:00.000+01:002012-12-18T18:38:02.280+01:00Lenovo x220 Trackpoint and Ubuntu<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana,sans-serif;">Although I'm using my Lenovo x220 laptop for more than a year, I discovered the settings for the track-point yesterday (random searches and forums, don't remember). I was never really thinking about it, but the track-point was a bit slow and stiff. The configuration settings of the usual UI configuration menu had no effect at all (yes, certainly a bug), either.</span><br />
<span style="font-family: Verdana,sans-serif;"><br /></span>
<span style="font-family: Verdana,sans-serif;">So, to reveal the magic, here it is. I've added a udev configuration file here:</span><br />
<span style="font-family: Verdana,sans-serif;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace;"><b>$ cat /etc/udev/rules.d/trackpoint.rules </b></span><br />
<span style="font-family: Verdana,sans-serif;"><span style="font-family: "Courier New",Courier,monospace;"><br />SUBSYSTEM=="serio", DRIVERS=="psmouse", WAIT_FOR="/sys/devices/platform/i8042/serio1/serio2/sensitivity", ATTR{sensitivity}="240", ATTR{speed}="95", ATTR{press_to_select}="1", ATTR{inertia}="6"</span></span><br />
<span style="font-family: Verdana,sans-serif;"><br /></span>
<span style="font-family: Verdana,sans-serif;"></span><br />
<span style="font-family: Verdana,sans-serif;">This is just one line for the settings of sensitivity, speed and intertia. You can also play around with them manually, e.g.</span><br />
<span style="font-family: Verdana,sans-serif;"><br /></span>
<span style="font-family: Verdana,sans-serif;"><span style="font-family: "Courier New",Courier,monospace;"><b>$ echo "5" | sudo tee /sys/devices/platform/i8042/serio1/serio2/inertia</b></span></span></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-79008335554532239512012-11-30T12:10:00.001+01:002012-12-02T13:13:29.928+01:00Mathematica 9's R integration vs. Rpy2<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana,sans-serif;"><br /></span>
<span style="font-family: Verdana,sans-serif;"><b>Some notes about "What's new in Mathematica 9: <a href="http://www.wolfram.com/mathematica/new-in-9/built-in-integration-with-r/" rel="nofollow" target="_blank">Builtin R Integration</a>"</b></span><br />
<span style="font-family: Verdana,sans-serif;"><b>To understand what's going on, please open the example: <a href="http://www.wolfram.com/mathematica/new-in-9/built-in-integration-with-r/hierarchical-clustering.html" rel="nofollow" target="_blank">Hierarchical Clustering</a>.</b></span><br />
<br />
<span style="font-family: Verdana,sans-serif;">This posting is basically about how to integrate R via Rpy2 in Python and hence also in Sage.</span><br />
<br />
<span style="font-family: Verdana,sans-serif;">First thing you should notice is the clash of two parallel worlds. MMA's "RSet" command converts and sets the variable y in the scope of R. That's nice, but wouldn't it be much easier, to just have a local variable for that? Second of all, the function definitions inside strings - filled with escaped quotes - is also not that great. Isn't there are better quoting available?</span><br />
<span style="font-family: Verdana,sans-serif;"><br /></span>
<span style="font-family: Verdana,sans-serif;">What I want to do is to accomplish something similar with Rpy2. So yes, there are also equivalents to this RSet function, and you can also evaluate arbitrary R code inside strings (Python has triple-quoting to avoid escaping quotes). But that's not everything. You can import R packages [<span style="font-family: "Courier New",Courier,monospace;">from rpy2.robjects.packages import <b>importr</b></span>] and bind them to local variables and have, for example, tab-completion on them. R Functions can be referenced directly, data-sets can be exchanged with implicit converters (e.g. numpy's ndarray -> R's Matrix), etc.</span><br />
<span style="font-family: Verdana,sans-serif;"><br /></span>
<i><span style="font-family: Verdana,sans-serif; font-size: small;">You can see the final output and code here: </span><span style="font-family: Verdana,sans-serif; font-size: small;"><a href="https://gist.github.com/4176508">https://gist.github.com/4176508</a></span></i><br />
<span style="font-family: Verdana,sans-serif;"><br /></span>
<span style="font-family: Verdana,sans-serif;">Besides the usual import/from stuff common in Python, I start by creating a random matrix with Numpy:</span><br />
<span style="font-family: Verdana,sans-serif;"><br /></span>
<br />
<span style="font-family: Verdana,sans-serif;"><b><span style="font-family: "Courier New",Courier,monospace;">mdata = np.random.randn(10, 5)</span></b></span></div>
</div>
<span style="font-family: Verdana,sans-serif;"></span><br />
<span style="font-family: Verdana,sans-serif;">Enable autmatic conversion between Numpy and R:</span><br />
<span style="font-family: Verdana,sans-serif;"><br /></span>
<br />
<b><span style="font-family: "Courier New",Courier,monospace;">from rpy2.robjects import numpy2ri<br />numpy2ri.activate()</span></b><span style="font-family: Verdana,sans-serif;"></span><br />
<span style="font-family: Verdana,sans-serif;"><br /></span>
<span style="font-family: Verdana,sans-serif;"></span><br />
<span style="font-family: Verdana,sans-serif;">Print the matrix using R's print:</span><br />
<br />
<span style="font-family: "Courier New",Courier,monospace;"><b>rprint = robj.globalenv.get("print")</b></span><br />
<span style="font-family: Verdana,sans-serif;"><span style="font-family: "Courier New",Courier,monospace;"><b>rprint(mdata)</b></span></span>
<br />
<br />
<span style="font-family: Verdana,sans-serif;"><span style="font-family: "Courier New",Courier,monospace;"><b><span style="font-size: xx-small;"> [,1] [,2] [,3] [,4] [,5]<br /> [1,] 2.1844065 -1.05401295 1.18316261 -0.356338229 1.55031790<br /> [2,] 1.2476473 0.89507075 -0.14576584 0.006899727 0.01350773<br /> [3,] -1.6416017 -0.28180113 0.02784612 1.199042583 0.01272994<br /> [4,] 1.8645490 0.30993270 0.18107913 0.131505590 0.57083588<br /> [5,] 1.2397427 0.73639680 -0.42883124 -0.436741492 0.43644592<br /> [6,] -0.1980955 -0.04463804 -0.11217381 1.768415923 -1.82884840<br /> [7,] 0.2943145 2.12648235 0.21068166 1.718289719 0.15711455<br /> [8,] 0.2453526 0.64922040 1.80518277 0.086208024 1.18789962<br /> [9,] 0.8229507 0.56227084 -1.72153433 -1.511514201 1.04610492<br />[10,] 0.1430900 0.03371198 -0.58992825 1.023002088 -1.47153121</span></b></span></span><br />
<br />
<span style="font-family: Verdana,sans-serif;">... and just for fun, R'summary, printed with Python's print function:</span><br />
<br />
<span style="font-family: Verdana,sans-serif;"><span style="font-family: "Courier New",Courier,monospace;"><b>print r.summary(mdata)</b></span></span><br />
<br />
<span style="font-family: Verdana,sans-serif;"><span style="font-family: "Courier New",Courier,monospace;"><b> </b></span></span>
<span style="font-family: Verdana,sans-serif;"><span style="font-family: "Courier New",Courier,monospace;"><b><span style="font-size: xx-small;"> V1 V2 V3 V4 <br /> Min. :-1.6416 Min. :-1.05401 Min. :-1.72153 Min. :-1.5115 <br /> 1st Qu.: 0.1687 1st Qu.:-0.02505 1st Qu.:-0.35806 1st Qu.:-0.2655 <br /> Median : 0.5586 Median : 0.43610 Median :-0.04216 Median : 0.1089 <br /> Mean : 0.6202 Mean : 0.39326 Mean : 0.04097 Mean : 0.3629 <br /> 3rd Qu.: 1.2457 3rd Qu.: 0.71460 3rd Qu.: 0.20328 3rd Qu.: 1.1550 <br /> Max. : 2.1844 Max. : 2.12648 Max. : 1.80518 Max. : 1.7684 <br /> V5 <br /> Min. :-1.82885 <br /> 1st Qu.: 0.01292 <br /> Median : 0.29678 <br /> Mean : 0.16746 <br /> 3rd Qu.: 0.92729 <br /> Max. : 1.55032 </span></b></span></span>
<br />
<br />
<span style="font-family: Verdana,sans-serif;">... now <b>applying the labels</b>. This time, I show how to execute R code directly, hence injecting the variable "y" in R's global namespace, too:</span><br />
<br />
<span style="font-family: "Courier New",Courier,monospace;"><b>from rpy2 import robjects as robj</b></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><b>robj.globalenv['y'] = mdata<br /><br />r("""<br />dimnames(y) <- b="b"></-></b></span><b style="font-family: 'Courier New', Courier, monospace;">list(paste("g", 1:10, sep=""),</b><br />
<span style="font-family: "Courier New",Courier,monospace;"><b> paste("t", 1:5, sep=""))<br />y<br />""")<!-----></b></span><br />
<br />
<span style="font-family: Verdana,sans-serif;">Compare this to the way you have to do this in MMA9!</span> <br />
<br />
<span style="font-family: Verdana, sans-serif;"><i>--- EDIT</i></span><br />
<span style="font-family: Verdana, sans-serif;">Below is a way how the same is accomplished in Python. The </span><span style="font-family: Courier New, Courier, monospace;">paste</span><span style="font-family: Verdana, sans-serif;"> command is replaced by Python's list comprehension, the </span><span style="font-family: Courier New, Courier, monospace;">list</span><span style="font-family: Verdana, sans-serif;"> command is from R and </span><span style="font-family: Courier New, Courier, monospace;">mdata</span><span style="font-family: Verdana, sans-serif;"> is converted to an R object to be able to do <a href="http://rpy.sourceforge.net/rpy2/doc-2.1/html/rinterface.html#pass-by-value-paradigm" target="_blank">slot assignments</a>.</span><br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><b>mdata = numpy2ri.numpy2ri(mdata)</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b>import rpy2.rinterface as ri</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b>descr = ri.baseenv["list"](</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b> ri.StrSexpVector(['g%s'%_ for _ in range(10)]),</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b> ri.StrSexpVector(['t%s'%_ for _ in range(5)]))</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b>mdata.do_slot_assign("dimnames", descr)</b></span><br />
<div>
<br /></div>
<br />
<span style="font-family: Verdana, sans-serif;">The first example is certainly more pleaseant, but once you would create some neat aliases for the R functions (e.g. </span><span style="font-family: Courier New, Courier, monospace;">list = ri.baseenv["list"]; strv = ri.StrSexpVector; ...</span><span style="font-family: Verdana, sans-serif;">), working in Python shouldn't be hard, too.</span><br />
<span style="font-family: Verdana, sans-serif;"><i>--- END EDIT</i></span><br />
<br />
<span style="font-family: Verdana,sans-serif;">Calculating the <b>correlation and distance matrix</b>. Notice, that dots in R's functions, like the <span style="font-family: "Courier New",Courier,monospace;">as.dist()</span>, are converted to underscores in Python. Those dots are just like normal letters in the identifier name, nothing further.</span><br />
<br />
<span style="font-family: "Courier New",Courier,monospace;"><b>stats = importr("stats")</b></span><br />
<br />
<span style="font-family: "Courier New",Courier,monospace;"><b>corrm = r.cor(r.t(mdata), method="spearman")</b></span><br />
<span style="font-family: "Courier New",Courier,monospace;"># no idea how to do 1-matrix automagically</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><b>robj.globalenv['corrm'] = corrm<br />distm = stats.as_dist(r("1-corrm"))</b></span><br />
<br />
<b><span style="font-family: "Courier New",Courier,monospace;">rprint(corrm)<br />rprint(distm)</span></b><br />
<b><span style="font-family: "Courier New",Courier,monospace;"><br /></span></b>
<b><span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]<br /> [1,] 1.0 -0.3 0.1 0.5 -0.2 0.9 0.8 0.6 0.3 0.2<br /> [2,] -0.3 1.0 0.6 0.3 0.7 -0.4 0.0 0.1 0.2 -0.5<br /> [3,] 0.1 0.6 1.0 -0.1 -0.1 -0.3 -0.1 0.7 0.6 -0.9<br /> [4,] 0.5 0.3 -0.1 1.0 0.7 0.6 0.7 -0.1 -0.3 0.3<br /> [5,] -0.2 0.7 -0.1 0.7 1.0 0.0 0.3 -0.4 -0.3 0.2<br /> [6,] 0.9 -0.4 -0.3 0.6 0.0 1.0 0.9 0.3 0.1 0.6<br /> [7,] 0.8 0.0 -0.1 0.7 0.3 0.9 1.0 0.4 0.3 0.5<br /> [8,] 0.6 0.1 0.7 -0.1 -0.4 0.3 0.4 1.0 0.9 -0.4<br /> [9,] 0.3 0.2 0.6 -0.3 -0.3 0.1 0.3 0.9 1.0 -0.3<br />[10,] 0.2 -0.5 -0.9 0.3 0.2 0.6 0.5 -0.4 -0.3 1.0</span></span></b><br />
<b><span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"></span></span></b><br />
<b><span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"><br /> </span></span></b><br />
<b><span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: xx-small;"> 1 2 3 4 5 6 7 8 9<br />2 1.3 <br />3 0.9 0.4 <br />4 0.5 0.7 1.1 <br />5 1.2 0.3 1.1 0.3 <br />6 0.1 1.4 1.3 0.4 1.0 <br />7 0.2 1.0 1.1 0.3 0.7 0.1 <br />8 0.4 0.9 0.3 1.1 1.4 0.7 0.6 <br />9 0.7 0.8 0.4 1.3 1.3 0.9 0.7 0.1 <br />10 0.8 1.5 1.9 0.7 0.8 0.4 0.5 1.4 1.3</span></span></b><br />
<br />
<br />
<span style="font-family: Verdana,sans-serif;">The <b>clustering</b> happens below (note: I had to execute the "NULL" in the r context, because it seems that Python's "None" isn't converted)</span><br />
<br />
<span style="font-family: "Courier New",Courier,monospace;"><b>hr = stats.hclust(distm, method = "complete", members = r("NULL"))</b></span><br />
<span style="font-family: Verdana,sans-serif;"><br /></span>
<span style="font-family: Verdana,sans-serif;">Plotting is straightforward too. To plot to a device besides X11, one has to be a bit more specific. The <a href="http://rpy.sourceforge.net/rpy2/doc-2.2/html/graphics.html" target="_blank">documentation</a> is full of examples. Notice, the only special part is the <span style="font-family: "Courier New",Courier,monospace;">mfrow=<b>r.c(1,2)</b></span>. </span><br />
<br />
<span style="font-family: Verdana,sans-serif;">Looking at Wolfram's blogpost, I really don't want to understand what MMA's "<span style="font-family: "Courier New",Courier,monospace;">getRPlot[...]</span>" calling "<span style="font-family: "Courier New",Courier,monospace;">mathematicaRPlotWrapper</span>" does.</span><br />
<br />
<span style="font-family: Verdana,sans-serif;"><span style="font-size: x-small;"><b><span style="font-family: "Courier New",Courier,monospace;">grdevices = importr('grDevices')<br />grdevices.png(file="mma9rpy2.png", width=512, height=300)<br />try:<br /> r.par(mfrow = r.c(1,2))<br /> r.plot(hr, hang = 0.1)<br /> r.plot(hr, hang = -0.1)<br />finally:<br /> grdevices.dev_off()<br /><br />grdevices.png(file="mma9rpy2-2.png", width = 512, height = 512)<br />try:<br /> r.heatmap(mdata)<br />finally:<br /> grdevices.dev_off()</span></b></span></span><br />
<br />
<span style="font-family: Verdana,sans-serif;">Final results: </span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://gist.github.com/raw/4176508/b52c48b279197dac351b9df881c3a2f98501242e/mma9rpy2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="186" src="https://gist.github.com/raw/4176508/b7c1a333532da1bb7baed968a01251b3d2c4e0d2/mma9rpy2.png" width="320" /></a></div>
<br />
<br />
<span style="font-family: Verdana,sans-serif;">... and a heatmap plot:</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://gist.github.com/raw/4176508/a5a0abde5ab9b6a5f59004644a139da31dca1cc2/mma9rpy2-2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://gist.github.com/raw/4176508/489b751223a457be9c7a2ad47469480e6d84da0b/mma9rpy2-2.png" width="400" /></a></div>
<br />
<span style="font-family: Verdana,sans-serif;">Final note, yes I know there is some fuzz at the bottom of the image with the dendrogram. I don't know why. Maybe someone can fix this ... and yes, that's possible, because all of this is fully open-sourced :-) </span><br />
<span style="font-family: Verdana,sans-serif;"><br /></span>
<span style="font-family: Verdana,sans-serif;"><b>td;dr</b>: <a href="https://gist.github.com/4176508">https://gist.github.com/4176508</a> </span><br />
<span style="font-family: Verdana,sans-serif;"><br /></span>
<span style="font-family: Verdana,sans-serif;"><br /></span>
</div>
Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-3473399517246044360.post-32585146161891719232012-11-23T18:01:00.002+01:002012-11-23T18:01:17.042+01:00Sage 5.4.1 Released<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><span style="font-size: small;"><b>Sage 5.4.1 was released on 15 November 2012.</b></span> </span></span><br />
<br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">It is available in<span style="font-size: x-small;"> </span>source and binary form from:
</span></span><br />
<ul style="text-align: left;">
<li><span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><a href="http://www.sagemath.org/download.html" target="_blank">http://www.sagemath.org/<wbr></wbr>download.html</a></span></span></li>
<li><span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><a href="http://www.sagemath.org/mirror/torrents.html">http://www.sagemath.org/mirror/torrents.html</a> </span></span></li>
</ul>
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Sage (<a href="http://www.sagemath.org/" target="_blank">http://www.sagemath.org/</a>) is developed by volunteers and combines<span style="font-size: x-small;"> </span>over 90 open source packages. For instructions about installing Sage, see
</span></span><br />
<ul style="text-align: left;">
<li><span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"> <a href="http://www.sagemath.org/doc/installation" target="_blank">http://www.sagemath.org/doc/<wbr></wbr>installation</a></span></span>
</li>
</ul>
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"></span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">The following page lists the platforms on which Sage should work:
</span></span><br />
<ul style="text-align: left;">
<li><span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"> <a href="http://wiki.sagemath.org/SupportedPlatforms" target="_blank">http://wiki.sagemath.org/<wbr></wbr>SupportedPlatforms</a></span></span>
</li>
</ul>
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">If you have any questions and/or problems, please report them to any of<span style="font-size: x-small;"> </span>these Google groups:
</span></span><br />
<ul style="text-align: left;">
<li><span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"> sage-support: <a href="http://groups.google.com/group/sage-support" target="_blank">http://groups.google.com/<wbr></wbr>group/sage-support</a></span></span>
</li>
<li><span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"> sage-devel: <a href="http://groups.google.com/group/sage-devel" target="_blank">http://groups.google.com/<wbr></wbr>group/sage-devel</a></span></span>
</li>
</ul>
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">You can also drop by in #sagemath on freenode or post your questions<span style="font-size: x-small;"> </span>at <a href="http://ask.sagemath.org/" target="_blank">http://ask.sagemath.org/</a></span></span>
<br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><br /></span></span>
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">The following 15 people contributed to this release. Of those, 2 made<span style="font-size: x-small;"> </span>their first contribution to Sage:
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><br /></span></span>
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"> - Aly Deines
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"> - Benjamin Hutz [first contribution]
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"> - Burcin Erocal
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"> - David Loeffler
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"> - Dmitrii Pasechnik
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"> - Jeroen Demeyer
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"> - John Palmieri
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"> - Karl-Dieter Crisman
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"> - Kenneth Smith
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"> - Paul Zimmermann
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"> - Punarbasu Purkayastha
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"> - Sarah Chisholm
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"> - Sebastien Gouezel [first contribution]
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"> - Travis Scrimshaw
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"> - Volker Braun
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><br /></span></span>
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">* Release manager: Jeroen Demeyer.
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><br /></span></span>
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">* We closed 13 tickets in this release. For details, see
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><br /></span></span>
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"> <a href="http://boxen.math.washington.edu/home/release/sage-5.4.1/tickets.html" target="_blank">http://boxen.math.washington.<wbr></wbr>edu/home/release/sage-5.4.1/<wbr></wbr>tickets.html</a></span></span>
<br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><br /></span></span>
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Closed tickets:
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><br /></span></span>
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">#13309: Build Sage on OS X Mountain Lion [Reviewed by Dmitrii Pasechnik]
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><br /></span></span>
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Merged in sage-5.4.1.rc0:
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><br /></span></span>
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">#6367: Karl-Dieter Crisman, Kenneth Smith: polygon2d -- several issues:<span style="font-size: x-small;"> </span>typo in docs, shouldn't have been renamed [Reviewed by Volker Braun]
</span></span><br />
<b><span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">#10803: Paul Zimmermann: critical bug in real_roots [Reviewed by Jeroen<span style="font-size: x-small;"> </span>Demeyer]
</span></span></b><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">#12753: Benjamin Hutz: is_PrimeField import error [Reviewed by David<span style="font-size: x-small;"> </span>Loeffler]
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">#12859: Aly Deines: quaternion algebra 'ramified at one prime' [Reviewed<span style="font-size: x-small;"> </span>by Sarah Chisholm]
</span></span><br />
<b><a href="http://www.sagemath.org/doc/reference/sage/combinat/symmetric_group_representations.html?highlight=symmetricgrouprepresentation#sage.combinat.symmetric_group_representations.SymmetricGroupRepresentation" target="_blank"><span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">#13382: Dmitrii Pasechnik: build docs for<span style="font-size: x-small;"> </span>SymmetricGroupRepresentation(</span></span></a></b><wbr></wbr><b><a href="http://www.sagemath.org/doc/reference/sage/combinat/symmetric_group_representations.html?highlight=symmetricgrouprepresentation#sage.combinat.symmetric_group_representations.SymmetricGroupRepresentation" target="_blank"><span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">s) [Reviewed by Volker Braun, Travis Scrimshaw]</span></span></a></b></div>
<div style="text-align: left;">
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">#13533: Jeroen Demeyer: Remove "optional - gcc" from doctests [Reviewed
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">by Karl-Dieter Crisman, John Palmieri]
</span></span><br />
<b><span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">#13541: John Palmieri: update scipy to 0.11.0 [Reviewed by Dmitrii<span style="font-size: x-small;"> </span>Pasechnik]
</span></span></b><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">#13598: John Palmieri: 'x' should be defined when using 'sage -c'<span style="font-size: x-small;"> </span>[Reviewed by Punarbasu Purkayastha]
</span></span><br />
<b><span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">#13632: Sebastien Gouezel: Fix latex display of arguments of symbolic<span style="font-size: x-small;"> </span>functions [Reviewed by Burcin Erocal] </span></span></b><br />
<br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Merged in sage-5.4.1.rc1:
</span></span><br />
<br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">#13407: Jeroen Demeyer: Move sage-make_relative to sage-location<span style="font-size: x-small;"> </span>[Reviewed by Dmitrii Pasechnik]
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">#13452: Jeroen Demeyer: Refactor sage-location [Reviewed by Dmitrii<span style="font-size: x-small;"> </span>Pasechnik]
</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">#13689: Jeroen Demeyer: Fix upgrading from relocated Sage with GCC<span style="font-size: x-small;"> </span>[Reviewed by John Palmieri]
</span></span></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-24697839785076427632012-11-15T12:19:00.001+01:002012-11-15T12:19:30.106+01:00Sage 5.4 released<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
I'm glad to blog (and "reshare) that Sage 5.4 is available now.<br />
<br />
Some random picks from the release notes:<br />
<br />
<ul style="text-align: left;">
<li>notebook internationalization</li>
<li>4ti2 interface</li>
<li>MathJax instead of jsMath</li>
<li>Bijection between Rigged Configurations and Crystal Paths</li>
<li>new features in group algebra category</li>
<li>non commutative symmetric functions</li>
<li>Update Cremona's table of elliptic curves to 270000</li>
<li>Plancherel measure of an individual partition</li>
</ul>
<br />
... and much more besides even more bugfixes :-)<br />
<br />
<a href="http://sagemath.org/download.html">http://sagemath.org/download.html</a><br />
<br />
And I suggest you to follow <a href="https://plus.google.com/u/0/113421169347512599264/about" target="_blank">Sage at Google+</a> to stay in the loop.<br />
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-37114835247288591972012-11-15T11:35:00.002+01:002012-11-15T11:35:25.717+01:00New Mirror: Universidade de São Paulo<div dir="ltr" style="text-align: left;" trbidi="on">
Sage just got a second mirror in South America, at the <a href="http://www5.usp.br/en/">Universidade de São Paulo</a>: <a href="http://linorg.usp.br/sage/index.html">http://linorg.usp.br/sage</a>. Now, there are two in Brazil and no one in another country, but still better than just one SPOF.</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-60459679336615013302012-04-30T14:27:00.002+02:002012-05-11T11:22:19.361+02:00Sage goes GSoC<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana, sans-serif;">This year <a href="http://www.sagemath.org/">Sage</a> is part of the <a href="http://www.google-melange.com/">GSoC</a> program for the first year. This is an exciting new opportunity to get new contributors on board and to aim for new features. We got nearly 60 project proposals, </span><span style="font-family: Verdana, sans-serif;">of which about</span><span style="font-family: Verdana, sans-serif;"> 8 or more were really excellent ones. </span><span style="font-family: Verdana, sans-serif;">We got 3 slots to fill </span><span style="font-family: Verdana, sans-serif;">and therefore</span><span style="font-family: Verdana, sans-serif;"> it was a really hard decision which projects to pick. We are curious how this will turn out during the summer.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span><br />
<span style="font-family: Verdana, sans-serif;">The projects are:</span><br />
<br />
<ul style="text-align: left;">
<li><a href="http://www.google-melange.com/gsoc/project/google/gsoc2012/poeschko/15001" style="font-family: Verdana, sans-serif;">Lattices by Jan Pöschko</a><span style="font-family: Verdana, sans-serif;">: Jan will work on a new "Lattice" class for Sage.</span></li>
<li><a href="http://www.google-melange.com/gsoc/project/google/gsoc2012/kulakova_lina/26001" style="font-family: Verdana, sans-serif;">Univariate polynomials and factorization library by Lina Kulakova</a><span style="font-family: Verdana, sans-serif;">: here, the aim is to implement a factorization for polynomials over F_p where p is large.</span></li>
<li><a href="http://www.google-melange.com/gsoc/project/google/gsoc2012/titusnicolae/12001" style="font-family: Verdana, sans-serif;">Symbolic Expressions by Titus Nicolae</a><span style="font-family: Verdana, sans-serif;">: this project aims to improve Sage's core code for handling symbolic expressions.</span></li>
</ul>
<div>
<span style="font-family: Verdana, sans-serif;">The actual work starts on May 21st and all three students will give regular updates through their blogs or by posting to the mailing list to keep others in the loop what they are doing. All regular developers are invited to give them feedback and help them if they encounter any problems.</span></div>
</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-56733945171038809412011-07-01T16:16:00.003+02:002011-07-01T16:20:17.776+02:00Sorting is Linear - also in Go!Wrttien in <a href="http://www.golang.org/">Go</a><br />
<br />
<pre style="font-size: 9px;">package main
/*
Sorting a list of positive int64 values is linear, also in Go!
Author: Harald Schilly
Based on some bash script I found somewhere on the internetz ...
*/
import "time"
func main() {
var vals = []int64 { 55, 1, 9, 0, 31, 11, 90, 11 }
var ret = make(chan int64)
var done = make(chan bool)
// main loop, just a single for loop
for _, v := range vals {
go func(v int64) {
// if it doesn't sort well, increase the 1e5
time.Sleep(1e5 * v)
ret <- v
} (v)
}
// output iterates over all results in the ret channel
go func() {
for i := 0; i < len(vals); i++ {
println(<-ret)
}
done <- true
}()
<-done
}
<div></div></pre>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-5333163567655754632010-11-12T20:34:00.000+01:002010-11-12T20:34:48.265+01:00Java XML DOM Document creation<div style="white-space: nowrap;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">/**</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> * Since if found some crap on the Internet, here a better example for creating an XML document in Java. </span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> * </span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> * Copyright: Harald Schilly <harald.schilly@gmail.com></harald.schilly@gmail.com></span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> * License: Apache 2.0</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> */</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"><br />
</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">package at.schilly.aldap2.ue12131415xml;</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"><br />
</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">import java.io.BufferedOutputStream;</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">import java.io.File;</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">import java.io.FileNotFoundException;</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">import java.io.FileOutputStream;</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">import java.text.SimpleDateFormat;</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">import java.util.Calendar;</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">import java.util.Map;</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"><br />
</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">import javax.xml.parsers.DocumentBuilder;</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">import javax.xml.parsers.DocumentBuilderFactory;</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">import javax.xml.parsers.ParserConfigurationException;</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">import javax.xml.transform.OutputKeys;</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">import javax.xml.transform.Transformer;</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">import javax.xml.transform.TransformerException;</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">import javax.xml.transform.TransformerFactory;</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">import javax.xml.transform.dom.DOMSource;</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">import javax.xml.transform.stream.StreamResult;</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"><br />
</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">import org.w3c.dom.Document;</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">import org.w3c.dom.Element;</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">import org.w3c.dom.Node;</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"><br />
</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">/** @author harald schilly */</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">public class MapToXml {</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> </span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> final private SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd");</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> </span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> /** this method takes a Map of Strings to Strings and builds an xml document.</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> * </span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> * @param xmlfn</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> * xml output filename</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> * @param map</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> * just a plain Map<string, string=""></string,></span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> * @throws ParserConfigurationException</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> * @throws FileNotFoundException</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> * @throws TransformerException */</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> public void write(final File xmlfn, final Map<string, string=""> map)</string,></span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> throws ParserConfigurationException, FileNotFoundException,</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> TransformerException {</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> // Docbuilder to create the xmldoc</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> DocumentBuilderFactory docbuilderfactory = DocumentBuilderFactory</span></span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: small;">.newInstance();</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> DocumentBuilder docbuilder = docbuilderfactory.newDocumentBuilder();</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> Document xmldoc = docbuilder.newDocument();</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> </span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> // That's the root element</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> Element root = xmldoc.createElement("map");</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> </span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> // last saved element</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> Element lastsaved = xmldoc.createElement("lastSavedBy");</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> lastsaved.setAttribute("name", "Harald Schilly");</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> lastsaved.setAttribute("date",</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> dateformat.format(Calendar.getInstance().getTime()));</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> root.appendChild(lastsaved);</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> </span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> // iterate over map and add the entry/value elements</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> for (Map.Entry<string, string=""> mapentry : map.entrySet()) {</string,></span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> Element entry = xmldoc.createElement("entry");</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> entry.setAttribute("key", mapentry.getKey());</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> </span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> Element value = xmldoc.createElement("value");</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> Node node = xmldoc.createTextNode(mapentry.getValue());</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> </span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> value.appendChild(node);</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> entry.appendChild(value);</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> root.appendChild(entry);</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> }</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> xmldoc.appendChild(root);</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> </span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> // get a transformer with the given .dtd</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> TransformerFactory transormerfactory = TransformerFactory.newInstance();</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> Transformer transformer = transormerfactory.newTransformer();</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, "map.dtd");</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no");</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> transformer.setOutputProperty(OutputKeys.INDENT, "yes");</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> </span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> // transform and write to a file</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> // use a StringWriter() object to write to a string.</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> FileOutputStream fos = new FileOutputStream(xmlfn);</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> BufferedOutputStream bos = new BufferedOutputStream(fos);</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> StreamResult result = new StreamResult(bos);</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> DOMSource source = new DOMSource(xmldoc);</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> transformer.transform(source, result);</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;"> }</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-size: x-small;">}</span></span><br />
<div></div></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3473399517246044360.post-36159435756312080512010-03-06T19:18:00.004+01:002010-03-06T19:31:50.517+01:00Anchors in Sage NotebooksIf you have a lengthy Sage Notebook and you want to quickly jump to a certain header or paragraph as a reference, use HTML anchors. They work like follows:<br />
<ol><li>An <a name="anchorname"></a> tag must be inserted at the position you want to jump to.</li>
<li>Reference it via <a href="#anchorname">some text</a>.</li>
</ol><div>After that, you can jump to the marked position just by clicking on the <u>some text</u> link.<br />
<br />
To insert rich text and HTML, use the rich text editor accessible via<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> <shift>+<click on blue insert bar></span>. There is an "HTML" icon. Alternatively, you can use the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">html()</span> function:<br />
i.e. <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">html('<a name="test"></a>') ...</span></div>Unknownnoreply@blogger.com0