How is the Metric value decided in WIndows After reading , I was wondering how the operating system 'chooses' the Metric value for a route.  I have 2 dynamically added routes for internet:        0.0.0.0          0.0.0.0      192.168.0.1    192.168.0.239     45       0.0.0.0          0.0.0.0         10.0.0.1       10.0.0.254     15   So naturally, my traffic is being routed to the gateway at 10.0.0.1 first because 15 &lt; 45, if there are no routes on 10.0.0.1, it will be routed to 192.168.0.1 for delivery.  What I'm wondering is:  How does Windows (or any OS with a routing implementation) decide the metric value for these 2 interfaces?  I notice some people contradicting each other in the comments of the linked question when it comes to priority based on Ethernet/Wireless and the like. For this reason I want to note:   The interface with Metric 45 is a Wireless adapter The interface with Metric 15 is connected to a Hyper-V Virtual Switch hosted on the same machine.
Interpreting the 'metric' column in routing table I'm a little confused about the output I'm seeing in my routing table, particularly the 'metric' column:  $ route -n Kernel IP routing table Destination     Gateway         Genmask         Flags Metric Ref    Use Iface 0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 wlan0 172.16.35.0     0.0.0.0         255.255.255.0   U     0      0        0 vmnet1 192.168.0.0     0.0.0.0         255.255.255.0   U     9      0        0 wlan0 192.168.82.0    0.0.0.0         255.255.255.0   U     0      0        0 vmnet8   According to the man page, metric indicates the 'distance' to the target. I was a little confused about what exactly "target" was. I assumed it was my router (it goes to gateway 0.0.0.0, which then goes to my router at 192.168.0.1). Thus, I expected the metric to be a single hop to my router. However, it's 9! Why is this so number high?
Optimizing a screenshot for adding in a document and printing I'm running the following script on Ubuntu 14.04:  #!/bin/bash  apt-get purge -y nginx apt-get install -y nginx  date   When I run it like cat /tmp/script | bash, apt-get starts installing, then "date" is printed (not the actual date, but the command name), then the remaining apt-get output is printed.  If however I run the script like /tmp/script, it works as expected: printing the date after apt-get finished.  Why does this happen and how can I force bash to work when being piped to the same way it does when invoked directly? Empty vector menu in QGIS on PC with French as default language I installed QGIS 3.0.0 on a PC with French as default language. After changing the language of QGIS to English, the 'Vector' menu is empty and there is a French 'Vecteur' menu. Any ideas how to fix this? I cannot change the system language. Average distance between two random points in a square A square with side $a$ is given. What is the average distance between two uniformly-distributed random points inside the square?  For more general "rectangle" case, see . The proof found there is fairly complex, and I am looking for a simpler proof for this special case. I expect it could be significantly simpler.  See also . I just bought a  game (Forza 4) for my Xbox 360 (bought in the US). When I tried to play the game, it wouldn't load because of region issue. Is there a legal way to solve this (no crack)? How to burn a Windows .iso to a USB device? I want to burn a Windows ISO to a USB device in Ubuntu. How do I do this?   I know how to burn a Ubuntu ISO into a USB device, but with a Windows ISO it's not the same. What's the rationale for requiring that a field be a $\boldsymbol{non}$-$\boldsymbol{trivial}$ ring? The title pretty much says it all.  Of course, one answer (IMO unsatisfactory) to such questions goes something like "a definition is a definition, period."  In my experience, mathematical definitions are rarely completely arbitrary.  Therefore I figure there must be a good reason for insisting that a field be a non-trivial ring (among other things), but it's not obvious to me.  I realize that a trivial ring would make for a very boring field, but it is also a rather boring ring, and yet it is not disallowed as such.  EDIT: I found a hint of a rationale in the statement that "the zero ring ... does not behave like a finite field," but I could not find in the  for this assertion exactly how the zero ring fails to behave like a finite field. Intuitive analysis of gradient, divergence, curl How to evaluate $\lim\limits_{n\to+\infty} \prod\limits_{k=1}^n (1+k/n^2)$? How to make child process die after parent exits? Suppose I have a process which spawns exactly one child process. Now when the parent process exits for whatever reason (normally or abnormally, by kill, ^C, assert failure or anything else) I want the child process to die. How to do that correctly?    Some similar question on stackoverflow:   (asked earlier)  (asked later)      Some similar question on stackoverflow for Windows: JUnit @Test expected annotation not working If $f,g:X \to Y$ are continuous and $Y$ is $T_2$, then $\{x \in X\,|\,f(x)=g(x)\}$ is closed I'd like to know if the following proof is valid.  The only thing I'm not sure about (though I can't see why it's invalid if it is) is if we can always use the Hausdorfness of $Y$ to separate an open set from $f(C)=g(C)$.  "Let $X$ be a space, $Y$ a $T_2$-space, and $f,g:X \to Y$ continuous functions.  Prove that $C:=\{x \in \,|\,f(x)=g(x)\}$ is a closed subset of $X$."  Let $x \in X$ be such that $f(x) \ne g(x)$.  Since $Y$ is $T_2$, there are open sets $U_\alpha \ni f(x)$ and $V_\alpha \ni g(x)$ such that $U_\alpha \cap O_\alpha=V_\alpha \cap O_\alpha=\varnothing$ for all $\alpha \in A$ where $A$ is the set indexing the points of $f(C)=g(C)$, and $O_\alpha$ is an open set containing $x_\alpha \in f(C)=g(C)$.  Let $U:=\displaystyle\bigcap_{\alpha \in A} U_\alpha$ and $V:=\displaystyle\bigcap_{\alpha \in A} V_\alpha$.  Then $U \cap f(C)=V \cap f(C)=\varnothing$.  Therefore, since $f,g$ are continuous, $f^{-1}(U)$ and $g^{-1}(V)$ are open sets in $X$ disjoint from $C$.  Since $X\setminus A$ is the union of such open sets, it is open itself and therefore $C$ is closed.  Thanks. ASP.NET MVC controller actions that return JSON or partial html I am trying to create controller actions which will return either JSON or partial html depending upon a parameter. What is the best way to get the result returned to an MVC page asynchronously? Prove that every isometry on $\mathbb{R}^2$ is bijective I'm having trouble with a question from an introductory Linear Algebra book. It goes: "Show that the Only Subspaces of $R^2$ are the zero subspace, $R^2$ itself, and the lines through the origin." I'm thinking the easiest way to do this is to show that if $W$ is a subspace of $R^2$ containing $2$ different lines through the origin then $W$ is all of $R^2$. Is this a good way to go about it? and how could I show this? The repository 'http://ppa.launchpad.net/mdeguzis/libregeek/ubuntu focal Release' does not have a Release file How to create a file system as a non root user? I'd like to create a filesystem image as a non-root user, the problem I'm facing is that the way I'm currently doing it, it needs a mount and as a non-root can't do a mount.  This is what I'm now doing:  #!/bin/sh  IMG="app.ext4" LBL="PIHU_APP" MNT="/mnt/PIHU_APP" APP="/home/buildroot/board/arctura/PIHU_APP/application"  #64MB: dd if=/dev/zero of=$IMG bs=4096 count=16384  mkfs.ext4 $IMG e2label $IMG $LBL  mkdir -p $MNT mount -o loop $IMG $MNT cp -r $APP $MNT sync umount $MNT   I have full root access, so I can setup/prepare anything, but the script will be executed from a non-root account.  However, I have a feeling there may be a better way that might not even need mounting, but I'm not sure.. I would like to know how I can get the value of a node with the following paths:   config/global/resources/default_setup/connection/host config/global/resources/default_setup/connection/username config/global/resources/default_setup/connection/password config/global/resources/default_setup/connection/dbname   from the following XML:  &lt;?xml version="1.0"?&gt; &lt;config&gt;     &lt;global&gt;         &lt;install&gt;             &lt;date&gt;&lt;![CDATA[Tue, 11 Dec 2012 12:31:25 +0000]]&gt;&lt;/date&gt;         &lt;/install&gt;         &lt;crypt&gt;             &lt;key&gt;&lt;![CDATA[70e75d7969b900b696785f2f81ecb430]]&gt;&lt;/key&gt;         &lt;/crypt&gt;         &lt;disable_local_modules&gt;false&lt;/disable_local_modules&gt;         &lt;resources&gt;             &lt;db&gt;                 &lt;table_prefix&gt;&lt;![CDATA[]]&gt;&lt;/table_prefix&gt;             &lt;/db&gt;             &lt;default_setup&gt;                 &lt;connection&gt;                     &lt;host&gt;&lt;![CDATA[localhost]]&gt;&lt;/host&gt;                     &lt;username&gt;&lt;![CDATA[root]]&gt;&lt;/username&gt;                     &lt;password&gt;&lt;![CDATA[pass123]]&gt;&lt;/password&gt;                     &lt;dbname&gt;&lt;![CDATA[testdb]]&gt;&lt;/dbname&gt;                     &lt;initStatements&gt;&lt;![CDATA[SET NAMES utf8]]&gt;&lt;/initStatements&gt;                     &lt;model&gt;&lt;![CDATA[mysql4]]&gt;&lt;/model&gt;                     &lt;type&gt;&lt;![CDATA[pdo_mysql]]&gt;&lt;/type&gt;                     &lt;pdoType&gt;&lt;![CDATA[]]&gt;&lt;/pdoType&gt;                     &lt;active&gt;1&lt;/active&gt;                 &lt;/connection&gt;             &lt;/default_setup&gt;         &lt;/resources&gt;         &lt;session_save&gt;&lt;![CDATA[files]]&gt;&lt;/session_save&gt;     &lt;/global&gt;     &lt;admin&gt;         &lt;routers&gt;             &lt;adminhtml&gt;                 &lt;args&gt;                     &lt;frontName&gt;&lt;![CDATA[admin]]&gt;&lt;/frontName&gt;                 &lt;/args&gt;             &lt;/adminhtml&gt;         &lt;/routers&gt;     &lt;/admin&gt; &lt;/config&gt;   Also I want to assign that value to the variable for further use. Let me know your idea. Compactness of $(M, d)$ in terms of continuous functions $f:M\to \mathbb R$ Suppose $(M,d)$ a metric space. I want to show that      If every continuous real-valued function on $M$ attains a maximum, then $(M, d)$ is compact.   I was trying to do this by assuming $M$ non-compact and showing explicitly a function which does not attain a maximum. If $M$ is not bounded it's enough to take the distance from a fixed point as we can always find a sequence which "exits" every compact and pushes the distance at infinity. But what if $M$ is bounded? To prove $ \tan(A) + 2 \tan(2A) +4\tan4A + 8 \cot8A =\cot(A) $