Regex: match multiline expression
Regex to get string between curly braces
I replaced a non-protected receptacle with a GFCI type and now my circuit tester trips the GFCI as soon as it is plugged in.  The receptacle tested fine before replacement, ground, neutral, hot, etc.  I've double checked the hot/neutral/ground connections.  I've also tried it with the downstream load disconnected.   The GFCI trips the moment I plug in my circuit tester (before pushing the test button).  Otherwise things check out OK.  I can plug in a power tool without it tripping.  Also, the integrated test/reset button work correctly.   I've read that the integrated test button is the only one that truly matters. Is this correct or should I be concerned? I'm sure a home inspector will red flag this if their tester has the same result.  Update  My tester is by "Commercial Electric".  The tester is one of the palm sized three prong type with three leds to indicate the condition of the circuit and a button on top to test GFCI. It's new from the local box store. How do I close a tkinter window? How do I end a Tkinter program? Let's say I have this code:  from Tkinter import *  def quit():     # code to exit  root = Tk() Button(root, text="Quit", command=quit).pack() root.mainloop()   How should I define the quit function to exit my application? Is there a simple way to add exFAT support? When I insert a USB stick or camera flash card I get the following error:  unknown filesystem type 'exfat'   Is there a simple way to add exFAT support to Ubuntu without kernel patching? Cross tabulation of two categorical variables: recommended techniques Compact vs Mirrorless - why pick one over another? What would be a reason for one to pick the compact (whatever it'd be P&amp;S or something more advanced) over mirrorless compact system camera  ?  Right now market is quite confusing — we have huge market of tiny-sensor compacts, we have mirrorless that use sensors in a size of these from P&amp;S cameras (Nikon 1 being notable example), we have compacts with sensors bigger than most popular mirrorless system (Canon G1X vs m4/3), we have lot of APS-C sensor mirrorless which are matched by some of the compacts (Fuji X100 being most notable example, but even Leica has its X2),  and to make it even more confusing — Sony released RX1 with full frame sensor, beating crap out of every mirrorless on a market.  So what are your arguments to pick compact over a mirrorless?  Why are they better, what's the reason behind logic of companies like Fujifilm which at the same time offers P&amp;S and X-mount mirrorless using same sensor size? Automatically rename files when they are placed in a specific directory Is it possible to automatically rename a file when it's placed in a specific directory?  For example I have a directory named "dir0".I move or copy a file named "file1" to "dir0".then "file1" should rename to "file1_{current timestamp}" Unmarshal a single element list fails How to pack a sphere with cubes? I read a little bit about , but I imagine the problem changes drastically when trying to fill a sphere with unit cubes. For example, how many unit cubes could one fit into a sphere of radius five? Clearly the upper limit would be $\left \lfloor \frac{4}{3}\pi \cdot 5^3 \right \rfloor$, but I imagine there will be plenty more empty space than just a small fraction of a cube. Novel about a man who has his car stolen and is cryogenically frozen with his cat? So this is a bit of a memory game of my behalf, but I'm trying to remember the name of a (presumably) Sci-Fi novel with only a recollection of the following:   A man owns a (yellow?) car parked outside his house along with a cat The car goes missing or is stolen The man decides to be cryogenically frozen for 75 (fairly sure, could be 50?) years along with his cat (I might be muddling up novels but I'm sure there was a cat...?) He takes a walk along the street X years in the future when he wakes up and the currency he has in his pocket is now worthless   I don't think I got that far into the book and all the above happened relatively early.  I read it about 10 years ago and at a guess, it's an 80's novel - all of the above details might be inaccurate, but I'm certain about the cryogenic freezing and the currency aspects.  I'd be surprised if this one gets anywhere! Problem about the definition of Euclidean domain I need to define a new command to create a squiggle arrow with some text on it. Something similar to what \xrightarrow command produces but with wiggly arrows as in \rightsquigarrow. The length of the arrow should automatically be adjusted to fit the text above it and I do not know how to handle this part in TikZ. Any ideas would be much appreciated. NullReferenceException in Unity My table is:     id home datetime player resource     1 10 04/03/2009 john 399   2 11 04/03/2009 juliet 244   5 12 04/03/2009 borat 555   3 10 03/03/2009 john 300   4 11 03/03/2009 juliet 200   6 12 03/03/2009 borat 500   7 13 24/12/2008 borat 600   8 13 01/01/2009 borat 700     I need to select each distinct home holding the maximum value of datetime. Result would be:     id home datetime player resource     1 10 04/03/2009 john 399   2 11 04/03/2009 juliet 244   5 12 04/03/2009 borat 555   8 13 01/01/2009 borat 700     I have tried: -- 1 ..by the MySQL manual:   SELECT DISTINCT   home,   id,   datetime AS dt,   player,   resource FROM topten t1 WHERE datetime = (SELECT   MAX(t2.datetime) FROM topten t2 GROUP BY home) GROUP BY datetime ORDER BY datetime DESC  Doesn't work. Result-set has 130 rows although database holds 187. Result includes some duplicates of home. -- 2 ..join  SELECT   s1.id,   s1.home,   s1.datetime,   s1.player,   s1.resource FROM topten s1 JOIN (SELECT   id,   MAX(datetime) AS dt FROM topten GROUP BY id) AS s2   ON s1.id = s2.id ORDER BY datetime   Nope. Gives all the records. -- 3 ..something exotic:   With various results. The problem:  Assume $f: \mathbb{R} \rightarrow \mathbb{R}$ satisfies $|f(t) - f(x)| \leq |t - x|^2$ for all $t, x$. Prove $f$ is constant.  I believe I have some intuition about why this is the case; i.e. if $t$ and $x$ are very close, ($|t - x| = \epsilon$), then $\sqrt{\epsilon}$ will converge to 0, so $|f(t) - f(x)|$ will also converge to zero if you keep taking $t$ and $x$ closer and closer to each other. However, how do I formalize this argument? Thanks. This question arises when I try to describe my itinerary to ticket service in the UK. Take for example, I plan to buy a ticket from A to B. B is the terminal. How to say its counter part A? I cannot find a proper term. I have to say "I will depart from A" or "I plan to go to B from A". Or I even use "departure place" to refer to B. I'll be generous and say it might be reasonable to assume that nature would tend to minimize, or maybe even maximize, the integral over time of $T-V$.  Okay, fine.  You write down the action functional, require that it be a minimum (or maximum), and arrive at the Euler-Lagrange equations.  Great.  But now you want these Euler-Lagrange equations to not just be derivable from the Principle of Least Action, but you want it to be equivalent to the Principle of Least Action.  After thinking about it for awhile, you realize that this implies that the Principle of Least Action isn't really the Principle of Least Action at all:  it's the "Principle of Stationary Action".  Maybe this is just me, but as generous as I may be, I will not grant you that it is "natural" to assume that nature tends to choose the path that is stationary point of the action functional.  Not to mention, it isn't even obvious that there is such a path, or if there is one, that it is unique.  But the problems don't stop there.  Even if you grant the "Principle of Stationary Action" as fundamentally and universally true, you realize that not all the equations of motions that you would like to have are derivable from this if you restrict yourself to a Lagrangian of the form $T-V$.  As far as I can tell, from here it's a matter of playing around until you get a Lagrangian that produces the equations of motion you want.  From my (perhaps naive point of view), there is nothing at all particularly natural (although I will admit, it is quite useful) about the formulation of classical mechanics this way.  Of course, this wouldn't be such a big deal if these classical ideas stayed with the classical physics, but these ideas are absolutely fundamental to how we think about things as modern as quantum field theory.  Could someone please convince me that there is something natural about the choice of the Lagrangian formulation of classical mechanics (I don't mean in comparison with the Hamiltonian formulation; I mean period), and in fact, that it is so natural that we would not even dare abandon these ideas? How to get a record from within custom visualforce page? Identify a book with a social engineering theme I originally read this book in the mid- to late '70s.   The premise was a bureaucracy whose job it was to manipulate events in human history by making the smallest possible change that would effect the desired outcome. Not time cops in the sense of going after law breakers.  The intent was to maintain a policy of non-interference as much as possible but when interference was warranted then to make the least possible change and to do so invisibly.  For example, they might take someone's keys off the dresser and put them just out of sight underneath the dresser where they plausibly might have fallen.  The subject would never know of the manipulation but would then be delayed getting out of the house and the ripples grew from there to avert a war or otherwise affect events on a large scale.  After reading that, whenever I would lose something - especially in an improbable way such as dropping a screw at my feet and then finding it on the other side of the room half an hour later - I would take some consolation in the thought that I had just averted some global catastrophe.  I was pretty scatterbrained as a kid (we call that ADHD nowadays) so I experienced this a lot.  Given that I've spent so much time pondering the ideas from the book, I'd love to re-read it. How to force restart an iPhone with broken home button Earlier today I was on my iPhone and it randomly froze so I turned it off. When I went to unlock it it wouldn't move. I couldn't unlock it or tap anything. So now I can only stay on the lock screen. I read on the Apple website that I should "force restart" it by pressing my home button and power button at the same time. The problem is my home button is stuck and doesn't work. What should I do? Aligning equations within multline