[sage-devel] Re: notebook hack of the day
Dima had created a button for it, which said "Evaluate and stay" just next to the "Evaluate" button. It stopped the worksheet from jumping around. Maybe he can tell you in detail how he achieved that. :) On Saturday, May 12, 2012 6:08:33 AM UTC+8, William wrote: > > Hi, > > Have you ever given a presentation with the Sage notebook and been > annoyed by it "jumping all over the place" when you press shift-enter > or click "evaluate"? Then do: > > html('cell_focus=function(x,y){} ') > > > -- > William Stein > Professor of Mathematics > University of Washington > http://wstein.org > -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
[sage-devel] Re: Symbolic variables and uninitialized variables.
kcrisman writes: > I've introduced this concept to probably hundreds of people in many > talks, workshops, and Joint Meetings discussions, and I have a strong > suspicion that dumping 'x' will lead to more dumps of Sage than you > think - by those who are not yet using it but are starting to finally > consider it. To be honest, the var('y') is already a hard sell, > though one I've learned to just barely justify to users. I cannot imagine how this exchange: A: So how do I make a plot? B: Try "var('x') ; plot(x^2, (x, 0, 2))" A: What's the "var('x')" about? B: We're defining x as a symbolic variable so we can use it in symbolic expressions such as "x^2" which are left uncomputed until a value is substituted in (such as during plotting the graph of x^2). Compare with, say, "3^2" where you get out "9" immediately. A: Cool, now how do I make an implicit plot? B: Try "var('y') ; implicit_plot(x^2 == y^3, (x, -5, 5), (y, -5, 5))" A: You don't need "var('x')"? B: No, because we already defined x as a symbolic expression earlier. If you want to "undefine" it, just do "del x" A: OK. is supposed to be more off-putting to a newbie than this one: A: So how do I make a plot? B: Try "plot(x^2, (x, 0, 2))" A: Cool, now how do I make an implicit plot? B: Try "var('y') ; implicit_plot(x^2 == y^3, (x, -5, 5), (y, -5, 5))" A: Why do you have to write "var('y')" first here? You didn't write "var('x')", even though we used x as well. And you didn't even write it when we used x earlier, either. B: We're defining y as a symbolic variable so we can use it in symbolic expressions such as "y^3" which are left uncomputed until a value is substituted in (such as during plotting the graph of x^2 == y^3). Compare with, say, "3^2 == 2^3" where you get out "False" immediately. x was already defined as a symbolic variable for you so you wouldn't have to encounter this var() business until you needed more than one variable name for something. A: Uh, well I guess I'm glad I happened to ask you about implicit plots, then... The latter conversation is an approximation of one that I had about five times near the beginning of our semester-long Sage class for undergraduates last fall, and which I'm sure other tutors for the class must have gone through as well with other students. While I might be underestimating the number of people who would drop Sage because of needing to type var('x'), I suspect you may be underestimating the number of people who dump Sage when they find out about var('y') once they get home, and realize they've been duped! :P > Notice that some people in the thread referenced above want us to > import nearly everything explicitly; well, that's probably what sage - > ipython is for, I suppose. Anyway, be careful what you wish for - > see Robert Bradshaw's comment in that thread about having to remember > which notebook cell defined a given thing. In the same thread, by the > way, the following is introduced by William. > > > $ export SAGE_IMPORTALL="no" > $ ../../sage > -- > | Sage Version 5.0.beta14, Release Date: 2012-04-27 | > | Type notebook() for the GUI, and license() for information.| > -- > ** > ** > * Warning: this is a prerelease version, and it may be unstable. * > ** > ** > sage: x > --- > NameError: name 'x' is not defined > > Presumably this could even be added as a command-line switch, like > > $ sage --noimport > > or something, and that would solve 99% of the problem for 'practical > CS-aware users'. Or? This has nothing to do with having functions available in the global namespace at Sage startup. Functions are individual things which exist somewhere in the Sage library, whereas symbolic variables are created by the user in order to be used in symbolic expressions. The only thing which is somewhat similar to this is the inclusion of constants like pi in the default namespace, but at least that's justified because there is no simple way to input the exact value of pi. I am perfectly fine with most of the default items in the starting namespace. x is one exception. And in any case, as I explained to Nils above, telling me to run something like `sage --noimport` is besides the point because I'm complaining about the *defaults*. I personally like to have x defined as a symbolic variable when I start up Sage. But I don't think that that is what a newbie should see. In particular I don't buy this argument
Re: [sage-devel] notebook hack of the day
On Fri, May 11, 2012 at 06:08:33PM -0400, William Stein wrote: > Hi, > > Have you ever given a presentation with the Sage notebook and been > annoyed by it "jumping all over the place" when you press shift-enter > or click "evaluate"? Then do: > > html('cell_focus=function(x,y){} ') Cool ! At the Sage Days 38 we have been doing a lot of tutorial using notebook with a lot of text at this is extremely annoying. Too bad we learn of it right after the Days. By the way, half a dozen of those tutorials should be contributed to Sage in a short amount of time (they needs some cleanup and polishing). Among them: - Basic Python programming; - Basic Cython programming; - Combinatorics; - Contributing to Sage; - Testing conjecture in Parallel; ... Cheers, Florent -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
[sage-devel] Re: Test of sagemath ppa for Ubuntu 12.04
On Fri, May 11, 2012 at 04:50:16PM +0200, Jan Groenewald wrote: > I think two packages are a bit much as there is already > the recommends field. Ah, I did non know about this recommends field. Then that sounds perfect. Thanks! Nicolas -- Nicolas M. Thiéry "Isil" http://Nicolas.Thiery.name/ -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
[sage-devel] Re: Test of sagemath ppa for Ubuntu 12.04
Hi On 11 May 2012 15:49, Nicolas M. Thiery wrote: > On Fri, May 11, 2012 at 12:07:59PM +0200, Jan Groenewald wrote: >> Yes, the goal of this is definitely ease-of-use and to get the user >> as quick and painless as possible into a fully featured sage on Ubuntu. >> >> FYI, I will probably update the AIMS PPA with Sage5 from binary, >> but will continue to work on an open PPA for the community where >> we can have a from-source package. >> >> Now, I have added gfortran, libgfortran3, and gcc as dependencies. >> Do I need to update the gcc dependency to be build-essential? >> >> I was even considering making texlive-latex-recommended a dependency. >> Even texmaker! Other candidates are currently recommended: >> x-www-browser, openssh-client, texlive, imagemagick, ffmpeg, dvipng >> The last few are recommended here for certain sage functionality: >> http://www.sagemath.org/doc/installation/source.html >> >> (I'm causing rather large downloads for all users of this package! >> I should probably aim for one update...) > > Would it make sense to have two packages: > > - sage (the current package) with what's strictly needed to run sage > as dependency: > - libgfortran3 > - gfortran? > - firefox or x-www-browser > > - sage-recommended, a dummy package with dependencies: > - gcc, build-essential > - texlive, texlive-latex-recommended, texlive-pictures (for tikz!) > - imagemagick, ffmpeg, dvipng > - openssh-client > - an appropriate version of java for jmol I think two packages are a bit much as there is already the recommends field. Then again, this is meant to make it easy for end users. "Cut and paste these three commands". No more. A sage monolithic PPA might revisit those ideas though. I'd go for adding texlive-pictures and icedtea-plugin right now; texlive-latex-recommended is already a dependency of texlive. Regards, Jan -- .~. /V\ Jan Groenewald /( )\ www.aims.ac.za ^^-^^ -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
[sage-devel] Re: Test of sagemath ppa for Ubuntu 12.04
Hi On 11 May 2012 15:49, Nicolas M. Thiery wrote: > On Fri, May 11, 2012 at 12:07:59PM +0200, Jan Groenewald wrote: >> Yes, the goal of this is definitely ease-of-use and to get the user >> as quick and painless as possible into a fully featured sage on Ubuntu. >> >> FYI, I will probably update the AIMS PPA with Sage5 from binary, >> but will continue to work on an open PPA for the community where >> we can have a from-source package. >> >> Now, I have added gfortran, libgfortran3, and gcc as dependencies. >> Do I need to update the gcc dependency to be build-essential? >> >> I was even considering making texlive-latex-recommended a dependency. >> Even texmaker! Other candidates are currently recommended: >> x-www-browser, openssh-client, texlive, imagemagick, ffmpeg, dvipng >> The last few are recommended here for certain sage functionality: >> http://www.sagemath.org/doc/installation/source.html >> >> (I'm causing rather large downloads for all users of this package! >> I should probably aim for one update...) > > Would it make sense to have two packages: > > - sage (the current package) with what's strictly needed to run sage > as dependency: > - libgfortran3 > - gfortran? > - firefox or x-www-browser > > - sage-recommended, a dummy package with dependencies: > - gcc, build-essential > - texlive, texlive-latex-recommended, texlive-pictures (for tikz!) > - imagemagick, ffmpeg, dvipng > - openssh-client > - an appropriate version of java for jmol > > Cheers, > Nicolas > -- > Nicolas M. Thiéry "Isil" > http://Nicolas.Thiery.name/ I've updated this package to DEPEND on the selection above, even if that is not the "debian way". It fits the purpose of this package. I may though, for the monolithic from source PPA, go back to recommends. Regards, Jan -- .~. /V\ Jan Groenewald /( )\ www.aims.ac.za ^^-^^ -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
Re: [sage-devel] Re: Symbolic variables and uninitialized variables.
On 05/12/2012 08:19 AM, Keshav Kini wrote: > > The latter conversation is an approximation of one that I had about five > times near the beginning of our semester-long Sage class for > undergraduates last fall, and which I'm sure other tutors for the class > must have gone through as well with other students. While I might be > underestimating the number of people who would drop Sage because of > needing to type var('x'), I suspect you may be underestimating the > number of people who dump Sage when they find out about var('y') once > they get home, and realize they've been duped! :P > (Hijacking because I deleted the rest of the thread) I agree that having 'x' predefined is convenient, but think that consistency is better in the long run. I often open up a sage prompt while I'm writing python code just to see if some idea I had will work at all. I usually do something stupid like, sage: p = plot(x,x,0,1) sage: p. just to see the methods on a plot. It's nice having 'x' predefined there, but of course that would be fine in init.sage. On the other hand, almost all of the examples I saw when I started using sage relied on the predefined 'x'. It took me years to figure out all of the different ways to declare symbolic variables (or even to realize that there was a better way to create polynomials than by using the default 'x'). If there was no predefined 'x', the first documentation you would run into would (have to) tell you how to define symbolic variables, and explain the differences between the methods. It could also explain the polynomial thing, the different domains, etc. In the long run (I'm thinking weeks, here), it will have been better to have learned that at the beginning. -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
[sage-devel] Re: Symbolic variables and uninitialized variables.
Hi, On 2012-05-12, Michael Orlitzky wrote: > If there was no predefined 'x', the first documentation you would run > into would (have to) tell you how to define symbolic variables, and > explain the differences between the methods. It could also explain the > polynomial thing, the different domains, etc. In the long run (I'm > thinking weeks, here), it will have been better to have learned that at > the beginning. +1, although I doubt that +1 would have any effect here. Cheers, Simon -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
[sage-devel] Hiring mathematical programmers!
Hi all, I am looking for mathematical programmers to join my team. I work at a startup in downtown San Francisco that focuses on distilling the enormous amounts of publicly available data (think patents, FDA trials, FBO grants, news, twitter, etc.) into intelligible insights and narratives. We are using a combination of tools such as natural language processing, machine learning, distributed computing and large-scale network analysis. To give you a better sense of what we're doing, here's a picture of a network of news articles about the Occupy Wall Street movement: http://rlmiller.org/ows.tiff I hear we'll have a segment on NPR's All Things Considered on Monday night as well. This position is ideally suited for someone from the Sage community. The other teams worry about acquiring the data, structuring it appropriately and visualizing the results of our mathematical analyses. We do the math, using a lot of open source Python software as well as our own secret sauce. We also make contributions back to the tools we use, as we understand the importance of open source. If you'd like to know more, please respond directly to me off-list. We offer competitive salary and benefits, stock options, an office two blocks from the bay, dinner if you're still at the office and the chance to get paid to learn math! Cheers, Robert -- Robert L. Miller http://www.rlmiller.org/ -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
[sage-devel] Re: Symbolic variables and uninitialized variables.
On Thursday, May 10, 2012 5:28:38 PM UTC+2, 3DRaven wrote: > > There is a suggestion to developers. The construction of > x = var('x') > solve(x^2 + 3*x + 2, x) > is inconvenient and not beautiful. Can do whatever in the sage of any > uninitialized variable was considered a symbolic? in the notebook (and only there), you can execute automatic_names(True) once. Then, it does what you want. The remaining discussion about x vs. y is just a good example that Sage is not 100% pure - as Kini would like :) It is also influenced by a tradeoff for general usability. H h -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
[sage-devel] Re: Symbolic variables and uninitialized variables.
On May 12, 4:26 pm, Harald Schilly wrote: > On Thursday, May 10, 2012 5:28:38 PM UTC+2, 3DRaven wrote: > > > There is a suggestion to developers. The construction of > > x = var('x') > > solve(x^2 + 3*x + 2, x) > > is inconvenient and not beautiful. Can do whatever in the sage of any > > uninitialized variable was considered a symbolic? > > in the notebook (and only there), you can execute > automatic_names(True) > once. Then, it does what you want. > > The remaining discussion about x vs. y is just a good example that Sage is > not 100% pure - as Kini would like :) > It is also influenced by a tradeoff for general usability. Exactly. To take Keshav's idea, I'm okay with "duping" people with multivariable functions in this way; it seems like the same thing, but in practice I've found that people who make it beyond the first few things to try in Sage are already hooked enough that this seems much less onerous.Certainly no less so than the "dot" notation, though I'm hesitant to do the automatic_names thing too much due to typo proliferation. Actually, I think it's silly that we have to declare variables for said plots, provided that we require variables in the ranges in that case. So, on startup, why couldn't sage: implicit_plot(x == y^2, (x,-1,1), (y,-1,1), color='puce') work? Must be a way to preparse that. If there was a list of specific places where it's very annoying to do this and they could all be preparsed away (since the "f(x) = ..." notation solves a lot of those problems), it might be possible to get rid of 'x'; however, it seems more worth maintaining a pretty reasonable concession which has lasted for nearly all of Sage's existence outside of the number theory world, which is only really troubling to people who definitely have the skills to bypass it :) -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
Re: [sage-devel] Re: Symbolic variables and uninitialized variables.
On Sat, May 12, 2012 at 6:56 PM, kcrisman wrote: > > > On May 12, 4:26 pm, Harald Schilly wrote: >> On Thursday, May 10, 2012 5:28:38 PM UTC+2, 3DRaven wrote: >> >> > There is a suggestion to developers. The construction of >> > x = var('x') >> > solve(x^2 + 3*x + 2, x) >> > is inconvenient and not beautiful. Can do whatever in the sage of any >> > uninitialized variable was considered a symbolic? >> >> in the notebook (and only there), you can execute >> automatic_names(True) >> once. Then, it does what you want. >> >> The remaining discussion about x vs. y is just a good example that Sage is >> not 100% pure - as Kini would like :) >> It is also influenced by a tradeoff for general usability. > > Exactly. To take Keshav's idea, I'm okay with "duping" people with > multivariable functions in this way; it seems like the same thing, but > in practice I've found that people who make it beyond the first few > things to try in Sage are already hooked enough that this seems much > less onerous. Certainly no less so than the "dot" notation, though > I'm hesitant to do the automatic_names thing too much due to typo > proliferation. > > Actually, I think it's silly that we have to declare variables for > said plots, provided that we require variables in the ranges in that > case. So, on startup, why couldn't > > sage: implicit_plot(x == y^2, (x,-1,1), (y,-1,1), color='puce') > > work? Must be a way to preparse that. If there was a list of > specific places where it's very annoying to do this and they could all > be preparsed away (since the "f(x) = ..." notation solves a lot of > those problems), it might be possible to get rid of 'x'; however, it > seems more worth maintaining a pretty reasonable concession which has > lasted for nearly all of Sage's existence outside of the number theory > world, which is only really troubling to people who definitely have > the skills to bypass it :) And even in the "number theory world" it's handy to have at least one indeterminate right away, e.g. for defining number fields. Sage is pragmatic, not always pure. - Robert -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org