setting a margin or padding for a 100% height grid without scrollbars I've got a grid layout. I want to add a 5px margin all around it but doing so adds a scrollbar. Is it possible to set a margin without having a scrollbar added?   function toggle() {   document.querySelector(".container").classList.toggle("withMargin"); } html, body, .container {   height: 100%;   margin: 0; }  .container {   display: grid;   grid-template-rows: 50px 1fr 1fr;   grid-template-columns: 300px 1fr 1fr;   gap: 5px 5px;   grid-auto-flow: row;   grid-template-areas: "logo header header" "nav-one main main" "nav-two main main";   background-color: black; }  .main {   grid-area: main;   background-color: lightcoral; }  .logo {   grid-area: logo;   background-color: lightcyan; }  .header {   grid-area: header;   background-color: lightgoldenrodyellow; }  .nav-one {   grid-area: nav-one;   background-color: lightgray; }  .nav-two {   grid-area: nav-two;   background-color: lightgreen; }  .container.withMargin {   margin: 5px; } &lt;!DOCTYPE html&gt; &lt;html&gt;  &lt;head&gt; &lt;/head&gt;  &lt;body&gt;   &lt;div class="container"&gt;     &lt;div class="main"&gt;       &lt;br /&gt;&lt;button onclick="toggle()"&gt;toggle .container margin&lt;/button&gt;     &lt;/div&gt;     &lt;div class="logo"&gt;logo&lt;/div&gt;     &lt;div class="header"&gt;header&lt;/div&gt;     &lt;div class="nav-one"&gt;nav one&lt;/div&gt;     &lt;div class="nav-two"&gt;nav two&lt;/div&gt;   &lt;/div&gt; &lt;/body&gt;  &lt;/html&gt;
CSS 100% height with padding/margin With HTML/CSS, how can I make an element that has a width and/or height that is 100% of it's parent element and still has proper padding or margins?  By "proper" I mean that if my parent element is 200px tall and I specify height = 100% with padding = 5px I would expect that I should get a 190px high element with border = 5px on all sides, nicely centered in the parent element.  Now, I know that that's not how the standard box model specifies it should work (although I'd like to know why, exactly...), so the obvious answer doesn't work:  #myDiv {     width: 100%     height: 100%;     padding: 5px; }   But it would seem to me that there must be SOME way of reliably producing this effect for a parent of arbitrary size. Does anyone know of a way of accomplishing this (seemingly simple) task?  Oh, and for the record I'm not terribly interested in IE compatibility so that should (hopefully) make things a bit easier.   EDIT: Since an example was asked for, here's the simplest one I can think of:  &lt;html style="height: 100%"&gt;     &lt;body style="height: 100%"&gt;         &lt;div style="background-color: black; height: 100%; padding: 25px"&gt;&lt;/div&gt;     &lt;/body&gt; &lt;/html&gt;   The challenge is then to get the black box to show up with a 25 pixel padding on all edges without the page growing big enough to require scrollbars.
java.io.Console support in Eclipse IDE I use the Eclipse IDE to develop, compile, and run my Java projects. Today, I'm trying to use the java.io.Console class to manage output and, more importantly, user input.  The problem is that System.console() returns null when an application is run "through" Eclipse. Eclipse run the program on a background process, rather than a top-level process with the console window we're familiar with.  Is there a way to force Eclipse to run the program as a top level process, or at least create a Console that the JVM will recognize? Otherwise, I'm forced to jar the project up and run on a command-line environment external to Eclipse. Story of lost tech but magic manifests I'm looking for this novel (or maybe a series of books?). I remember that technology began failing all over the world. Some people began transforming into different types of mythical creatures, like sprites, demons, etc. There was a band of about four travelers that were trying to make it to Chicago, since that seemed to be at the center of the issue. The story line frequently shifted the point of view in each new chapter. I vaguely recall a final battle in Chicago with an enormous and powerful demon creature. I think this demon used to be a corporate lawyer or big business guy before his transformation. I believe I read this in the early/mid 2000s, and was likely published around that time because of the types of tech used and failing in the story. Although it bears some surface similarity to the TV show, Revolution, they aren’t comparable in plot or characters. How do I print a #defined constant in GDB? How does transvoxel algorithm work and how can I implement It? Diplomacy Attacking a Territory as they move How do I restrict scaling to a specific axis? Im new to Blender but have some experience with 3dsmax. In blender, when i select some polys and try to scale them, i have no control on the amount and especially relative axis on which the scale would happen, where as with 3ds max i could scale restricted to x, y, z or any combination of using the handy widget. Is there a way to replicate this, or to get any control over the scale ?  thanks, Based on Logman dictionary:       happen to do something: if you happen to do something, you do it by chance.   for example take a look at these examples:     They happen to be unemployed at the time. I happen to have a degree in computer science.    So based on the definition of the happen to do something, first one means they are probably unemployed at the time. and the second one means I probably have a degree in computer science.     Am I right? Why are so many forces explainable using inverse squares when space is three dimensional? What happens if 2 separate abilities require you to sacrifice a creature? If i have two cards that force opponents to sacrifice every upkeep like for example  "At the beginning of each opponent’s upkeep, Mogis deals 2 damage to that player unless he or she sacrifices a creature."  And  "At the beginning of your upkeep, draw a card unless target opponent sacrifices a creature or pays 3 life."  Does the oppenent have to sacrifice twice? Or if they sacrifice Mogis's ability have they not allowed me to draw from indulgent tormentor? I decided to make sure that I know this important difference between American and British English, so I wrote what I have found out so far and I would be grateful to anyone who reads this and tells me whether I am wrong, or not.  In British English when people say  to hospital or in hospital when  talking  about somebody being there as a patient they don't use the definite article : "I had to go to hospital", "She spent two weeks in hospital". And the meaning is that somebody was there as a patient.   If then for some other reasons British English speakers  will use the definite article which will change the meaning itself, I noticed that, in American English, native speakers often use the  the and if they need to show that somebody is in church to pray,  in school as a student, in hospital as a patient, in prison as a prisoner, they use 'in' and not 'at'. Do American English speakers use 'at' like British English speakers use 'the' to give the sentences a different meaning?    Are my sentences correct? Do they show American English usage?   He is in the school. (enrolled as a student) He is at the school. (for some different reasons) He is in the hospital. (as a patient) He is at the hospital. (visiting somebody) He is in the church. (to pray) He is at the church. (for some different reasons) He is in the university. (as a student) He is at the university. (not as a student) He is in the college. (as a student) He is at the college. (Not as a student) He is in the prison. (as a prisoner) He is at the prison. (not as a prisoner) How many nonnegative integer solutions are there to the pair of equations  \begin{align}x_1+x_2+\dots +x_6&amp;=20  \\ x_1+x_2+x_3&amp;=7\end{align}  How do you find  non-negative integer solutions? How to find manually installed packages? I installed a plain Ubuntu 10.10 on my computer and installed some software via apt-get. Last week I managed to break everything and just started from scratch, and I need to reinstall my software. Is there some way to create a list with all the packages that I have installed manually?  So that it would give me a list like texlive, ... and not texlive, texlive-dep1, textlive-dep2, ... and all the standard packages removed?  If I could somehow figure out which programs out of the regular install I have removed, that would be awesome too!    Update 2015-05-23: I now use Ansible as configuration management on my systems. There I specify the packages to install. This serves the goal, installing all the programs on a fresh system, even better. So this question might be the entry into some light configuration management. What do the different colours in Ubuntu's ls command mean? For example, when I type the ls command in one of my folders, I get one of the files in light green, the other (which is a folder) in blue with green highlighting.   What do those colours mean, and there is any manual about all the colours? Beta regression of proportion data including 1 and 0 \xymatrix undefined Problem on Sum of Digits of a Number I was given this problem to Prove if $Q(n)=Q(2n)$ implies $9∣n$. Where $Q(n)$ be the sum of digits of $n$. I tried to use the fact that sum of digits is congruent to the number modulo $9$ but I had no luck. Any help is appreciated. R Difference between rbinom and sample I'm trying to model a Roulette game where if you bet on red (out of red(18/37), black(18/37), green(1/37)) and if you the ball lands on red you win 1 dollar and if it doesn't you lose $1. So in this case, is it a binomial distribution? Since there are only 2 outcomes from the gamblers perspective, red or not red. If thats the case are these 2 R functions the same?  set.seed(3) sample(c(0,1),100,replace=T,prob=c(19/37,18/37))     rbinom(n = 100, size = 1, prob = 18/37) Show that the boundary of a set equals the boundary of its complement $\newcommand{\bdy}{\operatorname{bdy}}$  I'm trying to show that $\bdy(A) = \bdy(A^c)$.  I know that $\bdy(A) = \operatorname{closure} A \setminus \operatorname{int}(A) = (\operatorname{int}(A^c))^c \setminus \operatorname{int}(A)$, but I don't know where to go from there.  Any help or hints would be very much appreciated. Perfect set without rational numbers Sorry if this problem is repeated.  Is there a nonempty perfect set in $\mathbb{R}^1$ which contains no rational number?  Proof sketch: This set must be uncountable because any nonempty perfect set in $\mathbb{R}^k$ is uncountable.   We know that Cantor set (C) is perfect set on a line. If we take $E=C+\sqrt{2}=\{x+\sqrt{2}: x\in C\}$. Will this set be an answer to above problem? Let $f$ be an entire function and $L$ a line in $\mathbb{C}$ such that $f(\mathbb{C})\cap L=\emptyset$. Show that $f$ is constant function.  If $f$ is not constant  then $f(\mathbb{C})$ is dense set in $\mathbb{C}$, but how can I use that line does not intersect the image set?