find joint distribution $\min (X,Y)$ and $W$, where W is a discrete distribution
What is the joint distribution of $Z=\min(X,Y)$ and $I_{Z=X}$?
"std::endl" vs "\n" Many C++ books contain example code like this...  std::cout &lt;&lt; "Test line" &lt;&lt; std::endl;   ...so I've always done that too. But I've seen a lot of code from working developers like this instead:  std::cout &lt;&lt; "Test line\n";   Is there a technical reason to prefer one over the other, or is it just a matter of coding style? Host alias for ssh There are a few SSH destinations I will frequently be connecting to and I'm wondering if rather than remember the IP address I can create a host alias for them.  I'd like to be able to use...  ssh -p xx user@domain.ssh  I've tried establishing this host in /etc/hosts and unless there's a service I needed to restart it had no effect. If I have a $2\times 2$ or $3\times 3$ matrix, how should I go about computing the eigenvalues and eigenvectors of the matrix?  NB: I am making this question to provide a unified answer to questions about eigenvalues of small matrices so that all of the specific examples that come up can be marked as duplicates of this post. See . Do I need a Turkey transit visa for a layover? I have an Indian passport and am planning to visit Germany with a valid visa. To book a flight for Germany (Mumbai – Dusseldorf), I came across some connected flights that stop at Istanbul.  Do I need to have visa for Turkey?  This is the first time I am travelling outside my country, and any information on this will be helpful. Why do we say "Eastern Europe" but "East Asia"? Let $f(z)=\sum\limits_{n=0}^{\infty}a_n z^n$ be an analytic function in $|z|\leq R$ such that $|f(z)|\leq M$. Prove an inequality about $f$'s zero Difference between Ubuntu and Linux Mint Can someone please tell me the differences between Ubuntu and Linux Mint ?   I thought they were almost the same thing until I downloaded Ubuntu 13.10 versions of softwares for my Linux mint 16 system, and half of them didn't work. (I did that as those are the links I got when I searched for Linux mint versions) How delete an application that is bundled with macOS? Backstory:   I am running macOS Sierra and use TextEdit a lot. The problem is that I hate the Versions save schema that causes the universal Save As shortcut of CmdShiftS to instead create a copy of the document. I also hate how Auto-Save makes permanent changes to documents I don't want to modify when I'm tentatively modifying a work-in-progress. Since the introduction of these nuisance features in Lion I have always backed up and then replaced TextEdit.app with the legacy 1.6 version from Snow Leopard.  The problem:  Today when I tried to delete TextEdit.app from my Applications folder using this Terminal command  sudo rm -rf /Applications/TextEdit.app   I got this error  rm: TextEdit.app: Operation not permitted   I was surprised to find that I can't kill it, even with sudo.  How can I actually get rid of an application that is bundled with macOS?  What I've tried so far:  I followed the instructions in , but it didn't work. I also read , which almost accomplishes the same solution by means of disabling Versions and Auto-Save, but then I don't get the benefit of legacy TextEdit's temporary backup saving feature. See the part in the answer stating "This effectively disables the old-style, pre-Lion autosaving completely".   So I think deleting the newer TextEdit v1.12 and replacing it with the legacy v1.6 is still the best option, however I can't get my system to delete it. Any help appreciated. prove inequality through mean value theorem How can I get vertex positions from a mesh? I want to read the vertex x and y coordinates with a script or a function.  How can I do that?  The   appears to have no position I could use.  I'd take any alternative approach that could give me x and y coordinates. I ask this Question on behalf of my neighbor.   Their 12 year old son saw his parents having sex.  As there is only one room in their home we can't say its the parents' mistake... but now the question is how do they handle the situation? How do I make an object face the mouse position, but only on one plane? I want a game object to turn and look towards where the mouse was clicked (in world space).  It works well when considering all 3 dimensions, but I really only care for the plane formed by the x and z axis, not the y.  I've tried to fix this by setting the y of the directionTarget to the y of the object's position, but that gives weird results.  My code looks like this:  Quaternion rotationTarget;     float rotationLerpProgress;     float rotationLerpDuration = 1f;      // Use this for initialization     void Start ()     {      }      // Update is called once per frame     void Update ()     {             if (Input.GetMouseButtonDown (0)) {                     var ray = Camera.main.ScreenPointToRay (Input.mousePosition);                     RaycastHit rayHit;                      if (Physics.Raycast (ray, out rayHit)) {                             var rayHitPoint = rayHit.point;                              var rotationDirection = transform.position - rayHitPoint;                                                            rotationDirection.Normalize ();                             //rotationDirection.y = transform.position.y;                             rotationTarget = Quaternion.LookRotation (rotationDirection);                             rotationLerpProgress = Time.deltaTime;                     }                     //targetPosition = Camera.main.ScreenToWorldPoint (Input.mousePosition);                                     }              if (rotationTarget != transform.rotation) {                      transform.rotation = Quaternion.Lerp (transform.rotation, rotationTarget, rotationLerpProgress / rotationLerpDuration);                     rotationLerpProgress += Time.deltaTime;                       if (rotationLerpProgress &gt;= rotationLerpDuration) {                              transform.rotation = rotationTarget;                     }              }      }   I must be missing something. How do I do this right? So I'm at that step where I am finally ready to Render my first big project. Aaaaaand it's been stuck on the first 4 tiles for the last 2 hours?   I am using a MacBook Pro Processor: 2.5 GHz Intel Core i5 Memory: 4 GB 1600 MHz DDR3 Graphics: intel HD Graphics 4000 1024 MB  (I include these because I have no idea what affects a computers ability to render but I assume it's one of them, most liekly the graphics card).  So anyways here are the pictures, as you can see I played with changing the resolution, the sample size and the max steps to see if I got different results but it just keeps getting stuck at those 1st four tiles. I've rendered a few other small projects successfully but this was my first time changing some values. I assume i've managed to accidentally change the wrong values and thats causing some conflict thats either stopping the render itself or is making it just too much for my computer.  My goal was the render this particular picture at a good enough resolution and clarity that it could then be made into a poster. So i wanted the resolution to be good and the sampling to be high.       Since writing this there has been no change to any of the numbers at the top of the render result (the time left, etc) Set horizontal width on custom listings environment I want to create a custom listings environment and want to set its width as something like 90% of textwidth, centred.  Per an  for algorithms, the first thing I tried was to embed the listing in a minipage environment. However, . I found a way to still make standard environment work, but it requires to use the escape command every time before ending the environment.  The second thing I tried was this latter command, but as far as I can see, it doesn't offer a feature to set the width of the listing or centre it.  \documentclass{article} \usepackage{listings} \usepackage{lipsum}   \lstnewenvironment{queryl} %% APPROACH 1  {\lstset{frame=shadowbox,escapechar=`}}  {}  \newenvironment{query} %% APPROACH 2  {\begin{minipage}{4cm}\centering\begin{queryl}}  {\end{queryl}\end{minipage}}   \begin{document} %% APPROACH 1 Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. \begin{queryl} begin { do nothing } end ; \end{queryl} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.  %% APPROACH 2 Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.  \begin{query} begin { do nothing } end ;`%&lt;- needs escape-to-LaTeX character to work \end{query}  Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. \end{document}     One can note that for the first environment, the frame extends beyond the width of the text. Also, puzzlingly the minipage environment doesn't seem to want to centre and swallows space (though I guess I could perhaps at least get that to work with tinkering).  In any case, does anyone have any ideas on how to set a width for a custom listings environment and centre it without requiring use of the escape character each time to end the environment? Why is $\langle \textbf R \rangle =Tr \rho R$ here $\rho$ is the state density matrix Java: Difference between the setPreferredSize() and setSize() methods in components What can $E=mc^2$ do? In the famous equation , the variables stand for:     $E$ is energy, $m$ is mass, and $c$ is the speed of light (in vacuum).   And I understand the equation fairly but limited in knowing in its effects/outputs in reality, honestly.   Some example? Could anybody please give me some sort of examples in real world which are done by this equation? Create Trigger that updates the same table before (or after ??) the Insert I have just started using triggers and one thing that I would need to do is to create a trigger that updates the same table that's inserting the row.  TABLE:  CREATE TABLE `city` (   `city_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,   `city` varchar(50) NOT NULL,   `country_id` smallint(5) unsigned DEFAULT '0',   `country` varchar(150) DEFAULT NULL,   `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,   PRIMARY KEY (`city_id`),   KEY `idx_fk_country_id` (`country_id`),   CONSTRAINT `city_ibfk_1` FOREIGN KEY (`country_id`) REFERENCES `country` (`country_id`) ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=6009 DEFAULT CHARSET=utf8;   Trigger:  DELIMITER $$ CREATE TRIGGER `populate_country_id` BEFORE INSERT ON `city` FOR EACH ROW BEGIN  IF NEW.country_id = 0  THEN     UPDATE city     INNER JOIN country B ON city.country = B.country     SET NEW.country_id = B.country_id;  END IF;  END $$ DELIMITER ;   MySQL is just returning: Can't update table 'city' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.  Is there any way I can make this work?  Thanks everyone! Why do we need a Stack Overflow in Portuguese? I have noticed there is a Stack Overflow in language differs from English which is global and mostly used by programmers.  I think there is no need for a site in other languages. Otherwise we will end up with 127 StackOverflow sites. I am afraid that we will lose the amount of people sharing data. bash: adduser: command not found on centOS I installed CentOS 5.5 on my VMWare 8 recently and I am trying to add a new user on the system. I am unable to add the user unless I use su - option. I believe it has to do something with path not set properly.  I updated the path and here is what it looks like  /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/uone/bin:/sbin   I believe the command is in /sbin dir which is already a part of path. Can anyone suggest me what else I might be missing?