What is the most concise script to list the missing ones in a digit sequence?
How to print the name of missing files in a folder?
Triangle Inequality of the Cartesian product with Max function Let $(X,d)$ be a metric space.  Define $$d'((x,y),(z,w))=max\{d(x,z),d(y,w)\}.$$   I'm trying to prove the triangle inequality for this, but really don't have a clue how.  Any tips or suggestions would be greatly appreciated! I'm looking into a restful design and would like to use the HTTP methods (POST, GET, ...) and HTTP headers as much as possible. I already found out that the HTTP methods PUT and DELETE are not supported from the browser.  Now I'm looking to get different representations of the same resource and would like to do this by changing the Accept header of the request. Depending on this Accept header, the server can serve a different view on the same resource.  Problem is that I didn't find a way to tell my browser to change this header.   The &lt;a..&gt; tag has a , that can have a mime type, looked like a good candidate but the header was still the browser default (in Firefox it can be changed in about:config with the network.http.accept.default key). Why don't we include $\rho g h$ in a hydraulic jack below? Consider a hydraulic jack with massless pistons as follows.    The famous equation for this system is   $$ \frac{F_1}{A_1}=\frac{F_2}{A_2} $$  My question is why isn't the equation as follows?  $$ \frac{F_1}{A_1}=\frac{F_2}{A_2} + \rho g h $$  It is based on  my understanding that any points in the same horizontal line have the same pressure.  Could you spot my misconception? This question has been asked before, at least twice by people who were trying to cheat on the PROMYS Europe 2020 Application, and once in a  because the OP showed no effort. I haven't been able to solve it, so I'm going to to ask it again.  PROMYS applications have closed, and I hope the effort shown below is enough to keep this question from being closed.     The Mathematical Forest is grown in a two-dimensional plane, where   trees can only grow on points with integer coordinates. To start with,   there are no trees at all. The foresters plant the first tree at   $(0,0)$. Each year, they carry out tree planting according to the   following rule. If there is a tree on the point (𝑚,𝑛) but there are   no trees on the points $(m+1,n)$ and $(m,n+1)$, then they can choose   to remove the tree on $(m,n)$ and plant new trees on the points   $(m,n+1)$ and $(m+1,n)$. For an integer $k\geq1$, the $k$th diagonal   consists of all points $(m,n)$ with $m+n=k−1$. Is it possible for the   foresters to arrange their planting so that eventually there are no   trees on the first $2$ diagonals? What about the first $3$ diagonals?    $4$ diagonals? Can you generalize?   It's easy to get to a position with no trees on the first two diagonals.  (It only takes $4$ plantings.)  I can prove it's impossible to reach a position with no trees on the first $4$ diagonals, and I believe it's impossible to reach a position with no trees on the first $3$ diagonals, but I can't prove it.  For the $k=4$ case, I used a pagoda function, as in a peg solitaire problem.  For $k=1,2,3,\dots$ define the potential of a tree on the $k$th diagonal as $\frac1{2^{k-1}}$, and the potential of the forest as the sum of the potentials of all the trees in it.  When a tree of potential $\frac1{2^{k-1}}$ is removed, it is replaced by $2$ trees of potential $\frac1{2^k}$ so the potential of the forest never changes.  Initially, the potential of the forest is $1$.  Since there are $k$ trees on diagonal $k$, the potential of all points beyond the fourth diagonal is $$\sum_{k=5}^\infty\frac k{2^{k-1}}=\frac34&lt;1,$$ so it is impossible that there are no trees on the first $4$ diagonals.  The potential of the fourth diagonal is $\frac12$, so this argument doesn't show that it's impossible to have no trees on the first $3$ diagonals.  I've done a lot of experimenting, though, and I believe that the statement is true.  (I even wrote a little computer game so I could experiment quickly.)  The best I've been able to do is to get down to one man on the third diagonal.   The black circles are trees eligible for removal, and the gray circles are other trees.  You can see that there is a "traffic jam" in front of the lone tree on diagonal $3$, and there seems to be no way to clear it.  I've been trying to come up with an argument that reflects this traffic jam, but I haven't been at all successful. We know that after $n$ removals there are $n+1$ trees, and I've been trying to prove somehow that they can't all be sufficiently far from the origin to allow all trees to get past diagonal $3$, but I haven't come close.   In the diagram above, if the tree at $(1,1)$ were moved to $(0,2)$, and the tree at $(1,2)$ were moved to $(2,0)$, then it would be possible to remove the tree at $(0,2)$, emptying the second diagonal.  In the fictitious position, we still have one tree on diagonal $2$ and two on diagonal $3$.   So, I think an argument along the lines I was trying cannot just be concerned with the distance from the origin; it must somehow take into account how the trees interfere with one another.  I haven't been able to do this.    I'd be grateful for solutions, hints, or counterexamples.  I wasn't really sure what tags to attach.  Please add any that seem appropriate. Trying to format USB (using Linux/fdisk) so it shows up on my Mac I have a USB drive that I can see/access/modify/etc in Linux/Ubuntu but it doesn't show up on my Mac OSX.  I did sudo fdisk /dev/sdb (where my USB is) and then g to create a new GPT partition table, n to make a new partition, used all default settings, then w to save and exit.  Then I did sudo mkfs.fat -F32 /dev/sdb1 to format the partition with a FAT32 filesystem.  I ejected the USB and put it in my Mac and it doesn't show up / get detected.  What did I miss? How do we delete subscribers (emails) from Auto suppression list using SSJS. Also, Auto suppression list maintain at SF end or application level. How does new shield system work? How to set custom keyboard shortcuts from terminal? I recently updated my version of Lyx from 1.6.7 to 2.0.6. I would like to transfer my old keyboard shortcuts to this new version, but I am having difficulty because I was inconsistent with the way that I set them up:   Some were defined in the specified .bind file,  but others were modified in the lyx preferences menu.   I found that when importing my old .bind file into this updated version of lyx, it imported the keyboard shortcuts that were in the .bind file, but not those that I had added in the preferences menu.  Does anyone know if these keyboard shortcuts that were added via the preferences menu are stored in another .bind file somewhere in the lyx directory? Has anyone else successfully transferred keyboard shortcuts that had been implimented in the preferences menu? I'm a C++ guy learning Java. I'm reading Effective Java and something confused me. It says never to write code like this:  String s = new String("silly");   Because it creates unnecessary String objects. But instead it should be written like this:  String s = "No longer silly";   Ok fine so far...However, given this class:  public final class CaseInsensitiveString {     private String s;     public CaseInsensitiveString(String s) {         if (s == null) {             throw new NullPointerException();         }         this.s = s;     }     :     : }  CaseInsensitiveString cis = new CaseInsensitiveString("Polish"); String s = "polish";    Why is the first statement ok? Shouldn't it be   CaseInsensitiveString cis = "Polish"; How do I make CaseInsensitiveString behave like String so the above statement is OK (with and without extending String)? What is it about String that makes it OK to just be able to pass it a literal like that? From my understanding there is no "copy constructor" concept in Java? Are comments on answers to my question supposed to show up in my recent activity Importing shapefile into AutoCAD Map 3D? I'm trying to import shapefiles into a DWG using diferent layers names and during my web search I found this post. I know you did this 2 years ago but my problem is very similar and I wonder if you could help me.  Basically I've got a shapefiles of pipelines and I want to use the attribute name to sort the features into different CAD levels in teh same layer. I tried the import and although soem people say that "you can set the import to use data field" I can't see any option to do it and I'm really struggling. Any help appreciated.  I'm running on AutoCAD Map 3D 2010. Is "Smaug" pronounced "Smog"? Did Tolkien the linguist intend for the name of the dragon Smaug to be pronounced "Smog" [IPA: /smɒɡ/ or /smɔːɡ/]? The trailer for the second installment of The Hobbit trilogy pronounces the word (pronounced 'sma-ow-g' [IPA: /smaʊɡ/]) entirely differently than the way I have been reading it for all these many years. Why can't I change directories using "cd" in a script? I failed to open a lock. Now what? Use of Indefinite Articles(a,an) Consider the following sentences:  I am staying in a hotel nearby. I am staying in an hotel nearby.  I know that both are correct. But I would like to know why? I do not see any proper reason for the second one as the 'h' is not silent as in French. So, what could be the reason? How to add ground to DC circuit? I'm just a dabbler in electronic circuits and I'm really still kind of a noob. I am working on a project called the "Atari Punk Console" (Originally known as the "Stepped Tone Generator") but there are some parts of the wiring schematic that I don't understand, specifically the parts with the ground symbol.  Here is the schematic:   See those two ground symbols? I don't understand how to properly connect the circuit to ground at these points. How can I do this and be sure that I did it properly. I don't understand grounding at all so any pointers or clarification is also welcome. Thanks in advance. Why is Ubuntu Software Center dropping previously provided applications? Ubuntu Software used to provide Pinta, KolourPaint, Audacity, and others, but they are no longer available there. I have to use apt to install them.   Why has Ubuntu Software 3.20.5 stopped providing applications that it used to?  Ubuntu 16.04 Ubuntu Software Center 3.20.5  Thanks in advance for your help! How do I change my username? Some time ago, when I installed Ubuntu, I chose a rather stupid username for my account that I do not want to use anymore. How do I change this (including the name of my home directory, and the name in the terminal) without losing settings for applications? How do I keep permissions and my keys for various authentification (e.g. email, SSH, GPG and more)? What settings could possibly get lost if I changed my username? Is WUBI freely available? I checked the link to download WUBI and the only way to proceed is by giving some amount as donation. I will surely do it, but I don't have a Paypal account and I am in urgent need to install Ubuntu. Can someone help me?