Very new to python and trying to create a program which takes an inputed number and tells the user if the number is odd or even. I have part of it working, it takes an number and gives the correct output depending on weather its odd or even, but the problem is, if you enter anything but a number, the program dosn't recongise it and crashes the program.   My solution dosn't work and I don't understand the error message.  Enter any number above 0   45 Traceback (most recent call last): line 5, in &lt;module&gt;     if not number.isdecimal(): AttributeError: 'int' object has no attribute 'isdecimal'   My implementation:    while True:     print()     number = int(input("Enter any number above 0   ")) # Ask user to input a number      if not number.isdecimal(): # Trying to get code to reject a input that is not a number instead of crashing the program         print()         print("Incorrect format, please enter numbers")         print()     else:         if number % 2 == 0: # Tell user inputed number is even if number is even             print()             print("That number is even!")         else:             print()              print("That number is odd!")  # Tell user inputed number is odd if number is odd
I have some HTML I am trying to parse.  There are cases where the html attributes alone are not going to help me identify the row type (header versus data).  Fortunately, if my row is a data row then it should have some values that can be converted to integers.  I have figured out how to convert the unicode to an integer for those cases that it is possible to make the conversion.  I am struggling to write the logic to move past the cells that the conversion will not work because the cell has content that must be treated as text.  for example if rowColumn[1][3] can be converted to an integer I can do so by   int(rowColumn[1][3].replace(',','').strip('$'))   but I get an error if rowColumn[1][3] has text content.
Get driving directions using Google Maps API v2 I want to find a set of integer solutions of Diophantine equation: $ax + by = c$, and apparently $\gcd(a,b)|c$. Then by what formula can I use to find $x$ and $y$ ?   I tried to play around with it: $x = (c - by)/a$, hence $a|(c - by)$.     $a$, $c$ and $b$ are known. So to obtain integer solution for $a$, then $c - by = ak$, and I lost from here, because $y = (c - ak)/b$. I kept repeating this routine and could not find a way to get rid of it? Any hint?  Thanks, Chan Mapping JSF .xhtml files to no extension On a quantum scale the smallest unit is the , which is a discrete measure.  There several question that come to mind:   Does that mean that particles can only live in a discrete grid-like structure,  i.e. have to "magically" jump from one pocket to the next? But where are they in between? Does that even give rise to the old paradox that movement as such is impossible (e.g. )? Does the same hold true  for time (i.e. that it is discrete) - with all the ensuing paradoxes? Mathematically does it mean that you have to use difference equations instead of differential equations? (And sums instead of integrals?) From the point of view of the space metric do you have to use a discrete metric (e.g. the ) instead of good old Pythagoras?   Thank you for giving me some answers and/or references where I can turn to.  Update: I just saw this call for papers - it seems to be quite a topic after all: Is Reality Digital or Analog? FQXi Essay Contest, 2011. , , . One can find some pretty amazing papers over there. Why does find -mtime +1 only return files older than 2 days? I'm struggling to wrap my mind around why the find interprets file modification times the way it does.  Specifically, I don't understand why the -mtime +1 doesn't show files less than 48 hours old.   As an example test I created three test files with different modified dates:   [root@foobox findtest]# ls -l total 0 -rw-r--r-- 1 root root 0 Sep 25 08:44 foo1 -rw-r--r-- 1 root root 0 Sep 24 08:14 foo2 -rw-r--r-- 1 root root 0 Sep 23 08:14 foo3   I then ran find with the -mtime +1 switch and got the following output:  [root@foobox findtest]# find -mtime +1 ./foo3   I then ran find with the -mmin +1440 and got the following output:   [root@foobox findtest]# find -mmin +1440 ./foo3 ./foo2   As per the man page for find, I understand that this is expected behavior:   -mtime n         File’s  data was last modified n*24 hours ago.  See the comments         for -atime to understand how rounding affects the interpretation         of file modification times.   -atime n        File  was  last  accessed n*24 hours ago.  When find figures out        how many 24-hour periods ago the file  was  last  accessed,  any        fractional part is ignored, so to match -atime +1, a file has to        have been accessed at least two days ago.   This still doesn't make sense to me though.  So if a file is 1 day, 23 hours, 59 minutes, and 59 seconds old, find -mtime +1 ignores all that and just treats it like it's 1 day, 0 hours, 0 minutes, and 0 seconds old?  In which case, it's not technically older that 1 day and ignored?   Does... not... compute. Do I need a license to create pdf files? I hope this is the correct place where I could ask this question. My mother is an accountant with a degree in economics. She works as a freelancer and she needs some licenses for her job.  The biggest problem is adobe acrobat standard, which costs 400€, quite a lot. I want understand if she must buy it to create pdf files or she can use some free (even for commercial use) programs that she has because of her job (the chamber of commerce provide some advantages to accountants).  She is actually using PDFCreator, which as I can read is free for business usage (open source also!!):   Thanks for any suggestion Mouseover tooltip for delete count is wrong How do I add newlines between lines printed on the command line? Mail logs are incredibly difficult to read. How could I output a blank line between each line printed on the command line? For example, say I'm grep-ing the log. That way, multiple wrapped lines aren't being confused. Story ID: A pre-teen girl who is a genius crosses the country in a van Prove that if $V$ is an inner product space, then $|\langle x,y\rangle| = \Vert x \Vert\Vert y\Vert$ if and only if one of the vectors $x$ or $y$ is a multiple of the other.  I am given a hint to let $a= \frac{\langle x,y\rangle}{\|y\|^2}$, and let $z = x - ay$, then prove $y$ and $z$ are orthogonal and $|a|= \frac{\|x\|}{\|y\|}$. I don't know how they come up with this, what was the original idea? How to initialize private static members in C++? What is the best way to initialize a private, static data member in C++?  I tried this in my header file, but it gives me weird linker errors:  class foo {     private:         static int i; };  int foo::i = 0;   I'm guessing this is because I can't initialize a private member from outside the class.  So what's the best way to do this? There is no smallest rational number greater than 2 I have a problem that I am seriously stuck on. I'm not sure what to do I've seen similar proofs online with the least positive rational number but this is apparently different and I'm not sure why.     Prove the statement “There is no smallest rational number greater than 2” by contradiction. How to permanently turn off online results I don't like getting online results when searching in my dashboard, so I went to System Settings &gt; Security &amp; Privacy &gt; Search, and I turned the setting off:    But when I restart my machine, the setting is always reset to:    So how can I permanently disable it without it turning on again after a restart?  Information Update:  I have had a look at the post that this has been marked as a possible duplicate of, and I don't think that my question really is a duplicate of it, as the other question is asking about how to set it globally, and I am not, I am only wanting to set it for one user, so the fact that it is not global is not the problem, the problem is that it is not sticking for that one user, and just resetting to its default state after a restart. In fact, I don't want it to be set globally, and the answers from the other question only really explain how to do that.    OS Information:  Description:    Ubuntu 15.04 Release:    15.04   Package Information:  unity:   Installed: 7.3.2+15.04.20150420-0ubuntu1   Candidate: 7.3.2+15.04.20150420-0ubuntu1   Version table:  *** 7.3.2+15.04.20150420-0ubuntu1 0         500 http://gb.archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages         100 /var/lib/dpkg/status Equivalent Definitions of the Operator Norm Do AWS Reserved Instances need to be assigned to the instance? I have an RDS instance running of type db.t2.small.  I bought a reserved instance for 1 year of the same type, I paid the partial upfront rate.  Do I need to assign this subscription in some way to my existing instance to say 'This is the instance that is using the subscription' or does AWS just charge for the instance usage depending which instances you have running and whether an available subscription was active for it at the time which determines the running rate?  The reason that I ask is that I can't see any mention of the reduced rate on my AWS Billing area and it shows that I've used 17 hours of my reservation, but there isn't a row on my bill so far this month that indicates the new partial upfront rate that I should be charged for my instance. After the events on Miller's planet, it seems to come as a revelation to Brand that     Miller had only landed a couple hours ago, and died a few minutes ago.   The crew of the Endurance, even when they were back at NASA headquarters, had all the information they needed to figure out the time dilation and how long Miller had been on the planet. As such, they must have known that     Miller, even in the best case, would have only had a couple hours worth of data.   Why use all those resources (fuel and time) just for that? Is there an easy way to log all commands executed, including command line arguments? I am trying to find how to log a specific instantiation of rrdtool to see whether the path it is receiving is incorrect.  I know I could wrap the executable in a shell script that would log the parameters, but I was wondering if there was a more kernel-specific way to monitor for that, perhaps a filesystem callback that sees when a particular /proc/pid/exe matches a given binary? permission reporting on sudoers I'm looking for a good, consistent and easy way to do a report of sudoers permissions for every user and group on the system. For users, I want the report to include permissions granted via group membership. Should players get a surprise attack by interrupting a villain's speech? Just before confrontations with the "boss" of a dungeon or adventure, I often like to ham it up a bit and let the BBEG-of-the-week gloat a bit about how brilliant their plan is, or what a thorn in the side the PCs have been, or about how the PCs will never win, etc. Usually this is pretty brief, but it sets the tone of the encounter, and generally allows the players a window to say anything they wanted to say before we start the final combat. It also gives the players a chance to ask questions in case they missed something about the plot and they'd like it cleared up in-game.  Usually this goes just fine, and the players seem to generally like it, but sometimes a player who doesn't quite fit the narrative-focused mindset of the rest of the party gets a little restless and throws the first punch. Again, usually this doesn't happen, but occasionally it does.  If a player decides to do this in a given speech, how should I respond? I've defaulted to making everyone roll initiative when a player says they attack in a situation like this. After all, I don't really want to reward the players for attacking in the middle of dialogue, since I (and most of the players) find the dialogue to be really fun, and it mostly exists for the players' benefit, anyway. Besides, when the villain finally attacks, they don't get a surprise round -- their attack just means everyone has to roll initiative.  On the other hand, I feel like the player who threw the first punch might feel a little cheated in not getting a free shot off. They might be trying to have a cool moment of emulating Han Solo, blasting the enemy when they're caught off-guard gloating. Since I make them roll initiative, though, I rob them of this moment and Greedo might get the first shot off, anyway.  So, in this situation, should the player who fires first get a surprise round, or am I handling it correctly in making everyone roll initiative?  5e is the relevant edition, here. Quoting the rules is nice, but I'll take a well-reasoned argument for one way of playing or the other over a strictly RAW answer. I need to evaluate the limit without using l'Hopital's rule.  $$\lim_{x \to 0}{\frac{\sqrt{1+x\sin{x}}-\sqrt{\cos{2x}}}{\tan^{2}{\frac{x}{2}}}}$$