How can I get the pid of a subshell?  For example:  $ echo $$ 16808   This doesn't work, because the original shell expands $$:  $ ( echo $$ ) 16808   Why does single quoting not work? After the original shell removes the single quote, does the subshell not expand $$ in itself?  $ ( echo '$$' ) $$   Why does eval not work either? Is eval run by the subshell?  Why does it give me the original shell's PID?  $ ( eval echo '$$' ) 16808   Thanks.
I'm reading "BASH pocket guide of Oreilly". It said:      The process ID of the current Bash process.   In some cases, this can differ from $$.   Above explanation , explained $BASHPID variable.  Question: which cases?
Why does Java's hashCode() in String use 31 as a multiplier? Per the Java documentation, the  for a String object is computed as:   s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]       using int arithmetic, where s[i] is the    ith character of the string, n is the length of    the string, and ^ indicates exponentiation.   Why is 31 used as a multiplier?  I understand that the multiplier should be a relatively large prime number. So why not 29, or 37, or even 97? So the vending machine tore my $5 in pieces. What now? The vending machine swallowed half of my $5 bill, and the other half remained in my hand. Can I get my $5 back, or is it all lost forever? Is there a location where I can drop in a custom JavaScript file in Drupal 7.x?  It just includes simple event actions for menus, and I don't want to edit the theme/module files.  Or do I have to just add the "include" hook to the theme/module? How can I assign a Func conditionally between lambdas using the conditional ternary operator? How to put legend below the chart? I have the following code that produces a line chart:  \begin{figure}[p]     \centering \begin{tikzpicture}     \begin{axis}[     use units,     cycle list name=exotic, %This defines the color. It produces nicer colors         width=15cm, height=8cm,     % size of the image         grid = major,         grid style={dashed, gray!30},         %xmode=log,log basis x=10,         %ymode=log,log basis y=10,         xmin=0,     % start the diagram at this x-coordinate         ymin=0,     % start the diagram at this y-coordinate         %/pgfplots/xtick={0,5,...,60}, % make steps of length 5         %extra x ticks={23},         %extra y ticks={0.507297},         axis background/.style={fill=white},         ylabel=Time,         xlabel=Number of Datapoints (n),         y unit=s,y unit prefix=m,         tick align=outside]        % import the correct data from a CSV file       \addplot table [col sep=comma,trim cells=true,y=Best Case (Ascending)] {datasets/time_mergesort.txt};           \addplot table [col sep=comma,trim cells=true,y=Average Case (Random)] {datasets/time_mergesort.txt};                     \addplot table [col sep=comma,trim cells=true,y=Worst Case (Descending)] {datasets/time_mergesort.txt};                      \legend{Ascending,Random,Descending}     \end{axis}  \end{tikzpicture}     \caption{Mergesort Run Time for Sorting Random Data}     \label{fig:merge_sort_from_csv} \end{figure}   And at the moment the legend appears on the chart on the upper right corner. I need to move that below the chart, or even to leave that on the chart but to move that on the upper left corner.   I have tried the solution mentioned at , but it did not work for me.  How can I move the axis in a different position? How can I add custom '.desktop' application launchers to Ubuntu Dock? Intuition for $\,c\mid a,b \iff c\mid \gcd(a,b)$ Delete commits from a branch in Git How to distinguish between American Indians and Indian Indians in native English (language) parlance? How to distinguish between American Indians and Indian Indians in native English (language) parlance?  Can I say Indian Indian to say Indian from Asia compared to the Native Americans? Where are some good places to find royalty free stock images? Getting Session ID in Lightning $SL_n(\mathbb R)$ is a subgroup of kernel of $f\in$ Hom$(GL_n(\mathbb R), A)$, $A$ is an abelian group. Try to prove the following proposition.     $SL_n(\mathbb R)$ is a subgroup of kernel of $f\in$ Hom($GL_n(\mathbb R), A)$, where $A$ is an abelian group.   My first attempt is to show that $SL_n(\mathbb R)$ is in form of $ABA^{-1}B^{-1}$, then it's clear that $ABA^{-1}B^{-1}$ is in $ker(f)$. However, there exists an elementary row reduction matrix, i.e. $E_{ij}(m)$ adding m times $j$-th row to $i$-th row. Then $E_{ij}(m)\in SL_n(\mathbb R)$. Now, it is possible that $E_{ij}(m)$ is not in $ker(f)$. Then I try to find any relation between $\mathbb R^{\times}$ and $A$, but, except knowing they are both abelian groups, I cannot figure out what else connects those two group. Could you give me some hints? Do I need a transit visa for waiting 23 hours in Dubai airport? I am an Indian citizen living in Ukraine. I will be traveling to India but I need to wait in Dubai airport 23 hours for my next flight to India. I will not be leaving Dubai airport.  So in this case do I need a transit visa? In a raster layer's Style Properties, I can choose pseudocolor render type, and choose a color ramp and classify the raster.      However, when I click the 'Apply' button, or click 'OK', the visualization of the raster never changes.  I was able to output a 'colorized' version of the same raster using GRASS plugin.  I also reinstalled QGIS 2.8, and was able to adjust and see a raster stylings using the steps I outlined above.  So, can anyone confirm this as an issue, or confirm that there's a mistake somewhere in my process?  I should note that I'm on a Mac, 10.10.4, and I'm using the QGIS provided by , 2.10.1-1 .  Update 1: Here's a screenshot of the rest of my settings.      I have Grayscale set to off in the Style setting.  Also, I don't believe grayscale/color-blind Preview is available on the Mac version of QGIS.  They're does't appear to be the option where it , in the Menu Bar under View / Preview / Photocopy (grayscale) etc.  Either way-- I added a shapefile to show color.  Update 2: I've experimented with setting color interpolation to discrete, linear, and exact, but still am not able stylize using Singleband pseudocolor.  I've also confirmed that the 'Render' box on the the main map view is checked.  Also, I am able to adjust Color Rendering settings, like Hue, Blending Mode, etc., and see the results when clicking 'Apply' or 'OK'.  Update 3: As other Mac users are confirming this, I think it may be a bug. I've created a bug report at the official . How can i render the reflections i see in the Look Dev viewport in Blender 2.8 i'm finding blender 2.8 confusing and i'm relatively new to blender in general anyway. While looking at my model in the Look Dev view port i can see reflections.        However, when i render my scene in eevee (and cycles), the reflections aren't rendered     Is there something i'm doing wrong or an option i haven't enabled? Relative Pronouns are ALWAYS added right after antecedent? Is is a rule that relative clauses should be added right after the antecedent(the noun relative pronouns refer to)? What if it is confusing?   For example:  "I went for a spin with a handsome boy last night."  "The handsome boy went out with my friend."  "I went for a spin with a handsome boy who went out with my friend last night ."  "I went for a spin with a handsome boy last night who went out with my friend." "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. Duplicate questions that use different words to describe the same problem are important for people to find the content via search engines. But the user experience when an anonymous user arrives at a duplicate is less than ideal.  They have to notice the duplicate link and understand that the answer they are looking for is likely behind that link. I don't think this is all that obvious to someone without experience with an SE site.  I propose to just redirect users to the duplicate automatically if the closed duplicate has zero answers. In that case they need to follow the link to the duplicate in any case, so we might as well redirect them to it in the first place.  I could imagine this being problematic with search engines, as we would be displaying different content than what the search engines see. If that is too problematic I would suggest to show a very obvious link to the duplicate in the answers section for anonymous users. Easy way to determine the virtualization technology of a Linux machine? Notation for infinite product in reverse order This question is related to notation of infinite product.   We know that, $$ \prod_{i=1}^{\infty}x_{i}=x_{1}x_{2}x_{3}\cdots $$  How do I denote $$     \cdots x_{3}x_{2}x_{1}  ?    $$  One approach could be  $$ \prod_{i=\infty}^{1}x_{i}=\cdots x_{3}x_{2}x_{1} $$  I need to use this expression in a bigger expression so I need a good notation for this. Thank you in advance for your help.