Align top of images using subcaption I'm trying to align the tops of two images using the subfigure environment from the subcaption package. Unless I'm misinterpreting the other questions, I believe I have read multiple questions asking the same,  and  are two examples. The problem is, those answers don't seem to work as I expected, and I still can't get the tops of the images to be aligned.   example:  \documentclass{article} \usepackage{subcaption} \usepackage{graphicx} \usepackage{mwe} \begin{document}     \begin{figure}         \centering         \begin{subfigure}[t]{0.45\textwidth}             \includegraphics[width=\linewidth, height=20em]{example-image-a}             \caption{taller image}         \end{subfigure}         \begin{subfigure}[t]{0.45\textwidth}             \includegraphics[width=\linewidth, height=15em]{example-image-b}             \caption{shorter image}         \end{subfigure}         \caption{two images}     \end{figure} \end{document}   For me this generates the following:   I would have expected it to align the tops of the images. How do I do this?
Understanding minipages - aligning at top I would like to be able to align two minipage at the top, without worrying about what is in the minipage.  I am aware of the optional [t] parameter, but still have some confusion as to how this all works.  I tend to think of a minipage as a regular page in that whatever is placed on it starts at the top and fills the page going across and then down the page, but this does not appear to be the case.  In the MWE example below, I have color coded the sections for reference purposes.   The first case (black) works just as I would expect. The two minipages are aligned exactly as I want with the [t] specifier.  No question here.  The next case (red) only works if the inner minipage also has the [t] specifier. Why is that necessary?  I would have thought that any content would be placed at the top of this page, and since both the outer minipage had a [t] things should have aligned at the top. I would like to place a graphic in the second mini page, and still have the two aligned at the top.   The simple case (blue) of using \includegraphics directly does not result in the content being aligned at the top.  So, then I attempt to put this in a \parbox (green) and this too does not yield the desired results.  I also try to place the graphic inside an inner minipage (brown) and specify the [t] alignment, and even though this worked in the red section, it does not here.  The only difference between the red and brown being that the red section had text, whereas the brown section has a graphic.  I am aware of question regarding  which suggests to place \vspace{0pt} at the top of the minipage, and that does provide the desired alignment (cyan), but adds vertical space at the top.  So, my second question is why is the \vspace{0pt} necessary when a graphic is included, but not when it is text.  This appears to be a hack and wondering if there is a replacement for minipage that works better without having to worry about exactly what is in the minipage?  Also, why did wrapping the figure in a parbox (green) or another minipage (brown) not solve this problem?   Here is the MWE:  \documentclass{article} \usepackage[demo]{graphicx} \usepackage{lipsum} \usepackage{xcolor}  \begin{document} \section{This Works - Aligned at top as desired} \begin{minipage}[t]{0.6\linewidth}     \lipsum[1] \end{minipage} \hfill \begin{minipage}[t]{0.3\linewidth}     \lipsum[2] \end{minipage}  \color{red} \section{Why does inner mini page required the [t]?} \label{Minipage-in-minipage} \begin{minipage}[t]{0.6\linewidth}     \lipsum[3] \end{minipage} \hfill \begin{minipage}[t]{0.3\linewidth}     \begin{minipage}[t]{\linewidth}% Why is [t] required here         \lipsum[4]     \end{minipage} \end{minipage}  \color{blue} \section{Why are These not aligned at top?} \begin{minipage}[t]{0.6\linewidth}     \lipsum[3] \end{minipage} \hfill \begin{minipage}[t]{0.3\linewidth}     \includegraphics[width=\linewidth]{foo} \end{minipage}  \color{green} \section{Why are These not aligned at top?} \begin{minipage}[t]{0.6\linewidth}     \lipsum[3] \end{minipage} \hfill \begin{minipage}[t]{0.3\linewidth}     \parbox{\linewidth}{\includegraphics[width=\linewidth]{foo}} \end{minipage}  \newpage \color{brown} \section{Why does this not work with the [t] as it did in red section?} This worked fine in Section \ref{Minipage-in-minipage}  \begin{minipage}[t]{0.6\linewidth}     \lipsum[3] \end{minipage} \hfill \begin{minipage}[t]{0.3\linewidth}     \begin{minipage}[t]{\linewidth}% Even with [t] here, this does not work         \parbox{\linewidth}{\includegraphics[width=\linewidth]{foo}}     \end{minipage} \end{minipage}   \color{cyan} \section{Adding a \textbackslash{}vspace\{0pt\} works} \begin{minipage}[t]{0.6\linewidth}     \vspace{0pt}% Hack!! But does do the job     \lipsum[3] \end{minipage} \hfill \begin{minipage}[t]{0.3\linewidth}     \vspace{0pt}% Hack!! But does do the job     \begin{minipage}[t]{\linewidth}% Why is [t] required here         \parbox{\linewidth}{\includegraphics[width=\linewidth]{foo}}     \end{minipage} \end{minipage} \end{document}
What is the difference between an "API," a "framework," an "IDE," and an "engine?" I am just starting out trying to learn to develop games. At first I thought C++ and OpenGL were the tools a beginner would start out to make a game, but quickly found out the OpenGL was just a API for graphics. Then I thought C++ and SFML were what I needed to learn to make a game, but found out the SFML was a media framework that could be used to make games but wasn't a game engine.  I don't want to use a software that does all the work for me, I want to code my own game, the way a game programmer would. I don't understand the difference between a IDE, framework, API, and a engine; What separates them from each other? Do some game programmers use the SFML framework, while other programmers use a game engine? Troubleshooting for biber Low output volume I have two laptops: Dell xps M1210 and Dell vostro 1400. On MS windows the output volume is so loud that I just need to set volume to around 20% to listen music and watch videos. I use Bose TriPort In-Ear Headphones most of the times. On ubuntu, even if I set 100% volume on the multimedia player, on the desktop volume manager as well, and also on the ncurses GUI of alsa mixer, I get very low volume output. Sometimes while playing some vidoes the volume is so low that I barely hear any words. I have struggled for two years since I started to use ubuntu to solve this mystery. The same sound card which gives excellent sound on MS windows fails miserably on GNU/Linux. Few weeks back I bought an Asus 100PX EEE PC. To my surprise even it also has the same issue. I have tried many versions of ubuntu and also I have done manual compiles of alsa modules without any success. I have asked and read about it in every possible forums and howto's. Nothing has helped me to address the issue. How to find modulo of large numbers like $9801\! \pmod {\!32}$ It is easy to calculate small examples like $26\pmod {5}$ but how do you calculate examples like $9801 \pmod {32}$ without a calculator. How to test search engine results? I had an interview question:     You were told that a search engine result by target query does not satisfy a requirement by its position. How would you test it?   How would you test it?  I had some thoughts though:   You need a list of input search queries You need a target position for each of the query You match each target position with actual   But it was not enough. Determinant of a matrix whose $(i,j)$th element is $|i-j|$? Question states: "Let $D_n$ denote the determinant of the $n$-by-$n$ matrix whose $(i,j)$th element (the element in the $i$th row and $j$th column) is the absolute value of the difference between $i$ and $j$. Show that $D_n = (-1)^{n-1}(n-1)2^{n-2}$."  It seems like that I can get a recurrence relation (especially the question was from a book chapter dealing with recursion). In trying to get a recurrence relation, here is what I have done so far:  (Let $R_k$ denote the $k$th row and let $(i,j)$ denote the element/spot of $i$th row and $j$th spot)  1) replace $R_1$ with $R_1-(R_2+R_{n-1})$ to get $R_1^*$  2) replace $R_1^*$ with $R_1^*+R_{n-2}$  3) If I am not mistaken, I should have $-2$ on $(1,1)$, $2$ on both $(1,n-1)$ and $(1,n)$, and all other element in the first row as $0$.  4) take out $2$ from the first row, and expand the determinant about the first row  5) I should have $D_n=2(-D_{n-1}+(-1)^n B_{n-1})$, where $B_{n-1}$ is the determinant of a not-easily-reducible mayrix whose last column consists of $n-1$ ones followed by one $-1$.  How should I go about from now on? Once I get a recurrence relation, it would be pretty easy to get the explicit formula for $D_n$ using induction.  P.S. This question apparently is a question taken from 1969 Putnam Competition One of the assumptions I make as GM is that the players should always be in the spotlight.  Sometimes the players find themselves in a situation where they watch NPCs speak to each other.  I don't like using this kind of situation, because it forces the players to watch me talk to myself and that turns them from active participants into an audience.  Usually I handle it by avoiding the situation.  I try not to write scenes that the players watch.  Instead the players speak to the NPCs one at a time.  When I do come across an exchange between NPCs I opt to summarize the conversation instead of acting it out.    I don't like this limitation though.  It gets a little contrived when all conversations in the game feature 5 PCs and 1 NPC.  Any suggestions? Either how to avoid doing it, or how to effectively role play a conversation between two (or more) NPCs that the characters may or may not be interacting with?   How do you keep clear which character is speaking? How do you make sure that the conversation feels like a real one and not like one person playing both roles? A saying for something that's good but also has a downside I'm trying to transition from a list of pros to a list of cons, and would like to have some sort of transition quote. Something in the form of,  "But, alas, (((something something quote quote)))"  Everything that has a beginning has an end, something along the lines of that. Is C++ CLI a superset of C++? Would a C++  compiler be able to compile some large sets of C++ classes without modifications?   Is C++ CLI a superset of C++? Profile tab hyperlink should match name change How to animate text over a twisted mesh (or text flowing along an infinity loop) How to change phone number in Google account? I gave Google my phone number to verify it, not knowing that it would change it, and now my phone number is completely different? What have I done, and how do I unverify it and change my phone number back? This question pertains to L1 &amp; L2 regularization parameters in Light GBM. As per official documentation:  reg_alpha (float, optional (default=0.)) – L1 regularization term on weights.  reg_lambda (float, optional (default=0.)) – L2 regularization term on weights  I have seen data scientists using both of these parameters at the same time, ideally either you use L1 or L2 not both together.   While reading about tuning LGBM parameters I cam across one such case: Kaggle official GBDT Specification and Optimization Workshop in Paris where Instructors are ML experts. And these experts have used positive values of both L1 &amp; L2 params in LGBM model. Link below (Ctrl+F 'search_spaces' to directly reach parameter grid in this long kernel)      I have seen same in XGBoost implementations.  My question is why use both at the same time in LGBM/XGBoost.  Thanks. Can I revert to the Mountain Lion style labels instead of Mavericks tags? How? SQL Server 2012 Page Life Expectancy resets to 0 after about 50 days I've noticed an odd behavior on a 2-server HA cluster and I was hoping someone could confirm my suspicion, or maybe offer some other explanation... Here is my setup:   A 2-server SQL 2012 SP1 installation SQL AlwaysOn HA has been enabled for a few databases CPUs are 2.4GHz, 4 cores RAM is 34 GB (it is an AWS instance, hence the odd number) Resource utilization is relatively low - each server has 14+ GB memory free, and SQL is not capped on how much memory to use Disk access time is fine - rarely going over 15ms/Read or Write Databases are not big - 1 GB, 1.5 GB, 7.5 GB SQL server process is using 16 GB Private Bytes, 15 GB Working Set   Overall, no resource issues are noted. Now for the odd part. SQL is not restarted (process has been running for almost 6 months) but it seems that every ~50 days, the Page Life Expectancy counter drops to (almost) 0. Up until that point it climbs steadily, no drops. Here is a perf graph:    When I look at the counter data (I don't have the exact number, just an hourly aggregation) it seems the PLE counter value reached about 4,295,000 sec (roughly 50 days) every time (at least every time I have data for).   My crazy theory is that the PLE number is held as milliseconds as an unsigned long int (which has a limit of 4,294,967,295) and at 49.71 days it resets, either by design, or because of a bug. This would explain the behavior of the two servers and the identical pattern they have. Or it could be something totally different and I am just not making any sense. :)  Has anyone seen anything like that, or can explain this behavior?  P.S. I saw  post, but my case seems slightly different.  P.P.S. This is a repost - I originally posted it , but was advised the audience here is more appropriate.  Thanks! How tipe are this series?  $$\sum_{n=2}^\infty \frac 1 {n^2\ln n}$$ But $$\sum_{n=2}^\infty \frac 1 {n\ln n\ln(\ln n)}$$ I used Condensation Test, but I stack after that. Thanks! "Reality" of EM waves vs. wavefunction of individual photons - why not treat the wave function as equally "Real"? In thinking how to ask this question (somewhat) succinctly, I keep coming back to a Microwave Oven.  A Microwave Oven has a grid of holes over the window specifically designed to be smaller in diameter than the wavelength of the microwaves it produces, yet larger than the wavelengths of the visible light spectrum - this is so you can watch your food being heated without getting an eye full of microwaves.  The "realness" of electromagnetic waves seems indisputable - both from the microwave example above, and also because if I want to broadcast a radio wave with a certain wavelength, then I need to make sure I have an antenna of corresponding length to produce the wave I'm looking for.  Furthermore, we discuss and treat these waves as real, measurable "objects" that exist and can be manipulated.     Now, if I want to describe the behavior of my Microwave Oven in the framework of QM (let's pretend my oven is going to only produce 1 photon of energy corresponding to a wavelength of the microwave spectrum for simplicity) then I'll describe the behavior of that photon as a wavefunction that evolves over time and gives a probability distribution within my microwave that similarly does not allow the photon to pass through the safety grid and exit the oven cavity giving me a retinal burn.  The difference is, the wavefunction is never treated as something "real" in this description.  When the safety grid is described as working to protect you because it has holes smaller than the wavelength of the classical waves it's blocking, this is a useful description that seems to describe "real" objects/be-ables.  While it is possible to describe why an individual photon has low probability of passing through the same grid but extended physical properties such as wavelength (in space) are treated as non-real because we're dealing with a point particle and with behavior described by something we also treat as non-real (the wavefunction); it seems unclear to me why we insist this wave function which predicts behavior of physical measurements so well is somehow "non-real."    Put another way, if we have no problem treating EM waves as "Real," then why do we insist on treating the wavefunction that describes the same behavior as "unreal?"  I understand there is recent research (Eric Cavalcanti and his group for one) trying to argue this point, but as every respectable physics professor, I've ever encountered, has treated the wavefunction as an indisputably non-real mathematical tool, I needed to ask this community for an answer. $X_1, X_2, \ldots, X_n$ are $n$ i.i.d. uniform random variables. Let $Y = \min(X_1, X_2,\ldots, X_n)$. Then, what's the expectation of $Y$(i.e., $E(Y)$)?  I have conducted some simulations by Matlab, and the results show that $E(Y)$ may equal to $\frac{1}{n+1}$. Can anyone give a rigorous proof or some hints? Thanks! A disk is stuck in my slot-loading Dell Studio Hybrid. How can I get it out? The slot-loading optical drive in my Dell Studio Hybrid has been acting up. Sometimes it works fine, sometimes it churns and makes some unpleasant sounds. Now I can't even get it to eject the disc that's in there.  Many drives have an "emergency eject" pinhole, but I don't see one here. How can I get the disc out? In Batman #1 in the New 52, when we visit the Batcave for the first time, we see a dinosaur:     What... is up with that? It is a completely awesome cave decoration - but what else is it? Is it a non sequitur or is it a call back to an earlier storyline? I imagine it's the latter – a life-size T-rex model is an expensive piece of decor, even for Bruce Wayne.  Bonus points: are there any other relics from past storylines visible in this Batcave?  Update: here's a shot of the other panel that gives us a view of the "showroom" (including the huge dice).