I am trying to workaround with STL stack where in I wish to display stack elements. But I don't find any efficient approach to display without popping each element.
Does the std::stack in the C++ STL expose any iterators of the underlying container or should I use that container directly?
Run command whenever someone joins a Minecraft server Is there any way to run a command automatically when a player joins the server? I need to do this without the use of a Bukkit plugin. I think it's possible with MCP but I want to know how! Why are more powerful tools using higher voltage? AFAIK each of the world leading cordless power tools manufacturers produces several "product lines" of cordless power tools with different voltages. For example, Bosch currently produces tools with Li-Ion batteries with 10,7V, 14,4V, 18V and 36V output and the higher the voltage the more powerful a tool is.  Now those tools are powered by batteries that are assembled from cells with lower voltage (something like 3,7 volts for Li-Ion cells I guess) and cells are connected in sequence until the target voltage is reached.  They could instead connect cells in parallel. They would have the same voltage, but higher current and that would again yield higher power.  Why do they choose higher voltage over same voltage and higher current to get higher power in electric tools? I'm working on creating an illustration that I will need in many, different guises in differential geometry/manifold theory etc. Following on from a previous (answered) question of mine (, I want to show how two coordinate lines in the plane originate from two curves on a surface via the chosen map:  \begin{tikzpicture}     \begin{axis}[             name=mfd,             declare function={                     f(\x,\y)=10-(\x^2+\y^2);             },                   declare function={                     c_x(\t)=(cos(\t)+(sin(5*\t)/10))/3+1;             },                   declare function={                     c_y(\t)=(sin(\t))/2-1;             },                   declare function={                     c_z(\t)=f(c_x(\t),c_y(\t));             },           ]                    \addplot3[surf,domain=-2:2,domain y=-2:2,]{f(x,y)};             \addplot3[black,opacity=1.0,variable=t,domain=0:360,dashed,thin] ({c_x(t)},{c_y(t)},{c_z(t)});             \addplot3[black,opacity=1.0,variable=t,domain=-2:2,thin] (t,-1.2,{f(t,-1.2)});             \addplot3[black,opacity=1.0,variable=t,domain=-2:2,thin] (0.8,t,{f(t,-1.2)});             \addplot3[black,opacity=1.0,only marks,mark=text,text mark=$\cdot$] (1,-1,{f(1,-1)}) coordinate (a);     \end{axis}     \begin{axis}[             at={($(mfd.north east)+(1cm,-2cm)$)},             anchor=north west,             declare function={                     c_x(\t)=(cos(\t)+(sin(5*\t)/10))/3+1;             },                   declare function={                     c_y(\t)=(sin(\t))/2-1;             }            ]                    \addplot[variable=t,domain=0:360]({c_x(t)},{c_y(t)});             \addplot[black,opacity=1.0,only marks,mark=text,text mark=$\cdot$] (1,-1) coordinate (b);             \addplot[variable=t,domain=0.6:1.4](t,-1.2);             \addplot[variable=t,domain=-1.5:-0.5](0.8,t);     \end{axis}     \draw [-stealth, shorten &lt;= 3pt, shorten &gt;= 3pt] (a) to[bend left] (b); \end{tikzpicture}   However, I have a couple of problems:   The curves representing the coordinate axes pulled back from the plane via the coordinate map insist on being closed off with a straight line - is there a way to avoid that? I want to draw all the black curves with a thin, dashed line, but I probably don't understand how to set those options. What am I doing wrong?   I apologise if these questions are rather elementary, but I find the relevant manuals difficult to search through; they seem to be meant for reading cover to cover rather than reference. Promote tag wiki creation for new tags CASESAFEID() apex equivalent Is there any function in Apex which could emulate functionality of the  formula function? I'm trying to get 18-char Id variant from the standard one. I use tikz (and tikzpicture) a fair bit, but files that used to compile fine before the latest slew of updates to pgf, and pstricks, no longer seem to do so (at least, on my MikTeX installation). The MWE (below) seems to compile correctly, but the DVI can't be rendered using yap, and dvi -> ps -> pdf fails (the dvi -> ps seems to be ok -- to the extent it isn't throwing errors), but ps2pdf fails miserably, with the following errors:   Error: /undefined in XC@.  Operand stack:    --nostringval--   --nostringval--   --nostringval--   --nostringval--   -  -nostringval--   --nostringval-- Execution stack: %interp_exit   .runexec2   --nostringval--   --nostringval--   --  nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --  nostringval--   false   1   %stopped_push   2045   1   3   %oparray_pop    2044   1   3   %oparray_pop   2025   1   3   %oparray_pop   1884   1   3    %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval-  -   --nostringval--   --nostringval--   2   %stopped_push   --nostringval-- Dictionary stack:   --dict:979/1684(ro)(G)--   --dict:1/20(G)--   --dict:87/200(L)--   --    dict:182/300(L)--   --dict:58/200(L)--   Current allocation mode is local   Current file position is 99615   GPL Ghostscript 9.26: Unrecoverable error, exit code 1   Here is the MWE:  \documentclass[12pt,letterpaper,oneside]{article}  \usepackage{tikz}  \usetikzlibrary{decorations,shapes,arrows,matrix,positioning}  \begin{document}  \begin{center} \begin{tikzpicture}[x=0.175cm,y=0.175cm,scale=1]  % set up maximum and minimum x- and y-coordinates \def\xmin{0} \def\xmax{23.5} \def\ymin{0} \def\ymax{23.5}  % draw and label axes    \draw[-&gt;,thick] (\xmin,0) -- (\xmax,0) node[below=8pt,near end]  {\small{abundance ($N$)}};   \draw[-&gt;,thick] (0,\ymin) -- (0,\ymax) node[above=12pt,near   start,rotate=90] { \small{birth rate ($b$)}};  % draw vertical reference line at K/2=50   \draw[color=black, thick,  smooth] (0,20) -- (20,0)  node[below=6pt,midway,rotate=-45] {\small{slope~$=a$}};  % draw circle around point where function intersects x-axis \draw [red] (0,20)  ellipse (0.2cm and 0.2cm) node[right=3pt,black] {$b_0$};   \end{tikzpicture}  \end{center}   \end{document} Eclipse: How to build an executable jar with external jar? I am trying to build an executable jar program which depends on external jar downloaded. In my project, I included them in the build path and can be run and debug within eclipse.  When I tried to export it to a jar, I can run the program but I can't when I try to press a button which includes function calls and classes from the external jar. I have edited the environment variables (Windows XP) CLASSPATH to include paths of all the external jar, but it doesn't work.  A point to note is that I got compile warnings while exporting my executable jar, but it doesn't show up any description about the warnings.  Would someone kindly provide a thorough guide on how to include an external jar program using eclipse? Determining true mean from noisy observations I have a large set of data points of the form (mean, stdev). I wish to reduce this to a single (better) mean, and a (hopefully) smaller standard deviation.  Clearly I could simply compute $\frac{\sum data_{mean}}{N}$, however this does not take in to account the fact that some of the data points are significantly more accurate than others.  To put it simply, I wish to preform a weighted average of these data points, but do not know what the weighting function should be in terms of the standard deviation. What sort of waves are produced by tuning forks? Is it transverse, longitudinal or both? We often know tuning forks are used to to produce wave in various experiments that we do in lab. But the matter of concern is what sort of waves are produced by it? Is it transverse, longitudinal or both? iOS app blocking actions with "you must join this site" message for sites I belong to How do I select all but two types of entities in Minecraft with the type selector? In a triangle $\angle A = 2\angle B$ iff $a^2 = b(b+c)$ Prove that in a triangle $ABC$, $\angle A = \angle 2B$, if and only if:  $$a^2 = b(b+c)$$  where $a, b, c$ are the sides opposite to $A, B, C$ respectively.   I attacked the problem using the Law of Sines, and tried to prove that if $\angle A$ was indeed equal to $2\angle B$ then the above equation would hold true. Then we can prove the converse of this to complete the proof.   From the Law of Sines,   $$a = 2R\sin A = 2R\sin (2B) = 4R\sin B\cos B$$  $$b = 2R\sin B$$  $$c = 2R\sin C = 2R\sin(180 - 3B) = 2R\sin(3B) = 2R(\sin B\cos(2B) + \sin(2B)\cos B)$$  $$=2R(\sin B(1 - 2\sin^2 B) +2\sin B\cos^2 B) = 2R(\sin B -2\sin^3 B + 2\sin B(1 - \sin^2B))$$  $$=\boxed{2R(3\sin B - 4\sin^3 B)}$$  Now,   $$\implies b(b+c) = 2R\sin B[2R\sin B + 2R(3\sin B - 4\sin^3 B)]$$  $$=4R^2\sin^2 B(1 + 3 - 4\sin^2 B)$$  $$=16R^2\sin^2 B\cos^2 B = a^2$$  Now, to prove the converse:  $$c = 2R\sin C = 2R\sin (180 - (A + B)) = 2R\sin(A+B) = 2R\sin A\cos B + 2R\sin B\cos A$$  $$a^2 = b(b+c)$$  $$\implies 4R^2\sin^2 A = 2R\sin B(2R\sin B + 2R\sin A\cos B + 2R\sin B\cos) $$  $$ = 4R^2\sin B(\sin B + \sin A\cos B + \sin B\cos A)$$  I have no idea how to proceed from here. I tried replacing $\sin A$ with $\sqrt{1 - \cos^2 B}$, but that doesn't yield any useful results. How to select more layers with GIMP? In Adobe Photoshop I am able to select multiple layers at once with Shift+Click.  How can I do that in GIMP? How do I show for an ideal transformer $M^2=L_1L_2$? I've been stuck on this problem for about an hour.     In an ideal transformer, the same flux passes through all turns of the primary and of the secondary . Show that in this case $M^2=L_1L_2$, where $M$ is the mutual inductance of the coils, and $L_1$, $L_2$ are their individual self-inductances.   My first instinct was the following: If we isolate the response of each coil to the other one, we get the equations $N_1\Phi_1=MI_2$ and $N_2\Phi_2=MI_1$, where $\Phi$ is magnetic flux going through a single turn of the coil and $I$ is current. Likewise, if we isolate the response of each coil to itself, we get the equations $N_1\Phi_1=L_1I_1$ and $N_2\Phi_2=L_2I_2$. I would now naturally want to say "Now just multiply $N_1\Phi_1$ and $N_2\Phi_2$ both ways, and get the desired result!" i.e.,  $$(N_1\Phi_1)(N_2\Phi_2)=(MI_2)(MI_1)=(L_1I_1)(L_2I_2)\implies M^2=L_1L_2$$  But that's incorrect, because the response of the coils to themselves and to the other coil are different quantities (i.e. not necessarily equal).  Realizing this, I write down the more general equations.  $$N_1\Phi_1=MI_2+L_1I_1$$ $$N_2\Phi_2=MI_1+L_2I_2$$  Now even with the hypothesis that $\Phi_1=\Phi_2=\Phi$, I still can't see how the identity $M^2=L_1L_2$ follows. Could you help clear up my confusion?  *Taken from D. Griffiths Introduction to Electrodynamics (4th ed.), Problem 7.58. This is something that has long bothered me, and I have asked a few physicists and chemists and never gotten a very satisfying answer. Why are particles charged? And I'm not asking (and this is the answer you often get) why some molecule might be negatively charged because the answer to that is simply is that there was one more negatively charged particle than positively charged particle. That doesn't answer my question, however, of why there are charged particles at all?  So, on a fundamental level, what makes one particle charged and another one neutral.  For instance, protons and neutrons have almost exactly the same mass, which I'm assuming that means they have very similar internal compositions, yet one is positively charged and the other neutral. What is going on that makes these particles different?  On a similar note, and I'd really like to know this, how is it that a proton and an electron have exactly equal and opposite charge, yet an electron is about 1000 times less massive than a proton?  I have particular trouble with this question because if the answer were something along the lines of "particle X which composes protons all have partial positive charges of n amount..." I would just ask why particle X has any charge and we'd be in the same predicament.  I'm sure there is a satisfactory answer to my question, I just can't find it and don't know what resources are reliable or detailed enough to be satisfactory. How to link dataframes in ArcGIS or QGIS? The below image shows a layout in ArcGIS 10.1 with four dataframes.  Each dataframe is of the same geographic area, although they are different images. For example, the top left image is a 1989 DOQ, the top right image is a reversed 1989 DOQ, the bottom left image is a 2012 DOQ, and the bottom right image is a reversed 2012 DOQ.   Is it possible to link the dataframes so that panning the image in one dataframe pans the images in all of the other dataframes (i.e. similar to how you can "Link Views" in Erdas Imagine)? Is this possible in QGIS? Python scope: "UnboundLocalError: local variable 'c' referenced before assignment" Does Gentle Repose work on a Circle of Spore Druid's Fungal Infestation Ability? The Circle of Spores Druid feature Fungal Infestation states:  If a beast or humanoid that is Small or Medium dies within 10 feet of you, you can use your reaction to animate it, causing it to stand up immediately with 1 hit point. The creature uses the zombie statistics. It remains animate for 1 hour, after which time it collapses and dies.  Circle of Spore druids also gain access to the  spell, which states:  You touch a corpse or other remains. For the duration, the target is protected from decay and can’t become undead. The spell also effectively extends the time limit on raising the target from the dead, since days spent under the influence of this spell don’t count against the time limit of spells such as raise dead.  There seem to be some good arguments that they cannot work together:  First, Gentle Repose states the target cannot become undead, which would seem to preclude Gentle Repose working on a fungally infested creature that appears to be in some sense raised from the dead. Second, gentle repose states you touch a corpse or other remains - one could argue that using the zombie statistics, the fungally infested entity is neither a corpse or remains, but an undead zombie.  However, there are also some reasonable arguments that they could work together:  First, the Fungal Infestation does not say that the creature is undead or a zombie, but that it uses the statistics of a zombie, which might leave room for a RAW interpretation that the features could work together (for example, it could be considered a fungally infested corpse or fungally raised remains). Second, Gentle Repose says that it extends the time limit of raising the target from the dead and makes reference to spells like Raise Dead, which in flavour are similar to what happens with Fungal Infestation.  RAW, can a player cast gentle repose on a zombie created by Fungal Infestation? Before running a ridge regression model, do I need to preform variable selection? I am currently constructing a model that uses last year's departmental information to predict employee churn for the current year.  I have 55 features and 318 departments in my data set.  A good portion of my independent variables are correlated, and because of this, I believe that performing a ridge regression on my data will lead to optimal predictions when I bring the model into production.  I have studied ridge regression and understand that the lambda coefficient computed for a given predictor can minimize the effect that predictor has on the model to next to nothing.  Does this mean that performing a ridge regression means I don't have to bother with variable selection? If I do need to perform a variable selection technique, would implementing a stepwise regression and then using those selected variables in my ridge regression be a valid approach at variable selection? I already posted this question on stack exchange but was informed that stack exchange was the better platform to ask statistical questions.  I am sorry for the confusion. I have an alpha version of Ubuntu.  When the stable version is released do I have to upgrade or is it already stable from the installed updates?