In JavaScript, why is "0" equal to false, but when tested by 'if' it is not false by itself?
Why does ('0' ? 'a' : 'b') behave different than ('0' == true ? 'a' : 'b')
Should we add more badges for asking questions? This proposal was superseded , which improves on the core concept.   Early on, there was a question about whether Stack Overflow should . At the time,  was:  Getting answers is reward enough for asking questions.  Even then, Stack Overflow was getting more than enough questions, so it didn't make much sense to incentivize more questions.  lists the badges that can be earned by asking quality questions. (There are at least 8). But looking at the list of recent , it looks more like a list of . These badges are difficult to come by in the first place, and they're much harder to earn on sites like  even though there are some  on that site. It turns out that . We , but we still need plenty of oysters. The Student bronze badge is awarded for the first upvoted1 question. There are no equivalent gold or silver badges. Therefore, I'd like to propose the following:  Student—Asked first question with score of 1 or more Sophomore—Asked 10 questions with score of 1 or more Socrates—Asked 50 questions with score of 1 or more  Do you have any suggestions of better names/levels?  To give you an idea of how many of these badges would be awarded, I wrote . The results2 for the original trilogy: users   gold silver bronze none    Site Name  ------- ---- ------ ------ ------- ---------  3000344 7127 67713  805778 2194566 Stack Overflow 235053  115  1698   53073  181980  Super User 156773  53   1191   40063  116710  Server Fault  The gold version on SO would be slightly more rare than  and more common than . Obviously, there would be fewer badges for smaller sites: 5545    1    18     917    4628    Philosophy 4032    4    41     802    3230    History  5663    3    28     917    4746    Parenting   Several older sites would get none at all: 5778    null 29     1063   4715    Quantitative Finance 7884    null 20     927    6957    Project Management 4333    null 17     1630   2703    Motor Vehicle Maintenance and Repair  These smaller sites get at most . I suspect that a gold or silver badge would encourage site regulars to increase that number without sacrificing quality. Certainly the requirement for those questions to stay in positive territory would prevent a person from flooding the site3 with terrible questions in order to get the badge.   1. The [original spec](https://blog.stackoverflow.com/2008/07/stack-overflow-badge-feedbac/) didn't consider voting at all for Student and Teacher.   2. Your results will vary from mine since I'm looking at slightly newer data. The bronze badge count also differs from the number of [Student](https://stackoverflow.com/help/badges/2/student) badges because the badge isn't revoked when a user's question is later downvoted or deleted.   3. There is a potential problem with cookie-cutter or variation-on-a-theme questions. However, I think the typical tools for closing and deleting questions will prevent people from gaming the system for these badges. "detached entity passed to persist error" with JPA/EJB code How can I make a script (or make some changes) to allow me to turn the screen off in Ubuntu (12.04) whenever I want, the way thevscreen can be turned off in Cellphones?  And how can I make a combination of keys (a shortcut) to execute that script?  I want to conserve power.  I've seen this question    but there is no hotkey for it.  Moreover, in the answer, it is said that there are many ways to accomplish this so I'd like to know more. Sufficient and necessary conditions to get an infinite fiber $g^{-1}(w)$ How do you do AppBar docking (to screen edge, like WinAmp) in WPF? Is there any complete guidance on doing AppBar docking (such as locking to the screen edge) in WPF? I understand there are InterOp calls that need to be made, but I'm looking for either a proof of concept based on a simple WPF form, or a componentized version that can be consumed.  Related resources: I understand that they force you to implement methods and such but what I cant understand is why you would want to use them. Can anybody give me a good example or explanation on why I would want to implement this. Which annotation should I use: @IdClass or @EmbeddedId The JPA (Java Persistence API) specification has 2 different ways to specify entity composite keys: @IdClass and @EmbeddedId.   I'm using both annotations on my mapped entities, but it turns out to be a big mess to people who aren't very familiar with JPA.   I want to adopt only one way to specify composite keys. Which one is really the best? Why? I am in the process of creating a LaTeX template for a conference submission, and up until now I've been working only with the anonymous submissions. Now I need to create the "camera-ready" version, which means I need to add authors to the document.   The template is based on article.cls, with some tweaks to meet the font and formatting specifications. The following image contains the examples from the Word template for the conference:    Basically, I need to be able to bold the author's name (which could I suppose be done manually in the document rather than in the template) and more importantly: divide the authors into two columns, with an optional centered last column with an odd number of authors. The font size of the author block corresponds to my \LARGE defined in the class file.  Are there any packages that facilitate this type of conditional formatting, either in a document, or in a .cls file? How can I use those packages to achieve the formatting I require? Presently, how much information can a quantum computer store, in how many qubits? What restrictions are there and how does it vary across realizations (efficiency of data storage, ease of reading and writing, etc)? The bevel depth (the radius of the tube) is set to 9cm but it actually isn't when compared to the background grid. This is is confirmed by importing it into sketchup and scaling it to the proper units it turns out the radius is only around 2.286cm. This problem only shows up on certain projects. What's wrong and how do I fix it?  (sorry that I can't upload the file, it's a long story) How do I get "restart" option in the shutdown menu in Unity? The dropdown menu I get when I click on the gear link in the top right corner only shows these options:   Lock Computer Logout Suspend Hibernate Shutdown   There is no "restart" or "reboot".  How can I make that option available?  Bonus question: Can I remove Hibernate, Lock, and Suspend? Let $X\sim B(n,p_h)$ and $Y\sim B(n,p_\ell)$ be two random variables following a respective binomial distribution, where $p_h&gt;p_\ell$. I want to show that  $$P(X\ge\alpha)\ge P(Y\ge\alpha),$$ for any $\alpha\in\{0,1,\dots,n\}$. In other words, I want to show  $$P(X\ge\alpha)=\sum_{i=\alpha}^{n}\binom{n}{i}p_h^i(1-p_h)^{n-i}\ge P(Y\ge\alpha)=\sum_{i=\alpha}^{n}\binom{n}{i}p_\ell^i(1-p_\ell)^{n-i}.$$  The statement to be proven is obviously true, but proving it is extremely difficult (at least for me). Can anyone give me some guidance on proving it?  It would be nice if someone can give an algebraic proof too, that is, show that  $$\sum_{i=\alpha}^{n}\binom{n}{i}p_h^i(1-p_h)^{n-i}\ge \sum_{i=\alpha}^{n}\binom{n}{i}p_\ell^i(1-p_\ell)^{n-i}.$$  Thank you very much! I am trying to display certain features in a shapefile-based layer using QGIS. I have found the subset function in the properties panel, which does exactly what i want, but is too tedious given that I have to manually sift through a large number of features. Is there a quicker way to do this?  I am using both shapefiles and postGIS best,  dietmar sit on the beach vs. sit at the beach How do I convert between big-endian and little-endian values in C++? How do I convert between big-endian and little-endian values in C++? For clarity, I have to translate binary data (double-precision floating point values and 32-bit and 64-bit integers) from one CPU architecture to another.  This doesn't involve networking, so ntoh() and similar functions won't work here.  Note: The answer I accepted applies directly to compilers I'm targeting (which is why I chose it).  However, there are other very good, more portable answers here. An "urgent" tag for questions that need answers within minutes Zorn's lemma and maximal ideals Let's consider two statements: Zorn's lemma and theorem about existence of maximal ideals in commutative ring with $1$.  It's easy to prove that Zorn's lemma implies existence of maximal ideals.  I wonder if the converse proposition is true, i. e., does existence of maximal ideals implies Zorn's lemma? My approach was to construct a ring structure on an ordered set which satisfies Zorn's lemma condition such that existence of maximal ideal implies existence of maximal element in the set, but I didn't succeed. Compound literals in MSVC Flag dialogue popup is stacked behind realtime-post-deleted-notification banners There is a little bug that becomes visible when a page contains realtime-post-deleted-notification banners (that's the CSS classname of these red banners appearing on answers which just got deleted, see screenshot below) and you try to open the flag dialogue above them:    Obviously, the dialogue appears below the banners, which it clearly should not do. It also has no input focus, trying to interact with the dialogue fails and either closes it (clicking outside of the red banners) or reloads the page (clicking on the red banners).  The cause for this is simply the z-index ordering in the site's CSS. Relevant CSS snippets:  .realtime-post-deleted-notification {     position: absolute;     text-align: center;     z-index: 100; }  .popup {     display: none;     padding: 15px;     position: absolute;     z-index: 10; }   So the fix for this minor bug would probably be to raise the z-index of the popup class to something greater than 100. How do I turn on workspaces? (Why do I only have one workspace?)