So I am currently a student and am having a programming couse.  Today we had about the use of sizeof in different classes(if it had 1 int or 2 int´s and so on)  One part of the example I found weird was this:  class TwoIntAndACharClass { public:     int x_;     int y_;     char z_; };   and the part to test it  TwoIntAndACharClass o3b; cout &lt;&lt; "Sizeof TwoIntAndACharClass          = " &lt;&lt;  sizeof(o3b) &lt;&lt; "\n";   So in the program i could see a class with 1 char took 1 byte. So when I saw this I thought I would see 9 bytes and not 12  So first I thought that it was weird but after some time I came to the conclusion that it might save some kind of blocks of 4 bytes.  To be 100% sure that this was true I then tried adding a new variable into the class(a double variable of 8 bytes) and the total size increased from 12 bytes to now 24 bytes. That ment that the char now had to be 8 bytes long so my last theory failed.  My last theory was that it would take the biggest already declared variable and use the size of that for the char variable _z , as this worked with both long long int(8 bytes) and a double(also 8 bytes)  So my question is, is my last theory true - or is it something different making the char take more memory then needed? (my teacher did say that each compiler could handle this differently but I have tried it on microsoft visual studio and a friend tried it on another compiler with the same results, but is that really true, is it the way the compiler handle this?)  Sorry for my poor english.
Why does the sizeof operator return a size larger for a structure than the total sizes of the structure's members?
For the Pell's equation where $d=2$: $$x^2-2y^2=1$$ What are all the integer solutions to the equation. Apparantly there are infinitely many solutions, but how would I represent them in an expression? I am trying to prove the following identities:  a. $$\sum_{k=0}^n(-1)^k{n\choose k}^2 = \bigg\{^{0 \ \text{if k is odd}}_{(-1)^m{2m\choose m} \ \text{if n = 2m}}$$ b. $$\sum^k_{i=0} {n+i \choose i}={n+k+1\choose k}$$  For part $b$ I know I can use induction. It is clearly true when $k=0$ and then assuming for $k-1$ we get $$\sum^k_{i=0}{n+i\choose i}={n+k\choose k-1}+{n+k \choose k}={n+k+1\choose k} \ ...$$ Let $R$ be a commutative ring with identity. Show that $R$ is a field if and only if the only ideals of $R$ are $R$ itself and the zero ideal $(0)$.  I can't figure out where to start other that I need to prove some biconditional statement. Any help? This seems to be quite a trivial problem, but after some searching I can't stil figure out the answer. One can run tcpdump using "any" as the interface description, ie:   # tcpdump -i any -n host 192.168.0.1   Is there any way to force tcpdump to show on which interface displayed packet was captured?  Update:  As more people confirmed this is probably not possible with vanilla tcpdump, can someone propose a solution to mentioned problem? Perhaps different sniffer?   General issue is as follows: On a system with 50 interfaces determine what is inbound interface for packets coming from specific ip address. Why is Main method private? Feature selection with Random Forests Make a computer act as a virtual USB device for other equipments Why are the laws of thermodynamics "supreme among the laws of Nature"? Eddington wrote     The law that entropy always increases holds, I think, the supreme position among the laws of Nature. If someone points out to you that your pet theory of the universe is in disagreement with Maxwell's equations — then so much the worse for Maxwell's equations. If it is found to be contradicted by observation — well, these experimentalists do bungle things sometimes. But if your theory is found to be against the second law of thermodynamics I can give you no hope; there is nothing for it but to collapse in deepest humiliation.   and Einstein wrote     [classical thermodynamics] is the only physical theory of universal content which I am convinced will never be overthrown, within the framework of applicability of its basic concepts.   Why did they say that? Is it a very deep insight they had, or is it something one can be convinced of quite easily? Or even, is it trivial? I am trying to disable the touchscreen on my Asus S200E laptop.  In Ubuntu 16.04, I was able to do so with this:  Section "InputClass"     Identifier "evdev touchscreen catchall"     MatchIsTouchscreen "on"     MatchDevicePath "/dev/input/event*"     Driver "libinput" EndSection   How can this be done on Ubuntu 18.04? I have fought the pumpkin moon and died like 3 times and made it to wave 7 or 6 whenever the pumpking first appears. I have full turtle armor and my primary melee weapon is a demon sickle. I also have the possessed hatchet, magnet sphere, and sniper rifle. I also have other gear like the Uzi. What should I replace, what should I take out, and what should I add? Thanks! In what order do multiple readied actions with the same trigger resolve? What is the minimal set of parts for a circut with this AVR microcontroller? My Arduino Uno has a ATMEGA328P-PU microcontroller, and bunch of other stuff on the board. I'd like to program the chip without the Arduino software, and only the minimum of other components.  I want to eventually create things without the cost of Arduino, and I want to learn about the other parts on the board and add them back as as needed.  I'm comfortable with C and gcc, so I can probably figure out the software part. But what, if anything, besides these two products below, do I need to have in the breadboard with the microcontroller? How to make /sbin/shutdown, /sbin/reboot etc. require sudo again in 16.04? For whatever reason, we do no longer need to be root (or using sudo) to run /sbin/shutdown, /sbin/reboot etc.  This seems to be because those executables are now symlinks to /bin/systemctl which handles everything as normal user.  However, what if I want shutdown and reboot to require root authentication again? How can I achieve this? Is stage.*.example.com valid for a wildcard DNS CNAME? How to install CUDA 8.0 on Ubuntu 16.04 with Nvidia GeForce GTX 1080 I am attempting to install CUDA 8.0 within Ubuntu 16.04 for the Nvidia GeForce GTX 1080. I had CUDA 7.5 installed, but it did not appear to be compatible with the GTX 1080. I downloaded the .run installer from Nvidia's developer page, but the installation fails and outputs the following to a nvidia-installer.log     An NVIDIA kernel module 'nvidia-drm' appears to already be loaded in     your kernel.  This may be because it is in use (for example, by an X     server, a CUDA program, or the NVIDIA Persistence Daemon), but this     may also happen if your kernel was configured without support for     module unloading.  Please be sure to exit any programs that may be     using the GPU(s) before attempting to upgrade your driver.  If no     GPU-based programs are running, you know that your kernel supports     module unloading, and you still receive this message, then an error     may have occured that has corrupted an NVIDIA kernel module's usage     count, for which the simplest remedy is to reboot your computer.   I have rebooted the computer, but that did not resolve the problem. How do I unload the 'nvidia-drm' module so that I can install the 8.0 CUDA? What insect is this? (India) Can anyone tell me what kind of insect (if it is one) is this...!! Or is it the pupa of some insect?  Well I don't think that the whole big thing is the insect itself, it appears to be just a kind of protection or shelter which moves along with the tiny little thing that keeps on popping out and going it so as to move. Location:  India Mapping Russia - Int'l dateline splitting polygon I am having the issue where the International Dateline is splitting a polygon I am working with.  I have a layer of the "Federal Districts" of Russia, and the eastern most federal district is being "cut" by the international dateline.   I currently have the data frame's coordinate system set to Asia Lambert Conformal Conic and this places the two "cut" polygons next to each other (how they should be).  I really need the polygon to not be cut and show as a continuous polygon.   I've researched up and down, tried changing the projection/coordinate system, but with no luck.  I've attached a screenshot of the one multi-part polygon that is being split by the international dateline.  I would like it so that there is no cutting of the polygon, and therefore no boundary line going through the polygon.  I've even tried transforming this multi-part polygon into separate, single-part polygons, then merge them back together, but anytime any part of any polygon crosses this line, it gets cut.  Layout View:    Data View: I want to show that  $$\int_{0}^{\frac{\pi}{2}}\frac{d\theta}{a + \sin^2(\theta)} = \frac{\pi}{2\sqrt{a(a+1)}}$$  for $a &gt; 0$.  I try several methods   Substitutions to rationalize The famous $U = \tan(\frac{\theta}{2})$ Multiplying by conjugates   and other calculus techniques and still, I can not prove the equality.   Anyone can give me a hint of how should I begin to work this integral?  I'm very ashamed that I can not solve this problem. Some days ago I realized that  (as well as ) never throw an IOException when writing, flushing or closing.  Instead it sets an internal flag (trouble=true) when an error occurs. It's not possible to get the exact exception, but only if there was some exception ().  My question is: why would one want to have such behavior? Isn't that bad API design? Remove line containing certain string and the following line