general function to handle errors api
Is there a difference between "==" and "is"?
Legendre symbol: Showing that $\sum_{m=0}^{p-1} \left(\frac{am+b}{p}\right)=0$ I have a question about Legendre symbol.  Let $a$, $b$ be integers. Let $p$ be a prime not dividing $a$. Show that the Legendre symbol verifies: $$\sum_{m=0}^{p-1} \left(\frac{am+b}{p}\right)=0.$$  I know that $\displaystyle\sum_{m=0}^{p-1} \left(\frac{m}{p}\right)=0$, but how do I connect this with the previous formula?  Any help is appreciated. Tiling problem: 100 by 100 grid and 1 by 8 pieces How do lexical closures work? While I was investigating a problem I had with lexical closures in Javascript code, I came along this problem in Python:  flist = []  for i in xrange(3):     def func(x): return x * i     flist.append(func)  for f in flist:     print f(2)   Note that this example mindfully avoids lambda. It prints "4 4 4", which is surprising. I'd expect "0 2 4".   This equivalent Perl code does it right:  my @flist = ();  foreach my $i (0 .. 2) {     push(@flist, sub {$i * $_[0]}); }  foreach my $f (@flist) {     print $f-&gt;(2), "\n"; }   "0 2 4" is printed.  Can you please explain the difference ?    Update:   The problem is not with i being global. This displays the same behavior:  flist = []  def outer():     for i in xrange(3):         def inner(x): return x * i         flist.append(inner)  outer() #~ print i   # commented because it causes an error  for f in flist:     print f(2)   As the commented line shows, i is unknown at that point. Still, it prints "4 4 4". Wired connection not working Ubuntu 12.04 Is list::size() really O(n)? Recently, I noticed some people mentioning that std::list::size() has a linear complexity. According to  , this is in fact implementation dependent as the standard doesn't say what the complexity has to be. The comment  says:     Actually, it depends on which STL you   are using. Microsoft Visual Studio V6   implements size() as {return (_Size);   } whereas gcc (at least in versions   3.3.2 and 4.1.0) do it as { return std::distance(begin(), end()); } The   first has constant speed, the second   has o(N) speed    So my guess is that for the VC++ crowd size() has constant complexity as Dinkumware probably won't have changed that fact since VC6. Am I right there? What does it look like currently in gcc? If it is really O(n), why did the developers choose to do so? Number of normals from a point to an ellipse From a typical point $P$ inside an ellipse, how many points $Q_i$ on the ellipse have $PQ_i$ normal to the ellipse?  Someone asked me at school many years ago but I don't think I worked it out. How widely-accepted is "What do you got?" to Americans? Watching , I noticed that Melanie Griffith twice asked    I recognise this as an American construction which sounds strange to me — Brits invariably say either "What have you got?" or "What do you have?". But I'd be interested to know if it's considered "normal" by most/all Americans, or if it's regionally or otherwise restricted. What is the reasoning that leads one to postulate this second form for the relativistic particle action? The action for the free relativistic particle with worldline $\gamma : I\subset \mathbb{R}\to M$ is  $$S[\gamma]=-m\int d\lambda\sqrt{-\dot{\gamma}^a(\lambda)\dot{\gamma}_a(\lambda)}\tag{1} $$  Now, one may postulate a second action  $$S'[\gamma,\eta]=\frac{1}{2}\int d\lambda \bigg(\eta(\lambda)^{-1}\dot{\gamma}^a(\lambda)\dot{\gamma}_a(\lambda)-\eta(\lambda)m^2\bigg).\tag{2}$$  These are classically equivalent actions.  My question is: usually what we have is (1) and we have a problem both with the square root and with the massless limit. Given this, how could we think about postulating (2)? In other words, how can we reach (2)?  Usually some people answer this by saying: "it doesn't matter, actions are postulated, you postulate it, compute the equations, prove it works and its over".  Now I beg to differ. I want to know how could someone reason exactly in order to know what to postulate.   I am perfectly comfortable with computing the equations of motion. I want to know is how given (1) we would have the idea to postulate (2).  Is it some special case of some general procedure that deals with constraints? Finding the distribution of sum of Lognormal Random Variables I am trying to find the distribution of sum of 2 lognormal random variables. I referred the literature available on Cross validated, Stack overflow and few papers before posting this.   I used convolution to find the distribution of sum of 2 lognormal rvs. The approximation works for difference. But, not for sum. I am getting a nasty kink at 0 in both CDF and PDF. I could not recognize the reason. With few tweaks, the shape of the distribution comes right. But, I am not sure what I was doing is right.   Can somebody guide me here? Can we use "there is" for plural nouns? Check existence of input argument in a Bash shell script Is Tolkien prejudiced against the East? In Tolkien's The Lord of the Rings series, there are generally two groups of Men. The good ones are coming from the West (Dúnedain, Men of the West), and the bad ones, the Easterlings, mostly fight under Morgoth and Sauron.  Why was this so? Vandermonde determinant for order 4 How do I close a connection early? Decide if the series converges and prove it using comparison test: $\sum_{k=1}^{\infty}\frac{1}{2k+3}$ Decide if the series converges and prove it using comparison test:   $\sum_{k=1}^{\infty}\frac{1}{2k+3}$   $$\frac{1}{2k+3} &lt;\frac{1}{2k}&lt;\frac{1}{k}$$  and since $\sum_{k=1}^{\infty}\frac{1}{k}$ diverges (we have defined that in our readings, so I can claim it here), the complete series will diverge, too.  Did I do everything correctly? What makes me feel a bit unsure is that there is no "$\leq$" sign anywhere and when I look up the comparison test on the internet, I don't see any "&lt;" or ">" in the definition.  Is it correct anyway? Selenium python drop down menu select Invest money and get 120% back - a site says How can I do development on my Android device? I have a pretty long commute to work and own an android phone. I figure it would be nice to do some simple programming on the way. I'm not picky on which language to code on. I usually have an internet connection on the train.  I've been looking through the android market but haven't found any apps that offer a "development environment" or an editor with a compiler. Is any development ON the Android possible? Does an app for this exist? How to install with Wubi when it says "Could not retrieve the required disk image files"? What is the best class or classes in 3.5e to build a character that uses both a sword and either arcane magic or psionics which can be fluffed as arcane magic and focuses on fighting powerful individual creatures?    I have a foundness for those that can sling spell along with blade, like Dak'kon from Planescape: Torment.  So, given that, how do I make the best Gishy character I can?  Specifically, the group is looking for a character focused on delivering high damage or other debilitating effects to an individual target.  There is no need to balance sword and magic, though I would prefer to have the melee abilities remain at least relevant through at least mid-levels.  This question:  is related.  But I am specifically looking to optimize for high targeted damage output and have no need to balance between sword and spell if focusing on one is more effective.  I have considered the duskblade and that may be the best answer, but as I have limited experience with 3.5 I want to find out if I should use a pure duskblade, a duskblade which steps into other classes, or some other class I have not considered.  In this particular case, the characters will start at level 7, and equipment rules are liberal as long as the characters can afford it.  I'm not sure how long this will last so I am focused on the next few levels instead of trying to plan all the way out to 20.  It will be a party of 5.  Not all of the rest of the characters have been fully fleshed out, but we will have a cleric and a wizard.  The other two are more up in the air but they one is looking at various rogue classes and the other is looking at some sort of melee class, with this gishy rounding out the team.  The initial encounter is up in the air, but there is a definite fondness for gryphons.  We do know that we will be working up to dragon in relatively short order, which is a factor in wanting to focus on large damage output to individual creatures as opposed to being able to deal with numerous weaker creatures.  The setting is "modified Forgotten Realms".    I personally own absolutely no 3.5 books, but we have access to a fair bit and just about anything from WoTC is permitted.  I am new to 3.5, but I have a fair bit of roleplaying experience including AD&amp;D.    Thematically, I envision the character as a generally honorable, but working as a monster hunter and mercenary.  I definitely favor swords though specifically which sword is flexible.  Dak'kon from Planescape would be an excellent example of what I would like to build, as would The Witcher.  Based on Kryan's excellent answer, it seems to be leading up to using duskblade and a specialist wizard to lead into Abjurant Champion.