Unexpected output when using `select` I'm going through a tutorial on Ruby that explains the neat construction the select method provides. As per that, the three print statements in the following code (filtering out even numbers) should produce an identical output:  numbers = (1..20).to_a p numbers.select(&amp;:even?) p numbers.select { |x| x.even? } p numbers.select do |x| x.even? end   When I run it, though, I get:  [2, 4, 6, 8, 10, 12, 14, 16, 18, 20] [2, 4, 6, 8, 10, 12, 14, 16, 18, 20] #&lt;Enumerator: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]:select&gt;    Clearly, the third statement is off, even though it's impossible to tell why. It's just the curly braces replaced with the do-end block so it shouldn't change anything.  I'm on Ruby 2.5 so I guess either the tutorial was running some other version and something has changed? Or maybe there's some subtlety here that I'm not able to put my finger on.
Ruby block and unparenthesized arguments I extracted simple example:  require 'pp' x = 1..3 pp x.map do |i| {:value =&gt; i, :double =&gt; (i*2)} end pp x.map { |i| {:value =&gt; i, :double =&gt; (i*2)} }  pp(x.map do |i| {:value =&gt; i, :double =&gt; (i*2)} end) pp(x.map { |i| {:value =&gt; i, :double =&gt; (i*2)} })   I am wondering why first pp produces:  [1, 2, 3]   While all the oders are giving:  [{:value=&gt;1, :double=&gt;2}, {:value=&gt;2, :double=&gt;4}, {:value=&gt;3, :double=&gt;6}]   I assume it has something to do with operator precedence. Where can I find good explanation?
Is there any differences between      Try to do   And     Try doing   Thank you in advence. Since I have an onboard Intel graphics card, and a ATI Radeon display controller, I was wondering if I could switch between the two as my graphics in use, as I could in 14.04 LTS through ATI Catalyst?  16.04 LTS is using the onboard, and the hardware listing lists ATI as well as display controler, but not in use. Additional drivers don't provide anything.   So is AMDGPU being used, or is ATI disabled?  lspci:  00:02.0 VGA compatible controller: Intel Corporation Broadwell-U Integrated Graphics (rev 09) 04:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Venus XTX [Radeon HD 8890M / R9 M275X/M375X] (rev ff)   lspci -nnk | grep VGA -A1  00:02.0 VGA compatible controller [0300]: Intel Corporation Broadwell-U Integrated Graphics [8086:1616] (rev 09)     Subsystem: Lenovo Broadwell-U Integrated Graphics [17aa:3824] I'm trying to condense the space around examples in gb4e, with the goal of removing unnecessary whitespace around examples in an abstract. Here's what gb4e gives me now:    What I'd like is for the examples to essentially look like part of the running text, as follows:    In sum, I'd like to remove the left indent before the top level item numbers, remove the vertical space between examples, and remove the vertical space above and below the exe environment.  I think \vspace commands might work here, but it would get very tedious to do this every time, and I'd also like to do it the 'right' way.  (I also think linguex might be able to do this without too much fuss, but I'm used to using gb4e so I'd prefer to stick with it if there's a way to do this.)  MWE:  \documentclass{article}  \usepackage{gb4e} \usepackage{lipsum}  \begin{document}     \lipsum[1]     \begin{exe}         \ex Blah \begin{xlist}             \ex Blah             \ex Blah         \end{xlist}         \ex Blah         \ex Blah     \end{exe}     \lipsum[1] \end{document} Work out the type of c# application a class contained in a DLL is being used by Is there any way to know in C# the type of application that is running.  Windows Service ASP.NET Windows Form Console  I would like to react to the application type but cannot find a way to determine it. Why is it dangerous to initialize weights with zeros? Is there any simple example that demonstrates it? Please will someone explain what time dilation really is and how it occurs? There are lots of questions and answers going into how to calculate time dilation, but none that give an intuitive feel for how it happens. What causes "java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'command' available as request attribute"? Math contest integer triplet problem: $x + y + z + xy + yz + xz = xyz − 1$ Can any one help me with this?  Determine all integer triples $(x,y,z)$ such that $1 ≤ x ≤ y ≤ z$ and $x + y + z + xy + yz + xz = xyz − 1$.  I thought of Vieta's formula but don't let me lead you into a dead end. How do I recover my Google account (or Gmail) password or username? Number of points on a line in a finite projective plane I've been reading some proofs regarding finite projective planes of order n, and often they start out by assuming that each line contains n+1 points. Is this a fact that follows from the axioms for finite projective planes? Or does this relate to the order of the finite field being projected? (for example in the Fano plane, does the fact that each line contains 3 points follow from the fact that there are 3 elements {0,1,2} in Z_2?) I haven't been able to find a clear explanation of this (clearly I do not yet have a solid understanding of how such planes are constructed). If someone could enlighten me that would be excellent. I used to edit the startup script for the GDM (/etc/gdm/Init/Default) to permanently change my display resolution.   How can I do this with LigthDM in Ubuntu Oneiric? Proving a basis for inner product space V when $||e_j-v_j||< \frac{1}{\sqrt{n}}$. Suppose $(e_1,e_2,...,e_n)$ is an orthonormal basis of the inner product space $V$ and $v_1,v_2,...,v_n$ are vectors of $V$ such that $$||e_j-v_j||&lt; \frac{1}{\sqrt{n}}$$ for each $j \in \left\{1,2,...,n \right \}$. Prove that $(v_1,v_2,...,v_n)$ is a basis of $V$.  I am completely lost and just starting to learn about inner product spaces. Could someone provide a proof with the explanation of how you got there? Picking a $\delta$ for a convenient $\varepsilon$? How do I give a villager trades with custom NBT tags I want to enable telnet on Windows 10.  I only see a telnet client but not a telnet server.  There is a web page telling me to open server manager and do a lot of stuff.  But, I don't have a server manager.  Please help!  I want to enable telnet. How to check if Receiver is registered in Android? How to use Class in Java? There's a good discussion of Generics and what they really do behind the scenes over at , so we all know that Vector&lt;int[]&gt; is a vector of integer arrays, and HashTable&lt;String, Person&gt; is a table of whose keys are strings and values Persons.  However, what stumps me is the usage of Class&lt;&gt;.  The java class Class is supposed to also take a template name, (or so I'm being told by the yellow underline in eclipse).  I don't understand what I should put in there.  The whole point of the Class object is when you don't fully have the information about an object, for reflection and such.  Why does it make me specify which class the Class object will hold?  I clearly don't know, or I wouldn't be using the Class object, I would use the specific one. AIC versus Likelihood Ratio Test in Model Variable Selection The software that I am currently using to build a model compares a "current run" model to a "reference model" and reports (where applicable) both a chi-squared p-value based on likelihood ratio tests and AIC values for each model.  I know that one advantage of AIC over likelihood ratio tests is that AIC can be compared on non-nested models.  However, I am not aware of any reason why AIC couldn't or shouldn't be compared on nested models.  In my model, when comparing nested models for variable selection, I'm finding several cases where the likelihood ratio test and the AIC comparison are suggesting opposite conclusions.  Since both are based on likelihood calculations, I'm struggling to interpret these results.  However the documentation of my software says (without explaining),   "If two models are nested (i.e. one is a sub-set of the other) then the more usual chi-squared test is the most appropriate to use. If the models are not nested, the AIC can be used..."  Can anyone elaborate on this and/or explain why AIC is not as helpful as likelihood ratio tests on nested models? Why is $c+q$ still a primitive root modulo $q$? Question: Let $p$ and $q$ be distinct odd prime numbers.  By considering primitive roots, we need to show $\exists c\in\mathbb{Z}$ with the property that:  $\bullet$ $c^n\equiv 1\pmod{p}$ whenever $n$ is a multiple of $p-1$, and   $\bullet$ whenever $n$ is not divisible by $q-1$, then $c^n\not\equiv 1\pmod{q}$  I am only interested with the beginning of this answer.  Answer: We let $c$ be a primitive root modulo $q$.  We are going to use Fermat's little theorem so we need $(c,p)=1$  If $(c,p)\neq 1$, then we have $p\mid c$, but then we have $(c+q, p)=1$  and since $c+q$ is a primitive root modulo $q$, we can replace $c$ with $c+q$ for $(c,p)=1$ for using Fermat's little theorem.  I understand the general method and argument, but...  Contention: Why is $c+q$ still a primitive root modulo $q$?  When is this generally true? Is there an identity for when things remain a primitive root?  Why is $(c+q)^{\phi(q)}\equiv 1\pmod{q}$? A maximal ideal among those avoiding a multiplicative set is prime Let $S$ be a multiplicatively closed subset of a ring $R$, and let $I$ be an ideal of $R$ which is maximal among ideals disjoint from $S$. Show that $I$ is prime. If $R$ is an integral domain, explain briefly how one may construct a field $F$ together with a ring homomorphism $R\to F$. Deduce that if $R$ is an arbitrary ring, $I$ an ideal of $R$, and $S$ a multiplicatively closed subset disjoint from $I$, then there exists a ring homomorphism $f\colon R\to F$, where $F$ is a field, such that $f(x)=0$ for all $x\in I$ and $f(y)\neq 0$ for all $y\in S$.   [You may assume that if $T$ is a multiplicatively closed subset of a ring, and $0\notin T$, then there exists an ideal which is maximal among ideals disjoint from $T$.]  Here is a question I need to answer. For the first part I can show if $x, y$ are not in $I$ then nor does $xy$. The second part is just the field of fractions.   For the third part, I think I need to find an ideal $J$ containing $I$ such $J$ is prime, so that $R/J$ is an integral domain, and use the second part. To find $J$ prime, I think as suggested by the hint, I should go for a maximal ideal disjoint from $S$ containing $I$, but how can I do that?