I'm an experienced developer but a Ruby newbie.  I was reading this thread  and learned some good stuff about when to use braces and when to use do .. end blocks.  One of the tips was use do .. end when you are after side effects and {} when you are concerned about the return value. So experimenting with some of the examples in the enumerator tutorial I'm going through: irb(main):001:0&gt; my_array = [1, 2] =&gt; [1, 2] irb(main):002:0&gt; my_array.each {|num| num *= 2; puts &quot;The new number is #{num}.&quot;} The new number is 2. The new number is 4. =&gt; [1, 2] irb(main):003:0&gt; my_array.each do |num| num *= 2; puts &quot;The new number is #{num}.&quot; end The new number is 2. The new number is 4. =&gt; [1, 2]  Hang on.  I thought the do..end block returns an enumerator object?  It looks like an array.  Let's check: irb(main):004:0&gt; puts my_array.each {|num| num *= 2; puts &quot;The new number is #{num}.&quot;} The new number is 2. The new number is 4. 1 2 =&gt; nil irb(main):005:0&gt; puts my_array.each do |num| num *= 2; puts &quot;The new number is #{num}.&quot; end #&lt;Enumerator:0x000055967e53ac40&gt; =&gt; nil  Okay, it is an enumerator. But what happened to the output of the puts call in the loop on line 005? The {} had the expected side effect but not the do..end block, which seems to violate that rule of thumb. What happened to my &quot;The new number is #{num}.&quot; strings?
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?
Why is it called the Millennium Falcon? I'm particularly interested in how the "Millennium" part pertains to the ship itself. It wouldn't hurt to explain the "Falcon" part either though. Combinations of selecting $n$ objects with $k$ different types Suppose that I am buying cakes for a party. There are $k$ different types and I intend to buy a total of $n$ cakes. How many different combinations of cakes could I possibly bring to the party? What's the difference between lists and tuples? What's the difference?  What are the advantages / disadvantages of tuples / lists? How many complements are in "I ask you to clean the room"? How many complements are needed in the below sentence?     "I ask you to clean the room."   This sentence above has one complement or two complements? It seems "See votes, expandable user card" goes on a second line on the activity page of the user profile resulting in a pretty bad look:    You can see it live on  (though of course that may change any day now depending on their rep-growth).  I'm using Chrome Version 67.0.3396.99 (Official Build) (64-bit) Continuously Differentiable Curves in $\mathbb{R}^{d}$ and their Lebesgue Measure Show that the image of the curve $\Gamma\in\mathscr{C}^{1}\left([a,b]\to\mathbb{R}^{d}\right)$ has d-dimensional Lebesgue measure zero (of course, $d\geq2$).  This can be proved using the absolute continuity of $\Gamma'$ (since $[a,b]$ is compact and $\Gamma'$ is assumed continuous, hence in $L^{1}([a,b])$) together with the fundamental theorem of calculus to obtain an $\epsilon$-small cover of $\Gamma$ by balls.  But I am trying to prove this using more elementary means (i.e. without integration).  Intuitively, since $\Gamma$ is smooth, we ought to (for fine enough partitions) be able to cover $\Gamma$ by boxes which arise from its tangent line.  And by taking the partition of $[a,b]$ to be finer and finer, the "tangent box" cover ought to also get smaller and smaller.  More rigorously, the vector-version of the mean value theorem can be applied: $$|\Gamma(t_{i-1})-\Gamma(t_{i})|\leq(t_{i}-t_{i-1})|\Gamma'(t_{i}^{\star})|\leq M_{i}\Delta t$$ where $t_{i}^{\star}\in(t_{i-1},t_{i})$ and $M_{i}=\sup_{t\in[t_{i-1},t_{i}]}|\Gamma'(t)|$ which exists and is finite since $\Gamma'$ is continuous.  But to me, it's not quite clear how to rigorously construct a cover by boxes from here.  NOTE:  In the proof I mentioned (using integration), essentially you sum the left hand side over all partition intervals of uniform length $\delta$ (which depends on the $\Gamma'$), and "integrate" the right hand side.  Actually, to be more specific, for each $\epsilon&gt;0$ there exists a $\delta&gt;0$ such that $||P||&lt;\delta$ implies $\int_{t_{i-1}}^{t_{i}}|\Gamma'(t)|dt&lt;\epsilon$ (e.g. absolute continuity).  This allows you to define numbers $\epsilon_{i}=\sup_{t,\bar{t}\in[t_{i-1},t_{i}]}|\Gamma(t)-\Gamma(\bar{t})|\leq\epsilon$ so that $\sum_{i=1}^{\#P}\epsilon_{i}\leq||\Gamma'||_{L^{1}([a,b])}$.  Then you can use these $\epsilon_{i}$ to put balls at each point $\Gamma(t_{i})$ of radius (say) $2\epsilon_{i}$, thus giving you an $\epsilon$-small cover.  Again though, this is harder to establish without integration theory. MonoTouch.Dialog: How to set limit of number of characters for EntryElement Why is the notation $\frac{\partial f}{\partial x}$ used? Should you set all the objects to null (Nothing in VB.NET) once you have finished with them?   I understand that in .NET it is essential to dispose of any instances of objects that implement the IDisposable interface to release some resources although the object can still be something after it is disposed (hence the isDisposed property in forms), so I assume it can still reside in memory or at least in part?  I also know that when an object goes out of scope it is then marked for collection ready for the next pass of the garbage collector (although this may take time).  So with this in mind will setting it to null speed up the system releasing the memory as it does not have to work out that it is no longer in scope and are they any bad side effects?  MSDN articles never do this in examples and currently I do this as I cannot  see the harm. However I have come across a mixture of opinions so any comments are useful. Since the Stack Exchange sites run on one clock, and a clock that is not common to most of us (such as those of us in the US), can we display a clock with the site time (UTC) displayed somewhere on every page, such as at the bottom with the other text?  That way we are more aware of when the days turn over, and ecetera...  close votes, delete votes, flags, and normal votes would also benefit from this as well (thanks @Grace Note!)...    What do you guys think? yea or nay? thoughts? Why is it impossible to override a getter-only property and add a setter? Why is the following C# code not allowed:  public abstract class BaseClass {     public abstract int Bar { get;} }  public class ConcreteClass : BaseClass {     public override int Bar     {         get { return 0; }         set {}     } }      CS0546 'ConcreteClass.Bar.set': cannot override because 'BaseClass.Bar' does not have an overridable set accessor Simple explanation to the induction from the slowly changing $\vec B$ of a solenoid in the region of $0$ magnetic field Rotate (group) objects outwards on spherical particle system? I'm trying to create a mini-world with (among other things) trees on it. I have created an icosphere, modeled several trees and put them in a group. Next I added a particle system to the sphere, and chose hair. In the "render" section I selected Group and the name of the group I created. As expected the trees show up but they're all oriented in the same direction, while I would like them to pop up just like the default hairs do (along the normal of the individual faces). I tried fiddling with all kinds of settings, had them oriented in all kind of ways (e.g. towards the "north pole"). I also tried using the emitter instead of hair setting but without success as well. What is the geometric meaning of the determinant of a matrix? I know that "The determinant of a matrix represents the area of ​​a rectangle." Perhaps this phrase is imprecise, but I would like to know something more, please.  Thank you very much. I have made a fancy title page using titleformat and tikz, but I now face the following problem. The \chaptertitlename command returns \chaptername or \appendixname. I would like to spread the letters of the text returned by \chaptertitlename to a given length.  For example I would like to be able to call: \mycommand{\chaptertitlename}{3cm} in order to space the letters of \chaptertitlename on a total length of 3cm. How to do that ?  EDIT: This example illustrates a nearly working thing:  \documentclass[11pt]{article} \usepackage{fontspec} \newcommand{\spreadletters}[2]{\makebox[#2][s]{#1}}  \begin{document} \spreadletters{m y w o r d}{3cm} \end{document}   How to convert myword to m y w o r d ?  EDIT 2: Can someone explain me why the first work and not the second one (and how to make it work) ?  \documentclass[11pt]{book} \usepackage{fontspec} \usepackage{seqsplit} \usepackage[explicit]{titlesec}  \newcommand{\spreadletters}[2]{\makebox[#2][s]{\seqsplit{#1}}}  \begin{document} \chapter{First} \spreadletters{myword}{10cm} \linebreak % This is working \spreadletters{\chaptertitlename}{10cm} % This is not working \end{document} How to write this boolean expression using only NOR gates? I'm having some trouble understanding how I can convert a boolean expression to a NOR-gate only expression.   What I'm working with looks like \$T = A B' C + A' B C' + A B\$. How would I go into implementing it with NOR gates? In D&amp;D 5e &quot;&quot; is a condition that can affect a creature during the first round of combat, only until the end of their turn:  [... T]he GM compares the Dexterity (Stealth) checks of anyone Hiding with the passive Wisdom (Perception) score of each creature on the opposing side. Any character or monster that doesn’t notice a threat is surprised at the start of the encounter. If you’re surprised, you can’t move or take an action on your first turn of the combat, and you can’t take a reaction until that turn ends. A member of a group can be surprised even if the other members aren’t. - PHB 189  Does the action that causes the surprise count as part of the round, though? Say Renee, a rogue, achieves a stealth check of 22, easily beating an orc sentry's passive perception. She sneaks directly behind him and stabs him in the back. Surely the orc isn't surprised at all until the dagger hits him (or if Renee misses, she fumbles around behind him or something). What I think it really boils down to in the end is: when is initiative rolled? If (in our example) initiative is rolled before Renee's attack hits (or misses) how can we justify the orc recovering from his surprise before the action that triggered said surprise even occurs, should he roll better than Renee on his initiative? I'd like to go with initiative is rolled immediately following whatever event began the encounter (which could be an attack, but is likely to often be something else wherever surprise isn't intended), but I can't find any documentation to support this stance.  Why Does Anyone Care? There are many reasons you might want someone to be surprised while you're attacking - in this example if Renee is over L3 (and took the Assassin archetype) she'll get 'Assassinate' if the orc is surprised, and 'Death Strike' if she's over L17. That's a lot of potential extra damage!  that if the orc is surprised, Renee will be able to retreat and hide, without having to take the disengage action as her bonus action to avoid an attack of opportunity. Of course, there's no way for her to know whether the orc is surprised or not at that stage, so trying this would be a bit of a gamble... Two blue arrows at top right of icons On some icons I am seeing a two blue arrows at the top the right pointing towards each other. I first noticed it on the icons on folders which I archived which happened randomly. I archived the folder and the text went blue as expected, then when I went to the folder again the text was black and the folder icon has these arrows. When I just recently installed Office 2007, I noticed the same arrows on the icons for the programs. OS: Windows 10 Pro 64-bit (the latest update: 1115) Application: Microsoft Office 2007 suite and file explorer How do I use F3 to get my coordinates when my laptop makes F3 a special key? Can you take the same feat multiple times?