How to define a generic class that restricts to only a certain set of types?
How does one restrict number of allowed types in Java generic type
I need to factory reset my Macbook but cannot recall the password. So I used Cmd+R during startup and go to terminal and typed 'resetpassword' according to this advice    Now 'Reset Password' application appears but there is nothing where I have to select the volume containing the user account. Why does this happen? Best practices for storing UI settings? Restore deleted photos I accidentally deleted the entire "downloaded" album full of pictures from my Samsung Galaxy S2 (SPH-D710) and am trying to use a  I downloaded.  My phone will not show up as a remove-able storage device on my computer, or on the program. I have tried to change the USB settings on my phone but there is no USB settings when I go to Settings > Wireless and networks as most information instructs.   I found the setting for USB debugging by going to Settings > Developer options and can turn that on and off, but that is the only setting I can find relating to USB storage.   When I connect it to the USB cord it gives me MTP or PTP options but again no USB options.   Any advice??? Thank you! Given $a,b,c,d \in \mathbb{Z}$, there is $x,y$ such that  $$(a^2 + b^2)(c^2 + d^2) = x^2 + y^2$$  One can show this by considering the complex number $a + bi$ and $c+ di$, using complex properties to deduce that $x = ac - bd, y = ad + bc$ is a solution.   However, given that either $a^2, b^2$ are distinct or $c^2,d^2$ are distinct, then how can one can find nonzero solutions $x,y$?  Sorry, I am assuming $a,b,c,d$ are nonzero. Difference between $:=$ and $=$ I am sorry if this is quite elementary question. But I always think, that why we use $:=$ at some places, instead of $=$. Is there any fundamental difference between these two? Before reading Terry Tao's blog (4 months ago), I had never seen a symbol like this (:=). Unicode applies the convention of using a  as signature at the beginning of a text stream, identifying the encoding used within it. The following three bytes at the beginning of a file: EF BB BF, identifies this file as a UTF8 file. Vi and most text editors gracefully ignore this signature. Open office does that as well, but it adds this signature at the beginning.  Now, if I open a TeX file with OpenOffic.org, and I do that quite a lot (for mixed directionality editing), the signature is added, and baffles LaTeX, which produces an error message such as:   ! LaTeX Error: Missing \begin{document}.   See the LaTeX manual or LaTeX Companion for explanation.  Type  H &lt;return&gt;  for immediate help.  ...                                                l.1   ��\documentclass{article}   whereas a simple dump of the file does not show the problem. Is there a way to eliminate this problem, while staying in the realm of latex? Usually I use beamer  with the Warsaw theme which puts theorems (and other things) in boxes. Now I switched my theme to Marburg but i still want to keep the boxes. How can one do that? Is there a term for solving a sub-sub problem of a problem so far removed from the main problem the link is not clear? In some situations, trying to solve a problem uncovers another problem. Attempts to fix that uncover yet another. A few more rounds and one can be doing something seemingly completely unrelated to the main problem. Is there an expression for that? How to input a specific Pantone color number in Illustrator? dist$(x,A)=0$ if and only if $x\in \overline{A}$ (closure of $A$) Let $(X,d)$ be  a metric space and non-empty $A\subset X$. The distance from $x$ to $A$ is defined as $$\mbox{dist}(x,A)=\inf\{d(x,a):a\in A\}$$  I want to show that dist$(x,A)=0$ if and only if $x$ is in the closure of $A$.     (=>): dist$(x,A)=0$ implies $\inf \{d(x,a):a\in A\}=0$. Suppose $x\not\in \overline{A}$, then $x\in X\setminus \overline{A}$, which is an open set. Thus $\exists\epsilon &gt;0$ such that punctured open ball $B(x;\epsilon)\setminus\{x\}= \{y\in X:0&lt;d(x,y)&lt;\epsilon\} \subset X\setminus\overline{A}$. But then dist$(x,A)=\inf\{d(x,a):a\in A\}\ge \inf\{d(x,y):y\in B(x,\epsilon)\setminus\{x\}\}&gt;0$. This is a contradiction! Hence, $x\in \overline{A}$.      (&lt;=): Suppose $x\in \overline{A}$. If $x\in A^\circ$ (the interior of $A$) then $\inf\{d(x,a):a\in A\}=d(x,x)=0$.   If $x\not\in A^\circ$ then $\exists $ a sequence $(a_k)_k\subset A$ such that $a_k$ converges to $x$. Then, $\forall \epsilon &gt; 0, \exists N\in\mathbb{N}$ such that $k\ge N\implies d(a_k,x)&lt;\epsilon$.      So that dist$(x,A)=\inf\{d(x,a_k)\}=\lim\limits_{k\to\infty} d(x,a_n) = 0$.   Please let me know if my proof is rigorous / correct. I'm not completely sure, think it's better to check. Run a GUI program at startup I am using Ubuntu 14.04. I wrote a small script named trial. The contents of the script are as follows:   #!/bin/sh SHELL=/bin/sh PATH=/bin:/sbin:/usr/bin:/usr/sbin      sh -c firefox   I copied the script to /etc/init.d, modified permission using chmod +x trial and used update-rc.d trial defaults. The file made link but when I rebooted the machine. It did not run firefox. I tried cron @reboot but with no success. I tried rc.local too again failure. Exclusive lighting Is (or will be) there any sort of light linking in Cycles, or a method to get a light to affect only certain objects that doesn't involve compositing two or more different render layers? Sort of what 3Dstudio does with the Include/Exclude methods. Is there a rising trend in Number Series I am trying to build a stock screening utility.   What  I am trying is to find if there is a rising trend in a time series of profit margins of a company. I know there can be dips in some years but I want to find if mathematically that overall there is a rising trend as well as towards the recent years there is higher margins as compared to previous years.   Is there any way we can find it mathematically?          Profit Return Year,Company A,Company B,Company C 2005,38.97,20.44,22.01 2006,22.4,20.59,20.63 2007,22.4,20.59,20.63 2008,21.56,22.01,23.87 2009,25,20,23.52 2010,25,22.38,18 2011,30,24.13,24.85 2012,32,25.43,27.47 2013,30,20,22 2014,35,27,20 I cannot boot to the desktop because I filled the file system. How do I reclaim some space? My memory is completely full when I tried following the data recovery and copied the wrong file using command line tool Test Disk. As it was taking so long to copy, I turned it off and I realized I copied the wrong file. Now my laptop memory is now full and lead me to more problems.  I have had similar problems to :       Now my screen keeps blinking:   Can anybody help? Many thanks. Wish you all the best. QT MySql connectivity using Windows XP, Qt Creator 4.5.2(windows 32 bit) I have a simple question answer to which would help me more deeply understand the concept of (non)commutative structures. Let's take for example (our teacher's definition of) a ring:  Let $R\neq \emptyset$ be a set, let $\oplus:A\times A \to A$ and $\bullet :A\times A \to A$ be binary operations. Moreover, let $(R, \oplus)$ be a commutative group, $(R, \bullet)$ be a monoid and following property holds for all $a, b, c\in R$: $$a\bullet(b\oplus c) = (a\bullet b)\oplus(a \bullet c)$$ $$(b\oplus c)\bullet a = (b\bullet a)\oplus(c \bullet a)$$ Then ordered triple $\mathbf R = (R, \oplus, \bullet \mathbf)$ is called a (unitary) ring.  Moreover, we call ring $\mathbf R$ commutative iff $(R, \bullet)$ is a commutative monoid. Commutativity of a ring is always a matter of its multiplicative operation because the additive operation is always assumed to be commutative.  Could anyone explain me the bold part? Why do we even in non-commutative rings (and fields etc.) assume the addition to be always commutative? Is there some serious reason? Would it make any trouble? Or studying of structures with non-commutative addition just doesn't give us anything new so we can take addition as commutative simply because of our comfort? Preserving order with LINQ I use LINQ to Objects instructions on an ordered array.  Which operations shouldn't I do to be sure the order of the array is not changed? Ubuntu 18.10: visual artifacts (black bar) in dock if extend-height is disabled I am using the default Ubuntu dock with bottom placement and org.gnome.shell.extensions.dash-to-dock extend-height set to false. With Ubuntu 18.10 this produces a noticeable visual glitch, note the black empty spaces at the edges of the dock:    I am getting this both on an upgraded system and on a clean install inside a VM. This was working fine in Ubuntu 18.04. Also happens if the theme is set to something else than Yaru (the default theme in Ubuntu 18.10). Reboot does not help. Dock looks OK if extend-height is enabled.  Any ideas on how to fix this? If $\gcd (x,4) = 2$ and $\gcd(y,4) = 2$ then $\gcd(x+y,4) = 4$ I was working my way through some number theoretic proofs and being a newbie am stuck on this problem :     If $(x, 4) = 2$ and $(y, 4) =2$, then $(x + y, 4) = 4$,     where $(a,b)$ denotes the greatest common divisor of $a$ and $b$.   My Solution  (Incorrect)   $x-4 = 2t$ $y-4 = 2p$ $x + y - 8 = 2(t+p) \Rightarrow x + y - 4 = 2f + 4 = 2(f+2)\Rightarrow 2$ divides $(x+y , 4)$   My Question:  My solution is definitely inadequate. Can someone help me out? I have three partitions on my drive, arranged something like the following:   ___________ | 1 |  2 | 3| -------------   I wish to merge partitions 1 and 3.  Is there a way to do this, or do I have to manually "slide" partition 2 over to partition 3, and then merge the newly open space where partition 2 used to be?  Note: I do not have the space to copy partition 2 to partition 3 (2 is 200GB and 3 is 65GB).