I am new to Bash Scripting and would need help to make a simple script that I will run on my CentOS. I would like the script to check if classpath is empty like this:  &gt; [root@hdp ~]# echo $CLASSPATH &gt;  &gt; [root@hdp ~]#   do: export CLASSPATH="something"  else  echo -n "There's already a classpath! Appending!"   If there already is a classpath set, append to the existing one without overwriting to it.
export CLASSPATH=.;../somejar.jar;../mysql-connector-java-5.1.6-bin.jar java -Xmx500m folder.subfolder../dit1/some.xml cd ..   is the above statement for setting the classpath to already existing classpath in linux is correct or not
Fill the area determined by two pgfplots graphs I need to fill the region determined by two (Gaussian) curves and the right red line (the region is brushed in green in the figure below). I also wonder what is the best way to draw vertical line which goes through the intersection of both graphs (the left red line on the figure).  Any pointers would be greatly appreciated.    My initial attemt is pasted below.  \documentclass{standalone} \usepackage{pgfplots}  \begin{document}  \pgfmathdeclarefunction{dnorm}{2}{%   \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}% }  \begin{tikzpicture} \begin{axis}[domain=0:12, samples=100, height=5cm, width=10cm] % Fill aread under the curves \addplot [fill=red!20, draw=none, domain=0:6] {dnorm(6.5,1.5)} \closedcycle; \addplot [fill=blue!20, draw=none, domain=6:10] {dnorm(4,1)} \closedcycle; % Draw curves \addplot [thick] {dnorm(4,1)}; \addplot [thick] {dnorm(6.5,1.5)}; \end{axis} \end{tikzpicture}  \end{document}   My solution  A picture is worth a thousand words. Code is pasted below.   \documentclass{article} \usepackage{tkz-fct} \usetikzlibrary{intersections}  \begin{document}  \tikzset{    name plot/.style={every path/.style={name path global=#1}} }  % Extract coordinates for point X \makeatletter \newcommand{\gettikzxy}[3]{%   \tikz@scan@one@point\pgfutil@firstofone#1\relax   \edef#2{\the\pgf@x}%   \edef#3{\the\pgf@y}% } \makeatother  % Dimlines \def\Dimline[#1][#2][#3][#4]{ \begin{scope}[thin, &gt;=stealth'] % redefine as flechas \draw let \p1=#1, \p2=#2, \n0={veclen(\x2-\x1,\y2-\y1)} in [|&lt;-&gt;|, decoration={markings,mark=at position .5 with {\node[#3] at (0,0) {#4};}, }, postaction=decorate] #1 -- #2 ; \end{scope} }  \begin{tikzpicture}[scale=1,font=\small] \tkzInit[xmin=0,xmax=12,ymin=0,ymax=.3,ystep=.05] % Draw coordinates \draw[&gt;=stealth', &lt;-&gt;] (0,6) node[above] {$y$} -- (0,0) --  (12.5,0) node[right] {$x$}; % Draw functions and areas \tkzFct[name plot=A,thick,color=red,domain=0:12]{1/(1.5*sqrt(2*pi))*exp(-((x-4.5)**2)/(2*1.5**1))} \tkzDrawArea[opacity=.3,color=blue,domain = 7:12] \tkzFct[name plot=B,thick,color=blue,domain=0:12]{1/(2*sqrt(2*pi))*exp(-((x-7)**2)/(2*2**1))} \tkzDrawArea[opacity=.3,color=red,domain=0:7] \tkzDrawAreafg[between=b and a,opacity=.3,color=green,domain = 0:7] % Intersection between curves \path [name intersections={of=A and B,by=C}]; % Extract coordinates of C \gettikzxy{(C)}{\cx}{\cy} % Vertical lines \draw [thick,dashed, black] (\cx,0) -- (\cx,5.5) node [above] {$x_{0}$}; \draw [thick,dashed, black] (7,0) -- (7,5.5) node [above] {$\hat{x}$}; % Define regions \Dimline[($(0,0)+(0,-.6)$)][($(7,0)+(0,-.6)$)][above,black][$\mathcal{R}_{1}$]; \Dimline[($(7,0)+(0,-.6)$)][($(12,0)+(0,-.6)$)][above, black][$\mathcal{R}_{2}$]; \end{tikzpicture}  \end{document} How do I get a list of obsolete packages? I'm trying to figure out a way to get a list of the packages that are no longer available in the repositories that I have enabled. This workstation has been through quite a few versions of Ubuntu and has had many 3rd party repositories added and removed. I'd like to get a list of software that I have from these removed repositories, so I can clean it up or add back the appropriate repositories. How did Harry breach the Statute of Secrecy? Something always bothered me with Fudge's accusations:     “Disciplinary hearing of the twelfth of August,” said Fudge in a   ringing voice, and Percy began taking notes at once, “into offences   committed under the Decree for the Reasonable Restriction of Underage   Sorcery and the International Statute of Secrecy by Harry James   Potter, resident at number four, Privet Drive, Little Whinging,   Surrey." - OotP Ch. 8 "The Hearing"   Harry cast the Patronus Charm, so he violated the Decree for Reasonable Restriction of Underage Sorcery alright - extinuating circumstances aside - but how did he breach the Statute of Secrecy?  The only witnesses were Dudley and Mrs. Figg, both of whom already knew that Harry is a wizard. Earlier, even Hermione gets it wrong (don't tell her!):     They haven’t even reported that you broke the International Statute of   Secrecy. We thought they would,... - OotP Ch. 4 "#12"   Yes, Harry does use magic in front of a Muggle, Dudley, but even Dudley is not so thick that the fact that Harry's a wizard would come as a revelation to him. Harry cannot breach the Statute of Secrecy to someone already in the know.  Shouldn't Dumbledore point out that glaring error in the indictment sooner rather than later? Or at least mention it, at all?  Is there maybe a source that mentions the Statute of Secrecy containing a clause, that even the mere possibility of magic being witnessed by an uninitiated muggle is sufficient for its breach?? Cause if so, wouldn't even adult wizards have a really tough time doing anything, ever.  Possibly related: How do I merge two dictionaries in a single expression (taking union of dictionaries)? Odd behavor with POSIXct/POSIXlt and subsecond accuracy In the Lord of the Rings it is said     "In Eregion long ago many Elven-rings were made, magic rings as you   call them, and they were, course, of various kinds: some more potent   and some less. The lesser rings were only essays in the craft before   it was full-grown, and to the Elven-smiths they were but trifles — yet   still to my mind dangerous for mortals. But the Great Rings, the Rings   of Power, they were perilous.”   [LotR I 2 (60)]   There is a clear distinction here between the 20 Rings of Power in the Ring Rhyme (the 7,9,3,and 1) and these other rings. What happened to the "lesser rings"? Is "Five dollars is all I have" correct? I want to emphasize that I only have 5 dollars, so can I use the sentence:     Five dollars is all I have.   Or must it be:      Five dollars are all I have.   Please give the explanation as well. Probability of 3 people in a room of 30 having the same birthday I have been looking at the birthday problem (http://en.wikipedia.org/wiki/Birthday_problem) and I am trying to figure out what the probability of 3 people sharing a birthday in a room of 30 people is. (Instead of 2).  I thought I understood the problem but I guess not since I have no idea how to do it with 3. What kind of substitution should I use to obtain the following integrals? $$\begin{align} \int_0^1 \ln \ln \left(\frac{1}{x}\right)\,dx &amp;=\int_0^\infty e^{-x} \ln x\,dx\tag1\\ &amp;=\int_0^\infty \left(\frac{1}{xe^x} - \frac{1}{e^x-1} \right)\,dx\tag2\\ &amp;=-\int_0^1 \left(\frac{1}{1-x} + \frac{1}{\ln x} \right)\,dx\tag3\\ &amp;=\int_0^\infty \left( e^{-x} - \frac{1}{1+x^k} \right)\,\frac{dx}{x},\qquad k&gt;0\tag4\\ \end{align}$$  This is not homework problems and I know that the above integrals equal to negative of the Euler–Mascheroni constant. I got these integrals while reading this Wikipedia page: . According to Wikipedia, the Euler–Mascheroni constant is defined as the limiting difference between the harmonic series and the natural logarithm: $$\gamma=\lim_{N\to\infty} \left(\sum_{k=1}^N \frac{1}{k} - \ln N\right)$$ but I don't know why can this definition be associated to the above integrals?  I can obtain the equation $(1)$ using substitution $t=\ln \left(\frac{1}{x}\right)\rightarrow x=e^{-t} \rightarrow dx=-e^{-t}\,dt$ and I know that $$\int_0^\infty e^{-x} \ln x\,dx=\Gamma'(1)=\Gamma(1)\psi(1)=-\gamma$$ but I can't obtain the rest. Any idea? Any help would be appreciated. Thanks in advance. How can I build XML in C#? How can I generate valid XML in C#? Story identification: Old man has hacker neighbor who mysteriously dies Does anyone know this story? It was a novelette published with another one (I don't remember what it was) in . The premise was that the narrator is an old man whose neighbor, a hacker, dies under mysterious circumstances. A younger woman who is an expert in computer security is hired by the police to investigate what happened, and she has a fling with the narrator. After a while she dies as well, and the narrator realizes that it is an evil force that comes through electric lines is responsible for the killings. The title has interesting formatting in that it ends with a square (much like a command prompt cursor: [_] ) Is using only HTTPS bad in a SEO perspective? I would like to set up a new business site. I plan to direct www.example.com to example.com and only use that domain. My plan is also to only use HTTPS and not HTTP.   Does this affect the SEO for the site? E.g. do Google put lower or higher rank for sites that is only available via HTTPS? What is the probability one card from each suit will be represented when 5 cards are dealt? Can hard drives fully utilize SATA III? My motherboard currently supports both SATA II and III (3 Gb/s and 6Gb/s respectively), but after reading some online, it seems as though connecting a HDD to the 6 Gb/s is pretty much pointless. If this is the case I'm going to leave my two SATA III ports open for something that can actually use it (which at this point I'm not really sure what can).  This is part of an article I read:     In terms of everything else, we saw basically no difference from the same single drive being plugged into a SATA 6Gb/s or SATA 3Gb/s port. All of this is obviously due to the hard drive not being able to actually take advantage of the 6Gb/s bus.   from . What is the difference between 'git pull' and 'git fetch'? What are the differences between git pull and git fetch? When adding image from Wikimedia Commons, automatically add author/license/link Many Stack Exchange questions and answers embed images from Wikimedia Commons. It is probably the most used image source here. Good news Thanks to their license, all images from Wikimedia Commons can be legally used inside Stack Exchange. Bad news The only requirement is to cite the author/license (), an easy task, but we are totally failing at it, only maybe 1% of Commons images used here are properly cited. That makes our use of these images illegal, and could expose Stack Exchange to various legal threats. Not my problem, you could say, but this is also important because , bringing Stack Exchange closer to closed-data sites like Yahoo! Answers or Experts-Exchange. Proposed solution When using the image addition widget, the widget should detect whether the image's URL has a *.wikimedia.org domain, and if yes:  (optional) Transfer the image to imgur, for perennity reasons. Retrieve the author name and license name from Commons (there is a very reliable API that gives that). Concatenate into a proper citation, maybe something like &quot;*Credit: [&quot; + author + &quot;](&quot; + commonsPageURL + &quot;) , [&quot; + license + &quot;](&quot; + licenseURL + &quot;)*&quot; Insert the citation at the same time as the image's MarkDown.  Benefits:  Remove a large part of Stack Exchange's copyright violations. Makes us a good citizen in the open data world. Remember what happens to sites who disregard ethics (Experts Exchange). Consistent citations. Zero added burden for the users. So basically , we all know the direction outside the magnet its from NORTH to SOUTH. but what i don't understand is that what is the direction inside is it the same ?? I am trying to write an if statement to test whether there are any files matching a certain pattern. If there is a text file in a directory it should run a given script.  My code currently:  if [ -f /*.txt ]; then ./script fi   Please give some ideas; I only want to run the script if there is a .txt in the directory. I want to do a survey of textbooks in set theory. Amazon returns 3582 books for the keywords "set theory". A small somewhat random selection with number of references in Google scholar is the following.   Two questions:    What textbooks in set-theory are considered standard?  What is a good place to aggregate standard references (of textbooks)?    (I'm only interested in text-books, which as a format already provide a kind of standardization)  Textbooks on set theory (author: title (year) #Google Scholar citations )   Thomas J. Jech: Set Theory 3rd Edition (1978) #2441  Kenneth Kunen: Set Theory (1980) #1881  P. R. Halmos: Naive Set Theory (1974) #1079 AA Fraenkel, Y Bar-Hillel, A Levy: Foundations of set theory (1973) #696 K Kuratowski, A Mostowski, M Mączyński: Set theory (1976) #609 Suppes: Axiomatic set theory  (1972) #589 Quine: Set theory and its logic (1969) #442 A Levy: Basic set theory (1979) #442 Herbert B. Enderton: Elements of Set Theory (1977) #349 Karel Hrbacek, Thomas J. Jech: Introduction to set theory (1999) #284 RR Stoll: Set theory and logic (1979) #281  N. Bourbaki: theory of sets (1970) #211 K Devlin: The joy of sets: fundamentals of contemporary set theory (1994) #182 Ciesielski: Set theory for the working mathematician (1997) #156 YN Moschovakis: Notes on set theory (1994) #138 FW Lawvere: Sets for mathematics (2003) #118 G Takeuti, WM Zaring: Introduction to axiomatic set theory (1982) #106 Kaplansky: Set Theory and Metric Spaces (2001) #103 Potter: Set Theory and Its Philosophy: A Critical Introduction (2004) #91 PT Johnstone: Notes on logic and set theory (1987) #87 Judith Roitman: Introduction to Modern Set Theory (1990) #47 Derek Goldrei: Set Theory: For Guided Independent Study (1996) #31 Basic set theory: A Shen, NK Vereshchagin (2002) #14 Ralf Schindler: Set Theory (2014) #13 Foreman, Kanamori: Handbook of Set Theory (2009) #38   Note:  Please feel free to add textbooks to the list, as long as they are not just on a smaller subset of set theory. (Some of the dates might not be the first published edition.) How exactly was the finalist chosen in the NIST AES competition?