I am new to Python (30 minutes). I want to know how to identify whether the number is an integer or a string, and proceed with the result using if else.  My code is:  number = input("enter the number \n")  integer = int(number)  if integer.is_integer():      if integer &gt; 0:         print("positive ", integer)     elif integer &lt; 0:         print("Negative ", integer)     else:         print("Number is", integer) else:     print("Enter integer value")
I have a Python function that takes a numeric argument that must be an integer in order for it behave correctly. What is the preferred way of verifying this in Python?  My first reaction is to do something like this:  def isInteger(n):     return int(n) == n   But I can't help thinking that this is 1) expensive 2) ugly and 3) subject to the tender mercies of machine epsilon.   Does Python provide any native means of type checking variables? Or is this considered to be a violation of the language's dynamically typed design?  EDIT: since a number of people have asked - the application in question works with IPv4 prefixes, sourcing data from flat text files. If any input is parsed into a float, that record should be viewed as malformed and ignored.
How can I make a surface look wet in cycles? I am trying to recreate a wet road with lights reflecting off of it. I started by making the object glossy but this did not give a very realistic look  I think I need to increase the specularity of the reflection to make it look more real but I can't find this option anywhere in cycles. Also what other techniques can I use to make a surface look wet in blender? I can link directly due to licening but  is what I am trying to recreate. How can one show there is no holomorphic function $f$ on the open unit disc $\mathbb{D}$ such that it extends continuously to $\frac{1}{z}$ on $\partial\mathbb{D}$? I mean $f$ takes value $\frac{1}{z}$ when $|z|=1$ and continuous here.  Thank you. A lot of people recommend to use the maximum node for glass setup, but I can't find that node. Nothing comes up when I search for it.  Where do I find it? Changing units of measurement in a simple regression model (Ubuntu/Linux)"find" command gives different results based on quotation marks I was using   find -iname *prib*   and getting only one result "./prib09jack.pdf" with   find -iname "*prib*"    I get many more results that I was looking for such as  ./Dir1/PRIB09/prib09jackTFF1.pdf   and many more, but why did it matter that the quotation marks were around "prib"?   Best. Lie Algebra of U(N) and SO(N) While revising for exams, I came across a question where at the end of it, we had to determine whether the below series was convergent or divergent:  $$\sum_{n=1}^\infty \frac{(-1)^n}{n(2+(-1)^n)} $$  Unfortunately, other than knowing that as the series $ \sum_{n=1}^\infty \frac{(-1)^n}{n} $ converges, this series will most likely converge as the $(2 + (-1)^n)$ terms are bounded, I can't see a way of using this to determine if it converges or not.  Here's a list of some of the other ideas I've tried, which don't seem to get me anywhere:   Generalising the series - By this, I mean replacing the $-1$ for $z$ and then try and use the ratio test to see whether $-1$ is inside or outside or on the boundary of the circle of convergence - however, when I did so, I believe that the ratio test is inconclusive for all values of $|z|$, which while disappointing, is an interesting feature of the series.  - While this is usually a nice tool to use for when dealing with awkward sums, I can't see any good choice of sequences $ (a_n) $ and $(b_n)$ to choose to use. Summing consecutive terms - By this, I mean evaluating the series by looking at the sum of    $$\sum_{k=1}^\infty \frac{(-1)^{2k}}{2k(2+(-1)^{2k})} + \frac{(-1)^{2k-1}}{(2k-1)(2+(-1)^{2k-1})}$$  $$ \Rightarrow \sum_{k=1}^\infty \frac{1}{2k} - \frac{1}{3(2k-1)}$$  $\quad$ but then as we are left with parts of the harmonic series this doesn't seem like a nice way to  $\quad$evaluate it.  Other than that, I'm completely out of ideas, so any new ones (or ways to make my old ones work) would be much appreciated! C#: code error while changing the active directory user's password Recent fluid-mechanical experiments by the groups of Couder in Paris and Bush at MIT, mimic a surprisingly wide range of quantum effects. The essential ingredient of these fluid-mechanical systems is a background or pilot-wave that guides the droplets.  Now, surprisingly, a simple analysis of a Bell-type experiment shows that, in the presence of a background field, one of the premises of the Bell inequality, namely measurement independence (MI), is violated. See the paper  (available ). Therefore such classical droplet experiments could violate a Bell inequality. More importantly, if this analysis is correct, background-based hidden-variable theories are admissible, even if they are local (in the sense of ‘involving only (sub)luminal interactions’) and even if they are compatible with free will.   My question: to me the analysis seems fully sound, but maybe there is still an unphysical hypothesis that slipped in ? I have an exercise found on a list but I didn't know how to proceed. Please, any tips?  Let $X$ be a connected subset of a connected metric space $M$. Show that for each connected component $C$ of $M\setminus X$ that $M\setminus C$ is connected. Splitting of prime ideals in algebraic extensions I'm reading Algebraic Number Theory by Jurgen Neukirch. I have some problems with some of the exercises in Section 9 of Chapter 1.  They are:  1) If $L / K$ is a Galois extension of algebraic number fields with non-cyclic Galois group, then there are at most finitely many non-split prime ideals of $K$.  2) Let $L / K$ be a finite (not necessarily Galois) extension of algebraic number fields and $N / K$ the normal closure of $L / K$. Show that a prime ideal $p$ of $K$ is totally split in $L$ if and only if it is totally split in $N$.  I have worked on them for a long time but couldn't get any idea of it.   Can you please help? Thank you! Book where girl can grow nails and might be a thief I'll apologize for this being a vague description up front. I read a book about 8 years ago about a girl who could grow her nails into essentially razorblades or long enough that they could be used as razors. She travels to a city and either becomes an assassin or a thief (pretty sure it was a thief). I vaguely remember the book opening with her being chased by a mob. At some point during her thief training she realizes that the layout of the city is the key to some important plot device. I think she was given some scroll or cryptic image and then during her training she realizes that the layout of the city correlates to it.  Although I did read this 8 years ago I'm pretty sure the book was at least 5-10 years older than that, maybe even more because it was my mom who gave it to me and she said had read it when she was younger. The dust cover was missing when I read it so I have no description for the cover. I do remember that the author was male. It was a fantasy setting and there may have been vampires involved at some point but that part of my recollection of the book is even fuzzier than what I've already described. I've tried googling for this book but obviously my description is fairly vague. I will gladly answer any follow up questions that I can to try and help figure this out because it has been bothering me for years. Scientists have found mammoth blood, and are planning to   How does one go from having its blood to a full blown living mammoth? Is it possible?    Why does it matter if the blood is frozen or not? Suppose one found dinosaur blood, could one clone a dinsosaur (as in say 'Jurassic Park')? Problems with pie charts There seems to be in increasing discussion about pie charts.   The main arguments against it seem to be:   Area is perceived with less power than length. Pie charts have very low data-point-to-pixel ratio   However, I think they can be somehow useful when portraying proportions. I agree to use a table in most cases but when you are writing a business report and you've just included hundreds of tables why not having a pie chart?  I'm curious about what the community thinks about this topic. Further references are welcome.  I include a couple of links:         In order to conclude this question I decided to build an example of pie-chart vs waffle-chart. For every $n \in \mathbb{N}$, find a function $f$ which is differentiable $n$ times at $0$, but not $n+1$ times. For every $n \in \mathbb{N}$, (in this problem $\mathbb{N}$ starts at $n = 1$) find a function $f$ which is differentiable $n$ times at $0$, but not $n+1$ times.  The function I chose is the following:  $$ f_n(x) = \begin{cases} x^{n+1} &amp;\mbox{if } x \le 0\\ x^{n} &amp;\mbox{if } x &gt; 0 \end{cases} $$  Now I can't think of the best way to prove that $f$ is differentiable  $n$ times at $0$ but not $n+1$ times. How to write zero in the unary numeral system In the decimal system: $...-3, -2, -1, 0, 1, 2, 3...$ In the binary system: $...-11, -10, -1, 0, 1, 10, 11...$ In the unary system: $-111, -11, -1, \text{ ??? }, 1, 11, 111...$   I was only able to find a related question but none with an answer so far: During the 'Hard Answers' Thieves Guild quest, Karliah asked me to meet her at the Ragged Flagon.  However, it seems that she doesn't show up at the rendezvous point.  Where do I find her? Can I apply for a Schengen visa of the first port of entry or does it need to be the country of the longest duration? I'm planning to travel to the Netherlands, Spain and Bulgaria. My longest stay will probably be in Bulgaria. Now, Bulgaria doesn't issue a Schengen visa but allows people with a Schengen visa to visit. Which visa should I be applying for? Bulgarian Visa AND Schengen visa or just the Schengen visa for Netherlands or Spain? VirtualBox 5.0.40 crashes the whole host since update to kernel 4.13.0-26-generic I received the updates through normal Software Updater, 10-Jan-2018. After this VirtualBox would not start any VM, complaining about dkms and asking to make modprobe vboxdrv. Following the advice I reinstalled virtualbox-dkms with:  sudo apt-get --reinstall install virtualbox-dkms   After this and a reboot I tried to start a VM which freezed the whole machine and a hard reboot was necessary.  Is there a way to make VirtualBox work with the latest kernels?  EDIT:  As suggested by N0rbert, the command:  apt-cache policy `dpkg -S VirtualBox | head -n1 | sed -e 's/://g' | awk '{print $1}'`  gives:   virtualbox-qt:   Installed: 5.0.40-dfsg-0ubuntu1.16.04.2   Candidate: 5.0.40-dfsg-0ubuntu1.16.04.2   Version table:  *** 5.0.40-dfsg-0ubuntu1.16.04.2 500         500 http://fr.archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages         100 /var/lib/dpkg/status      5.0.18-dfsg-2build1 500         500 http://fr.archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages   EDIT (on 29-Mar-2018): Issue is resolved for me, with the Ubuntu Ubdate from today. I have seen that it had some virtualbox-updates, therefore I tried to boot with the most recent kernel again. Then I had to run  sudo apt-get --reinstall install virtualbox-dkms  And after this my virtual machines in VirtualBox started working without crashing the whole computer. Finally! Short example of regular expression converted to a state machine?