We have two sets: set No.1 and set No.2 as in this picture:    The observer is fixed to set No.1 . He sees set No.1 motionless and observes set No. 2 approaching with velocity 100,000 m/s.  Each set has one lamp and two, so called, touchers. The ends of the lamp on set No. 1 is connected directly to the touchers. One end of the lamp on set No. 2 is connected to one end of a battery and the other end of the battery is connected to the other toucher.  Set No. 2 is approaching set No. 1 so that each toucher in each set will be touched twice by the touchers of the other set. There is no friction between touchers and nothing else slowing down the movements.  The observer on set No. 1 observes the distance between touchers in each set 10 meters. It seems the lamp on Set No. 1 will light up. But the lamp on set No. 2 will not light up. And an observer on No. 2 will be be sure that the energy of the battery is not used because there has been no closed circuit.  My question: Will set No. 2 slow down?  Note 1: the numbers in the picture is what an observer on set No. 1 calculates.  Note 2: ignore friction, interaction of wires (including magnetic field. electric field, etc), and so on. Only consider the energy that a lamp needs to light up and if it may slow down the movement to get the energy. Do not ignore the mass of the sets so  slowing down needs or produces energy.  Note 3: The experiment is designed such that an observer in set No. 1 will see the circuit is closed (because its touchers will be connected to the battery of set No. 2 simultaneously). But for an observer in set No. 2 the circuit will remain open. This is the main situation the experiment tries to create. So  yu can change the numbers (like 10 and 100000) if they are not good.  Note 4: The core of the question is the circuit part of which is moving. I think if lamp 1 lights up it cannot use the battery. It can only use the kinetic energy of set No. 2. This is why I'm asking if set No. 2 will slow down.  Note 5: the touchers are not like a sharp point. So electricity will have enough time to turn on the lamps.    explanation: It seems from comments I have to explain the situation more carefully:   For set No. 1 the distance between (the centers of) the touchers in both sets is 10. So lamp 1 will feel the ends of a battery connected to its ends. So lamp 1 has to light up. Because the circuit is closed for it. For set No. 2 the distances between (the centers of) the touchers in both sets are not the same. So the battery will never feel a closed circuit. So for sure, it will not release energy at all. the lamp of set No. 1 will light up and the battery will not be used. So what is the source of energy which helps the lamp to turn on? There remains no other source of energy except the kinetic energy stored in set No. 2 (for Set. 1). So I think the lamp will hinder the motion of set No. 2 to gain some energy to light up. So it will slow down set No. 2.   Is this correct? if no how do you explain (1), (2) and (3) all holding together?
We have two sets: set No.1 and set No.2 as in this picture:   The observer is fixed to set No.1 . He sees set No.1 motionless and observes set No. 2 approaching with velocity 100,000 m/s.   Each set has one lamp and two, so called, touchers. Each set is designed so that if both touchers are touched simultaneously the lamp is turned on otherwise it remains off.  Set No. 2 is approaching set No. 1 so that each toucher in each set will be touched twice by the touchers of the other set.  The observer on set No. 1 observes the distance between touchers in each set 10 meters. He thinks the lamps on set No. 1 will be turned on because touchers in it will be touched simultaneously.  My question: Will the lamp on set No. 2 be turned on? How if an electrical current flowing from one toucher in a set to the other proves simultaneous touching?
I think it would be super if, in my LaTeX editor, I could click on the name of package...  \usepackage{blob}   ... and the corresponding style file, blob.sty, would be opened.  Do any LaTeX editors have this feature? I mainly use Aquamacs/AucTeX myself, but am interested in other editors too. I reckon it would be mildly challenging to implement, because blob.sty might be    in the current working directory,  in the system texmf directory, or  in the user's texmf directory. Why is brace expansion not supported? Do I have to do any configuration to start brace expansion? When I run mkdir {1..10}, it just creates a dir naming {1..10}. The canonical way to return multiple values in languages that support it is often . Option: Using a tuple Consider this trivial example: def f(x):   y0 = x + 1   y1 = x * 3   y2 = y0 ** y3   return (y0, y1, y2)  However, this quickly gets problematic as the number of values returned increases. What if you want to return four or five values? Sure, you could keep tupling them, but it gets easy to forget which value is where. It's also rather ugly to unpack them wherever you want to receive them. Option: Using a dictionary The next logical step seems to be to introduce some sort of 'record notation'. In Python, the obvious way to do this is by means of a dict. Consider the following: def g(x):   y0 = x + 1   y1 = x * 3   y2 = y0 ** y3   return {'y0': y0, 'y1': y1 ,'y2': y2}  (Just to be clear, y0, y1, and y2 are just meant as abstract identifiers. As pointed out, in practice you'd use meaningful identifiers.) Now, we have a mechanism whereby we can project out a particular member of the returned object. For example, result['y0']  Option: Using a class However, there is another option. We could instead return a specialized structure. I've framed this in the context of Python, but I'm sure it applies to other languages as well. Indeed, if you were working in C this might very well be your only option. Here goes: class ReturnValue:   def __init__(self, y0, y1, y2):      self.y0 = y0      self.y1 = y1      self.y2 = y2  def g(x):   y0 = x + 1   y1 = x * 3   y2 = y0 ** y3   return ReturnValue(y0, y1, y2)  In Python the previous two are perhaps very similar in terms of plumbing - after all { y0, y1, y2 } just end up being entries in the internal __dict__ of the ReturnValue. There is one additional feature provided by Python though for tiny objects, the __slots__ attribute. The class could be expressed as: class ReturnValue(object):   __slots__ = [&quot;y0&quot;, &quot;y1&quot;, &quot;y2&quot;]   def __init__(self, y0, y1, y2):      self.y0 = y0      self.y1 = y1      self.y2 = y2  From the :  The __slots__ declaration takes a sequence of instance variables and reserves just enough space in each instance to hold a value for each variable. Space is saved because __dict__ is not created for each instance.  Option: Using a  (Python 3.7+) Using Python 3.7's new dataclasses, return a class with automatically added special methods, typing and other useful tools: @dataclass class Returnvalue:     y0: int     y1: float     y3: int  def total_cost(x):     y0 = x + 1     y1 = x * 3     y2 = y0 ** y3     return ReturnValue(y0, y1, y2)  Option: Using a list Another suggestion which I'd overlooked comes from Bill the Lizard: def h(x):   result = [x + 1]   result.append(x * 3)   result.append(y0 ** y3)   return result  This is my least favorite method though. I suppose I'm tainted by exposure to Haskell, but the idea of mixed-type lists has always felt uncomfortable to me. In this particular example the list is -not- mixed type, but it conceivably could be. A list used in this way really doesn't gain anything with respect to the tuple as far as I can tell. The only real difference between lists and tuples in Python is that lists are , whereas tuples are not. I personally tend to carry over the conventions from functional programming: use lists for any number of elements of the same type, and tuples for a fixed number of elements of predetermined types. Question After the lengthy preamble, comes the inevitable question. Which method (do you think) is best? MATLAB/OCTAVE Extracting elements from different sized vectors in a cell array Reverse / invert a dictionary mapping Given a dictionary like so:  my_map = {'a': 1, 'b': 2}   How can one invert this map to get:  inv_map = {1: 'a', 2: 'b'} Please help me to answer the following problem:  Let $f(x)=x^3-3x-5\in\mathbb{Q}[x]$  Thanks Ubuntu 16.04 Jan 3 2018 update causing screen/access issues Yesterday (Jan. 3, 2018), I installed an OS update (Ubuntu 16.04), using the Software Center. My system isn't working correctly now. When my mouse rolls over the Launch bar, it disappears, then any open window disappears, leaving me with only the desktop screensaver showing. I can't even shut the computer off using the settings button on the top.  I went into the Terminal and attempted to fix it using the following commands:  sudo apt-get dist-upgrade sudo apt-get autoremove   But I'm still having the same problem.  I have reinstalled Ubuntu 16.04 and when I accepted the update on install had the same problem.  I have reinstalled it a second time but have not done an OS update and everything seems to be working fine.    Found another user with the same problem:    Is it possible that the Meltdown security update is at fault?  I've read the update has been issued for 64-bit x86 architecture ();  I'm running a 32 bit i386 architecture.  Could that be an issue and is there a way to correct it? Cannot edit post meta fields with rest API I am using python to send POST requests to /wp-json/wp/v2/&lt; post type &gt;/&lt; post id &gt;. This successfully updates standard fields such as title, content etc. However I am unable to make any changes to the custom theme meta fields structured like &quot;post_meta&quot;:{     &quot;meta_1&quot;:[],      .      .      &quot;meta_n&quot;:[] }.  When I make a GET request to the same endpoint, the post meta fields are returned so I don't think this is an issue with the fields not being registered? Thanks How to filter a dictionary according to an arbitrary condition function? How can I monitor my Samba traffic? Decide if the series converges and prove it using comparison test: $\sum_{k=1}^{\infty}\frac{1}{2k+3}$ Decide if the series converges and prove it using comparison test:   $\sum_{k=1}^{\infty}\frac{1}{2k+3}$   $$\frac{1}{2k+3} &lt;\frac{1}{2k}&lt;\frac{1}{k}$$  and since $\sum_{k=1}^{\infty}\frac{1}{k}$ diverges (we have defined that in our readings, so I can claim it here), the complete series will diverge, too.  Did I do everything correctly? What makes me feel a bit unsure is that there is no "$\leq$" sign anywhere and when I look up the comparison test on the internet, I don't see any "&lt;" or ">" in the definition.  Is it correct anyway? Common screen resolution? I'm developing a web application which is quite information heavy. This means that every pixel available in the screen for display helps a lot, to avoid the UI looking too cluttered and to display relevant data.  I was wondering: which is the "common" screen resolution? Years ago it was something like 1024&times;768, but nowadays it must be something much higher. I can't rely on what I use as I'm a developer and I probably have bigger screens and resolution than the average Joe user.  So, where can I find the currently recommended resolution for webapps? I am trying to figure out how I create a downloadable PDF template of a wedding invitation design that my customers can edit themselves. They will be approx 2 fonts used on each template and the customer will need to be able to edit all text themselves.  e.g. change their names, wedding date, location etc. etc.  Basically I want to be able to sell an editable downloadable template.  So I will need to lock the artwork and "open" the text so they can edit the text only.  If you think of something like this image. That has artwork that I want to be uneditable and then has text that I want the customer to be able to edit and print out themselves at home etc. Windows 10 64-bit requirements: Does my CPU support CMPXCHG16b, PrefetchW and LAHF/SAHF? I'm currently trying to find out whether or not it would be a good idea to update my slightly dated notebook (Windows 7, 64-bit) to Windows 10. The problem is that Microsoft states in their  that to use the 64-bit version of Windows 10, a processor which supports CMPXCHG16b, PrefetchW and LAHF/SAHF is needed. I know that my processor is 64-bit (Intel Core i5-2430M @ 2.40 GHz) but I don't know how to find out whether it supports CMPXCHG16b, PrefetchW and LAHF/SAHF, and I have no idea what these mean.  I tried using Google and got no results that made sense to me, only some comparison of my i5 and a similar AMD processor. I also checked Intel's ARK website. If somebody could point me to where I can get more info I would be really grateful. When is "Y" a vowel? In school we are taught the vowels: A, E, I, O, U, and sometimes Y.    got me thinking about when the letter Y is considered to be a vowel.  I understand (perhaps incorrectly) that in words like bicycle and why it is a vowel. What about the word voyeur (as mentioned in the XKCD alt-text)?   If I've got this backwards, and Y is almost always a vowel, how can I tell when it is a consonant? Thinking back, I don't think my education ever covered the difference between them, we just memorized which letters were which. Let me add or change edit summary during edit window (grace period) Why would a company like Apple be buying back its own shares? What is the reason that a company like AAPL is buying back its own shares? Does it have too much cash and it doesn't know what to do with it? So it is returning the cash back to investors? $$e^{i} = e^{i2\pi/2\pi} = (e^{2\pi i})^{1/(2\pi)} = 1^{1/(2\pi )} = 1$$  Obviously, one of my algebraic manipulations is not valid. How to establish the following identities without the help of calculus:  For positive integer $n, $ $$\sum_{1\le r\le n}\frac{(-1)^{r-1}\binom nr}r=\sum_{1\le r\le n}\frac1r $$  and  $$\sum_{0\le r\le n}\frac{(-1)^r\binom nr}{4r+1}=\frac{4^n\cdot  n!}{1\cdot5\cdot9\cdots(4n+1)}$$ Prove that for $ 0&lt;x&lt; \pi $, $$ \quad S_n(x) = \sin x + \frac{ \sin3x }{3} + ... + \frac{ \sin((2n-1)x) }{2n-1} &gt;0 \quad \forall n = 1,2,... $$  Having trouble with this problem. This is an olympiad-style question, so an answer that doesn't use calculus or analysis would be preferred. A possible approach is induction, but for this we need to find a function in terms of $n$ and $x$ so that we can actually use the inductive step. If anyone has any ideas they would be appreciated.  If you really want to go down the calculus route (at this point I don't mind), then $ S_n' (x) = \cos x + \cos 3x + ... +\cos((2n-1)x) $ , which you can find a closed form for, but I don't know how useful that is.