edit My google-fu is apparently sub-par, this has a simple solution found here:   I want to force each section to start on a new page if the whole section doesn't fit on the remainder of the page.  I have tried to use minipages, but they fail when the text exceeds the space available on the page. (I want to allow the sections to overflow into another page only if they are the only thing on that page).  this doens't work either:  \begin{samepage} \section{Some title} \lipsum[1-5] \end{samepage} \begin{samepage} \section{Some title} \lipsum[1-4] \end{samepage} \begin{samepage} \section{Some title} \lipsum[1-30] \end{samepage}
I would like my sections to start on a new page if they do not fit on the current page. In other words:  if a section fits on the current page print it, if it does not fit start printing it on the next page.  I would like this to be done automatically.  \usepackage{titlesec} seems to be the solution, but I can not get it to do the job.   Should it be done with titlesec? how ? Is there a better approach?
$\newcommand{\P}{\mathbb{P}}$Is it valid to interpret $\P(B|A)$ as "infinite probability" when $\P(A) = 0$? JPA and Hibernate - Criteria vs. JPQL or HQL What are the pros and cons of using  or ? The Criteria API is a nice object-oriented way to express queries in Hibernate, but sometimes Criteria Queries are more difficult to understand/build than HQL.   When do you use Criteria and when HQL? What do you prefer in which use cases? Or is it just a matter of taste? Number of ways to connect sets of $k$ dots in a perfect $n$-gon Determine $4$ specific digits in $34!$ Is there a standard "never returns" attribute for C# functions? Can you reduce yourself, crawl into the Tarrasque's airway, and try to collapse its lung by enlarging inside of it? A player tried to use the spell  on his PC while in the mouth of the Tarrasque to shrink himself, then go deeper into its airway and to try to collapse its lung by enlarging himself inside of it. I imagine there's no real rule for this but I felt silly just denying it, because it seemed like a cool idea that you could only probably do with a creature as large as the Tarrasque.  Can you crawl into a gargantuan creature’s mouth or into its airway via reduce/enlarge and attack its brain or internal organs? Is there a way to start a PC with Ubuntu from the Keyboard? Because my button &quot;Power&quot; is broken. Story about human space explorers who run into alien telepath space crew I read a short story in an anthology around 1998 (the book could have been older than that) which went like this - A human space exploration scientific crew is exploring an alient planet (peaceful planet, as I recall) when they run into an alien spaceship (from a different planet which also happened to be there) - the aliens were telepaths.   The alien commander and first officer discuss the earthlings after a meeting and realize that the human crew are the descendants of a species (Banthu/Klanthu/Zantha, something like that) which had tried to violently take over the galaxy some 20/30/50,000 years ago and which had been beaten back by the combined might of the rest of the galaxy. They had supposedly been eliminated but they somehow managed to survive and are back in space only a few thousand years after they were completely beaten (which is something the aliens are amazed by).   The alien commander kills the human explorers via telepathy but realizes that there is no information available to locate their home planet and speculate that they will be meeting again soon given the past history of the humans.  I vaguely think there was also a fantasy short by L Sprague de Camp in the same anthology, but can't be 100% sure. Any thoughts/ideas? Thanks! Odd behavior in a QGIS plugin: my function is triggered twice I have a plugin with a function (triggered by a button) that selects a specific layer by name, then shows its attribute table. When I close the plugin and open it again, the attribute table pops up twice, and repeating this keeps adding another table popup. What's wrong?  Code:  def showTable(self):     for lyrs in QgsMapLayerRegistry.instance().mapLayers().values():         if lyrs.name() == "TestFeatures":             lyrTest = lyrs     self.iface.showAttributeTable(lyrTest) Is there anything beyond subtle hints that Jack becomes the Face of Boe? In the following example, is it appropriate to use a or an as the indefinite article, and why?     He ate __ green apple.   I know that in the case of just "apple", it would be "an apple," but I've heard conflicting answers for "green apple," where the noun is separated from the article by an adjective.  Also, which is more appropriate in this case:     He ate  __ enormous Pop-Tart. pdf of a quotient of uniform random variables Suppose $x_1, x_2$ are IDD random variables uniformly distributed on the interval $(0,1)$.  What is the pdf of the quotient $x_2 / x_1$? How to get dark menu bar and dock in Mojave light mode? I prefer light windows with dark menu bar as in High Sierra. However, it seems I can only choose all-dark or all-light in Mojave now. Are there any way to hybrid or customize it? Too much sugar in soup -- how to make it less cloying? I was making this recipe: , which was from the old Lincoln Del, one of my mom's favourite places. I mistakenly doubled the sugar, putting in 1/2 a cup instead of a 1/4 of a cup. Given the 2/3 of a cup ketchup, which was Heinz, the soup turned out way, way too sweet.   Is there any way I can rescue this? Calculating conditional entropy given two random variables I have been reading a bit about conditional entropy, joint entropy, etc but I found this: $H(X|Y,Z)$ which seems to imply the entropy associated to $X$ given $Y$ and $Z$ (although I'm not sure how to describe it). Is it the amount of uncertainty of $X$  given that I know $Y$ and $Z$? Anyway, I'd like to know how to calculate it. I thought this expression means the following:  $$H(X|Y,Z) = -\sum p(x,y,z)log_{2}p(x|y,z)$$  and assuming that $p(x|y,z)$ means $\displaystyle \frac{p(x,y,z)}{p(y)p(z)}$, then  \begin{align} p(x|y,z)&amp;=\displaystyle \frac{p(x,y,z)}{p(x,y)p(z)}\frac{p(x,y)}{p(y)}\\&amp;=\displaystyle \frac{p(x,y,z)}{p(x,y)p(z)}p(x|y) \\&amp;=\displaystyle \frac{p(x,y,z)}{p(x,y)p(x,z)}\frac{p(x,z)}{p(z)}p(x|y)\\&amp;=\displaystyle \frac{p(x,y,z)}{p(x,y)p(x,z)}p(x|z)p(x|y) \end{align} but that doesn't really help.  Basically I wanted to get a nice identity such as $H(X|Y)=H(X,Y)-H(Y)$ for the case of two random variables.  Any help?  Thanks Isomorphism between $\Bbb R$ and $\Bbb R(X)$? My questions are:     $1.$ Is there a field morphism $\Bbb R(X) \hookrightarrow \Bbb R$ ?      $2.$ If the answer to $1.$ is "yes", are $\Bbb R$ and $\Bbb R(X)$ isomorphic as fields?   $ $    $ $  For $1.$, here are some comments:   This is true for $\Bbb C$, see . The key point here is the fact that $\Bbb C$ is algebraically closed, of cardinality $2^{\aleph_0}$, and of characteristic $0$. The same argument doesn't work for $\Bbb R$. We can actually find a subfield $F$ of $\Bbb R$ such that $F \cong F(X) \cong F(X,Y) \cong \cdots$, see .  that $\Bbb Q(X)$ does not embed in $\Bbb Q$ (as a field).  This is equivalent to: Is there an injective ring morphism $\Bbb R[X] \hookrightarrow \Bbb R$ ? (By taking the fraction fields).   As for 2. :   They are isomorphic as abelian groups, and actually as $\Bbb Q$-vector spaces. They are not isomorphic as $\Bbb R$-algebras, because they haven't the same transcendence degree over $\Bbb R$. Let's try to see how to construct such a field isomorphism. We could try$^{[1]}$ to find a subset $B$ of $\Bbb R$ such that $\Bbb R = \Bbb Q(B)$ and $C \subsetneq B \implies \Bbb R \neq \Bbb Q(C)$.  The set $B$ must contain transcendental elements, pick such an $x_0 \in B$.  Then $\Bbb R = \Bbb Q(B) = \Bbb Q(B \setminus \{x_0\})(x_0)$ and we could try$^{[2]}$ to find a field isomorphism $\Bbb Q(B \setminus \{x_0\}) \cong \Bbb Q(B)$, so that $\Bbb Q(B \setminus \{x_0\})(x_0) \cong \Bbb Q(B)(x_0) \cong \Bbb R(X)$.  For ${[1]}$, I tried to use Zorn's lemma on $\mathscr B = \{B \subset \Bbb R \mid \Bbb R = \Bbb Q(B)\}$ and the partial order $B_1 ≤ B_2 \iff B_1 \supset B_2$. But this is not clear to me why this should be an inductive set.  For ${[2]}$, my idea was to define $f : \Bbb Q(B \setminus \{x_0\}) \cong \Bbb Q(B)$ by choosing a bijection $b : B \setminus \{x_0\} \to B$ (these sets should be uncountable), and then trying to extend $f\vert_{B \setminus \{x_0\}} = b$ to a field morphism.     Edit for $^{[1]}$: in  article (MINIMAL GENERATING SETS OF GROUPS, RINGS, AND FIELDS, by LORENZ HALBEISEN, MARTIN HAMILTON, AND PAVEL RUZICKA) the theorem 2.4. proves that $\Bbb R$ has no minimal generating set as field (or $\Bbb Q$-algebra, i.e. as ring). The argument uses Artin-Schreier theorem. Minimal generating sets of modules are   .  I think that $B$ is a minimal generating set of a subfield $K \subset \Bbb R$ over $\Bbb Q$ if and only if any element of $B$ cannot be written as a rational fraction of other elements of $B$. Under these conditions and using (transfinite) induction, we can probably prove (and this was my first idea) that any function $f: B \to \Bbb C$ such that $b$ and $f(b)$ are conjugate over $\Bbb Q$ (i.e. have the same minimal polynomial) extends to a (unique) field morphism $\sigma : K = \Bbb Q(B) \to \Bbb C$.  Actually, the collection $\mathscr B$ defined above doesn't have to be an inductive set, at least if we replace $\Bbb R$ by $K =\Bbb Q(\sqrt 2, \sqrt[4]{2},\sqrt[8]{2},\dots)$, because the descending chain $\left(E_n = \{\sqrt[2^m]{2} \mid m \geq n\}\right)_{n \geq 1}$ satisfy $K = \Bbb Q(E_n)$, but $K \neq \Bbb Q\left(\bigcap_{n≥1} E_n\right)=\Bbb Q$, so the chain has no upper bound w.r.t. $≤$ in $\mathscr B$. My number is associated with iMessage on other phone, how to remove it? Good day everyone. For only 1 hour (!) I used my relatives iPhone with my sim card and that's it, he keeps receiving all of my iMessages. I tried checking in iTunes all devices associated with my account and his device is not listed. I tried to log in and log out to/from iMessage on his phone with his apple ID, still won't help. How can I stop this nightmare!? When I go to iMessage settings>Send &amp; Receive on his device, there is only my phone number listed, how do I remove it without smashing phone to the wall?! Thanks and have a great day  EDIT. After talking to apple support for some time, they removed my phone number from my friend's iMessage. So I guess if you are facing same problem you have to contact support. Possible Duplicate:          Both words seem to be used interchangeably. I generally don't differentiate between them and intuitively pick one over the other. Is there a standardized way to distinguish between the two? Lets say I have a loop in Bash:  for foo in `some-command` do    do-something $foo done   do-something is cpu bound and I have a nice shiny 4 core processor. I'd like to be able to run up to 4 do-something's at once.  The naive approach seems to be:  for foo in `some-command` do    do-something $foo &amp; done   This will run all do-somethings at once, but there are a couple downsides, mainly that do-something may also have some significant I/O which performing all at once might slow down a bit. The other problem is that this code block returns immediately, so no way to do other work when all the do-somethings are finished.  How would you write this loop so there are always X do-somethings running at once? Control 220V AC line using MCU