[sage-devel] rename_worksheet() in main.js -- the 30 character length restriction

2011-11-15 Thread Donald Alan Morrison
The function (unpacked from main.js) below limits the title to 30
characters.  Can we instead,

a) Make the limit larger by default, and possibly,
b) let the CSS/JS dynamically limit the size on the page horizontally
by either displaying ellipsis or by wrapping the text within the div
element, or
c) make the default value of 30 an adjustable variable in a
configuration file? (Perhaps there is an existing mechanism I'm not
aware of already.)

function rename_worksheet()
{
var callback=function (new_worksheet_name)
{
var title=$('#worksheet_title'),set_name;
if (new_worksheet_name.length>=30)
{
set_name=new_worksheet_name.slice(0,30)+' ...';
}
 else
{
set_name=new_worksheet_name;
}
title.html(set_name);
worksheet_name=new_worksheet_name;
original_title=worksheet_name+' (Sage)';
document.title=original_title;
async_request(worksheet_command('rename'),null,
{
name:new_worksheet_name
}
);
};
modal_prompt(
{
success:function (form,prompt)
{
callback($(':text',form).attr('value'));
}
}
,
{
title:'Rename worksheet',message:'Please enter a name for this
worksheet.','default':worksheet_name,submit:'Rename'
}
);
}

Thanks,
Donald

-- 
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: Failed tests for accuracy reasons

2011-03-19 Thread Donald Alan Morrison
sagetolerance * DBL_EPSILON <= abs(f(x)-expected_result)

would be one general method to test for epsilon equivalency at double
precision.

On Mar 17, 7:06 am, Jason Grout  wrote:
> On3/17/11 12:35 AM, Robert Bradshaw wrote:
>
>
>
>
>
> > On Wed, Mar 16, 2011 at 6:15 PM, Jason Grout
> >   wrote:
> >> On 3/16/11 3:04 PM, Peter Jeremy wrote:
>
> >>> Overall, I believe the abs(actual-expected) >>> the only practical way to handle doctests.  The expected numeric
> >>> result is still available, just not on a line by itself.
>
> >> Crazy idea: What if we introduce a "# numeric 1e-10" doctest flag (like
> >> #optional, etc.) that does just that---reads in the doctest answer, gets 
> >> the
> >> output of the function, and does an abs(actual-expected)<  epsilon (where
> >> epsilon can be specified in the flag, or it has a default).
>
> >> sage: some_numerical_function() # numeric 1e-6
> >>3.43234454
>
> >> passes if abs(real result-3.43234454)<1e-6
>
> > +1, that's a great idea. I'd be up for # [relative|absolute] tolerance
> > []
>
> In case people missed it, Robert put his code where his mouth and vote
> was:http://trac.sagemath.org/sage_trac/ticket/10952
>
> So now it needs review.  I've put up a comment or two.  It would be
> great if multiple people looked at it, though.
>
> Jason

-- 
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: When is a test not a valid test?

2010-12-06 Thread Donald Alan Morrison
On Dec 6, 11:15 am, Robert Bradshaw 
wrote:
> On Mon, Dec 6, 2010 at 8:01 AM, David Kirkby  wrote:
> > On 4 December 2010 05:32, William Stein  wrote:
> >> On Thu, Dec 2, 2010 at 6:40 PM, David Kirkby  
> >> wrote:
>[*snip*]
> > It's fairly clear in the past that the "Expected" result from a test
> > is what someone happened  to get on their computer, and they did not
> > appear to be aware that the same would not be true of other
> > processors.
>
> Most of the time that's due to floating point irregularities, and then

http://docs.python.org/release/2.6.6/tutorial/floatingpoint.html#representation-error

If the "numerical noise" issue in sage testing has been in controversy
for so long, why not replace all such failing doctests with a warning
(if triggered) promising to convert it to a sensible test (not
dependent on floating point order of operations in hardware or said
base conversion); and dispense with all the vitriol? (Not referring to
any particular persons' vitriol -- I'm an equal opportunity observer
of circumlocution.)

> there's an even smaller percentage of the time that it's due to an
> actual bug that didn't show up in the formerly-used environments. In

How does this help your side of the argument?

> both of these cases the test, as written, wasn't (IMHO) wrong. Not

Why?  If the test is non-deterministic, then you can have false-
positives and false-negatives.  What's a good argument for that if you
can avoid it?  If there are counter-examples (test case scenarios)
that prove you must take a statistical approach, then that would be an
entirely different testing framework.

> I agree, people of all backgrounds can make significant contributions.

http://trac.sagemath.org/sage_trac/ticket/8336

Robert and I had a long off-list discussion on this round() bug.  The
problem IMHO, is not sticking to an interface; the requested invariant
(that the same precision type be returned) is not possible in some
cases.  In other words, the interface/invariants are wrong, not the
test.

Speaking in maths terms, if the relation fails the vertical line test
(and is therefore not a function); why on earth would you call it a
function?

-- 
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: NIST FOIA Re:DLMF (The "Digital Library of Mathematical Functions")

2010-11-27 Thread Donald Alan Morrison
On Nov 27, 10:03 am, rjf  wrote:
> huh?  you seem to be answering a question from some other thread...

Are you confused because I didn't post on sage-polemic -- I mean sage-
flame?

Yes, I started a new thread because the topic had changed.  You are
quite fond of pointing out topic changes on sage-polemic.

>From the Google Web Interface, if one changes the topic within the
same thread (instead of starting a "new post"(new thread); then
subsequent replies to older posts keep the old topic, though usually
carry some of the new topic as well.

Please top post a reply, and we can have Dave chime in on that
too. :-)

> why don't you just look at the copyright info.
> It says
>
>  Bulk copying,reproduction, or redistribution in any form is not
> permitted.
>
> http://dlmf.nist.gov/about/notices#S4

Because the central point that Robert Dodier made is that it should be
in the public domain as it was funded with federal money (not sure if
that's necessarily true); but since I'm interested in such an
eventuality, that's why I would want to ask them for a formal
explanation on public record.  FOIA requests get answered by lawyers,
not webmasters.

-- 
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] NIST FOIA Re:DLMF (The "Digital Library of Mathematical Functions")

2010-11-26 Thread Donald Alan Morrison
http://www.nist.gov/admin/foia/foia.htm

A very nice page, even with a sample form letter.  Does anyone
*really* want to be the one to ask about the DLMF license?

Otherwise, I can do it.

-Don

-- 
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: New Ticket: PARI Bug in znprimroot()

2010-11-26 Thread Donald Alan Morrison
On Nov 26, 5:44 pm, Donald Alan Morrison 
wrote:
> primitive_root(ZZ) ArithmeticError for (+-)2^i for i >= 3
>
> http://trac.sagemath.org/sage_trac/ticket/10343

Please disregard.  I guess there must be a more modern meaning for
primitive roots (only the odd primes considered for p^i and 2*p^i with
the exceptions of n=2 or n=4?)

sage: for a in range(16):
: print mod(5^a, 16)
:
1
5
9
13
1
5
9
13
1
5
9
13
1
5
9
13
sage:

-- 
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] New Ticket: PARI Bug in znprimroot()

2010-11-26 Thread Donald Alan Morrison
primitive_root(ZZ) ArithmeticError for (+-)2^i for i >= 3

http://trac.sagemath.org/sage_trac/ticket/10343

-- 
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: Searching OEIS is broken

2010-11-26 Thread Donald Alan Morrison
On Nov 26, 4:53 pm, David Joyner  wrote:
> On Fri, Nov 26, 2010 at 7:28 PM, Robert Dodier  
> wrote:
> > On Nov 25, 5:02 pm, Rob Beezer  wrote:
> >> On Nov 25, 3:35 pm, Donald Alan Morrison 
> >> wrote:
>
> >> > "Abramowitz and Stegun: Handbook of Mathematical Functions" is another
> >> > interesting topic source you mentioned.  It is very nice that it's
> >> > free to view.  I'm surprised that it's just scanned imagessomeone
> >> > could have run it through OCR, then LaTeX.
>
> >> The "Digital Library of Mathematical Functions" is the follow-on to
> >> Abramowitz and Stegun.
>
> >>http://dlmf.nist.gov/
>
> > The DLMF is not the same as A&S in at least one respect:
> > whereas A&S is a work in the public domain, DLMF is copyrighted.
>
> > Now one might suppose that the DLMF is a work of a federal
> > agency (NIST) and therefore cannot be copyrighted.
> > The arrangement is this: NIST contracts with the authors
> > (not NIST employees, I gather) to write it, then the authors
> > assign the copyright to NIST.
>
> Is that legal? In any case, I've heard that version. I have also heard
> another version:
> NIST is one of the few (possibly only) fed agency which has an
> exception to the "public domain" rule for official govt work. (True)
> However, the exception is for a very specific purpose and
> it isn't at all clear to me that NIST meets that provision in the copyright
> law. I am not a lawyer but also I am very biased in favor of openness,
> so my feeling on what NIST has done (copyright-wise) to the
> DLMF) could very well be inaccurate.
>

Sounds like an excellent reason for filing a FOIA Request.

Hopefully NIST doesn't have a draconian FOIA fees table posted.  The
requester is supposed to be able to specify a maximum acceptable bill,
so they don't pick up a huge tab without warning.

-Don

-- 
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: Searching OEIS is broken

2010-11-25 Thread Donald Alan Morrison
On Nov 25, 5:24 pm, Tom Boothby  wrote:
> Two technical solutions:
>
> 1) have 'make' download the database.
> 2) Before we make each release, dump a few gigabytes onto the OEIS
> wiki, such that what we distribute is well under 5% of their
> "aggregate content".  (tongue firmly in cheek)

Tom: Not sure where your joke begins and ends, but,

A1: If the license says you can't or the stripped version is no longer
available, that's not an option.

A2: The classic server limited the rate of CGI requests (it took me
nearly a month to download all the A-Files as a result, even though
they are small).  I imagine a similar scheme will be in place with the
wiki.

I think the A&S NIST adaptation (DLMF) is more interesting to pursue.

-Don

-- 
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: Searching OEIS is broken

2010-11-25 Thread Donald Alan Morrison


On Nov 25, 5:19 pm, David Joyner  wrote:
>[...]
> (b) Even if he does own copyright (and I'm not saying he does), since it is
> free data and no one makes any money from it, if someone did redistribute the
> data which is already freely available, how can he prove that any
> damage occurred?
>[...]

http://www.amazon.com/Encyclopedia-Integer-Sequences-N-Sloane/dp/0125586302

They have printed it in hardcover in the past, so I imagine they may
again, and direct the proceeds to their non-profit foundation.

-Don

-- 
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: Searching OEIS is broken

2010-11-25 Thread Donald Alan Morrison
On Nov 25, 4:02 pm, Rob Beezer  wrote:
> On Nov 25, 3:35 pm, Donald Alan Morrison 
> wrote:
>
> > "Abramowitz and Stegun: Handbook of Mathematical Functions" is another
> > interesting topic source you mentioned.  It is very nice that it's
> > free to view.  I'm surprised that it's just scanned imagessomeone
> > could have run it through OCR, then LaTeX.
>
> The "Digital Library of Mathematical Functions" is the follow-on to
> Abramowitz and Stegun.
>
> http://dlmf.nist.gov/
>
> They have done a nice job rendering the mathematics on web pages -
> IIRC using a custom latex-conversion tool built just for this purpose.
>
> Rob

It looks well done.  The following table contrasting various aspects
of software packages includes SAGE:

http://dlmf.nist.gov/software/

It would be nice if there were collapsable examples for each
expression/function catalogued, or if it were more interactive.  (This
is _not_ a complaint :-).

Don

-- 
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: Searching OEIS is broken

2010-11-25 Thread Donald Alan Morrison


On Nov 25, 12:15 pm, William Stein  wrote:
> On Thu, Nov 25, 2010 at 11:29 AM, Mike Hansen  wrote:
> > On Thu, Nov 25, 2010 at 7:43 AM, ulfarsson  wrote:
> >> the function sloane_find seems to be broken after the recent updates
> >> to The online encyclopedia of integer sequences, oies.org. For example
>
> >> sloane_find([1,2,3,4,5,6])
>
> >> does not find anything in the database.
>
> > This ishttp://trac.sagemath.org/sage_trac/ticket/10056and has been
> > fixed in Sage 4.6.1.
>
> >> Does anyone have a recent copy of teh gzipped file lying around
> >> somewhere that I could borrow until the oeis fixes their file?
>
> > I'm not sure how recent you need, but I believe this is from about a year 
> > ago.
>
> >http://sage.math.washington.edu/home/mhansen/database_sloane_oeis-200...
>
> > --Mike
>
> Hi,
>
> Unfortunately, I looked at the new OEIS end user license.  Very, very
> sadly, redistributing the above file is a blatant violation of these
> terms (see Section 2, number 2). So Mike, please remove it at some
> point so I don't get into trouble.  (I doubt they are going to do
> anything right now.)
>
> http://oeis.org/wiki/The_OEIS_End-User_License_Agreement
>
> 
> I think this is a very, very sad direction for OEIS to have gone in,
> with Sloane passing it off under such terms.  It's really a shame.
> Wikipedia has provided a vastly better example in how to make data
> available.
>
> It might even be the case that the sloane_sequences file in Sage, if
> it were to a grow a bit, would violate the terms.
> 
>
> I wonder if the OEIS used to be available under a different license,
> or maybe Sloane just didn't worry about licenses?  If it did used to
> be available under different terms?
>
> I encourage people to read the terms 
> herehttp://oeis.org/wiki/The_OEIS_End-User_License_Agreementto make sure
> I'm not misunderstanding them.  And if you're the sort of person (like
> me), who has contributed to OEIS, to think twice before doing so in
> the future.
>
>  -- William

I downloaded all the A-files (containing the formulas, comments, and
the first few terms) before the new license was released.  At the time
I downloaded it; the site said it was ok to have a copy for research
use but not commercial use.  Also only the keyword:core sequences (169
sequences) are really vetted and importantsome of the keyword:nice
sequences (6205 excluding intersection with core) are also important.
A little bird told me that about 2-5% of entries have errata.

Maybe it would be a worthwhile project to create an independent db
format, and re-create core sequences working from other texts.
Certainly just looking up a function name or identity expression is
fair use of the text (not copying anything else)...I mean, someone
can't copyright the name of a function.  Or does copyright cover
"lists of function names"?  If so, other sources could be consulted to
compile a list of (new-)"core" sequences.

"Abramowitz and Stegun: Handbook of Mathematical Functions" is another
interesting topic source you mentioned.  It is very nice that it's
free to view.  I'm surprised that it's just scanned imagessomeone
could have run it through OCR, then LaTeX.

-Donald

-- 
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: Searching OEIS is broken

2010-11-25 Thread Donald Alan Morrison


On Nov 25, 7:43 am, ulfarsson  wrote:
> Hi,
>
> the function sloane_find seems to be broken after the recent updates
> to The online encyclopedia of integer sequences, oies.org. For example
>
> sloane_find([1,2,3,4,5,6])
>
> does not find anything in the database. The oies has also taken down
> the stripped version of their database athttp://oeis.org/stripped.gz
> so one can not download and use a local copy of the database.
>
> Does anyone have a recent copy of teh gzipped file lying around
> somewhere that I could borrow until the oeis fixes their file?

I have a copy downloaded on September 13th.

-- 
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: Should notebook use a deport port of 8080 and not 8000?

2010-11-24 Thread Donald Alan Morrison
On Nov 24, 2:04 pm, David Kirkby  wrote:
> On 21 November 2010 15:43, Jeroen Demeyer  wrote:
>
> > On 2010-11-21 15:18, Dr. David Kirkby wrote:
> >> A comment from a user recently that he can only use port 80 and 8080 by
> >> his employer, makes me think we should change the default port.
> > I would just like to point out that this is irrelevant, because the port
> > under discussion is the one used by running Sage locally.  So any
> > port-blocking towards the Internet done by employers doesn't matter for
> > this.
>
> > Jeroen.
>
> But it's also the default port if you make the notebook public too.
>
> It would seem sensible to make that the default port that's designated
> asr an alternative HTTP port, rather than one that's designated as one
> for Remote Desktop Management.
>
> Dave

http://www.iana.org/assignments/port-numbers

-- 
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: Two issues with random_prime()

2010-11-16 Thread Donald Alan Morrison


On Nov 16, 10:22 am, William Stein  wrote:
> [...]
> They mention that Mathematica does have a "proof = True" version of
> PrimeQ called ProvablePrimeQ that one can optionally load.  I just
> tried it on a 200-digit number and it took 22 seconds as compared to 3
> seconds in PARI (hence Sage).

Thanks William, I stand corrected.  My post algorithm was psuedo-skim-
correct. =)

-- 
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: Two issues with random_prime()

2010-11-16 Thread Donald Alan Morrison
> > Eg, how would you
> > interpret the docs for PrimeQ?
> >http://reference.wolfram.com/mathematica/ref/PrimeQ.html
>
> I would interpret that as Mathematica's PrimeQ[] tests with 100%
> certainty if the number is prime or not.

Mma probably uses the fast "psuedo-primality tests" in the range where
they are known to be correct (less than about 2^64, though they can go
higher.)  After that, sieving or AKS is necessary.

-- 
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: Regression testing

2010-10-25 Thread Donald Alan Morrison


On Oct 25, 4:23 pm, Mitesh Patel  wrote:
>>[...]
> On 10/25/2010 01:54 PM, William Stein wrote:
> >   * A document with a unique id, starting at 0, for each actual test
> >        {'id':0, 'code':'factor(2^127+1)'}
>
> >   * A document for each result of running the tests on an actual platform:
> >        {'machine':'bsd.math.washington.edu', 'version':'sage-4.5.3',
> > 'timings':{0:1.3, 1:0.5,...} }
> > Here, the timings are stored as a mapping from id's to floats.
>
> This last option seems most "natural" to me, though identical inputs
> that appear in multiple suites would generally(?) get different ids in
> the collections.  Would it be better to use a hash of the 'code' for the
> 'id', or can the database automatically ensure that different ids imply
> different inputs?

http://www.mongodb.org/display/DOCS/Indexes#Indexes-UniqueIndexes

-- 
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: Regression testing

2010-10-25 Thread Donald Alan Morrison


On Oct 25, 2:47 pm, "Dr. David Kirkby" 
wrote:
> On 10/25/10 04:50 PM, Donald Alan Morrison wrote:
> > On Oct 25, 8:19 am, David Kirkby  wrote:
> >> Getting a checksum of each doctest would be easy. I suggest we use:
> >> $ cksum sometest.py  | awk '{print $1}'
> >> because that will be totally portable across all platforms. 'cksum' is
> >> 32-bit checksum that's part of the POSIX standard and the algorithm is
> >> defined. So there's no worry about whether one has an md5 program, and
> >> if so what its called.
> >http://docs.python.org/library/hashlib.html#module-hashlib
>
> > Python's standard library "hashlib" contains both MD5 and SHA1 Message
> > Digests.
>
> > Their advantage over the checksum (CRC) algorithm, is that the output
> > digest changes dramatically when only 1 input bit changes.
>
> I'm not convinced it's important how many bits change in the output if the 
> input
> changes by one bit.

http://selenic.com/pipermail/mercurial/2009-April/025526.html
http://mercurial.selenic.com/wiki/Nodeid

-- 
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: Regression testing

2010-10-25 Thread Donald Alan Morrison


On Oct 25, 8:19 am, David Kirkby  wrote:
> Getting a checksum of each doctest would be easy. I suggest we use:
>
> $ cksum sometest.py  | awk '{print $1}'
>
> because that will be totally portable across all platforms. 'cksum' is
> 32-bit checksum that's part of the POSIX standard and the algorithm is
> defined. So there's no worry about whether one has an md5 program, and
> if so what its called.

http://docs.python.org/library/hashlib.html#module-hashlib

Python's standard library "hashlib" contains both MD5 and SHA1 Message
Digests.

Their advantage over the checksum (CRC) algorithm, is that the output
digest changes dramatically when only 1 input bit changes.

-- 
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: bug wranglers

2010-10-18 Thread Donald Alan Morrison


On Oct 16, 5:21 am, Burcin Erocal  wrote:
>[...]
> if they are filed in different components. The members of the
> bug-wrangler mailing list will be able to see the initial report for
> every ticket, so they might recall a similar problem reported a few
> days ago.
>
> Another advantage is that the members of this team don't need to be
> developers, or even know how to code. It is enough to be able to listen
> to user requests and use trac.
>
> This could also be a good starting point for people who want to get
> into Sage development, since it provides an opportunity to look through
> the library and become familiar with the internal structure of Sage.
>
> Comments?

What will be appropriate attire for Bug Days?  Will there be a wake
(and party) after the (bug) funeral?

-- 
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: server start, server shutdown

2010-10-15 Thread Donald Alan Morrison
Hi Kwankyu,

Thanks for your work.  Here are some comments for the current version:

49  os.kill(pid,signal.SIGTERM)
50  time.sleep(.5)
51  if os.path.isfile(pid_file):
52  print "Waiting for the sage server to terminate..."
53  time.sleep(3)
54  if os.path.isfile(pid_file): # assume the server
process is malbehaving.
55  print "Killing the errorneous sage server
process..."
56  os.kill(pid,signal.SIGKILL)
57  os.remove(pid_file)

Line 50 "blocks" (waits syncronously without checking status); also
half of a second may not be long enough if all memory was used up and
there was excessive paging in/out from the swap file.  One alternative
method is to check for the existence of the pid file periodically for
a longer period (possibly parameterized), and if it is deleted,
recheck that the twistd process has indeed exited else send SIGKILL.

Otherwise, good refactor. :-)

-Don

On Oct 14, 10:36 pm, Kwankyu Lee  wrote:
> Hi Don,
>
> I just uploaded a revised version of the script modified according to
> your comments. Check it out!
>
> Kwankyu

-- 
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: server start, server shutdown

2010-10-14 Thread Donald Alan Morrison
On Oct 13, 6:03 pm, Kwankyu Lee  wrote:
> Hi,
> There is a simple script for that purpose in trac ticket #7893.
> http://trac.sagemath.org/sage_trac/ticket/7893

Some comments on the script:

1) The stop_server function does not do error checking to ensure that
the pid contained in the pid file actually corresponds to a server
process: http://trac.sagemath.org/sage_trac/attachment/ticket/7893/sage-server

30  def stop_server():
31  try:
32  # if sage notebook server is running, "twist.pid" is
created
33  file = open(os.environ['HOME'] + '/.sage/
sage_notebook.sagenb/twistd.pid', 'r')
34  pid = file.readline()
35  file.close()
36  print "Stopping sage server..."
37  os.system('kill -INT ' + pid)
38  except IOError:
39  print "No sage server running."

Given the frequency of reboots for most users, and the cost to the
user of killing a random process, it would be good to error check
against the actual running process name.

2) It would be good to add some code that waits for SIG_TERM to
complete, then optionally sends SIG_KILL.  One can't assume SIG_TERM
will be handled correctly by the server, especially if it's in a bad
state.

3) The script should verify the completion of #2, then delete the pid
files.

-Don

-- 
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] server start, server shutdown

2010-10-13 Thread Donald Alan Morrison

I find the following command useful from the terminal:

cd sage-4.5.3-linux-64bit-ubuntu_10.04.1_lts-x86_64-Linux/ && nohup ./
sage -n 2>&1 > /dev/null & exit

It closes the terminal, but keeps the sage server running.  Of course
the sagedir should be an env var, or parameterized, or searched for...

Is there an inverse command already in existence that does a "killall"
on the sage server processes for the current user, (by sending
SIG_TERMwaiting, then sending SIG_KILL)?  It might be useful to
have these shorthands for "up/down" or "start/stop" without the user
having to memorize a long command-line.  It could be put in script(s).

-Don

-- 
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] bug? sage.combinat.sloane_functions.A111776

2010-09-24 Thread Donald Alan Morrison
Sage 4.5.3, 32-bit, Ubuntu 10.04


%time
# n 0..35
# http://www.research.att.com/~njas/sequences/table?a=111776&fmt=4
OEIS_A111776 = 
[1,1,1,1,2,3,1,4,6,10,1,8,12,20,35,1,16,24,40,70,125,1,32,48,80,140,250,450,1,64,96,160,280,500,900,1625]
s453_A111776 = sloane.A111776.list(36)
OEIS_A111776 == s453_A111776

False
CPU time: 0.02 s,  Wall time: 0.03 s

%time
sloane_sequence(111776)[2] == OEIS_A111776

Searching Sloane's online database...
True
CPU time: 0.00 s,  Wall time: 0.43 s

-- 
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