While watching Star Trek Into Darkness, the following two scenes looked funny to me.   In the opening scene, Spock almost dies while trying to save a native population from death by volcano. His death is only averted by exposing the population to the sight of the Enterprise, which might or might not be a worse problem, depending on your perspective. Some time later, McCoy and Dr. Marcus go open a torpedo they know little about, with a very real risk of instant death apparently hanging over their heads.   What I find funny is that these are the kind of tasks that could be easily delegated to a remotely-controlled robot. Bomb-disposal units in the present day never send a person to examine a suspicious device if they can use a robot instead. Why do the enterprise crew not make use of this option? Given how stupendously advanced their technology is, you would think they could have a few mechanical gizmos with a radio link to the bridge, so that they could perform this kind of tasks without putting lives at risk.
Okay, obviously beyond Data and the Soong-type androids. But seriously, we have more robots in our daily life now than there apparently are on Trek. Is there a canon answer why not? It seems like Star Wars is more on the nose in this regard - it’s unclear why all dirty/dangerous/boring work wouldn’t be done by robots (anthropomorphic or not).
How to parse a time into a Date object from user input in JavaScript? I am working on a form widget for users to enter a time of day into a text input (for a calendar application). Using JavaScript (we are using jQuery FWIW), I want to find the best way to parse the text that the user enters into a JavaScript Date() object so I can easily perform comparisons and other things on it.  I tried the parse() method and it is a little too picky for my needs. I would expect it to be able to successfully parse the following example input times (in addition to other logically similar time formats) as the same Date() object:   1:00 pm 1:00 p.m. 1:00 p 1:00pm 1:00p.m. 1:00p 1 pm 1 p.m. 1 p 1pm 1p.m. 1p 13:00 13   I am thinking that I might use regular expressions to split up the input and extract the information I want to use to create my Date() object. What is the best way to do this? Conky does not work properly on Ubuntu 16.04 GNOME I have this strange problem with conky. It doesn't show properly on the desktop:    I've tried everything from editing conky widget file to reinstalling conky and conky manager (v.2.4). Who knows how to fix it? What do the words 'RELATED' and 'ESTABLISHED' individually signify in RELATED,ESTABLISHED state in iptables? The question is how can I exclude an object from the freestyle render?  What I need to do is create a Clay render with the wire only on the airplane.  My scene is simple I only have two objects the "Toy Plane" and the "floor". For the Clay render I only override the materials to a simple clay material and done.    But this happens when I use freestyle. How can I tell freestyle to ignore the "Floor"? Beamer: change header background color I have decided to switch from Powerpoint to Beamer, and for my first presentation I'd like to use the , and the same colors as in this goggle slide template:  .  I tried to do some research about it, the closest answers I found are the question  and the . I tried this code:  \documentclass{beamer} \usepackage[frenchb]{babel} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc}  \usetheme{metropolis}  \definecolor{bluegreen}{rgb}{3, 166, 155} \definecolor{pitchblack}{rgb}{0, 0, 0} \definecolor{lightbeige}{rgb}{255, 251, 241} \definecolor{mediumgray}{rgb}{183, 183, 183}  \setbeamercolor{background canvas}{bg=pitchblack} \setbeamercolor{normal text}{fg=lightbeige} \setbeamercolor{headline}{bg=bluegreen, fg=mediumgray}  \begin{document} \begin{frame}     \frametitle{The title}     Lorem ipsum... \end{frame} \end{document}   I does everything I want, except that the title bar's background color is lightbeige:    What did I do wrong? Or what argument should I pass to \setbeamercolor to get it right? Thanks in advance :-). No newline after (sub)section? I want my text to appear right after the call to \subsection{Name} but  I can't find how to do it. I'm using the article class.  An example of command:  \subsection{a)} Blah blah bla...   produces:     a)      Blah blah bla...   instead of what I want:     a) Blah blah bla...   Anything I could do? Why aren't there any fighter carriers in the Star Trek universe? All of the ships of every species seem to be medium to large vessels with multiple crew members. Why aren't there single fighter craft and carrier ships to transport them in mass?  I've just noticed the difference between Battlestar Galactica and Star Trek, where the former has primarily aircraft carriers, and the latter has battleships.   Wouldn't a huge fleet of small fighters be extremely maneuverable and possibly stealthy?  Update:  For clarity, my question is not about the Federation and their choice of ships, but the universe at large. I would think there would be some diversity in space warfare strategy, such as huge armadas of fighters with base stations / carriers. How to add user to a group from Mac OS X command line? trying to add a user to a group from the command line but can't figure out how?   Specifically this is on Mac OS X Server 10.5.8  like to add user to 'admin' and 'wheel' groups Print composer custom grid label problem In answer to  Klas Karlsson puts forward a solution to the problem of formatting print composer grid labels for projected maps.  I'm very weak on scripting, but in QGIS 2.14 I've tried to enter the text as shown in Klas's illustration, which generates error messages. In my case I'm working with a coordinate system that has a six-digit Easting and a six-digit Northing and I'm trying to get a result similar to that shown in Klas's picture (but with a six-digit Northing). Can anyone help me with this? Preservation of ideals in localized rings Refer to localization of rings in Lang's Algebra p. 108. In particular, let $A$ be a commutative ring, $S$ a subset of $A$ that is a submonoid of the multiplicative monoid structure of $A$, containing the identity. Then  $S^{-1}A$ is the set of elements $\frac{a}{s}$ with $a \in A$ and $s \in S$.  We have $\frac{a_1}{s_1}=\frac{a_2}{s_2}$ if there exists $\bar{s} \in S$ such that $\bar{s}(s_2a_1 - s_1 a_2)=0$. Now consider the injection of $A$ into $S^{-1}A$ given by $x \mapsto \frac{x}{1}$. This is a ring homomorphism. Let $J$ be an ideal of $A$. Ring homomorphisms preserve ideals and so the injection of $J$ into $S^{-1}A$, call it $J^{*}$, will be an ideal. My problem is that i don't see why for any $\frac{a}{s} \in S^{-1}A$ and any $\frac{j}{1} \in J^{*}$ we will have that $\frac{aj}{s}$ will be in $J^{*}$, i.e. why there must exist an element $\kappa \in J$ such that $\frac{aj}{s}=\frac{\kappa}{1}$. Take any three random variables $X_1$, $X_2$, and $X_3$.   Is it possible for $X_1$ and $X_2$ to be dependent, $X_2$ and $X_3$ to be dependent, but $X_1$ and $X_3$ to be independent?  Is it possible for $X_1$ and $X_2$ to be independent, $X_2$ and $X_3$ to be independent, but $X_1$ and $X_3$ to be dependent? How do I sudo a command in a script without being asked for a password? Why does a minimal prime ideal consist of zerodivisors? Let $A$ be a commutative ring. Suppose $P \subset A$ is a minimal prime ideal. Then it is a theorem that $P$ consists of zero-divisors.  This can be proved using localization, when $A$ is noetherian: $A_P$ is local artinian, so every element of $PA_P$ is nilpotent.  Hence every element of $P$ is a zero-divisor. (As Matt E has observed, when $A$ is nonnoetherian, one can still use a similar argument: $PA_P$ is the only prime in $A_P$, hence is the radical of $A_P$ by elementary commutative algebra.)  Can this be proved without using localization? Install suspension forks on non-suspension bike Enclosing Page Numbers using the `Backref=Pages` Extension of `Hyperref` The setuid permission bit tells Linux to run a program with the effective user id of the owner instead of the executor:  &gt; cat setuid-test.c  #include &lt;stdio.h&gt; #include &lt;unistd.h&gt;  int main(int argc, char** argv) {     printf("%d", geteuid());     return 0; }  &gt; gcc -o setuid-test setuid-test.c &gt; ./setuid-test  1000  &gt; sudo chown nobody ./setuid-test; sudo chmod +s ./setuid-test &gt; ./setuid-test  65534   However, this only applies to executables; shell scripts ignore the setuid bit:  &gt; cat setuid-test2  #!/bin/bash id -u  &gt; ./setuid-test2  1000  &gt; sudo chown nobody ./setuid-test2; sudo chmod +s ./setuid-test2 &gt; ./setuid-test2  1000     Wikipedia :     Due to the increased likelihood of security flaws, many operating systems ignore the setuid attribute when applied to executable shell scripts.   Assuming I'm willing to accept those risks, is there any way to tell Linux to treat the setuid bit the same on shell scripts as it does on executables?  If not, is there a common workaround for this problem? My current solution is to add a sudoers entry to allow ALL to run a given script as the user I want it run as, with NOPASSWD to avoid the password prompt. The main downsides to that is the need for a sudoers entry every time I want to do this, and the need for the caller to sudo some-script instead of just some-script Difference Boolean modifier. How do I get it to work with my mesh? I want to make a screw head, but I can't get the cross in the screw head; the Boolean modifier doesn't work.  Link: Random weighted choice Consider the class below that represents a Broker:  public class Broker {     public string Name = string.Empty;     public int Weight = 0;      public Broker(string n, int w)     {         this.Name = n;         this.Weight = w;     } }   I'd like to randomly select a Broker from an array, taking into account their weights.  What do you think of the code below?  class Program     {         private static Random _rnd = new Random();          public static Broker GetBroker(List&lt;Broker&gt; brokers, int totalWeight)         {             // totalWeight is the sum of all brokers' weight              int randomNumber = _rnd.Next(0, totalWeight);              Broker selectedBroker = null;             foreach (Broker broker in brokers)             {                 if (randomNumber &lt;= broker.Weight)                 {                     selectedBroker = broker;                     break;                 }                  randomNumber = randomNumber - broker.Weight;             }              return selectedBroker;         }           static void Main(string[] args)         {             List&lt;Broker&gt; brokers = new List&lt;Broker&gt;();             brokers.Add(new Broker("A", 10));             brokers.Add(new Broker("B", 20));             brokers.Add(new Broker("C", 20));             brokers.Add(new Broker("D", 10));              // total the weigth             int totalWeight = 0;             foreach (Broker broker in brokers)             {                 totalWeight += broker.Weight;             }              while (true)             {                 Dictionary&lt;string, int&gt; result = new Dictionary&lt;string, int&gt;();                  Broker selectedBroker = null;                  for (int i = 0; i &lt; 1000; i++)                 {                     selectedBroker = GetBroker(brokers, totalWeight);                     if (selectedBroker != null)                     {                         if (result.ContainsKey(selectedBroker.Name))                         {                             result[selectedBroker.Name] = result[selectedBroker.Name] + 1;                         }                         else                         {                             result.Add(selectedBroker.Name, 1);                         }                     }                 }                   Console.WriteLine("A\t\t" + result["A"]);                 Console.WriteLine("B\t\t" + result["B"]);                 Console.WriteLine("C\t\t" + result["C"]);                 Console.WriteLine("D\t\t" + result["D"]);                  result.Clear();                 Console.WriteLine();                 Console.ReadLine();             }         }     }   I'm not so confident. When I run this, Broker A always gets more hits than Broker D, and they have the same weight.  Is there a more accurate algorithm?  Thanks! Journal of Finance Template German '*.bst' Best way to detect when a user leaves a web page? What is the best way to detect if a user leaves a web page?  The onunload JavaScript event doesn't work every time (the HTTP request takes longer than the time required to terminate the browser).  Creating one will probably be blocked by current browsers.