I am trying a simple program in which I have taken a float number and comparing it with fixed numbers 0.5,0.7, 0.8 each time the output is different than expected. My code is  #include&lt;stdio.h&gt; int main*() {     float a = 0.5;     if (a &gt; 0.5)         printf("greater");     else if (a &lt; 0.5)         printf("less");     else if (a == 0.5)         printf("equal");  }   Now the crazy part is when I execute it with 0.5 value of a and replacing 0.5 with 0.7 as in code it prints equal, if with 0.7 then less and if with 0.8 then it prints greater. I can't figure it out. Can anybody explain this Please? I'm using codeblocks 16.01 for this and tried in Turbo C++ as well.
Consider the following code:   0.1 + 0.2 == 0.3  -&gt;  false   0.1 + 0.2         -&gt;  0.30000000000000004   Why do these inaccuracies happen?
How do I avoid checking for updates for a specific module? In a current project I have had to patch the life out of a few modules (node hierarchy, workbench access and a few more). These modules are now absolutely perfect for the project's needs and are very unlikely to break with future updates to core.  That being said, when the app is handed over the clients will have full (user 1) access to the system and will therefore be warned when these modules have available updates. And they will update them, no matter how many times I beg them not to (oh how easy life would be without clients!).  Is there a way (perhaps in the modules' .info files) to persuade the update manager not to check for updates for these modules?  EDIT  I'm aware of the project status url key that's available for the .info file so I guess I could set that to a non-existent URL but I'd much rather do this in a clean way if possible. I'd like to create a Windows bootable USB stick, but I don't have a Windows machine with me at the moment to do so. How could I achieve the same using Ubuntu? Eisenstein Criterion with a twist As opposed to the generic polynomial form for utilizing the Eisenstein Criterion ($a_nx^n+a_{n-1}x^{n-1}+\dots+a_0\in\mathbb{Z}[x]$ is irreducible in $\mathbb{Q}$) how do we prove that if $p$ is a prime, $x^{p-1}+x^{p-2}+\dots+x+1$ is irreducible over $\mathbb{Q}$? FTPS versus SFTP versus SCP My homework has this problem:     Prove that there exist irrational numbers $x$ and $y$ such that $x +  y$ is rational.   There is an easy solution that I found on mathbitsnotebook.com:     \begin{align} \left(2+6\sqrt{7}\right) + \left(-6\sqrt{7}\right) = 2.\end{align}   Can we prove the same without using subtraction? How to add a vertical line to a plot Understand PAM and NSS In the last days I have set up some Linux system with LDAP authentication and everything works fine, but there's still something I can't really understand regarding NSS and PAM, also after a lot of research. Citing:  NSS allows administrators to specify a list of sources where authentication files, host names and other information will be stored and searched for  and  PAM is a set of libraries that provide a configurable authentication platform for applications and the underlying operating system  What I don't understand is how PAM and NSS work and interact together. In  the architecture is explained pretty well: I configure PAM to use pam_ldap for LDAP accounts and pam_unix for local accounts, then I configure nsswitch.conf to fetch information from local files and LDAP. If I have understood correctly LDAP is used twice: first by pam_ldap and then by NSS which is itself called from pam_unix. Is that right? Is LDAP really used twice? But why do I need to configure both NSS and PAM? My explanation is that PAM performs different tasks than NSS and it is used by other programs. But, then, it should be possible to use only NSS or only PAM, as I have read in . So I experimented a bit and I have first tried to delete LDAP from the nsswitch.conf (and the authentication stopped to work as if only pam_ldap is not enough to do the job). Then I re-enabled LDAP in NSS and I deleted it from the PAM configuration (this time everything worked fine, as if pam_ldap is useless and NSS is enough to authenticate a user). Is there anyone who can help me to clarify this? Many thanks in advance. UPDATE I've just tried something now. I removed again all the pam_ldap entries in all pam configuration fields and I have also removed shadow: ldap from nsswitch.conf. As now in all the system there are only the lines: passwd: ldap files and group: ldap files in nsswitch.conf. Well... the login with LDAP users works perfectly, those two lines (plus /etc/ldap.conf) are enough to configure LDAP auth. From my knowledge PAM in independent from NSS, but my tests showed it's not. So I ask myself is it possible to completely disable NSS and use only PAM? Is there any tweak to bring back emblems in Nautilus? A word or short phrase for 'better in every way'? When we're comparing two or more things, there are times when we have to weigh the advantages or disadvantages of each one.  There are other times when one of the things is better for every way in which it's being judged, and the final decision is not based upon trade-offs.  I know that I've heard a phrase for this (I want to say it was two words), but I've had no luck in remembering it.    I don't think 'clearly superior' or 'clear winner' quite fit the bill, as that might still suggest that the disadvantages are significantly outweighed by the advantages.  Is there such a phrase, or even a single word, that would convey this meaning without using idioms? If an elephant can apply 250N force and a rabbit can apply 25N force , and if they are pulling each other , then elephant will pull with 250N force and according to newtons third law the rabbit should also pull the elephant with 250N force.then from where do the rabbit got the extra 225N i.e.(250-25=225) force??? can anyone please explain. How can I copy/transfer games via external hard drive? I have successfully transferred "Killing Floor" from my brother's laptop to my own via external hard drive. The problem, now that I have all the files, is that I don't know how to launch the game through Steam. All I did was copy files from his Laptop to the hard drive, then from the hard drive to my laptop, then I put the files in the "Steamapps" folder under "Steam" in my laptops hard drive. So the question is, how do I start up the game through Steam? Script to remove Yellow(or any color) from layers panel? The question is raised from the viewpoint of a foreign language learner.  -ed is known to be added to a verb to mean past tense or past participle, but some phrases like four-legged animals, winged birds, are in the form of noun+-ed, why is it so? What is the logic behind such a structure? Teenagers find an ancient lizard creature in stasis and accompany him on adventures to an undersea city When I was a kid, I read a book (likely from the '60s) about a pair of kids who find an ancient lizard/fish man inside a cave. The cave has been recently exposed by an earthquake and the creature is inside a super technologically advanced stasis chamber. I think this creature's name is something like "Sslaa". He takes the kids on a quest to find his lost underwater city.  They end up finding the city, which is still populated by creatures like himself and protected from the ocean above by an immense diamond dome. Eventually, Sslaa has to drive an advanced mining vehicle deep into the crust of the earth, presumably to prevent his city's destruction by an impeding magma flow or other seismic event.  For extra obscurity bonus points, I could swear I managed to find this book on Google several years ago, and was shocked to learn that it had originally been written in German, and then translated to English.  Does anyone out there recognize this one? In Fringe's season 1, the episode  (1x13) shows how  travels on VertusAir flight 718. We witness how he develops some strange symptoms, withdraws into a lavatory and transforms into a porcupine-like monster.  At the end of season 3, Peter "switches" the timeline (changing the past and making the present continue in a different timeline henceforth) from blue- to orange-verse. Various statements throughout the 4th season indicate time (the date) was not reset; Olivia and Walter have been working on Fringe cases for some three years etc. - hence it is safe to say that season 4 plays 3 years after season 1.  Then, in the episode  (4x16), the events from 1x13 happen again, up to the point of Bowman's transformation, which this time doesn't happen (not aboard the plane, anyway). As far as I can tell, great care was taken to exactly recreate the events from the season 1 episode, including hiring the same actors to play the flight attendants once again ( and ), so obviously this is supposed to be the same event with slight changes.  Peter, as well as Olivia - who is in the process of regaining her memories from the blue-verse -, remember the events from 1x13 and note the difference that Bowman's transformation happened later this time, implying that in the orange-verse, everything related to flight 718 played out the same way, except for the small difference that the transformation happened a bit later.  BUT ... all of this happened 3 years later!! Is there any explanation for this?  How unlikely is it that in the orange-verse timeline, Marshall Bowman is on the very same flight with the very same flight attendants 3 years after the same would have happened in the blue-verse? Mind you, this is not a "small change" in the course of events while mostly everything else stays the same.  So, why did Peter and Olivia realize the transformation happened a tad later in the orange-verse timeline, but were not baffled by the fact that essentially the same events as in the blue-verse happened, but three years later?  EDIT: Not only the flight and the flight attendants were the same in both episodes. The passenger next to Bowman was the same, an elderly lady played by  both times, as well. Moreover, the transcripts of  and  reveal that the dialogue between Bowman, the passenger next to him, and the cabin crew is the same down to the lines of text until the moment of transformation.  Interestingly, the announcement by the captain in the beginning seems to be different - starting the inflight movie + selling headsets vs. circling before beginning the final descent + selling snacks. On the other hand, this could be presumed to be a slight retcon, as in 4x16, it was crucial for the plot that the plane would be close to landing, and starting the inflight movie would not make much sense right before landing. Let $1, \omega, \dots, \omega^{n-1}$ be the roots of the equation $z^n-1=0$, so that the roots form a regular $n$-gon in the complex plane. I would like to calculate $$ \prod_{j \ne k} (\omega^j - \omega^k)$$  where the product runs over all $j \ne k$ with $0 \le j,k &lt; n$.    My attempt so far  Noting that if $k-j = d$ then $\omega^j - \omega^k = \omega^j(1-\omega^d)$, I can re-write the product as $$ \prod_{d=1}^{\lfloor n/2 \rfloor} \omega^{n(n-1)/2}(1-\omega^d)^n$$  I thought this would be useful but it hasn't led me anywhere.  Alternatively I could exploit the symmetry $\overline{1-\omega^d} = 1-\omega^{n-d}$ somehow, so that the terms in the product are of the form $|1-\omega^d|^2$. I tried this and ended up with a product which looked like $$\prod_{j=0}^{n-1} |1 - \omega^j|^n $$  (with awkward multiplicative powers of $-1$ left out). This appears to be useful, but calculating it explicitly is proving harder than I'd have thought.  The answer I'm expecting to find is something like $n^n$.    My motivation for this comes from Galois theory. I'm trying to calculate the discriminant of the polynomial $X^n+pX+q$. I know that it must be of the form $ap^n+bq^{n-1}$ for some $a,b \in \mathbb{Z}$, and putting $p=0,q=-1$, the polynomial becomes $X^n-1$. This has roots $1, \omega, \dots, \omega^{n-1}$, so that $(-1)^{n-1}b$ is (a multiple of) the product you see above. An expression for $a$ can be found similarly by setting $p=-1,q=0$. How can I send mail from an iPhone application I want to send an email from my iPhone application. I have heard that the iOS SDK doesn't have an email API. I don't want to use the following code because it will exit my application:  NSString *url = [NSString stringWithString: @"mailto:foo@example.com?cc=bar@example.com&amp;subject=Greetings%20from%20Cupertino!&amp;body=Wish%20you%20were%20here!"]; [[UIApplication sharedApplication] openURL: [NSURL URLWithString: url]];   So how can I send an email from my app? A coworker and I are locked in a debate over the value of SEO keywords in the URL of a page. She wants to change all the filenames of the HTML pages of a fencing company so they look like residential-home-chicago.html, contact-chicago-contractor.html, and so on. She is convinced that because Google highlights keywords in URLs in search results, that means that putting keywords here is more valuable.  My position is that these do not improve SEO, since Google doesn't seem to give keywords in the URL any more weight than keywords in the body of the page, and . In the meantime, they make it harder for me to find the pages I want when its time to edit them, and the site as a whole looks cheap and spammy.   suggests to me that yes, keywords in URLs are useful, but not superior, and that they are more useful for human readability than search engine rankings.  I'm looking for authoritative sources that support either position, not blog articles from SEO optimization companies trying to promote themselves. Why does a light object appear lighter in your peripheral vision when it's dark? So, I am not sure I can reproduce it via images, but the steps are:  1) At night, open a window and have a look at the surface of the earth  2) Suppose there's an object that reflects a tiny amount of light  3) When you actually try to focus your eyes at this object, you either don't see anything (depends on the amount of light it reflects) or you can hardly see it  4) When you focus your eyes on something that is 3-10 metres away, you can easily see this object with your ambient vision. Not the details, but it seems that it reflects more light.   Why does it happen? LaTeX template for typesetting a novel I'd like to use LaTeX to typeset a novel. Could you recommend me any template?  What I mean is a template (some .tex file) where I can include my chapterN.tex files (mainly plain text) and get a pretty good design with zero work :)