[sage-devel] Re: Identification with ldap.
Dear William or anyone I tried to unify the objects in user_db and users and let the passwords proxy ldap if they are not the default users (which could use the basic hash+salt method). I ran into this odd problem that on startup it was trying to set a non-existent admin with the password. On some investigation I ran across the part of run_notebook.py quoted below which I just don't understand. How does it ever get to the else branch??? http://www.sagemath.org/hg/sage-main/file/f1f9a0884cdf/sage/server/notebook/run_notebook.py The tabbing seems to have go lost here. 103 if not nb.user_exists('admin'): 104 reset = True 105 106 if reset: 107 passwd = get_admin_passwd() 108 if reset: 109 nb.user('admin').set_password(passwd) 110 print Password changed for user 'admin'. 111 else: 112 nb.create_default_users(passwd) 113 print User admin created with the password you specified. 114 print \n\n 115 print **70 116 print \n 117 if secure: 118 print Login to the SAGE notebook as admin with the password you specified above. 119 #nb.del_user('root') On Jul 18, 3:43 pm, William Stein [EMAIL PROTECTED] wrote: On Fri, Jul 18, 2008 at 2:17 PM, Michael_D_G [EMAIL PROTECTED] wrote: Thanks so much William! No I am not talking about the worksheets but the notebook. What confused me was that a UserDatabase looked like the place were all the users were being stored. I saw user.py but that doesn't have a container class. There is clearly some redundancy between UserRecord and User. What you seem to be saying is that rather than put my effort into user_db.py, I should be reworking users.py. What would be nice is to have a single containter class that holds the user information. I sort of started in this direction by making UserDatabase subclass dict. The password, rather than actually being a string or hash is its own class. That subclasses the new-style object class. The thing is we can override the __eq__ method. This means that when you check if two password objects are equal you can use what ever authentication method the system is configured to use. This pushes all the complication for authentication away from the notebook (which probably shouldn't have it) and into classes for managing user information. A first draft (messy prototype): class UserRecord(object): def __init__(self, username, passwd=None, email=None): self.username = username self.passwd = LDAP_Password(username,passwd) self.email = email class LDAP_Password(object): def __init__(self, username,passwd): self.uid = username if passwd: valid = authenticate_uid(base,server_ip,server_port,self.uid,passwd) if valid: #cache password self.passwd=passwd else: self.passwd=None else: self.passwd=None def __eq__(self,passwd): # Allows checking against either a string # or another LDAP_Password # object. if type(self)==type(passwd): pw=passwd.passwd else: pw = passwd #Password never checked if self.passwd == None: valid = authenticate_uid(base,server_ip,server_port,self.uid,pw) if valid: self.passwd=pw return str(self.passwd).__eq__(pw) def __repr__(self): # Really insecure return str(self.passwd) One thing I am not happy about is that I am implicitly using this as a caching method. If the plain text password is authenticated then I store it and use it to check instead of theldap. More properly the caching mechanism should be at least hashing and probably pushed into authenticate_uid. Hi, I don't like the really insecure storing of the plain text password at all; that's of course terrible since it will get pickled to disk probably. But I like the design strategy you suggest above, especially overloading __eq__ and improving user.py. I very very very strongly encourage you to create one single tiny patch that does something right in this direction and submit it to be reviewed and included in Sage. It will help you get a sense of how the Sage workflow goes without biting off more than you can easily chew. -- William --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: bug: double escaping of quotes
On Wed, Jul 16, 2008 at 3:42 AM, Mats [EMAIL PROTECTED] wrote: bug report: Using notebook mode. Problem: cell input: '\'' output: '\\u0027' expected output: '\u0027' Sincerely, Mats Thanks. This is now http://trac.sagemath.org/sage_trac/ticket/3692 William --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: sage + py.test fails
We officially reported the bug to them via their tracker. Then one Sage developer worked for a long time and heroically found a fix and reported it too. I think it maybe just takes a long time to filter through the system back to the *deployed* RHEL and SLES linux boxes all over the place.I.e., using the system-wide Python by default just isn't an option. And of course a lot of users want to install Sage without having to be root, and they don't know anything about Python or installing it themselves. I see. and OSX there is also the multilib issue, i.e. 32 vs. 64 bit are supported on the same machine. So I disagree that it mostly works and I consider it a bad, bad idea to even give the user some simple option to make Sage build with the system python. It is trivial to do if you know your way around the Sage build system, but that actually means that one can likely fix issues oneself like in your case. Everybody else just has to play by the rules. Well, if the situation is that the system wide python is so different on different machines that it makes Sage fail, then it sucks. Imho. It won't necessarily fail, but there are many possibilities for potentially very subtle bugs. And since I spend an (unresonable) amount of time chasing down pretty much every issue reported I would prefer that the number of variables does not increase. In addition it is not my fault that Apple decided that a universal Python is the way to go. Once we switch to a pure 64 bit Python on OSX Apple's python won't work at all any more anyway. And this problem on OSX is not some hypothetical issue: I spend two hours a couple weeks ago debugging a python import module failure on OSX where universal libraries played a role and the linker happily linked together an x86 extension and a ppc library. The import of the module failed and it was far from clear why. And if it takes me two hours to figure out you can guess what I would assume what would happen to most people. And in that case the situation was clear cut and I had shell access to the box in question. Now imagine debugging that problem by email :) Also let me add that the goal of Sage is to provide a viable alternative to the Ma's and that all of those programs are self-contained. Our design decisions are very much motivated by the Sage mission statement. We have to be really focused on that goal, and consequently *not* worry about certain other very worthy goals like nicely integrating as a library. That's not to say that it isn't *wonderful* that some people like Tim Abbot are doing an amazing job on the goal of integrating as a library. Speaking of which, I think debian-sage is the perfect solution for you Ondrej. Of course you know all about it since you're very involved in that effort. (I get the sense it will be ready soon too.) Unfortunately not lately, but I at least created the list and wiki pages. So all credit goes to Tim. He has done a fenomenal job. Yes, That should fix the problem. Nevertheless I still want to find ways to easily test newest Sage and newest SymPy in some canonical way without messing up with paths and shooting myself in the foot, to use mabshoff's words. And I won't post the obvious one line diff to make Sage with system python at build time work. If you need to ask you shouldn't play with something that could cause endless trouble :p I understand your point as the release manager, but from the users point of view, if every program distributed all the libraries (python, fortran, libxml, and all the other stuff that ships with sage), and it would be incompatible with the other installations, as currently Sage is incompatible with systemwide python as you stressed several times, then it's bad, because I cannot mix Sage with other components on my system. So it's Sage and the rest of the world. Well, Sage works because it is self contained and it is only possible to work because it is self contained. We can fix bugs rapidly because we nearly control 100% of the components and its dependencies of Sage. No one ever promised that Sage would play well with your system and installing Python packages into a Sage install is trivial. You can trivially use your system's Python, but I have no intentions of making it easy on you because other people will see the email and will shoot themselves in the foot. Even once Sage is in Debian proper I will not consider anything a bug unless it can be reproduced with a vanilla Sage build from sources. There is only one official Sage release and it will not be the one in any distribution. I seriously doubt that any distribution can keep up with the official Sage. That said, it will be very good for there to be a Sage in Debian, and I'm really looking forward to the day that happens. I know because before for many many users I was personally a Linux user users - years? How many years were you using linux and why did you
[sage-devel] Re: Draft Sage description for Debian
On Sun, Jul 20, 2008 at 11:12 PM, Timothy G Abbott [EMAIL PROTECTED] wrote: There is a sage source package, which builds the library packages libsage2 and libsage-dev. In theory, I could try to be sneaky and take That's right, I haven't noticed: http://packages.debian.org/sid/libsage-dev sage as the binary package with sagemath as the source package name, but I suspect I would not get away with it. Right, let's use sagemath. Ondrej --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: [Axiom-developer] Re: [sage-devel] Re: Identification with ldap.
Do you want your code to live? That's a very interesting question. When I was much younger, I used to think I did. But when you realize that an awful lot of code isn't meant to live -- it's meant to solve an immediate problem, and then be discarded -- then you don't care whether it lives or not. Axiom was clearly designed to live, rather than solve an immediate problem. But how much code is out there that was designed with a 30-year horizon? More to the point, how much code is in Sage that is designed for the 30 year horizon? Will a matrix inversion still give the right answer 30 years from now? If so, how many dozens of times will it have to be reimplemented because nobody can understand the current code? Which of the 16 kinds of matrix inversions are used and how do they differ in terms of input domains, performance, robustness, etc? Should I use the Maxima inversion or the Sympy inversion or the Lapack inversion or implement a new one? The front ends will likely change. Axiom's hyperdoc help system is being reimplemented using a firefox front end. The build system is about to be moved from using 'make' to using 'asdf'. The file system layout is disappearing, replaced by latex literate books. http://axiom.axiom-developer.org/axiom-website/documentation.html Sage's notebook is certain to be replaced. Even so, if we want the next generation of developers to contribute effectively it seems important to write down what they need to know so they don't give up in frustration. That's a serious loss. We need a computational mathematician to be able to contribute effectively without becoming frustrated. We also need to capture the special knowledge that lies behind the contributed code since there will be very few experts worldwide in a given research area. Would you recognize and be able to fix a bug in a feynman quantum computation? William has stated that he doesn't care about this issue since he wants a system NOW that he can use to do his number theory research. But it is fundamentally about the quality of the system. The 4Ms don't care because they pay people to learn the code. Google and Microsoft, having invested real dollars into the effort, ought to try for a higher standard and a longer horizon. I really wish they would hire a team with a mandate to make this code literate. Tim --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: sagemath.org website info #2
What kind of link from Warwick University did you have in mind? I can imagine being able to get a link from departmental pages but not from university pages. But also, the department has very long-standing and valuable links with the Magma group and John Cannon in particular (he visits there for a few months every year), so any mention of Sage there would be accompanied by links to -- at least -- Magma John Cremona (Mathematics Professor at U of Warwick, for those who don't know me) 2008/7/19 Dr. David Kirkby [EMAIL PROTECTED]: On 18 Jul, 20:33, Harald Schilly [EMAIL PROTECTED] wrote: Hello Sage folks, as promised in my last website posting [1], here a bit more how things evolved. I think the homepage could be more search engine friendly, which should help the rank on google. There are a lot of keywords, but I'm not convinced they are in the right order: This is what the keywords currently are: sage, sagemath, sage math, open source, floss, free, software, software package, mathematic, mathematics, math, maths, cas, computer algebra system, python, cryptography, numerical computation, algebra, group theory, combinatorics, graph theory, calculus, symbolics, number theory, mathematical programming, scientific computing, mathematical education, free software, interactive maths, alternative, groups, finite field, linear algebra over finite fields, free advanced algebra program, advanced mathematical software, gf(2), opensource math, mathematics software free, math notebook, free math software, William Stein 1) Now I think there are too many there, which probably does not help the page rank. I'm not an expert on this, but I think that an excessive number does more harm than good. 2) I believe the order affects the rank too. I find it hard to believe that they are optimal. 3) One of them is mathematic. Is that supposed to be Mathematica? Here are a few suggestions. free mathematica, free maple, free mathematics software, download mathematics, sage, open source mathematics, free computer algebra system, mathematics software, mathematical software, symbolic computation, mathematica clone, maple clone, arbitrary precision arithmetic, plot graph, 4) If I type 'free mathematica' into google, the number one hit is this question on a forum: http://www.karakas-online.de/forum/viewtopic.php?t=189 Sage is not even mentioned as one of the free versions - all the others I can think of are. It would be worth someone registering and saying a bit about sage. Google seems far the most popular engine, so I would worry about that more than any of the others. 5) Typing 'free maths software' brings up http://www.dmoz.org/Science/Math/Software/ as #4. (dmoz is a list of open source software). I've been told before that it is quite important to get in the dmoz directory, but I don't see Sage listed there. 6) I believe links to sites from sourceforge are quite helpful. It might be worth finding some relevant software on there, and asking if they will link to sage. I'll stick a link from http://witm.sourceforge.net/ for you. 7) You could try asking on one of the web developer sites for suggestions how to improve ranking. uk.net.web.authoring is a newsgroup, which has a slight uk bias, but 95% of the questions on there are just as applicable to any other country. I've found them pretty helpful in the past for suggestions how to improve a site. 8) Typing 'mathematics university' into google I get 95 million hits. Google insists on sending me to google.co.uk, so I get mainly uk universites. The top ones are Warwick, Oxford, Cambridge, Bristol, University College London. I would bet all of them have links pages. Why not ask them to link to sage? 9) Since Microsoft Research are funding sage, how about trying to get Sage listed on the M$ web site? I don't even see it mentioned on the page dealing with US university research. I would suspect if Google finds microsoft linking to a site, it would push it up the page rank a lot. 10) Ask regular users of Sage to link to the site. 11) I think the plan should be to get well respected sites - major universities, Microsoft (as much as I hate to say it), 12) Once a Solaris port is done, try to get Blastwave and Sunfreeware to keep packages. I'm not sure if Blastware will, as I think they want Solaris 8 packages. But I guess if it does not run on Solaris 8, they might accept it. You might get some problems getting Sunfreewave to have a package, as the owner of that site (Steve Christensen) works for Wolfram Research, produces his own Mathematica addon and moderates comp.soft-sys.math.mathematica. I suspect, given he does not allow other software to be discussed on comp.soft-sys.math.mathematica, he might be reluctant to produce a package for Sage. But you can only ask. Sticking 'solaris software' into google I find www.sunfrerware.com is the top hit - more than www.sun.com !! At number 4 is
[sage-devel] Re: Blogs
Igor's sliders for 2d plots look good. Some other random notebook ideas I had (that i don't expect to be implemented anytime soon, but i think are worth writing down somewhere): Is it possible to put all output (and input?) cells in some css (html/ whatever, i dont know anything about web pages) component that can be collapsed/expanded? (I am thinking of the way mathematica has those lines brackets to the right of its notebook, though those are kind of confusing, a regular plus sign widget would be fine). That would be nice for long notebooks-- you can collapse the parts you arent working on. It would also be nice if jmol applets didn't have to load automatically when opening a notebook which has them previously running (it makes the notebook take forever to load), or adding an option to control this. And has anyone asked the jmol creator if he can add some flag to the applet that will strip out all the chemistry options in the right-click menu? Also I am finding that editing large cells (say 50 lines?) gets kind of slow (on my p4 2ghz 1gb ram) and that breaking it up into multiple cells improves this quite a bit. If this is a simple bug it would be nice to fix. Lastly, would it be possible to do 'load ../05/worksheet.txt' so that I can use methods i wrote in another worksheet in my current one? Or to have a common data directory that all worksheets can access? On Jul 19, 10:10 am, William Stein [EMAIL PROTECTED] wrote: Hi, All the students working fulltime on Sage this summer for me are blogging about their work. I've put links to all their blogs here: http://wiki.wstein.org/2008/summer/employ Feel free to read them, give feedback, etc. William -- William Stein Associate Professor of Mathematics University of Washingtonhttp://wstein.org --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: Sage 3.0.6.alpha0 released
I was able to reproduce this on many different machines, all had only one common case - they had GCC 4.3.1 or later - additional to my system there is also friends Debian that is affected, as of arch a way to make it reproducible is to update to latest (pacman -Syu) still looking for someone with GCC 4.3.0 to see if those are all gcc 4.3.x or only 4.3.1 (this happens on different cpus, happened on amd barton, semptron and intel core 2 duo, also on different glibc versions, gcc seems to be only connecting element as far as I found out, in all cases adding those two flags to Make-arch fixes it... I will look into gcc bugtracker, maybe there is something to explain it) cheers, Andrzej. gcc -v Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.1-6' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-cld --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu Thread model: posix gcc version 4.3.1 (Debian 4.3.1-6) --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: Package management and versioning
On Jul 20, 4:21 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, OK, so who knows a clever way to detect which files were added/changed in a directory structure? Quick and very dirty : 'find . -cmin -5' (files modified less than 5 minutes ago). Not even close :). There are packages that install in less than 10 seconds. Quick and dirty : ls -lR before ; make install ; ls -lR after ; diff -u before after | sed -e 'whatever_to_prettify_the_output' but it will look kind of ugly. Better. Better : make a decent snapshot of the tree state before installing, keeping track of filename, modification time, size, possibly some md5 checksum or something (say in an sqlite database file, easy to do in python), and compute the difference after running make install. I am not so sure this is worth it. You are basically writing apt/rpm for user space. And we like to reuse components if they exist and fit the bill :) But once you are there, you might as well keep the snapshot, add the package name as one of the file attributes, and bam you have a package management system ! But this is IMHO not KISS - a guiding principle of Sage :). Right now a fresh 3.0.6.alpha0 contains about 107235 files in $SAGE_LOCAL when following symbolic links. That is a lot of IO and disk seeks to do to upgrade for each package. One thing that endlessly annoys me about rpm for example is its sluggish performance, which is largely rooted in its db backend, i.e. berkeley db IIRC. On top of that sqlite's performance sucks even worst. And you also introduce another point of failure where up to now KISS had provided a nearly perfect solution, i.e. any sort of db corruption will break Sage's upgrade system. /v I *really* like the idea for optional packages, but for the core there are various problems you will have to deal with: * Updating one spkg often forces the update of another spkg. For example updating clisp forces a recompile of Maxima. So you cannot just switch between two clisp installs and expect things to work. And there are even more complicated dependencies in the default tree. * The Sage library is special and there are loads of subtle dependencies. For example 3.0.3 to 3.0.4 upgraded LinBox from 1.1.5 to 1.1.6.rc0. A seemingly innocent update until you learn that this also means that the name of the wrapper library has changed. So running a 3.0.4 or later Sage library with a linbox-1.1.5 or earlier will cause Sage not to even start any more. In some cases it is imaginable that Sage does start but will exhibit subtle bugs since we fixed something in FOO-1.3.3.p12, but for some reason one user ends up running FOO-1.3.3.p11. Happy bug hunting in that case. * sage -upgrade will be completely broken by introducing the framework you envision. We could disallow upgrading of Sage at some point so that everybody would be forced to start with a clean tree, but so far that has never happened. * Once sage -upgrade works you will end up with ever increasing install sizes of Sage. You can obviously prune the tree, but just the other day I removed about 5 GB of spkgs from two Sage installs that have been updated for a while and actually caused the notebook to crash due to lack of space on the harddisk. Now imagine what those Sage trees would take up on disc if all those spkgs had not been overwritten. Due to the above I don't think using anything like you propose for the core is a good idea. I have changed my mind on fundamental issues like this before (usually from negative to positive once an implementation actually existed), but so far the bad does outweigh the good by a mile. We do KISS for a reason :) But please do not be discourage to attempt to make it work. Cheers, Michael --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: Identification with ldap.
On Sun, Jul 20, 2008 at 11:01 PM, Michael_D_G [EMAIL PROTECTED] wrote: Dear William or anyone I tried to unify the objects in user_db and users and let the passwords proxy ldap if they are not the default users (which could use the basic hash+salt method). I ran into this odd problem that on startup it was trying to set a non-existent admin with the password. On some investigation I ran across the part of run_notebook.py quoted below which I just don't understand. How does it ever get to the else branch??? That code looks to me like it is just crap. I'm not insulting anybody by saying that since I wrote that code. I would like to strongly encourage you (Michael D. G.) to take a clean copy of Sage, change just that code by say getting rid of the else, test things out, make a patch, and submit it for inclusion in sage. This is a hopefully simple straightforward task and will give you a sense for the sage project's workflow (plus you get your name in big red lights as a contributor). -- William http://www.sagemath.org/hg/sage-main/file/f1f9a0884cdf/sage/server/notebook/run_notebook.py The tabbing seems to have go lost here. 103 if not nb.user_exists('admin'): 104 reset = True 105 106 if reset: 107 passwd = get_admin_passwd() 108 if reset: 109 nb.user('admin').set_password(passwd) 110 print Password changed for user 'admin'. 111 else: 112 nb.create_default_users(passwd) 113 print User admin created with the password you specified. 114 print \n\n 115 print **70 116 print \n 117 if secure: 118 print Login to the SAGE notebook as admin with the password you specified above. 119 #nb.del_user('root') On Jul 18, 3:43 pm, William Stein [EMAIL PROTECTED] wrote: On Fri, Jul 18, 2008 at 2:17 PM, Michael_D_G [EMAIL PROTECTED] wrote: Thanks so much William! No I am not talking about the worksheets but the notebook. What confused me was that a UserDatabase looked like the place were all the users were being stored. I saw user.py but that doesn't have a container class. There is clearly some redundancy between UserRecord and User. What you seem to be saying is that rather than put my effort into user_db.py, I should be reworking users.py. What would be nice is to have a single containter class that holds the user information. I sort of started in this direction by making UserDatabase subclass dict. The password, rather than actually being a string or hash is its own class. That subclasses the new-style object class. The thing is we can override the __eq__ method. This means that when you check if two password objects are equal you can use what ever authentication method the system is configured to use. This pushes all the complication for authentication away from the notebook (which probably shouldn't have it) and into classes for managing user information. A first draft (messy prototype): class UserRecord(object): def __init__(self, username, passwd=None, email=None): self.username = username self.passwd = LDAP_Password(username,passwd) self.email = email class LDAP_Password(object): def __init__(self, username,passwd): self.uid = username if passwd: valid = authenticate_uid(base,server_ip,server_port,self.uid,passwd) if valid: #cache password self.passwd=passwd else: self.passwd=None else: self.passwd=None def __eq__(self,passwd): # Allows checking against either a string # or another LDAP_Password # object. if type(self)==type(passwd): pw=passwd.passwd else: pw = passwd #Password never checked if self.passwd == None: valid = authenticate_uid(base,server_ip,server_port,self.uid,pw) if valid: self.passwd=pw return str(self.passwd).__eq__(pw) def __repr__(self): # Really insecure return str(self.passwd) One thing I am not happy about is that I am implicitly using this as a caching method. If the plain text password is authenticated then I store it and use it to check instead of theldap. More properly the caching mechanism should be at least hashing and probably pushed into authenticate_uid. Hi, I don't like the really insecure storing of the plain text password at all; that's of course terrible since it will get pickled to disk probably.But I like the design strategy you suggest above, especially overloading __eq__ and improving user.py. I very very very strongly encourage you to create one single tiny patch that does something right in this direction and submit it to be reviewed and included in Sage. It will help you get a sense of how the Sage workflow goes without biting off more than you can easily chew. -- William -- William Stein
[sage-devel] Re: units, was: Suggestion components to add onto SAGE
William Stein wrote: Since you've clearly been thinking of this from a developer's perspective, and maybe even spending a lot of time writing code, is there any chance you could just dump some of your design thoughts in an email here? I'll try to come up with some coherent description post it here. (1) Are the list of all units one uses pretty standard? Is there a table, say in Wikipedia, with pretty much all of them? Or do people make up new units in the course of their work or research? Well, from what I can tell in any given field most work is done with a relatively small set of units which are conventional for the field. The union of all units in all fields is fairly extensive though. Any computerized units system would have to include the SI units. Beyond that, there are so-called customary units (feet, pounds, etc) which are still widely used in the US; I am not aware of other non-SI systems in extensive use. I think it's fairly common to see semi-SI units such as MJ/day or mg/kg. I think it's common enough to invent to invent new units like those for convenience. The implication, to me, is that any units system has to be easily extensible, since it's likely that random users would want units that escaped our notice. (2) Are there *any* difficult algorithms that involve units or is this mostly a notational and representation problem plus some algebra and simplification? There's isn't really anything too complicated -- probably the most complex operation in the ezunits package is to solve a system of linear equations. Most of the fun seems to be in the notation and representation. Maybe there would be some interesting algebra problems if only I had more imagination. (3) Does Maxima, Maple, Mathematica, Matlab or Axiom do anything particularly cool, surprising or clever involving units? I have looked around to see what Maple and Mathematica have in the way of units, but from what I have seen, there is nothing very exciting. Which is OK --- something boring which just works right would be very useful. FWIW Robert Dodier --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: marketing strategy [was: sagemath.org website info #2]
On Sun, Jul 20, 2008 at 5:36 PM, Harald Schilly [EMAIL PROTECTED] wrote: On Jul 20, 5:28 pm, William Stein [EMAIL PROTECTED] wrote: Harald, are you personally considering spending some of your own money on advertising Sage? oh no, don't worry, i have no money ;) I was worried you were going to hit me up for a bill for $4 from Google if Sage turned out to be really popular for some reason :-) i got some virtual money as a teaser or something else to play with. so i try to spend it wisely and monitor how it works. That's very interesting. Do let us know how it goes. money-free marketing in the form of blogs, links, forums and the word of mouth is probably better anyways, because it reaches the people directly ... Yep, though let's not reject the possibility of paid advertising. For example, I'm paying a little so there will be a Sage booth at the AMS meeting in DC. That's paid advertising in some sense. William --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: Package management and versioning
Quick and very dirty : 'find . -cmin -5' (files modified less than 5 minutes ago). Not even close :). There are packages that install in less than 10 seconds. That one was a joke, of course. I have used it occasionally for a punctual problem, but it's not for packaging. I am not so sure this is worth it. You are basically writing apt/rpm for user space. And we like to reuse components if they exist and fit the bill :) apt/rpm are way too big for my purposes, I am not even sure I want to consider dependencies between packages just yet. But once you are there, you might as well keep the snapshot, add the package name as one of the file attributes, and bam you have a package management system ! But this is IMHO not KISS - a guiding principle of Sage :). Right now a fresh 3.0.6.alpha0 contains about 107235 files in $SAGE_LOCAL when following symbolic links. That is a lot of IO and disk seeks to do to upgrade for each package. Yes ! I totally agree with you, it is completely unacceptable to traverse the whole Sage directory at each package installation. Which is precisely why we need DESTDIR in every scenario I can think of. Once you have that and you keep track of package manifests for removal, you do in fact have the bare bones of a package manager. One thing that endlessly annoys me about rpm for example is its sluggish performance, which is largely rooted in its db backend, i.e. berkeley db IIRC. On top of that sqlite's performance sucks even worst. And you also introduce another point of failure where up to now KISS had provided a nearly perfect solution, i.e. any sort of db corruption will break Sage's upgrade system. About sluggish performance, I was in the train without a Sage installation but I started to play around with pysqlite. Given that mathematicians tend to keep on themselves (the extrovert ones are the ones that look at _your_ shoes ;-) I thought it was a good idea to package GNU hello for inclusion in Sage. I built a fake sage directory our of random parts, it has around 15k files. Built a sqlite database for it, and timed the hello-related commands : Extraction of the tarball : approx. 1.3 sec (oldish G4 powerbook, unplugged, bare with me ...) ./configure : 41 sec (yes, my laptop is old I told you) make : 6.4 sec (see above) make install : 7.5 sec (same time going to $SAGE_ROOT or to a staging directory) SPKG.insert : 0.4 sec (moves the files from staging to $STAGE_ROOT and updates the database) SPKG.remove : 0.4 sec (removes the installed files for hello, updates the database) So the overhead of the database appears to be minimal. Admittedly my directory is too small by an order of magnitude, but still I don't expect the overhead to grow out of bounds. I would call a 5% overhead at install time within the bounds of reason. * Updating one spkg often forces the update of another spkg. For example updating clisp forces a recompile of Maxima. So you cannot just switch between two clisp installs and expect things to work. And there are even more complicated dependencies in the default tree. As I said, I am not intending to manage package dependencies just yet, just removal. * The Sage library is special and there are loads of subtle dependencies. For example 3.0.3 to 3.0.4 upgraded LinBox from 1.1.5 to 1.1.6.rc0. A seemingly innocent update until you learn that this also means that the name of the wrapper library has changed. So running a 3.0.4 or later Sage library with a linbox-1.1.5 or earlier will cause Sage not to even start any more. In some cases it is imaginable that Sage does start but will exhibit subtle bugs since we fixed something in FOO-1.3.3.p12, but for some reason one user ends up running FOO-1.3.3.p11. Happy bug hunting in that case. (Then it appears that a non-working transient state is unavoidable, isn't it ?) * Once sage -upgrade works you will end up with ever increasing install sizes of Sage. You can obviously prune the tree, but just the other day I removed about 5 GB of spkgs from two Sage installs that have been updated for a while and actually caused the notebook to crash due to lack of space on the harddisk. Now imagine what those Sage trees would take up on disc if all those spkgs had not been overwritten. Point taken. Due to the above I don't think using anything like you propose for the core is a good idea. I have changed my mind on fundamental issues like this before (usually from negative to positive once an implementation actually existed), but so far the bad does outweigh the good by a mile. We do KISS for a reason :) I will keep the list informed as I go. Not desperate yet ! And even if the system is only for optional packages, it would still be a useful addition to Sage. (As opposed to, say, GNU hello :-) Cheers, /vincent --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email
[sage-devel] Re: Python question or Sage question...
William Stein a écrit : Why don't we work together on this. Yes :-) Write a pure-python file called something like notebook_ldap.py that provides a simple interface to the ldap stuff you have setup. Show some examples of how to use it from the command line to authenticate a user. Then I bet *i* can easily plug your code into the notebook so that it will work. I have written scripts to perform ldap identification (but they are not yet integrated in Sage). The files are joint. It works with my ldap server. The class notebook_ldap (the name will certainly change) has: -a start(self) method which performs a persisting connection on the server, -a search(self,user,passwd) method. Both return True or False if they succeed or not. I am absolutely not sure that it will work out of my lab... It seems that, with an Active Directory, TLS is not used, but SSL is. Changing ldap:// in ldaps:// and puting self.withTLS=False should work, but I have no mean to verify. If if works everywhere, insertion into Sage will be possible. I'm waiting for comments, suggestions and so on... Yours t.d. -- Thierry Dumont. Institut Camille Jordan -- Mathematiques-- Univ. Lyon I,43 Bd du 11 Novembre 1918, 69622 - Villeurbanne Cedex - France. [EMAIL PROTECTED] web: http://math.univ-lyon1.fr/~tdumont #!/usr/bin/env python import sys,getpass from notebook_ldap import * x=notebook_ldap() # initialize connection to server if x.start(): print 'connection to ldap server is ok.' else: print 'impossible to connect to ldap server' sys.exit() # user name must be on the command line. # get the passwd: cred=getpass.getpass() #try some identifications: print With arg[1] and your password: ,x.search(sys.argv[1],cred),'\n' # Whatever the preceeding request returned True or False, # the following ones will certainly return false: print x.search('bla',cred),'\n' print x.search(sys.argv[1],'bla'),'\n' #and this should again be ok: print x.search(sys.argv[1],cred) Simple ldap identification. import sys,ldap class notebook_ldap: def __init__(self): # change this to fit your configuration. # ( for ssl, you should have self.server='ldaps//' # and self.withTLS=False ) self.server='ldap://ldap-math.univ-lyon1.fr' self.base='o=people,dc=math,dc=univ-lyon1,dc=fr' self.CAPath='/etc/ssl/certs/ca-certificates.crt' self.withTLS=True def start(self): # we want to test the connection; thus all this cannot go # in __init__ try: self.l = ldap.initialize(self.server) self.l.set_option(ldap.OPT_X_TLS_DEMAND, self.withTLS) self.l = ldap.initialize(self.server) self.l.set_option(ldap.OPT_X_TLS_DEMAND, self.withTLS) ldap.set_option(ldap.OPT_X_TLS_CACERTFILE,self.CAPath) self.l.start_tls_s() self.l.bind_s(, ) return True except ldap.CONNECT_ERROR: print connection impossible with ldap server return False except ldap.LDAPError,e: print configuration or ldap server problem return False def search(self,user,cred): # check for a username 'user' and a password 'cred'. # if the result is False and you are sure that 'user' and 'cred' # are ok, check self.base. try: res = self.l.search_s(self.base, ldap.SCOPE_SUBTREE, 'uid='+user,['']) if res!=[]: for dn,hash in res: my_dn=dn self.l.simple_bind_s(my_dn,cred) return True; else: print Incorrect user name return False except ldap.INVALID_CREDENTIALS: print Your username or password is incorrect. return False except ldap.CONNECT_ERROR: print connection impossible with ldap server return False except ldap.LDAPError, e: print configuration or ldap server problem return False begin:vcard fn:Thierry Dumont n:Dumont;Thierry org;quoted-printable:CNRS - Universit=C3=A9 Lyon 1.;Institut Camille Jordan adr:;;43 Bd du 11 Novembre;Villeurbanne Cedex;F;69621;France email;internet:[EMAIL PROTECTED] title;quoted-printable:Ing=C3=A9nieur de Recherche/Research Ingeneer x-mozilla-html:FALSE url:http://math.univ-lyon1.fr/~tdumont version:2.1 end:vcard smime.p7s Description: S/MIME Cryptographic Signature
[sage-devel] Draft Sage description for Debian
I'm getting the point in the Debianization of Sage that I'm primarily working on the package for Sage itself (rather than its dependencies). Below is my current draft description for the Debian Sage package (i.e. the stuff that would show up when you run 'apt-cache show sagemath'). Any comments would be appreciated. (I've noticed that SAGE has been replaced with Sage on the website, and am following that change in the package description). -Tim Abbott Package: sagemath Priority: optional Section: math ... Description: Computer algebra system written in Python Sage is a computer algebra system with support for a wide range of mathematics, including algebra, calculus, elementary to very advanced number theory, cryptography, numerical computation, commutative algebra, group theory, combinatorics, graph theory, and exact linear algebra. . Sage integrates several dozen mathematical software packages, making it possible to combine the best algorithms from several different packages together in a single Sage program. . Much of the Sage core and the Sage interfaces are implemented in Cython, helping Sage avoid the usual performance problems associated with Python. . Sage has a friendly command-line interface based on iPython and a web-based notebook interface which can run locally or connect to a remote Sage server over the network. --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: Package management and versioning
Packages need to be configured with --prefix=$SAGE_ROOT/local, installed with DESTDIR=somewhere, and then somewhere/$SAGE_ROOT/local has to be renamed to $SAGE_ROOT/spkg/graft/packagename-v.er.si-on before graft (or whichever one) is called to put the links in place. I am more than sure that a lot of packages do not honor DESTDIR. Those can be likely fixed. There is also a lot of code that does not use configure make make install. How is that dealt with? What about python packages? Or do you only want to deal with optional packages? For Python packages using setuptools, setup.py has an option -- root=... just for that. Essentially, anything that is packaged for a linux distribution is packaged this way, you install it with a fake root, create a tarball of that and call it a (deb|rpm) package, so all build systems that I know of implement something similar. And as you say, those that don't are easily fixable. Yes, it is certainly something that sounds interesting enough to play with, but while it likely works on Unix/Linux and OSX I doubt it will work on native Windows. So that could be a major showstopper to its adaption. I am thinking of something like a wrapper (sage_graft ?) that would do the clever thing in unix, and plainly move the files in windows. So no functionality is lost in windows, and some is gained in unix ... To answer William's question : the main problem with deb/rpm is that you need to keep a central database of installed files, whereas a tree of links contains the information within itself, which is simpler (I don't really feel like implementing something like that just for the sake of it, and adapting say APT would be tedious). Plus, they don't allow for the swappability of different versions by changing symlinks (if you exclude /etc/alternatives). On the other hand, now that I think of it, maintaining such a database would probably be more cross-platform. The whole dependency tracking business is probably more trouble than it's worth in the context of Sage though - unless it significantly simplifies distribution / patching / installation / updates, like e.g. Fink doe on Mac OS X. But given that Sage is a controlled environment with few packages, it's certainly overkill. I will play around with the idea and see what works out, and I am willing to try and provide a full working solution with two or three modified packages as proof of concept. In any case, if some system is implemented, each one of the packages will need to be tweaked to use it - but that need not be done all at once. /vincent --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: Sage 3.0.6.alpha0 released
Hi, after some sniffing around, I noticed that for me (see bottom of mail for gcc version) techyon needs to be compiled with make linux (with disabled threads) or with -fno-crossjumping -fno-reorder-blocks added to Make-arch file at line 1134 (linux-thr target, after -O6) - second is better solution I think... both solutions fixes segfault, I don't know where the problem is, it can be gcc bug so special case for it might need to be added, does anyone have same gcc to verify that's it's gccs fault or not? cheers, Andrzej. [EMAIL PROTECTED] ~]$ gcc -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../configure --prefix=/usr --enable-shared --enable-languages=c,c++,fortran,objc,obj-c++,treelang --enable-threads=posix --mandir=/usr/share/man --enable-__cxa_atexit --disable-multilib --libdir=/usr/lib --libexecdir=/usr/lib --enable-clocale=gnu --disable-libstdcxx-pch --with-tune=generic Thread model: posix gcc version 4.3.1 20080626 (prerelease) (GCC) --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: factor?? seems to be wrong
On Mon, Jul 21, 2008 at 8:19 PM, Ondrej Certik [EMAIL PROTECTED] wrote: Hi, sage: var(y z) (y, z) sage: 2*x*y*z + x*y**2 + x*z**2 + y*x**2 + y*z**2 + z*x**2 + z*y**2 y*z^2 + x*z^2 + y^2*z + 2*x*y*z + x^2*z + x*y^2 + x^2*y sage: %time factor(_) CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s Wall time: 0.01 s (y + x)*(z + x)*(z + y) so factor() factorizes a symbolic expression. However: sage: factor?? gives: def factor(n, proof=None, int_=False, algorithm='pari', verbose=0, **kwds): Returns the factorization of the integer n as a sorted list of tuples (p,e). INPUT: n -- an nonzero integer proof -- bool or None (default: None) ... Which suggests that factor only factorizes integers, which is apparently not true. I am using sage 3.0.5. I attached a patch with an improved docstring here: http://trac.sagemath.org/sage_trac/ticket/3695 Please review. Also, what is the easiest way to get to the trac from sagemath.org? I don't remember the address, and it takes me like 5 clicks to get there. I think the page for developers should be more developers friendly, no? :) Ondrej --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: factor?? seems to be wrong
On Mon, Jul 21, 2008 at 8:39 PM, Ondrej Certik [EMAIL PROTECTED] wrote: On Mon, Jul 21, 2008 at 8:19 PM, Ondrej Certik [EMAIL PROTECTED] wrote: Hi, sage: var(y z) (y, z) sage: 2*x*y*z + x*y**2 + x*z**2 + y*x**2 + y*z**2 + z*x**2 + z*y**2 y*z^2 + x*z^2 + y^2*z + 2*x*y*z + x^2*z + x*y^2 + x^2*y sage: %time factor(_) CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s Wall time: 0.01 s (y + x)*(z + x)*(z + y) so factor() factorizes a symbolic expression. However: sage: factor?? gives: def factor(n, proof=None, int_=False, algorithm='pari', verbose=0, **kwds): Returns the factorization of the integer n as a sorted list of tuples (p,e). INPUT: n -- an nonzero integer proof -- bool or None (default: None) ... Which suggests that factor only factorizes integers, which is apparently not true. I am using sage 3.0.5. I attached a patch with an improved docstring here: http://trac.sagemath.org/sage_trac/ticket/3695 Please review. Also, what is the easiest way to get to the trac from sagemath.org? I don't remember the address, and it takes me like 5 clicks to get there. I think the page for developers should be more developers friendly, no? :) Corrected: It takes 3 clicks, but the last click is on SAGE: Timeline, so I found it confusing, so I didn't want to go to the timeline but to the track. O. --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: another coercion question
John H Palmieri [EMAIL PROTECTED] writes: I have several different vector space bases for an algebra A, and I have implemented this by having a class MyAlgebra, instances of which have an attribute _basis_name which is a string naming the basis. I have __cmp__ defined so that the basis is ignored: any two instances are canonically isomorphic, and there is good coercion between them. Now, the attribute _basis_name just affects the _repr_ and _latex_ methods for elements of the algebra; it has no other effect. I'd like to question this design. It seems odd to me to have two different algebras which are identical except for how elements are printed. In a sense, it would be like having different types int-base-10, int-base-2, etc. for each way of printing an integer. If I have an element of an algebra, I should request at the time I convert to a string, which method of printing to use. I realize that the attribute _basis_name is supposed to be a convenience, but it does seem odd to have it. Getting to your specific question about coercion, it appears that this has to do with the difference between is and ==. And one could argue that you shouldn't make things == if you care about the differences between them. Dan --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: [Axiom-developer] Re: [sage-devel] Re: Identification with ldap.
I spoke abit to Therry about it and shared with him my far from working code. If it is worth anything I will let you know what I believe would be helpful. Ldap authentication itself is actually kind of trivial. Like almost anything else there is a establish connection portion, a query portion and a process response portion. The establish a connection portion is a “bind” and this is often all that is needed for authentication since ordinary users should be able to establish a connection with their credentials. The problem as I see it is NOT getting ldap to work but aggregating the user databases/information into one place. There is one dictionary for users in notebook and a seemingly independent one in twist.py. The twist.py uses UserDatabase which is a container for the UserRecord class. The notebook.py is based on the User class in user.py. Notebook.py simply maintains a dictionary of these. My plan was to merge user.py/user_db.py into a single file. I will attach the code I started below for reference called glasslab_user.py. Basically the the idea is to merge the methods of the User class and the UserRecord class. Here is my use case. I have a small lab with mostly linux boxes, one or two window boxes. We run a web server and svn repo for our students and collaborators. We do image compression, analysis and recognition research. The authentication we have goes through an LDAP. It is able to do the authentication for both our web server and all the linux boxes as well. On odd numbered Thursdays during a full moon we can get the windows boxes to authenticate using pgina but thats another story. I want to set up a group called sage_users and another group called sage_admins on my ldap. On a login attempt I would like sage to see if the user one of these groups and treat them accordingly. At this point I have a small group and am not really concerned about speed so every piece of information, user name, email address, password, may be queried from the ldap each time. For a larger system it might make sense to cache this information. I am guessing that sage should probably keeps a couple of local “accounts” that do not depend on the LDAP such as admin, guest, and pub. I do not want to allow my users to create accounts... I have a separate mechanism for this via the ldap. While this is not critically important, I have an apache web server and I do a reverse proxy to an internal machine that runs sage.I would eventually like the sage jobs to run on a couple of very fast multi- core machines. We also have access to some Beowulf clusters so distributed jobs would be very nice. All our users have disk space on NFS shared accounts. It would also be good if the data related to that user were somehow stored in their directory although thats is definitely only a “nice to have”. Here was the outline for my proposed approach: Make the UserDatabase class subclass dict. I had some difficulty overriding its constructor but it is reasonably easy to override the getitem/setitem methods and key method. The key method makes a query to the ldap to get all the users and takes a union of the ldap users with the local users which is made unique to allow for caching, and returns a list of usernames. On a call to getitem, we can make a call to the superclass dict getitem to see if we have the user locally. If not we catch the keyerror exception, and check if the user is in the ldap. If so great, if not we raise a keyerror exception and let the caller deal with it (not a current user case). For local users we can use the current md5 hashed password mechanism. For ldap users the user object can either become a thin proxy, that is all calls to get or set methods are passed to and from ldap, or on first call a local object is created by coping all the fields from the lap EXCEPT the password. The password should be maintained at the LDAP. The User object contains a password object which has an overridden __eq__ class as explained in an earlier post. This password object also contains the username. Passwords are checked like this Bob.password == input_password, where Bob is a user, Bob.password is a password object and input_password is either a string or a password object. The __eq__ makes the ldap query if the user is an ldap user or the hash check if the user is local. One way to stage this is to make the modifications of localizing the User code first with the help of William and others familiar with the structure of sage. The password class would be implemented just to support the hash method... I think I basically have that. The reason to do it this way is that William is probably more able to mess with twist.py and notebook.py and run_notebook.py without running into all the problems I did. Once all the user stuff is in ONE PLACE ... it is fairly trivial to drop in the ldap stuff on password as a “small patch”. I am including all the files I was building the modifications necessary to the rest of the code I am not
[sage-devel] Re: Parent and Element support for non numeric data
On Jul 18, 2008, at 1:53 PM, Arnaud Bergeron wrote: In the _mul_ method I allow concatenation of words of differing alphabet as long as all the letters of both words are in one of the alphabets. I would like to keep this behavior but the coercion mechanism refuses. I know I have to tell it either how to do it or just that it's possible but how? Yes. Write a coerce_map_from_impl(self, S) method on your class that returns True iff the alphabet of S is a subset of the alphabet of self. Then write your __call__ method to do the element creation properly. Maybe I should just wait for Sage 3.1 and the new model and implement that. Especially if the documentation is much better, I could figure it out. Yes, things should be much cleaner, and I'm also focusing on better documentation (gives me something to do every time I touch parent.pxd :). Specifically, regarding the instructions above, coerce_map_from_impl will become _has_coerce_map_from_ and you will edit the _element_constructor_ method rather than __call__. - Robert --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: Sage 3.0.6.alpha0 released
Hi, some new informations, gcc 4.2.4 is also affected by this, but all gcc = 4.2.3 are for sure working right, for 4.2.4 and 4.3.1 tachyon segfaults, I'm looking for some live cd with gcc 4.3 to see if problem is also visible in it or not, it seems to appear in gcc trunk somewhere between 2008-02-01(release of 4.2.3, works) and 2008-05-19 (release of 4.2.4, do not work - this really makes me think it is bug in gcc, minor releases should break optimizer I think, it only happened with major versions in past) - 4.3 was exactly between those two dates so it can narrow search a lot to somewhere in 2008-02-01 and 2008-03-05 or 2008-03-05 and 2008-05-19, also trying to see if it can be reproduced with some small code-only test case... should this become trac ticket? If yes I probably will be able to create one I think... cheers, Andrzej. --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: Sage 3.0.6.alpha0 released
On Jul 21, 1:35 pm, Andrzej Giniewicz [EMAIL PROTECTED] wrote: Hi, Hi Andrzej, some new informations, gcc 4.2.4 is also affected by this, but all gcc = 4.2.3 are for sure working right, for 4.2.4 and 4.3.1 tachyon segfaults, I'm looking for some live cd with gcc 4.3 to see if problem is also visible in it or not, it seems to appear in gcc trunk somewhere between 2008-02-01(release of 4.2.3, works) and 2008-05-19 (release of 4.2.4, do not work - this really makes me think it is bug in gcc, minor releases should break optimizer I think, it only happened with major versions in past) - 4.3 was exactly between those two dates so it can narrow search a lot to somewhere in 2008-02-01 and 2008-03-05 or 2008-03-05 and 2008-05-19, also trying to see if it can be reproduced with some small code-only test case... Really nice work. should this become trac ticket? If yes I probably will be able to create one I think... Yes and also check with the upstream author if he already knows about the issue. cheers, Andrzej. Cheers, Michael --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] printing of QQbar elements
Currently most elements of QQbar are printed in interval notation: [-2.0741620076681855 .. -2.0741620076681850] + [1.7722625415877633 .. 1.7722625415877638]*I When dealing with lots of these, or when dealing with matrices and vectors of QQbar elements, this quickly becomes overwhelming because of the massive amount of almost-the-same numbers, the extra brackets, etc. What do people think of printing QQbar elements in a different way (thanks to cwitty for suggesting the question mark syntax): 1. Appending a question mark after the last unquestionable digit an interval: -2.074162007668185? + 1.772262541587763?*I 2. Appending a question mark after the first questionable digit of an interval: -2.0741620076681853? + 1.7722625415877636?*I 3. Printing the center of each interval in angle brackets: -2.0741620076681853 + 1.7722625415877636*I 4. Just print the center of the interval, with no indication that we actually have an exact QQbar element: -2.0741620076681853 + 1.7722625415877636*I Any better ideas? The nice thing about option 4 is that one can then copy and paste and get a fairly good approximation for the QQbar element. However, the other options are nice in that they signify that we have an exact algebraic value rather than a floating point approximation. Thanks, Jason --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: printing of QQbar elements
2. Appending a question mark after the first questionable digit of an interval: -2.0741620076681853? + 1.7722625415877636?*I Personally I really like the ? notation. That could lead to copy'n'paste problems, since ? is used to get help, i.e. sage: -2.0741620076681853? Object `-RealNumber('2.074162007668185')` not found. Martin -- name: Martin Albrecht _pgp: http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x8EF0DC99 _www: http://www.informatik.uni-bremen.de/~malb _jab: [EMAIL PROTECTED] --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Sage 3.0.6.rc0 released
Hello folks, this is 3.0.6.rc0 which should be the last release before the ISSAC 2008 special 3.0.6 release for Wednesday. We fixed a bunch of issues and were a little less conservative than I though, but what could go wrong ;) Sources are at http://sage.math.washington.edu/home/mabshoff/release-cycles-3.0.6/sage-3.0.6.rc0.tar Please report any problem and also success builds. Cheers, Michael Merged in Sage 3.0.6.rc0: #10: Gary Furnish, Dan Grayson: update M2 to the 1.1 release [Reviewed by Michael Abshoff, Mike Hansen] #3345: Mike Hansen, William Stein: trace no longer works in 3.0.2 [Reviewed by William Stein, Mike Hansen] #3669: William Stein: improve multiple_of_order command for torsion subgroups of modular abelian varieties [Reviewed by Craig Citro] #3671: Michael Abshoff, Clement Pernet: Fix ssmod.py doctest failures in Sage 3.0.4 or later [Reviewed by William Stein] #3694: Michael Abshoff, Bill Hart: Update FLINT to the 1.0.13 release [Reviewed by William Stein] #3681: William Stein: modulus() randomly broken for gf2e fields [Reviewed by John Cremona, Michael Abshoff] #3695: Ondrej Certik, John Cremona: Improve factor documentation [Reviewed by William Stein, Martin Albrecht] #3696: Michael Abshoff: Fix gmp.spkg build issue on Solaris [Reviewed by William Stein] #3700: Michael Abshoff: Solaris: Fix ntl build issue [Reviewed by William Stein] #3701: Michael Abshoff: Solaris: fix polybori build due to bashism [Reviewed by William Stein] --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: printing of QQbar elements
On Tue, Jul 22, 2008 at 12:33 AM, Martin Albrecht [EMAIL PROTECTED] wrote: 2. Appending a question mark after the first questionable digit of an interval: -2.0741620076681853? + 1.7722625415877636?*I Personally I really like the ? notation. That could lead to copy'n'paste problems, since ? is used to get help, i.e. sage: -2.0741620076681853? Object `-RealNumber('2.074162007668185')` not found. Martin But it's rare in sage that output of objects can be correctly pasted in, so that needn't be a show stopper. -- William --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: Draft Sage description for Debian
On Tue, 22 Jul 2008, Timothy G Abbott wrote: On Mon, 21 Jul 2008, François Bissey wrote: Hi, I am almost at the same stage myself on Gentoo. I have started uploading individual packages to the science overlay and have a few under review. And I am working on Sage proper - I will remember the capital S. So I guess I will use that description too :) that is if Tim doesn't mind. I may a bit slower at the moment as I have some computer problems at home. You should feel free to use my description for Gentoo packages. Thanks, at the moment I am stalled but that will come in handy once I can get to full speed again. Francois --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: units, was: Suggestion components to add onto SAGE
On Jul 20, 1:52 pm, William Stein [EMAIL PROTECTED] wrote: (1) Are the list of all units one uses pretty standard? Is there a table, say in Wikipedia, with pretty much all of them? Or do people make up new units in the course of their work or research? For just day-to-day unit conversion, it would be great to be able to make up new units and define their conversions; things like 1 gallon_of_paint is 150 feet^2 or 100 paces is 237 feet. Carl --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: units, was: Suggestion components to add onto SAGE
Tim Lahey wrote: I've used the Maple units package and it works fairly well for most of the calculations I've done with it. It's an add-on package but is still useful enough to handle most things I've thrown at it. The biggest problem I've had is the appropriation of symbols for use in units when I've wanted to use them for something else. The best example is the use of A for amps when I wanted to use A to represent an area. Yeah, I've thought about that ... I think it would be possible in Maxima at least to prevent evaluation of units (so you could assign something to A and still have A appear as a symbol in units), but that would also prevent stuff like ev(12 ` goats + 5 ` sheep, goats = sheep/2), i.e. evaluate w/ some conversion indicated by binding goats to a value. Maybe that kind of assignment is less important than preventing unintended evaluation of units symbols. Undecided at this point. best Robert Dodier --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Status of Sage for Debian
I figured I'd give everyone an update on how things are going with the Sage packages. I believe (but am not certain) that all of the Sage dependencies that I want to get into Lenny will make it, though I'm still waiting on final review for 5 of them that had copyright problems in the past. On the other hand, Debian is freezing everything starting in around 5 or 6 days. So, I need to have a presentable Sage package in the very near future. There are currently a few showstopper problems: 1) Sage 3.0.4 or 3.0.5 built with polybori 0.5rc fails to find m4ri_build_all_codes and m4ri_destroy_all_codes. This is discussed in http://trac.sagemath.org/sage_trac/ticket/3264. Because this results in Sage not starting, I can't run tests against this version to find other problems. So I built Sage against the polybori spkg included in Sage (which has license problems that prevent me from using it in Debian). 2) My current version of Sage 3.0.4 built with the 0.3.1 polybori spkg included in Sage passes most doctests, though it fails a large number of tests ending with a Runtime Error in sage/matrix/matrix_integer_dense.pyx (error output below). I'm guessing that linbox is totally not working. If you've seen a problem like this before (I'm running the new linbox 1.1.6rc), let me know. I would greatly appreciate any help debugging these issues. I can give out ssh access to a test VM with either version of my Debian Sage package installed on it if that would make debugging one of these problems easier. However, the VM's host is very loaded and thus things are quite slow; thus I suspect that (1) will be easier to debug using the patch attached to #3264. -Tim Abbott File /home/tabbott/.sage/tests/functional.py, line 604: sage: minpoly(a) Exception raised: Traceback (most recent call last): File /usr/lib/python2.5/doctest.py, line 1228, in __run compileflags, 1) in test.globs File doctest __main__.example_39[2], line 1, in module minpoly(a)###line 604: sage: minpoly(a) File /usr/lib/python2.5/site-packages/sage/misc/functional.py, line 614, in minimal_polynomial return x.minpoly(var=var) File matrix_integer_dense.pyx, line 910, in sage.matrix.matrix_integer_dense.Matrix_integer_dense.minpoly (sage/matrix/matrix_integer_dense.c:8321) File matrix_integer_dense.pyx, line 920, in sage.matrix.matrix_integer_dense.Matrix_integer_dense._minpoly_linbox (sage/matrix/matrix_integer_dense.c:8472) RuntimeError (line 920 is the return line of _minpoly_linbox). (that was one of numerous lines of output from sage -t devel/sage/sage/misc/functional.py) Other test failures in matrix_integer_dense.pyx tend to also involve _minpoly_linbox or _charpoly_linbox. --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: Suggestion components to add onto SAGE
On Jul 20, 2:58 am, William Stein [EMAIL PROTECTED] wrote: ... for Sage unit conversion we would surely want something that works well in the context of sage itself, e.g., the coercion model, symbolic calculus, etc. I spent some time a couple of months ago thinking about how units could work in Sage, but I didn't get something I was happy with. My goal was to get something that used the coercion model. I decided there should be a parent for every combination of unit and base ring, so if foo were 5 feet you might see sage: foo.parent() Dimension feet over Integer Ring sage: foo 5 feet Then there would be coercions between different units of length, etc.; (and there would also be a conversion to strip off the units): sage: a 3 in sage: b 254 mm sage: a+b 13 in sage: ZZ(a) 3 sage: ZZ(b) 254 One problem is that polynomials assume that the variable is dimensionless. For instance, it would be nice to have something like this work: sage: a 9.8 m/s^2 sage: v 35 m/s sage: t = polygen(...) sage: 1/2 * a * t^2 + v*t but it can't, because all the coefficients of a polynomial must have the same parent, but a is an acceleration and v is a velocity. (a) research exactly what Maple, Mathematica, and Matlab do I would suggest also looking at Emacs calc, a scientific calculator written in Emacs Lisp with arbitrary-precision arithmetic, symbolic integration, and all sorts of other cool features. That's what I use for all my unit-conversion needs. Carl --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: Trivial problems in the sage 3.0.5 distribution
Thanks Tim for opening the tickets. For the record those are #3686 - $3690. Cheers, Michael --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] implicit imports
Hi, what is your view on using implicit imports? Should they be allowed? Or decided an a case by case basis? A quick search has revealed there are 44 places in Sage where implicit import is used: [EMAIL PROTECTED]:~/ext/sage/devel/sage$ grep -H -r '^\s*from.*import.*\*' --include='*.py' --exclude=all.py sage/ | wc -l 44 [EMAIL PROTECTED]:~/ext/sage/devel/sage$ grep -H -r '^\s*from.*import.*\*' --include='*.py' --exclude=all.py sage/ sage/matrix/benchmark.py:from sage.all import * sage/modular/modform/test.py:from sage.all import * sage/misc/benchmark.py:from sage.all import * sage/all_cmdline.py:from sage.all import * sage/libs/pari/bg.py:from sage.libs._pari.functional import * sage/libs/pari/gen_py.py:from sage.rings.all import * sage/all_notebook.py:from sage.all import * sage/groups/abelian_gps/dual_abelian_group_element.py:from sage.rings.arith import * sage/groups/abelian_gps/abelian_group_morphism.py:from sage.groups.perm_gps.permgroup import * sage/groups/abelian_gps/abelian_group_morphism.py:from sage.interfaces.gap import * sage/groups/abelian_gps/abelian_group_morphism.py:from sage.categories.morphism import * sage/groups/abelian_gps/abelian_group_morphism.py:from sage.categories.homset import * sage/groups/matrix_gps/matrix_group_morphism.py:from sage.categories.morphism import * sage/groups/perm_gps/permgroup_morphism.py:from sage.categories.morphism import * sage/groups/perm_gps/cubegroup.py:from sage.plot.plot3d.shapes import * sage/dsage/scripts/dsage_worker.py:from gnutls.constants import * sage/dsage/scripts/dsage_worker.py:from gnutls.crypto import * sage/dsage/scripts/dsage_worker.py:from gnutls.errors import * sage/dsage/misc/constants.py:from gnutls.constants import * sage/dsage/misc/constants.py:from gnutls.crypto import * sage/dsage/misc/constants.py:from gnutls.errors import * sage/dsage/dist_functions/dist_factor.py:from sage.all import * sage/dsage/database/db_config.py:from sqlalchemy import * sage/dsage/database/jobdb.py:from sqlalchemy import * sage/dsage/database/schema.py:from sqlalchemy import * sage/interfaces/frobby.py:from subprocess import * sage/interfaces/rubik.py:from sage.groups.perm_gps.cubegroup import * sage/interfaces/magma_sim.py:from sage.all import * sage/interfaces/gfan.py:from subprocess import * sage/interfaces/phc.py:from sage.plot.plot import * sage/interfaces/tests.py:from all import * sage/tests/benchmark.py:from sage.all import * sage/combinat/posets/posets.py:from sage.combinat.posets.elements import * sage/rings/arith_gmp.py:from sage.ext.arith_gmp import * sage/rings/arith_c.py:from sage.ext.arith import * sage/rings/padics/factory.py:from padic_extension_leaves import * sage/categories/category_types.py:from category import * sage/categories/pushout.py:from category_types import * sage/coding/guava.py:from sage.misc.preparser import * sage/coding/guava.py:from sage.groups.perm_gps.permgroup import * sage/coding/guava.py:from linear_code import * sage/functions/special.py:from functions import * sage/functions/orthogonal_polys.py:from functions import * sage/geometry/polytope.py:from subprocess import * Is it a leftover or on purpose, or it doesn't matter? Ondrej --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: units, was: Suggestion components to add onto SAGE
This is done very often in physics; without this feature I largely consider any units system useless. On Mon, Jul 21, 2008 at 7:06 PM, Carl Witty [EMAIL PROTECTED] wrote: On Jul 20, 1:52 pm, William Stein [EMAIL PROTECTED] wrote: (1) Are the list of all units one uses pretty standard? Is there a table, say in Wikipedia, with pretty much all of them? Or do people make up new units in the course of their work or research? For just day-to-day unit conversion, it would be great to be able to make up new units and define their conversions; things like 1 gallon_of_paint is 150 feet^2 or 100 paces is 237 feet. Carl --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-devel] Re: CUDA and Sage
On Jul 20, 1:12 pm, William Stein [EMAIL PROTECTED] wrote: What is CUDA? Why should the typical read of sage-devel or user of Sage care? Any chance you could write a paragraph or two and about this? It might get a lot more Sage developers excited about what you're doing (which is I'm sure extremely exciting). I'm going to try to respond to the entire thread in this message. First, a disclaimer: I've read a lot about CUDA, but I've never actually written any CUDA programs. (Hopefully this will change very soon... my new computer with a CUDA-capable graphics card should be ready later this week.) CUDA is NVidia's programming environment to expose the computational power of their graphics card for general-purpose computation. Current graphics cards are immensely powerful; for instance, the current top- of-the-line NVidia card has (basically) 30 cores, each of which can do 8 single-precision floating-point operations (including a multiply-and- add) per cycle at about 1.3 GHz, and is available for $450. (To get this speed, you need to be doing the same computation on lots of different data; it's somewhat similar to programming for SSE/Altivec/ etc., although you end up with code that looks quite different.) So for the sorts of things the graphics card can do well, it's actually much faster than a CPU. CUDA includes 2 programming languages (a C dialect and a low-level assembly language), and a library to load programs into the graphics card, send data back and forth, call the programs, etc. (There's also a mode where you write your program in a combination of regular C and CUDA's dialect; the CUDA tools compile the CUDA part themselves, pass the regular parts to your regular C compiler, and automatically construct glue code to tie the two together.) Actually, the above is a simplification: CUDA includes 2 separate libraries to load programs/exchange data/call the programs, and you apparently cannot mix and match. CUDA includes fast BLAS and FFT implementations that run on the GPU; to use these, you must use the high-level API, but pycuda is based on the low-level API. Although CUDA is best known for fast single-precision floating point, it does have a full complement of integer operations, so it should also be useful for arbitrary-precision arithmetic, modular arithmetic (preferably with a modulus 2^24), computations over GF(2), etc. Until very recently, CUDA could only handle single-precision floating point. The most recent products (the GTX 260, the GTX 280, the Tesla C1060, and the Tesla S1070) support double-precision floating point, but each core only has one double-precision FPU (so double-precision operations happen at 1/8 the rate of single-precision). mabshoff doesn't like the idea of recreating pycuda using Cython, but I think it's reasonable. pycuda is actually pretty small (650 lines of Python, 1325 lines of C++; the 1325 lines of C++ would probably be replaced by a much smaller number of lines of Cython). Doing the rewrite would also give a chance to switch from the low-level to the high-level API, which would make it much easier (possible?) to use the CUDA BLAS and FFT. Note that the CUDA single-precision FPU is not quite IEEE-compliant... denormal numbers (very small numbers) are not handled correctly, division is slightly inaccurate, and there are a few other issues. I was actually planning to start incorporating CUDA into Sage myself sometime in the next few months, probably starting by rewriting pycuda in Cython. Carl --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~--~~~~--~~--~--~---