enum Color  {    GREY = 4294967294,    RED   }   RED is assigned the largest value a 4 byte unsigned int can hold. When I use sizeof to know the size of my enum Color (sizeof (Color)), it prints 4. If I assign -1 to RED, the sizeof prints 8. Does that mean an enum is by default unsigned?
Are C++ enums signed or unsigned? And by extension is it safe to validate an input by checking that it is &lt;= your max value, and leave out >= your min value (assuming you started at 0 and incremented by 1)?
I have an Excel file containing data collected over many years as latitude and longitude coordinates for archaeological sites. How can I import it into QGIS as a new layer? How to Set Firefox 4 to only store History for a set period of time, i.e. one day? How do I pre-install Ubuntu for someone (OEM install)? Why am I seeing a bomb icon on my files and folders in Ubuntu? I just read this very insightful post , where the author stated that the variance of $\hat\beta$ is:  $$\text{var}(\hat\beta) = \sigma^2(\textbf{X}^\prime \textbf{X})^{-1}.$$  I couldn't figure out why it is like this. Can anyone elaborate a bit? Why can't I do foreach (var Item in DataTable.Rows)? I've tried other solutions, but none of them are specific to my setup. I just started using the new Linux subsystem featured in the recent Windows 10 update. I'm using WAMP x64 v3.0.6, and have successfully cloned my website and got it up and running. At the root of the Linux subsystem, I installed Drush globally with Composer, using the directions given on the .  Typing drush status returns the following when I run it in my default directory:  Drupal version         :  7.50  Site URI               :  http://default  Database driver        :  mysql  Database hostname      :  localhost  Database port          :  Database username      :  root  Database name          :  aerosphere  PHP executable         :  /usr/bin/php  PHP configuration      :  /etc/php5/cli/php.ini  PHP OS                 :  Linux  Drush script           :  /home/bob/.composer/vendor/drush/drush/drush.php  Drush version          :  7.1.0  Drush temp directory   :  /tmp  Drush configuration    :  Drush alias files      :  Drupal root            :  /mnt/c/wamp64/www/drupal-7.50  Site path              :  sites/default   But, as mentioned in the title, drush cc all returns No Drupal site found, only 'drush' cache was cleared.[warning] I assume it has something to do with adding a path to the .bashrc, but I don't know what to add. Any tips would be greatly appreciated!  My question is different from "", they're on a Mac and using MAMP, and I'm using WAMP on Windows. I've tried the solutions offered on that post, but the issue has not been resolved.  I'm obviously having issues connecting to MySQL as I get this when I run mysql command:     The program 'mysql' can be found in the following packages: * mysql-client-core-5.5 * mariadb-client-core-5.5 * mysql-client-core-5.6 * percona-xtradb-cluster-client-5.5      Try: sudo apt-get install .   So I've added these lines to my .bashrc file:  PATH="$HOME/.composer/vendor/bin:$PATH" export PATH="/mnt/c/wamp64/mysql/mysql5.7.14/bin:$PATH"   The top line was added to get drush working. I've checked multiple times, and I have the path correctly set, but it's still not working. How can I calculate magnification ratio I get by reversing a lens? I am looking for a way to mathematically determine the maximum magnification ratio that is possible/practical to achieve by reverse mounting a non-macro lens, prior to purchasing the lens.     See related questions: If every pair of congruence equations admits solutions, then the entire system admits solutions Let a system of three linear congruence equations in integers be given;      \begin{cases}x\equiv b_1\mod c_1\\ x\equiv b_2\mod c_2\\ x\equiv b_3\mod c_3\\ \end{cases}   with $c_1,c_2,c_3\in\mathbb Z_{+}$. Show that, if every pair of congruence equations admits solutions, then the entire system admits solutions.    Now, if every pairs admits solutions, then for example $b_1\equiv b_2\equiv a\mod \gcd(c_1,c_2)$ for some $a$ then;   $x-a\equiv b_1-a\mod c_1$  $x-a\equiv b_2-a\mod c_2$  replacing $x$ by $x':=\frac{x-y}{\gcd(c_1,c_2)}$, we obtain:  $x'\equiv b_1'\mod c_1'$  $x'\equiv b_2'\mod c_2'$  and since $\gcd(c_1,c_2)=1$ by Chinese Remainder Theorem we have a unique solution $\mod{c_1'c_2'}$, so $x\equiv (\gcd(c_1,c_2)x'+a)\mod{\operatorname{lcm(c_1',c_2')}}\quad(1)$  We can do it with another pair (take $2$nd and $3$rd, since we know that such a pair admits solutions;  $x\equiv(\gcd(c_2,c_3)x''+a')\mod{\operatorname{lcm(c_2',c_3')}}\quad(2)$  Now how can I show that for the pair $(1)$ and $(2)$ also solutions exist ? What happens to water level when ice XII melts? There exists this famous idea that if all floating icebergs melt, water level will stay the same (because the water replaced by ice is the volume of the melted ice). Now,   Is this always so, if you allow more exotic forms of ice (take e.g. ice XII with density 1.29) ? Is this always so on/in earth ?   EDIT:  I was looking a possibility that you would have water as a liquid that contains pieces of water as a solid. No land is assumed to exist here. "Ice" is always floating or sunken(if possible).  To reformulate, can Ice be sunken in water in any circumstance (pressure, temperature)?  EDIT 2:  Wikipedia: "Ice VII has a density of about 1.65 g cm-3 (at 2.5 GPa and 25°C)".   And water as an incompressible liquid has a density of 1 g cm-3. This means that ice VII is at the bottom of the "lake" and will expand when it melts. Is this true? And are there environments in earth where this (or similar) can happen? What makes a field not groupable I'm trying to use an aggregate query, but one of the fields I want to group by is not groupable (saw it in the soql error and then verified groupable=false in the metadata).  It's just a number field that holds an integer (number 2,0 in salesforce field spec-speak).  Is there a trick to make it groupable?  Any way around this problem? I don't want to write hundreds of lines of code just to average a list by this field. Date comparison : which date format? Is it possible to copy text from image? Is there any tools to copy text from video's or images? How to plot periodic function's graphic? I have a question that bothers me after reading a part of the big book of rules :).  It's about the rule 717, illegal actions.     717.1. If a player realizes that he or she can’t legally take an action after starting to do so, the entire action is reversed and any payments already made are canceled. No abilities trigger and no effects apply as a result of an undone action. If the action was casting a spell, the spell returns to the zone it came from. The player may also reverse any legal mana abilities activated while making the illegal play, unless mana from them or from any triggered mana abilities they triggered was spent on another mana ability that wasn’t reversed. Players may not reverse actions that moved cards to a library, moved cards from a library to any zone other than the stack, or caused a library to be shuffled.   For example, player A plays a .     As an additional cost to cast Goblin Grenade, sacrifice a Goblin.   Goblin Grenade deals 5 damage to target creature or player.   It goes on the stack. Player B gains priority and casts a  on the only goblin of Player A.     Destroy target nonartifact, nonblack creature. It can't be regenerated.   The terror goes on the stack. Then both players agree to resolve the stack. The terror kills the last goblin standing and then the Goblin Grenade can't be cast because of the additional cost which can't be paid. So in my opinion that leaves two possibilities:   The Goblin Grenade returns to the zone it was previously from (the hand of Player A) The Goblin Grenade becomes illegal and gets countered, so it goes to the graveyard   Based on rule 717 I think it goes back to the hand but I'm not quite sure. :) How would you implement an LRU cache in Java? Please don't say EHCache or OSCache, etc. Assume for purposes of this question that I want to implement my own using just the SDK (learning by doing). Given that the cache will be used in a multithreaded environment, which datastructures would you use? I've already implemented one using  and , but I'm curious if any of the new concurrent collections would be better candidates.  UPDATE: I was just reading through  when I found this nugget:     If you need constant-time access and want to maintain the insertion order, you can't do better than a LinkedHashMap, a truly wonderful data structure. The only way it could possibly be more wonderful is if there were a concurrent version. But alas.   I was thinking almost exactly the same thing before I went with the LinkedHashMap + Collections#synchronizedMap implementation I mentioned above. Nice to know I hadn't just overlooked something.  Based on the answers so far, it sounds like my best bet for a highly concurrent LRU would be to extend  using some of the same logic that LinkedHashMap uses. How to remove "phone style" Gnome swipe to unlock How is it the Voyagers are a few seconds closer to Earth than earlier? The  of March 01, 2013 put it's distance at 14 hrs 04 mins 23 secs of light-travel time from Earth. A  (earlier today) tweet says it is 14 hrs 04 mins 22 secs of light-travel time from Earth. An  tweet put it still further out at 14 hrs 04 mins 25 secs of light-travel time.  The Voyager 2 tweets on Voyager 1's proximity to Earth too has reduced similarly to  earlier today from  reported on Feb 28 2013  It could quite simply be a typo ... If not a typo then my curiosity is piqued; I was under the impression the Voyagers are outbound from the Solar System now without any major in-system activities now.   How is it the Voyagers are closer to Earth than before? Parsing JSON with Unix tools I've been searching for a quantum algorithm to compute the the inner product between two $n$-qubit quantum states, namely $\langle\phi|\psi\rangle$, which is in general a complex number. One can get $|\langle\phi|\psi\rangle|^2$ through thte SWAP test for multiple qubits, but this is not really the inner product as the information of the real and imaginary parts are lost. I came across this , which claims that the task can be done by simply using CZ gates. I'm not sure if I am mistaken, but it seems to me that such a circuit works for computational basis states, but not for general quantum states. Could somebody help me confirm if this is actually the case? If the above algorithm doesn't work for general quantum states, what algorithm would you suggest?