line 7: [: missing `]' I have that error How do I fix it? I have indented
Brackets in if condition: why am I getting syntax errors without whitespace?
What package should I use to typeset units? bash - problems reading text file and printing line by line Can a druid in Ape wildshape use weapons? Wilson and Fermat's Theorem Why is Ubuntu Software Center dropping previously provided applications? Ubuntu Software used to provide Pinta, KolourPaint, Audacity, and others, but they are no longer available there. I have to use apt to install them.   Why has Ubuntu Software 3.20.5 stopped providing applications that it used to?  Ubuntu 16.04 Ubuntu Software Center 3.20.5  Thanks in advance for your help! What conservation law corresponds to Lorentz boosts? Noether's Theorem is used to relate the invariance of the action under certain continuous transformations to conserved currents. A common example is that translations in spacetime correspond to the conservation of four-momentum.  In the case of angular momentum, the tensor (in special relativity) has 3 independent components for the classical angular momentum, but 3 more independent components that, as far as I know, represent Lorentz boosts. So, what conservation law corresponds to invariance under Lorentz boosts? The proof of shrinking coefficients using ridge regression through "spectral decomposition" I have understood how ridge regression shrinks coefficients towards zero geometrically. Moreover I know how to prove that in the special "Orthonormal Case," but I am confused how that works in the general case via "Spectral decomposition." Passing data between view controllers Why is $\sqrt{-x}*\sqrt{-x}=-x?$ I found this math "problem" on the internet, and I'm wondering if it has an answer:     Question: If you choose an answer to this question at random, what is the probability that you will be correct?      a. $25\%$      b. $50\%$      c. $0\%$      d. $25\%$   Does this question have a correct answer? Export multiple objects to .obj How to change desktop background from command line in Unity? I have a script that updates my desktop background every day with the NASA APOD. Since upgrading to 11.10, that script stopped working, presumably because I'm using gconftool-2 to actually update the desktop background. Is there a new way to do this under Unity? Is there some way to embed LaTeX source code in a PDF file? Where can I start to learn ArcPy? Number formation from given digits I was asked this question in a recent interview. You are given two digits $0$ and $9$. Using only these two digits you must form the least positive number that is a multiple of a given '$n$' . The value of $n$ will be provided before hand. For example if we are given $n$ as $7$ then the answer will be $9009$ .  I tried using some basic divisibility principles but was not able to come up with a correct solution and code it up. Probably I need some help in number theory If we have two circles in the plane described by $(x_1, y_1, r_1)$ and $(x_2, y_2, r_2)$ we can determine if they are completely disjoint by simply:  $$(x_1 - x_2)^2 + (y_1 - y_2)^2 &lt; (r_1 + r_2)^2$$  Assume this is not the case, we now want to know if one completely overlaps the other.  (That is: if the second circles interior is a subset of the first circles interior.)  If $(x_1, y_1) = (x_2, y_2)$ than we can trivially compare radii, so lets assume their centers are distinct.  The way I have imagined is to create a parametric equation of the line that connects the two centers:  \begin{align} x_p(t) &amp;= x_1 + t(x_2 - x_1) \\ y_p(t) &amp;= y_1 + t(y_2 - y_1) \end{align}  Then we calculate the two line segments (represented as two pairs of t values) where the circles intersect this line.  One is a subset of the other if and only if the corresponding circles are subsets of each other.  Is there a simpler approach I am overlooking? How to make read-only file system writable? At some point, the filesystem on my digital audio player has become read-only. I cannot copy files into it or remove files on it.  Are there some possible reasons for the player's file system to change permissions in this way?  I tried using chmod:  $ sudo chmod a+rw SGTL\ MSCN/  chmod: changing permissions of `SGTL MSCN/': Read-only file system   SGTL MSCN is the mount point of the digital audio player.  What else can I try to make it writeable? Highlight elements in the matrix List of Figures + Beamer? I want to have a List of Figures in my Beamer presentation.  I spent some time searching the web for a solution and only found desperate people telling others that it's not possible, i.e.  or .  I also made some experiments on my own, i.e. "abuse" tocloft to do the job. However, even \usepackage{tocloft} causes pdflatex to fail with ! LaTeX Error: \l@section undefined. (and lying to tocloft by defining the command as empty beforehand doesn't to any good either).  I can't really see why it should be that difficult to make a List of Figures in beamer, since \tableofcontents works flawlessly.   I'm not afraid of doing some coding on my own, but I'm not deep enough into TeX to really understand the magic behind the "List of Figures", "Table of Contents" and alike.  Is anyone out there having suggestions or links that might help me figure this out?  \documentclass{beamer}  % uncomment the following line % to get the error message % `! LaTeX Error: \l@section undefined.`  %\usepackage{tocloft}   % uncomment the following lines INSTEAD % to lie to tocloft % and get the next error message  %\makeatletter %\newcommand\l@section{} %\makeatother %\usepackage{tocloft}  \begin{document}  \begin{frame}{A frame} \begin{figure} \mbox{A} \caption{An 'A'} \end{figure} \end{frame}  \begin{frame}{List of Figures} \listoffigures \end{frame}  \end{document}   EDIT: Solution  Starting from Marco Daniels answer to my question, I modified his code to reflect my needs. Here is what I came up with. Please feel free to comment, improve and reuse this.  \RequirePackage{ifthen}  \makeatletter  \AtEndDocument{%   \clearpage   \beamer@tempcount=\c@page\advance\beamer@tempcount by -1%   \if@filesw   \newwrite\tf@lof   \immediate\openout\tf@lof\jobname.lof\relax   \newwrite\tf@lot   \immediate\openout\tf@lot\jobname.lot\relax   \fi }  \long\def\beamer@makecaption#1#2#3#4{%   \def\insertcaptionname{\csname#1name\endcsname}%   \def\insertcaptionnumber{\csname the#1\endcsname}%   \edef\insertframenumber{\theframenumber}%   \ifthenelse{\equal{#3}{\empty}}{%       \def\insertlistcaption{#2}%   }{%     \def\insertlistcaption{#3}%   }   \def\insertsource{#4}%   \def\insertcaption{#2}%   \ifthenelse{\equal{#1}{figure}}{%       \addtocontents{lof}{\protect\listoffigureformat{\insertcaptionnumber}{\insertlistcaption}{\insertframenumber}{\insertsource}}{}{}%   }{}   \ifthenelse{\equal{#1}{table}}{%       \addtocontents{lot}{\protect\listoftableformat{\insertcaptionnumber}{\insertlistcaption}{\insertframenumber}}{}{}%   }{}   \nobreak\vskip\abovecaptionskip\nobreak   \sbox\@tempboxa{\usebeamertemplate**{caption}}%   \ifdim \wd\@tempboxa &gt;\hsize   \usebeamertemplate**{caption}\par   \else   \global \@minipagefalse   \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%   \fi   \nobreak\vskip\belowcaptionskip\nobreak% }  \def\listoffigureformat#1#2#3#4{%   \makebox[2ex][r]{#1}%   \hspace{1ex}%   {\usebeamercolor[fg]{bibliography entry author} #2}%   \ifthenelse{\equal{#4}{\empty}}{}{ -- #4}%   \dotfill%   \makebox[2ex][r]{#3}\par% } \def\listoffigures{%   \setlength{\leftskip}{3ex}   \setlength{\parindent}{-3ex}   \@starttoc{lof}% } \def\listoftableformat#1#2#3{\makebox[2ex][r]{#1}\hspace{1ex}#2\dotfill\makebox[2ex][r]{#3}\par} \def\listoftables{%   \setlength{\leftskip}{3ex}   \setlength{\parindent}{-3ex}   \@starttoc{lot}% }  \long\def\@caption#1[#2]#3{   \par\nobreak   \begingroup     \@parboxrestore     \if@minipage       \@setminipage     \fi     \beamer@makecaption{#1}{\ignorespaces #3}{\ignorespaces #3}{\ignorespaces #2}\par\nobreak     \endgroup}  \makeatother Why does $\sum_{k=1}^{\infty}\frac{{\sin(k)}}{k}={\frac{\pi-1}{2}}$? Inspired by  (and far more straightforward, I am guessing), Mathematica tells us that $$\sum_{k=1}^{\infty}\dfrac{{\sin(k)}}{k}$$ converges to $\dfrac{\pi-1}{2}$.   Presumably, this can be derived from the similarity of the Leibniz expansion of $\pi$ $$4\sum_{k=1}^{\infty}\dfrac{(-1)^{k+1}}{2k-1}$$to the expansion of $\sin(x)$ as $$\sum_{k=0}^{\infty}\dfrac{(-1)^k}{(2k+1)!}x^{2k+1},$$ but I can't see how...  Could someone please explain how $\dfrac{\pi-1}{2}$ is arrived at?