I have read many articles comparing muable and immutable classes in java. I have also read that immutable classes are easier to understand than mutable once (to the user of course).  Why it is so..? Actually I think that mutable classes show real problems more precisely than immutable once and developer does not have to carry an overhead of creating new objects every time.  please help me with that  Thanks in advance
I'm trying to get my head around mutable vs immutable objects. Using mutable objects gets a lot of bad press (e.g. returning an array of strings from a method) but I'm having trouble understanding what the negative impacts are of this. What are the best practices around using mutable objects? Should you avoid them whenever possible?
In the category $\mathbf{Set}$ is "the product of an empty set of sets a one-element set"? I was reading  on Category Theory and it said (paraphrased to add context):     Exercise 4: Explain why in $\textbf{Set}$ (the Category of Sets), the product of an empty set of sets is a one-element set.   which I think is incorrect. The product of two empty sets (or any number) is empty because we are considering:  $$ \emptyset \times \emptyset = \{ (a,b) : a \in \emptyset, b \in \emptyset \} = \emptyset$$  where $a \in \emptyset , b \in \emptyset$ are false, so the above is the $\emptyset$ which is NOT a one element set (its a zero element set).   This should be trivial so I am assuming I am somewhere mis reading the natural language of the exercise. Someone help me catch where is it and what the answer should be? i.e. whats being asked and the answer? I am using a tikzpicture for plotting. the values I want to plot are typical (X,Y) pairs. The x-value is an uninteresting id-value. I want to order the bins ascending/descending according to the y-value, but how do I do that? The figure seems to automatically take the x-values for ordering, how can I override that? (I am not particularly fixed to tikzpicture - its just the first thing that actually worked and displayed the plot....) Following minimal-working example, how could I achieve a reordering according to the y-value?  \documentclass{article} \usepackage[english]{babel} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{relsize} \usepackage{times} \usepackage{url} \usepackage{latexsym} \usepackage{graphicx} \usepackage{colortbl} \usepackage{color} \usepackage{caption} \usepackage{pgfplots, pgfplotstable} \usetikzlibrary{arrows} \usepackage{amsmath} \usepackage{multirow} \usepackage{booktabs}  \usepackage{filecontents} \definecolor{OgAns}{rgb}{0, 0.8, 0.4}  \begin{filecontents}{testdata.dat} 1   30 2   44 4   26 3   39 \end{filecontents}  \begin{document} \begin{figure} \begin{tikzpicture}         \begin{axis}[                ybar stacked,             ymin=0,             ymax=100,             bar width=5pt,             legend style={at={(0.35, -0.4)},anchor=south west},             legend columns=-1                       ]           \addplot[ybar,fill=OgAns]  file {testdata.dat};          \end{axis}     \end{tikzpicture} \end{figure}   \end{document} This option, which was present in the "Mouse and Touchpad" settings panel in previous versions, is for some reason absent in 16.04 LTS. Does anyone know why this is, and/or how to fix it? Thanks. Why does $\lim_{n\to\infty}(1+\frac{1}{n})^n = e$ instead of $1$? On Wikipedia, it says that $\lim_{n\to\infty}(1+\frac{1}{n})^n = e$ :     It [e] is approximately equal to 2.71828,[1] and is the limit of (1 + 1/n)n as n approaches infinity, ... ()   When I evaluate $(1+\frac{1}{n})^n$ for $n = 10^8$, I get approximately $2.718281798347$ which indeed is pretty close to $e$.  But when I try to "solve" the limit using the laws of limits, I get  $$\lim_{n\to\infty}\left(1+\frac{1}{n}\right)^n = \left(\lim_{n\to\infty}\left(1+\frac{1}{n}\right)\right)^n$$  because of the power law  $$ = \left(\lim_{n\to\infty}(1)+\lim_{n\to\infty}\left(\frac{1}{n}\right)\right)^n$$  because of the addition law  $$=\left(1+0\right)^n = 1$$  but that would mean that $e=1$, which is obviously not true.  What am I missing / doing wrong?  Thanks in advance. Disable the "You've gone full screen" notification in Chrome There is a prime between $n$ and $n^2$, without Bertrand VHDL Transition Function Visually stunning math concepts which are easy to explain Since I'm not that good at (as I like to call it) 'die-hard-mathematics', I've always liked concepts like the  or the , which are easy to understand and explain but are mathematically beautiful at the same time.  Do you know of any other concepts like these? Volume generated by revolving the region in the first quadrant bounded by the parabolas $y^2=x$, $y^2=8x$, $x^2=y$, $x^2=8y$ about the $x$-axis. I came across this question from Schaum's Outlines of Advanced Calculus:     Show that the volume generated by revolving the region in the first quadrant bounded by the parabolas $y^2=x$, $y^2=8x$, $x^2=y$, $x^2=8y$ about the $x$-axis is $\dfrac{279\pi}{2}$.   My solution was to divide the region into three parts:    $$\pi\int_{1}^{2}(x^2)^2 - (\sqrt{x})^2\;dx = 4.7\pi$$  $$\pi\int_{4}^{8}(\sqrt{8x})^2 - (\sqrt{x})^2\;dx = 42\pi$$  $$\pi\int_{2}^{4} (x^2)^2 - \left(\frac{1}{8}x^2 \right)^2\;dx = 44.9\pi.$$  Hence the total volume will be  $$\pi(4.7 + 42 + 44.9) = 91.6\pi$$  which is wrong.  Can someone point out my mistake? Assuming I have a Czech license and break a minor law in Germany which incurs me a certain number of "violation points" (e.g. speeding), would those points be eventually transferred to my Czech license? I would obviously have to pay the fine (either on the spot or by mail), but it's not clear if EU countries exchange data on traffic points.  I would limit the scope to EU/EEA license holders driving within the EU/EEA, to avoid an overly broad question. Also assume that the person in question is resident in his home country and is only visiting other EU/EEA countries as a tourist. how to decode this JSON string? I have a question about subsets $$ A \subseteq \mathbb R $$ for which there exists a function $$f : \mathbb R \to \mathbb R$$ such that the set of continuity points of $f$ is $A$. Can I characterize this kind of sets? In a topological,measurable or in some way? For example, does there exist a function continuous on $\mathbb Q$ and discontinuous on the irrationals? Just looking for the difference between   2&gt;&amp;- 2&gt;/dev/null |&amp; &amp;&gt;/dev/null &gt;/dev/null 2&gt;&amp;1   and their portability with non-Bourne shells like tcsh, mksh, etc. hyperlink name with biblatex authoryear (biblatex 1.4b) "dev/sda1: clean, ..." This message appears after I startup my laptop, then it won't continue booting dev/sda1: clean, 552599/6111232 files, 7119295/24414464 blocks   After I turn on my laptop this message appears. The system never boots, the message just stays there. Prove $\gcd(a,b) \gcd(a,c) \gcd(b,c) \,\text{lcm} (a,b,c)^2=$ $\text{lcm}(a,b)\,\text{lcm}(a,c) \,\text{lcm}(b,c) \gcd(a,b,c)^2$ I'm trying prove $$\gcd(a,b) \gcd(a,c) \gcd(b,c) \,\text{lcm} (a,b,c)^2=\text{lcm}(a,b)\,\text{lcm}(a,c) \,\text{lcm}(b,c) \gcd(a,b,c)^2$$  It is a part of solution of another problem I try a lot to prove it but I could not be succeed.  I tried using exponent manipulation in prime factorizations but it didn't help me. Why exactly can't a single resistor be used for many parallel LEDs? Why can't you use a single resistor for a number of LEDs in parallel instead of one each? Is there a C++ decompiler? Does low disk space affect SSD performance? I was wondering if having less than 5-10GB of free space on an SSD would affect performance. Is it specific to SSD or is it more of an operating system aspect?  For example, on an Intel X-25 G2 that has TRIM support (on Windows 7). TOC entries and labels for included PDF pages I am embedding full pages from another PDF document (using the pdfpages package), but I would like to be able to declare my own section headings before each embedded document (for e.g. hyperlinking / TOC purposes). pdfpages has an experimental feature which lets me do this, but the problem is that I want to put all of these embedded documents inside a section, so I need to insert a section heading and a subsection heading on the first document I embed. Unfortunately pdfpages doesn't seem to be able to do this. Is there a way for me to do this?  Edit: Thank you for the suggestions. I am also in need of something similar for general labels — at the moment I am abusing the addtolist option of \includePDF but the objects I'm labelling aren't really figures or tables.