I am trying to do this: protected List&lt;T&gt; list = new List&lt;T&gt;();  for (int i = 0; i &lt; size; i++) {     list.Add(null); }  I get a compiler error saying &quot;cannot convert from null to T&quot;. I have looked around but could not find an answer to this question.
I have a generic method with this (dummy) code (yes I'm aware IList has predicates, but my code is not using IList but some other collection, anyway this is irrelevant for the question...)  static T FindThing&lt;T&gt;(IList collection, int id) where T : IThing, new() {     foreach T thing in collecion     {         if (thing.Id == id)             return thing;     }     return null;  // ERROR: Cannot convert null to type parameter 'T' because it could be a value type. Consider using 'default(T)' instead. }   This gives me a build error      "Cannot convert null to type parameter   'T' because it could be a value type.   Consider using 'default(T)' instead."   Can I avoid this error?
I have this input:  sdkxyosl 1 safkls 2 asdf--asdfasxy_asd 5 dkd8k  jasd 29 sdi44sw 43 asasd afsdfs 10 rklyasd 4   I need this output:  sdi44sw 43 dkd8k  jasd 29 asasd afsdfs 10 asdf--asdfasxy_asd 5 rklyasd 4 safkls 2 sdkxyosl 1   So i need to sort the lines by the last column.  I don't know how many columns are in one line.  I just can't figure it out, how to do it. I don't have "perl powers". I just have ~average scripting powers with sed, awk, cut, etc..   Does somebody know how to do it? I have being using Skype for a long time on my Ubuntu 14.04 LTS. From this morning on, Skype simple cannot connect to my account anymore.  That is my Skype version:     Skype 4.3.0.37   © 2014 Skype and/or Microsoft   My Ubuntu system:  LSB Version:    core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch:core-4.1-amd64:core-4.1-noarch:cxx-3.0-amd64:cxx-3.0-noarch:cxx-3.1-amd64:cxx-3.1-noarch:cxx-3.2-amd64:cxx-3.2-noarch:cxx-4.0-amd64:cxx-4.0-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-3.1-amd64:desktop-3.1-noarch:desktop-3.2-amd64:desktop-3.2-noarch:desktop-4.0-amd64:desktop-4.0-noarch:desktop-4.1-amd64:desktop-4.1-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.0-amd64:graphics-3.0-noarch:graphics-3.1-amd64:graphics-3.1-noarch:graphics-3.2-amd64:graphics-3.2-noarch:graphics-4.0-amd64:graphics-4.0-noarch:graphics-4.1-amd64:graphics-4.1-noarch:languages-3.2-amd64:languages-3.2-noarch:languages-4.0-amd64:languages-4.0-noarch:languages-4.1-amd64:languages-4.1-noarch:multimedia-3.2-amd64:multimedia-3.2-noarch:multimedia-4.0-amd64:multimedia-4.0-noarch:multimedia-4.1-amd64:multimedia-4.1-noarch:printing-3.2-amd64:printing-3.2-noarch:printing-4.0-amd64:printing-4.0-noarch:printing-4.1-amd64:printing-4.1-noarch:qt4-3.1-amd64:qt4-3.1-noarch:security-4.0-amd64:security-4.0-noarch:security-4.1-amd64:security-4.1-noarch Distributor ID: Ubuntu Description:    Ubuntu 14.04.3 LTS Release:    14.04 Codename:   trusty   Any suggestion why or how to fix it?  Thanks in advance. $n\in N, a_{n+1} = a_n (1 - a_n)$ , $0 < a_0 < 1$. Prove that $\lim\limits_{n\to\infty} a_n\cdot n = 1$. $n\in N,   a_{n+1} = a_n  (1 - a_n)$ , $0 &lt; a_0 &lt; 1$. Prove that $\lim\limits_{n\to\infty} a_n\cdot n = 1$. I proved that $\lim\limits_{n\to\infty} a_n = 0$ and that $a_n$ is strictly decreasing. I tried Cezaro Stolz but didn't get anywhere. Thanks in advance. How can I delete Facebook messages I've sent to other Facebook users from their inbox?  I have had a conversation with my friend but now I want to delete my messages from that conversation. Can I have them deleted from my friend's inbox? How can I check the integrity of a downloaded Ubuntu CD? I've just downloaded a CD image of Ubuntu. I know the installer has a check CD option, but how can I check that the image is good before burning it to CD? Is there a way in Adobe Creative Suite to "share palettes/swatches" across programs? I use a mixture of InDesign, Photoshop and Illustrator to produce the vast amount of printed media I design at my current position and I find myself faced with copy/pasting color values from one program to another almost all the time, I have tried to find a quicker way but have been unsuccessful. I use a program called  to copy and store my most used colors, but still, it's not the same as being able to select it from the swatches palette in Adobe CS.  So the main meat of the question is:   Can I share my colors/swatches between InDesign, Photoshop and Illustrator and if so, how? Where are packages stored installed with APT in Ubuntu 16.04? I know that packages installed with apt-get are stored in /var/cache/apt/archives.  I just installed mariadb server in Ubuntu 16.04 with following command:  sudo apt install mariadb-server   When I tried to find packages in /var/cache/apt/archives, there are no packages. Where are they stored if it's not in this directory? What's the difference between mobile and desktop processors? I was trying to install minted package in TeXLive. I installed it and then run sudo tlmgr update --all. It was running slow so I stopped it using Ctrl+Z in an ubuntu terminal and then I run sudo tlmgr update --list. After that I installed texlive-latex-extra and python-pygments. Later on I run sudo tlmgr update --all again and let it finish.  After that I am trying to run a simple code using listings and greek but I get an error     Bad Character code (256)   A MWE that illustrated the problem is the following  \documentclass{book}  \usepackage[english,greek]{babel} \usepackage[iso-8859-7]{inputenc} % %\usepackage[utf8]{inputenc} \usepackage{kerkis} \usepackage{pifont} % %  \newcommand{\sw}{\selectlanguage{english}} \newcommand{\sq}{\selectlanguage{greek}} \newcommand{\eng}[1]{\latintext#1\greektext} \newcommand{\gre}[1]{\greektext#1\latintext}  \usepackage{xcolor} \usepackage{listings} \usepackage{textcomp}  \definecolor{listinggray}{gray}{0.9} \definecolor{lbcolor}{rgb}{0.9,0.9,0.9}  \lstdefinestyle{JavaStyle}{         backgroundcolor=\color{lbcolor},     tabsize=4, %   rulecolor=,     language=Java,      % choose the language of the code         basicstyle=\scriptsize,     % the size of the fonts that are used for the code         upquote=true,         aboveskip={1.5\baselineskip},         columns=fixed,         showstringspaces=false,         extendedchars=false,         breaklines=true,         prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},         frame=single,         numbers=left,         showtabs=false,         showspaces=false,         showstringspaces=false,         identifierstyle=\ttfamily,         keywordstyle=\color[rgb]{0,0,1},         %commentstyle=\color[rgb]{0.026,0.112,0.095},         commentstyle=\itshape\color{green!40!black},         stringstyle=\itshape\color{red!90!black},         numberstyle=\itshape\color{yellow!50!black} }  \lstdefinestyle{CppStyle}{         backgroundcolor=\color{lbcolor},     tabsize=4, %   rulecolor=,     language=C++,       % choose the language of the code         basicstyle=\scriptsize,     % the size of the fonts that are used for the code         upquote=true,         aboveskip={1.5\baselineskip},         columns=fixed,         showstringspaces=false,         extendedchars=false,         breaklines=true,         prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},         frame=single,         numbers=left,         showtabs=false,         showspaces=false,         showstringspaces=false,         identifierstyle=\ttfamily,         keywordstyle=\color[rgb]{0,0,1},         %commentstyle=\color[rgb]{0.026,0.112,0.095},         commentstyle=\itshape\color{green!40!black},         stringstyle=\itshape\color{red!90!black},         numberstyle=\itshape\color{yellow!50!black} } \begin{document}  This is a dummy text. kjhbki \end{document}   The .aux file says  \relax  \select@language{greek} \@writefile{toc}{\select@language{greek}} \@writefile{lof}{\select@language{greek}} \@writefile{lot}{\select@language{greek}}   while the .log file can be found   Any idea why is this happening and how to fix this? Note that if I remove the listings preamble, delete all produced files and build the document, everything works fine. To show: $(\mathbb{Q},+)$ is not isomorphic to $(\mathbb{R},+)$  Now, the equation $x^{2} =3$ has a solution in $\mathbb{R}$, but not in $\mathbb{Q}$.  Hence they are not isomorphic to each other.  Is that right, or do I need to prove something else?  Thanks. Does $\sum_{k=1}^{\infty}\ln(\frac{k}{k+1})$ converge/diverges?? Does this series converge or diverge? $$\sum_{k=1}^{\infty}\ln(\frac{k}{k+1})$$   my thought is that, I can break it down to $$\sum_{k=1}^{\infty}\ln(k) - \sum_{k=1}^{\infty}\ln(k+1)$$ then maybe using comparison test or something? But I don't know exactly how to prove whether this series converges or diverges.  Any help would be appreciated! Is there a way to detect the collapse in wave function of entangled particles instantaneously? Is there a machine or instrument which will notify us instantly when the wave-function has collapsed if we have access to only one of the entangled particles? Note that the wave function collapse will be triggered by observing the particle which we do not have. Or in other words is there a way to identify (instantaneously) if the entangled pair of a particle has been observed and the wave function has collapsed. Misplaced navigation bar and question title It appears that on Server Fault and Super User, the navigation bar and question title have suddenly become misplaced. The same does not occur on SO and mSO, nor on any of the other SE sites I spot-checked.  This is being seen in both Chrome and Firefox and just began occurring within the last few minutes.      What it should look like:      While this was fixed for a few hours, it has returned as of 22:05. Given that $x^y=y^x$, what could $x$ and $y$ be? It's not too difficult to figure out that $x$ and $y$ can both be 1, and also $x$ can be 2 and $y$ can be 4 (and vice versa). But I can't rule out if there are other solutions. Does it have anything to do with inverse functions? Is there a way to see the solutions by graphing, or algebraically? $N(ab) \geq N(a)$ is not necessary for the ring to be euclidean The definition of euclidean ring in my textbook is 1) $N(ab) \geq N(a)$ 2) Euclidean algorithm works. However there is a note that the first condition is not necessary. There is a hint that we can choose a following norm: $N'(a) = \min_{b\sim a} N(b)$. I do not understand why it works. We need to check that euclidean algorithm still works with this norm.   I tried to do the following. If $a \sim b$, then $a = bx, x \in K^*$. Let $N'(a)$ be $N(ax)$. Let us divide $ax$ by $bx$ instead of $b$. We get $ax = bxq + rx$, $N(rx) \leq N(bx)$. Here I am stuck and have no idea how to continue. How to remove the "No front page content has been created yet." message from the front page? I only want blocks on the homepage. Because I don't have any nodes, and I want to keep the homepage as /node I am getting a "No front page content has been created yet." message on my page.  How do I get around this? How to detect if a variable is an array Must $k$-subalgebra of $k[x]$ be finitely generated? Trouble enabling Cube surfer addon Every time I have tried to enable the Cube Surfer addon but this error message comes up. FYI I have the correct versions of everything.  I have had this problem with some other add ons as well. Sometimes it's when I have tried to click a button in an addon (after 'successfully' installing) Is it possible to write all mathematical formulas in a separate file and add them in main file on-demand?