When I type Matlab (without sudo) on the command line for the shell, matlab properly opens. Then, on the left pane in Ubuntu 16.04, I tell Ubuntu to lock Matlab to launcher.  However, when I try to activate it from the launcher, it shows the boot screen, and then closes without any error.  Since it works from shell without permissions, I guess it's not a permission issue.
I'm trying to install a Matlab R2011a launcher for Unity in Ubuntu 12.04. I've tried  (although I know it's for 11.10 and mentions that even 11.10 is an unsupported OS for Matlab R2011a) but without any satisfactory solution.  This is my launcher file, /usr/share/applications/matlab.desktop:  #!/usr/bin/env xdg-open [Desktop Entry] Type=Application Icon=/usr/share/icons/matlab.png Name=MATLAB R2011a Comment=Start MATLAB - The Language of Technical Computing Exec=matlab -desktop Categories=Development;   I open the dash panel and search for "matlab". This launcher is found among applications. I click it, and Matlab's splash screen shows up, but when it disappears the program doesn't start. (I've verified with htop that no matlab-processes are running in the background either.)  If I add  Terminal=true   to the launcher file, the program starts OK, and opens a terminal as well as Matlab. However, both the terminal and Matlab itself show up in the Launcher area, with the Matlab icon, so it looks like I have two Matlab instances running when really it's only one. (Actually, they show up as two different programs, and not just two instances of the same - the icons are independent, not grouped together.)  This is definitely not optimal. I had hoped to create a launcher I can lock to the launcher area, and then that same icon will be the icon for the active Matlab instance when the program is running.  How do I create a launcher for Matlab that works as expected?  Update: I was apparently a bit unclear on my symptoms, I'll try to clarify a little. I've also tried some suggestions from the answers, and further investigated what happens. My current setup (a launcher file with Terminal=true and Exec=matlab -desktop -nosplash &amp;) renders the following behavior:   I open Dash by pressing the Windows key on my laptop, and search for "matlab". It finds the launcher named "MATLAB R2011a". I click it. A terminal window opens, using the icon I referred to in the launcher file. Almost immediately, MATLAB's splash screen also opens, using the same icon (and thus being grouped with the terminal window in the launcher). The splash screen disappears and, so does one of the icons in the launcher. The MATLAB desktop environment opens, using a different version of the icon which is displayed next to the icon for the terminal window (not grouped with it).   I can lock the terminal window's icon to the launcher and successfully start MATLAB by clicking it, but it doesn't feel optimal that I start the program with one icon, and switch to it with another. I've also tried the following:   Exec without the ampersand &amp; in the launcher command, but it didn't make a difference. Executing matlab -nosplash manually from a terminal still shows the splash screen. (What, then, does the nosplash option really do?)
Do you have to pass delete the same pointer that was returned by new, or can you pass it a pointer to one of the classes base types?  For example:  class Base { public:     virtual ~Base();     ... };  class IFoo { public:     virtual ~IFoo() {}     virtual void DoSomething() = 0; };  class Bar : public Base, public IFoo { public:     virtual ~Bar();     void DoSomething();     ... };  Bar * pBar = new Bar; IFoo * pFoo = pBar; delete pFoo;   Of course this is greatly simplified.  What I really want to do is create a container full of boost::shared_ptr and pass it to some code that will remove it from the container when it is finished. This code will know nothing of the implementation of Bar or Base, and will rely on the implied delete operator in the shared_ptr destructor to do the right thing.  Can this possibly work? My intuition says no, since the pointers will not have the same address.  On the other hand, a dynamic_cast&lt;Bar*> should work, so somewhere the compiler is storing enough information to figure it out.  Thanks for the help, everybody who answered and commented. I already knew the importance of virtual destructors, as shown in my example; after seeing the answer I gave it a little thought, and realized the whole reason for a virtual destructor is this exact scenario. Thus it had to work. I was thrown by the absence of a visible means of converting the pointer back to the original. A little more thinking led me to believe there was an invisible means, and I theorized that the destructor was returning the true pointer for delete to release. Investigating the compiled code from Microsoft VC++ confirmed my suspicion when I saw this line in ~Base:  mov eax, DWORD PTR _this$[ebp]   Tracing the assembler revealed that this was the pointer being passed to the delete function. Mystery solved.  I've fixed the example to add the virtual destructor to IFoo, it was a simple oversight. Thanks again to everyone who pointed it out. I like to be thorough, but if you feel confident you can skip the first paragraph.  Review: A ring is a set $R$ endowed with two operations of + and $\cdot$ such that $(G,+)$ is an additive abelian group, multiplication is associative, $R$ contains the multiplicative identity (denoted with 1), and the distributive law holds.  If multiplication is also commutative, we say $R$ is a commutative ring. A ring that has no zero divisors (non-zero elements whose product is zero) is called an integral domain, or just a domain.  We want to show that for a domain, the equation $x^2 = 1$ has at most 2 solutions in $R$ (one of which is the trivial solution 1).    Here's what I did:   For simplicity let $1,a,b$ and $c$ be distinct non-zero elements in $R$.  Assume $a^2 = 1$.  We want to show that letting $b^2 = 1$ as well will lead to a contradiction.  So suppose $b^2 = 1$, then it follows that $a^2b^2 = (ab)^2 = 1$, so $ab$ is a solution as well, but is it a new solution?  If $ab = 1$, then $abb = 1b \Rightarrow a = b$ which is a contradiction.  If $ab = a$, then $aab = aa \Rightarrow b = 1$ which is also a contradiction.  Similarly, $ab = b$ won't work either.  So it must be that $ab = c$.  So by "admitting" $b$ as a solution, we're forced to admit $c$ as well.  So far we have $a^2 = b^2 = c^2 = 1$ and $ab = c$.  We can procede as before as say that $(abc)^2 = 1$, so $abc$ is a solution, but once again we should check if it is a new solution.  From $ab = c$, we get $a = cb$ and $b = ac$, so $abc = (cb)(ac)(ab) = (abc)^2 = 1$.  So $abc$ is not a new solution; it's just one.  At this point I'm stuck.  I've shown that it is in fact possible to have a ring with 4 distinct elements, namely $1,a,b$ and $c$ such that each satisfies the equation $x^2 = 1$ and $abc = 1$.  What am I missing? "exec: gnome-session: not found" when logging in using lightdm On login the password is accepted but I'm returned to the login screen. Tried multiple times even after reboot... same behavior.  I left my laptop (Lenovo Ideapad z510) in suspend mode (lid down) last night, but it did not resume this morning, as it usually does. It had shutdown or crashed, and on booting with Ubuntu the login failure mentioned above started.  cat ~/.xsession-errors /usr/sbin/lightdm-session: 1: /usr/sbin/lightdm-session: ls: not found /usr/sbin/lightdm-session: 104: exec: gnome-session: not found   Okay. I've tried a bunch of suggestions from    Changed id to /usr/sbin/id in /etc/profile removed .Xauthority removed /tmp removed,  purged and re-installed lightdm checked .profile for syntax errors (source .profile worked fine, so I guess no syntax errors)   Nothing worked. My guest login is working fine, so another user should also work. I'm now going to create another user and continue working, but a solution to this problem is still warranted... it's likely going to repeat in future.  Installing and reconfiguring gdm also did not work.  sudo apt-get install gdm How to pronounce '-ing' followed by a vowel I'm getting into English recently and I'm a little confused by the way people pronounce a word that starts in a vowel right after a word ending in -ing.  For example:      You have to bring it up now?   I don't know if I should pronounce it as:   bring /ŋit/ brin' /nit/ bring /git/   Another example would be "I'm coming out".  Likewise, what about the ending -ang? For example:      We can just hang out and have a good time.    And to round it all up, what about a combination of the two? For example,      He got sick of hanging around waiting for you and went home.   I've been asking myself these questions for weeks. Examples and Counterexamples of Relations which Satisfy Certain Properties Show that $d_b(x,y)=\frac{d(x,y)}{1+d(x,y)}$ is a metric. where $(X,d)$ is a metric and $x,y \in X$.  I know we need to show:   non-negativity: $d(x,y)\geq$ 0 $d(x,y)=0$ if and only if $x=y$ symmetry: $d(x,y)=d(y,x)$ $d(x,z)\leq d(x,y) + d(y,z)$   I think we need to consider the derivative of $f(t)=\frac{t}{1+t}$ however I am not sure what to do next. Syntax highlighting in app differs from normal web view Solving a implicit, recursive function Assuming $F(0,0)=0$, can I solve $F(F(x,y),y)=0$ for $y=f(x)$ near $(0,0).$ At work we were discussing this as my boss has never heard of normalization. In Linear Algebra, Normalization seems to refer to the dividing of a vector by its length. And in statistics, Standardization seems to refer to the subtraction of a mean then dividing by its SD. But they seem interchangeable with other possibilities as well.   When creating some kind of universal score, that makes up $2$ different metrics, which have different means and different SD's, would you Normalize, Standardize, or something else? One person told me it's just a matter of taking each metric and dividing them by their SD, individually. Then summing the two. And that will result in a universal score that can be used to judge both metrics.  For instance, say you had the number of people who take the subway to work (in NYC) and the number of people who drove to work (in NYC).   $$\text{Train} \longrightarrow x$$ $$\text{Car} \longrightarrow y$$  If you wanted to create a universal score to quickly report traffic fluctuations, you can't just add $\text{mean}(x)$ and $\text{mean}(y)$ because there will be a LOT more people who ride the train. There's 8 million people living in NYC, plus tourists. That's millions of people taking the train everyday verse hundreds of thousands of people in cars. So they need to be transformed to a similar scale in order to be compared.  If $\text{mean}(x) = 8,000,000$  and $\text{mean}(y) = 800,000$  Would you normalize $x$ &amp; $y$ then sum? Would you standardize $x$ &amp; $y$ then sum? Or would you divide each by their respective SD then sum?  In order to get to a number that when fluctuates, represents total traffic fluctuations.  Any article or chapters of books for reference would be much appreciated. THANKS!  Also here's another example of what I'm trying to do.   Imagine you're a college dean, and you're discussing admission requirements. You may want students with at least a certain GPA and a certain test score. It'd be nice if they were both on the same scale because then you could just add the two together and say, "anyone with at least a 7.0 can get admitted." That way, if a prospective student has a 4.0 GPA, they could get as low as a 3.0 test score and still get admitted.  Inversely, if someone had a 3.0 GPA, they could still get admitted with a 4.0 test score.  But it's not like that. The ACT is on a 36 point scale and most GPA's are on 4.0 (some are 4.3, yes annoying). Since I can't just add an ACT and GPA to get some kind of universal score, how can I transform them so they can be added, thus creating a universal admission score.  And then as a Dean, I could just automatically accept anyone with a score above a certain threshold.  Or even automatically accept everyone whose score is within the top 95%.... those sorts of things.  Would that be normalization? standardization? or just dividing each by their SD then summing? I want to use a Java file SaveProp which is written in a package user. The class file has been placed in WEBINF/classes. Below are the two lines which cause the issue.  jsp:useBean id="user" class="user.SaveProp" scope="session"  jsp:setProperty name="user" property="*"   It throws:  The value for the useBean class attribute user.SaveProp is invalid   I'm using Tomcat 6.0. Why use a dedicated light meter instead of the one built into the camera? Package for drawing RDF graphs Is there some package to draw nice RDF graphs, such as the one below (taken from )?  Can such a graph (with the same style) be produced in TikZ? I'm having some issues SSH'ing to a server when logged into a particular VM.  From my local PC, I can log in to the server just fine using the command ssh -i .ssh/[my private key] username@domain.  If I then SSH into another unrelated server which also has the same private key and run the above command it will also log in just fine in to the server.  But, when I SSH into a particular OpenStack VM (again has the same private key) on the unrelated server and then SSH in to the server from there I start getting prompted for a passphrase. But a passphrase hasn't been set for the key so inevitably I get a "Permission denied (publickey)." error.  To double check, I removed the private key from the VM and scp'd the private key from my PC into it again and tried the same command I still get prompted for a passphrase.  In other words:   PC - SSH - Server1 = Works fine  PC - SSH - Server2 - SSH - Server1 =     Works fine  PC - SSH - Server2 - SSH - Virtual Machine - SSH - Server 1 =         Asks for a passphrase   What could be the reason behind this? It's definitely the right private key I'm using and it has the appropriate permissions.  Edit - Output of ssh -v -i .ssh/[my private key] username@domain as requested  OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 58: Applying options for * debug1: Connecting to xxx.xxx.xxx.xxx [xxx.xxx.xxx.xxx] port 22. debug1: Connection established. debug1: key_load_public: No such file or directory debug1: identity file /.ssh/[my private key].ppk type -1 debug1: key_load_public: No such file or directory debug1: identity file /.ssh/[my private key].ppk-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_7.4 debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.4 debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.4 pat OpenSSH* compat 0x04000000 debug1: Authenticating to xxx.xxx.xxx.xxx:22 as '[my username]' debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256@libssh.org debug1: kex: host key algorithm: ecdsa-sha2-nistp256 debug1: kex: server-&gt;client cipher: chacha20-poly1305@openssh.com MAC: &lt;implicit&gt; compression: none debug1: kex: client-&gt;server cipher: chacha20-poly1305@openssh.com MAC: &lt;implicit&gt; compression: none debug1: kex: curve25519-sha256@libssh.org need=64 dh_need=64 debug1: kex: curve25519-sha256@libssh.org need=64 dh_need=64 debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ecdsa-sha2-nistp256 SHA256:ZiugTjR5fM0E3evOwHoePFKspDQChA0Ab6L0q88KP/g debug1: Host 'xxx.xxx.xxx.xxx' is known and matches the ECDSA host key. debug1: Found key in /home/centos/.ssh/known_hosts:2 debug1: rekey after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: rekey after 134217728 blocks debug1: SSH2_MSG_EXT_INFO received debug1: kex_input_ext_info: server-sig-algs=&lt;rsa-sha2-256,rsa-sha2-512&gt; debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Trying private key: /.ssh/[my private key].ppk Enter passphrase for key '/.ssh/[my private key].ppk': Enter passphrase for key '/.ssh/[my private key].ppk': Enter passphrase for key '/.ssh/[my private key].ppk': debug1: No more authentication methods to try. Permission denied (publickey). node.js conflicts: /sbin/node vs /usr/bin/node I have two Ubuntu 12.10 machines: machine A is a VMWare VM and machine B is and old Acer laptop. On both machines, I installed node using apt-get. However machine A installs the main binary as /usr/bin/node and machine B as /usr/bin/nodejs. Here are some behaviors I observed:   Both machine returns /usr/bin/node in response to the which node command. However, there is no such file on machine B. Issuing the command node works for machine A, not B. On B, I have to use nodejs instead. On B, there is a binary called /sbin/node, A does not have it.   These behaviors causes inconsistency problem when developing on both machines. For now, I worked around by renaming the binaries on B as such:  sudo mv /sbin/node /sbin/node-sbin sudo ln -s /usr/bin/nodejs /usr/bin/node   Is there a way to really fix this, so that node will be installed as /usr/bin/node instead of /usr/bin/nodejs? Where does pp (PAR) unpack add (-a) files? How to find out client ID of component for ajax update/render? Cannot find component with expression "foo" referenced from "bar" How does new shield system work? Term for group of guys attempting to show who is alpha? Similar to pissing contest - but not in an aggressive manner. Just each guy attempting to out talk one another to show they are the leader / in charge.   Sample sentence:     Well, that meeting was more of a X than being productive with Greg trying to show he was in control. Creating an arbitrary state of the quantum simple harmonic oscillator How to disable auto brightening LCD