2018-06-06 21:04:22 -0500 | received badge | ● Nice Answer (source) |

2018-04-27 14:54:49 -0500 | received badge | ● Good Answer (source) |

2017-12-28 02:31:02 -0500 | received badge | ● Great Answer (source) |

2017-03-30 10:26:52 -0500 | received badge | ● Guru (source) |

2017-03-30 10:26:52 -0500 | received badge | ● Great Answer (source) |

2017-02-13 10:06:41 -0500 | received badge | ● Nice Answer (source) |

2016-10-07 22:37:17 -0500 | received badge | ● Great Answer (source) |

2016-08-06 03:05:58 -0500 | received badge | ● Guru (source) |

2016-08-06 03:05:58 -0500 | received badge | ● Great Answer (source) |

2016-07-22 17:23:19 -0500 | received badge | ● Famous Question (source) |

2016-06-27 18:45:19 -0500 | received badge | ● Good Answer (source) |

2016-05-30 17:05:16 -0500 | received badge | ● Nice Answer (source) |

2015-09-26 11:51:01 -0500 | received badge | ● Famous Question (source) |

2015-02-16 08:00:52 -0500 | received badge | ● Nice Answer (source) |

2014-12-11 07:04:13 -0500 | received badge | ● Nice Answer (source) |

2014-07-24 07:11:00 -0500 | received badge | ● Good Answer (source) |

2014-07-24 07:10:25 -0500 | received badge | ● Nice Answer (source) |

2014-06-28 20:14:48 -0500 | marked best answer | substituting expressions for numbers Say you have some formula in the form of an expression: Now I want to replace the 10 by the variable a. What's the easiest way to do this? It's the opposite of the typical substitution, so the functions I'd usually throw at it all fail. So far I can only up with (1) string techniques, which are bugs waiting to happen, or (2) walking the entire expression tree and constructing a new expression from each operator/operand triplet. |

2014-01-31 06:26:04 -0500 | commented question | "No module named scipy" Your error message says `No module named scilab`, not `No module named scipy`, so there was a typo somewhere. |

2014-01-27 10:23:42 -0500 | edited answer | Any way to timeout? Updated: in modern Sage, Yes, you can use the alarm function and catch the resulting KeyboardInterrupt Here's an example use: But this should simply work, you shouldn't need to play timing games. After interrupting one of the really long calculations, I managed to break an assert: so clearly things are getting themselves into a state. UPDATE: I should also give the usual warning about using "bool(eq)", which is that it doesn't do what you might think it does. bool(eq) == False does |

2014-01-27 10:21:47 -0500 | edited answer | Distinguish between alarm() and manual interrupt Updated: modern Sage raises an Also, it's probably a better idea to use Sure. While I would have made it a little more explicit, the KeyboardInterrupt generated by alarm does contain information that a typical KeyboardInterrupt doesn't, in the .args and .message attributes. For example, control-C in the following produces but adding So one way to take advantage of this would be through something like this: which gives I tend to wrap this stuff up in decorators, but in this case mine is nested three deep so it's probably overkill for the problem, because it makes it look more complicated than it really is. |

2014-01-16 10:03:38 -0500 | commented answer | Function generator No need to use indices; `[f.function(x) for f in F]` should work too. |

2014-01-16 07:11:24 -0500 | answered a question | Bug in Legendre polynomial. The Legendre polynomial itself looks fine. To avoid the numerical imprecisions, you could work over QQ instead: It looks like you need 100+ bits of precision in order to evaluate the function in the original order: The polynomial is very oscillatory in that there's a large amount of cancellation going on. If you're really interested in the value, and only secondarily the polynomial, then you could use either |

2013-11-25 14:14:44 -0500 | received badge | ● Notable Question (source) |

2013-10-04 10:17:50 -0500 | commented question | Changing country name @kcrisman: this might be a questiong about the Other Sage.. |

2013-09-17 01:07:42 -0500 | received badge | ● Nice Answer (source) |

2013-09-14 19:41:37 -0500 | received badge | ● Good Answer (source) |

2013-08-28 18:10:51 -0500 | edited answer | [spam message] [spam message] |

2013-08-28 18:10:33 -0500 | edited question | [spam message] [spam message removed] |

2013-08-16 04:10:53 -0500 | commented question | RAM memory becomes full while running script Could you edit your question to include the smallest example you can find which reproduces the problem? Making one will either help you discover the problem yourself or give us information to work with. |

2013-08-15 07:55:35 -0500 | commented question | Computing derivatives That's what you'd get if `sqrt` were actually `math.sqrt` and not Sage's `sqrt`. |

2013-08-05 09:01:06 -0500 | received badge | ● Nice Answer (source) |

2013-07-08 05:43:47 -0500 | received badge | ● Good Answer (source) |

2013-07-08 02:09:49 -0500 | received badge | ● Good Answer (source) |

2013-05-23 07:56:36 -0500 | commented question | How to find instances where $d(a,b) = p^2$ for $p$ a prime Are you sure there are any such pairs to find? Unless I'm missing something, you can't fit $2p^2$ into $(a+1) (b+1) (a+b+2)$ successfully. |

2013-05-04 06:24:49 -0500 | received badge | ● Enthusiast |

2013-04-18 10:32:28 -0500 | received badge | ● Great Question (source) |

2013-04-02 11:34:21 -0500 | commented question | Sage + IronPython None of the Cythonic stuff would work, I don't think, which rules out a lot of the core. |

2013-03-29 13:00:08 -0500 | received badge | ● Good Answer (source) |

2013-03-29 03:43:14 -0500 | commented question | Table of primes @LuizRobertoMeier: I deleted your insulting comment. When everyone else except you is finding you unclear, you might want to consider the possibility that it's not that everyone except you is an idiot, it's that you've been more ambiguous than you think. |

2013-03-28 10:23:31 -0500 | commented answer | Finding the permutation that sorts a list Oh, that's nice. |

2013-03-28 07:50:44 -0500 | answered a question | code for bipartite graphs It's not completely clear to me what you mean by "indexing" a graph edge. If you want to give them labels, you can do that using produces |

2013-03-28 06:07:51 -0500 | received badge | ● Great Answer (source) |

2013-03-28 06:07:51 -0500 | received badge | ● Guru (source) |

2013-03-27 22:31:22 -0500 | received badge | ● Good Answer (source) |

2013-03-27 15:43:05 -0500 | received badge | ● Nice Answer (source) |

2013-03-27 14:34:05 -0500 | edited answer | Finding the permutation that sorts a list IIUC, the Alternatively, you can use a Schwartzian transform (a.k.a. the "decorate-sort-undecorate" idiom). Starting from our list, we can enumerate it, counting from 1 (the "decorate" part) Sort these by the second term, the value: Extract the sorted indices: Finally, we can make this into a proper and confirm it by applying it to our list: |

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.