What's the point of DMA in embedded CPU's?

Question: I was doing a project recently with the mbed (LPC1768), using the DAC to output various waves. I read parts of the datasheet, and it talked about how it had DMA for a lot of the peripherals. This seemed like it would be useful, but on further reading, I found that the DMA used the same data bus as the cpu (which I guess is normal). Does this mean that the CPU cant interact with any of the memories while the DAC is getting data? Also, since the DAC didn't have a buffer (as far as i could tell) and therefore has to DMA very often, whats the point of DMA? If the CPU can't do memory transactions, can it do anything?
Comment: I suggest you look at the features of your CPU and if it can do anything else than access memory. I have heard of some CPUs that can do things like decisions or calculations, not sure if this is common at all..
Comment: Saw a cover of EDN once that showed a drawing of a man wearing an enormous, three foot long shoe, and a headline, "If it's a shoe, wear it."  The point was, If a part does ten things you don't need, and one thing you do need, and the price, footprint, and power budget all fit, then you should just use it, and not waste your time looking for something with fewer features.
Comment: Simple example, say you want to do lots of printing of information to a serial port. You can either sit and wait for each byte to be sent (slow), copy it to a buffer and then use interrupts on the CPU to send each byte when the port is ready (lots of context switching = slow), or copy it to a buffer and let the DMA controller time the data out while the CPU is busy doing other things (can be faster).
Comment: Should the CPU spend it's time transferring data to an I/O port or delegate the task to a dedicated device?
Comment: Yes the CPU can do other stuff, but in an embedded system it's probably spending a lot of its time interfacing with peripherals, especially I/O ports. Wouldn't it make more sense to have an extra data bus just for DMA? Or is that usually not necessary? The situation where you would want an extra bus is when you're trying to push the limits of your hardware, which I assume is when you would want to usa DMA anyway?
Comment: for example if the CPU wants to read data from HDD, instead of wasting time for reading byte-by-byte, the CPU can just leave the work for DMA and do more useful things while waiting for data to be copied to RAM
Answer: The long and short is that DMA allows the CPU to effectively behave at its native speed, while the peripherals can effectively behave at their native speed. Most of the numbers in the example are made up.
Let's compare two options to periodically collect data from an ADC:

You can set the ADC as part of an interrupt (periodic or otherwise)
You can create a buffer, and tell the DMA to transfer ADC readings to the buffer.

Let's transfer 1000 samples from the ADC to RAM.
Using option 1: For every sample there is

12 cycles are spent entering interrupt
read adc(s)
store in ram
12 cycles are spent exiting interrupt

Let's pretend this interrupt function is 76 instructions, the whole routine is 100 instructions long, assuming single cycle execution (best case). That means option 1 will spend 100,000 cycles of CPU time executing.
Option 2: DMA is configured to collect 1000 samples of ADC. Let's assume the ADC has a hardware trigger from a timer counter.

ADC and DMA transfer 1000 samples data in to ram
DMA interrupts your CPU after 1000 samples
12 cycles are spent entering interrupt
Code happens (let's say it tells the DMA to overwrite the RAM)
12 cycles are spent exiting interrupt

Pretending the whole interrupt (with entry and exit overhead) is 100 single-cycle instructions. Using DMA, you only spend 100 cycles to save the same 1000 samples.
Now, each time the DMA accesses the bus, yes, there might be a dispute between CPU and DMA. The CPU may even be forced to wait for the DMA to finish up. But waiting for the DMA to finish is much much shorter than locking the CPU in to servicing the ADC. If the CPU core clock is 2x Bus clock, then the CPU might waste a few core cycles waiting for the DMA to finish. This means that your effective execution time of the transfer is between 1000 (assuming CPU never waits)and 9000 cycles. Still WAY better than the 100,000 cycles.
Comment: Important to note that RAM is not the only place that the CPU can store data. In general the CPU loads the data from RAM into registers before working on it.
Comment: Yah, absolutely correct. My example is purely a rough sketch.
Comment: Many microcontrollers also have a multilayer bus so concurrent operations are possible. Eg: adc->ram and flash->register at the same time. Also, many instructions are longer than 1 clock, so there is plenty of time for the DMA.
Answer: The LPC1768 datasheet I found has the following quotes (emphasis mine):

Eight channel General Purpose DMA controller (GPDMA) on the AHB multilayer
  matrix that can be used with SSP, I2S-bus, UART, Analog-to-Digital and
  Digital-to-Analog converter peripherals, timer match signals, and for
  memory-to-memory transfers.
Split APB bus allows high throughput with few stalls between the CPU and DMA

The block diagram on page 6 shows SRAM with multiple channels between the AHB matrix and the following quote backs this up:

The LPC17xx contain a total of 64 kB on-chip static RAM memory. This includes the main
  32 kB SRAM, accessible by the CPU and DMA controller on a higher-speed bus, and two
  additional 16 kB each SRAM blocks situated on a separate slave port on the AHB
  multilayer matrix.
  This architecture allows CPU and DMA accesses to be spread over three separate RAMs
  that can be accessed simultaneously

And this is reinforced by the following quote:

The GPDMA enables peripheral-to-memory, memory-to-peripheral,
  peripheral-to-peripheral, and memory-to-memory transactions.

Therefore you could stream data to your DAC from one of the separate SRAM blocks or from a different peripheral, whilst using the main SRAM for other functions.
This kind of peripheral-peripheral DMA is common in smaller parts where the memory interface is quite simple (compared to say a modern Intel processor).
Comment: Yes - this is exactly what the AHB matrix is for.  It allows different controllers (CPU, DMA, certain peripherals like ethernet and USB) to access different things at the same time.  This is why there are multiple 'ports' to the SRAM.
Comment: Ahh, thanks, I didn't realise that was possible, I'm kindof new to DMA. Does that imply that the cpu can access peripherals while the DAC is accessing the separate SRAM?
Comment: Yeah, the AHB in these cheap little critters delivers insane memory bandwidths due to the parallel memory banks: you can have ethernet, USB2 and everything run at max throughput and the cpu doesn't even notice...
Comment: Also thumb code can put 2 instructions in one 32-bit word, so the cpu may not need to access the bus that often when doing math or operations that mostly involve registers... On the other side, I think the M3 and M4 can do several memory accesses per clock (instruction and data) due to having several busses.
Answer: If on a given cycle the processor and a DMA controller would need to access the same bus, one or the other would have to wait.  Many systems, however, contain multiple areas of memory with separate buses along with a bus "bridge" that will allow the CPU to access one memory while the DMA controller accesses another.
Further, many CPUs may not need to access a memory device on every cycle.  If a CPU would normally only need to access memory on two out of three cycles, a low-priority DMA device may be able to exploit cycles when the memory bus would otherwise be idle.
Even in cases where every DMA cycle would cause the CPU to be stalled for a cycle, however, DMA may still be very helpful if data arrives at a rate which is slow enough that the CPU should be able to do other things between incoming data items, but fast enough that the per-item overhead needs to be minimized.  If an SPI port was feeding data to a device at a rate of one byte every 16 CPU cycles, for example, interrupting the CPU for each transfer would likely cause it to spend almost all its time entering and returning from the interrupt service routine and none doing any actual work.  Using DMA, however, the overhead could be reduced to 13% even if each DMA transfer caused the CPU to stall for two cycles.
Finally, some CPUs allow DMA to be performed while the CPU is asleep.  Using
an interrupt-based transfer would require that the system wake up completely
for each unit of data transferred.  Using DMA, however, it may be possible for
the sleep controller to feed the memory controller a couple of clocks every
time a byte comes in but let everything else stay asleep, thus reducing
power consumption.
Comment: The Cortex-M parts like the LPC1768 have distinct memory path from flash to the instruction decoder, so in fact register-to-register operations may mean the CPU can execute multiple instructions between times when it needs access to data memory.
Answer: As a programmer, DMA is an option for transferring data to and from the peripherals that support it.  For the classic example of shifting a large buffer through a serial peripheral like SPI or UART, or collecting a number of samples from an ADC, you have three methods of moving that data:

Polling method. This is where you wait on register flags to allow you to shift in/out the next byte. The problem is that you are holding up all execution of the CPU while waiting for this.  Or, if you have to share CPU time in an operating system, then your transfer will be drastically slowed down.
Interrupt method. This is where you write an interrupt service routine (ISR) that executes with every byte transfer and you write the code in the ISR that manages the transfer.  This is more CPU efficient because the CPU will service your ISR only when needed.  It is free for use at all other times except in the ISR.  ISR is also one of the faster options for making the transfer in terms of speed of transfer.
DMA. You configure the DMA with source/destination pointers, number of transfers and off it goes.  It will steal bus cycles and CPU time to accomplish the transfer, and the CPU is free to do other things in the mean time.  You can configure a flag or interrupt to indicate when the transfer is done.  It is usually a touch faster than ISR and is usually your fastest transfer option.

As a programmer, I prefer DMA because it is the easiest to code and is essentially the fastest technique to make the transfer.  Typically, you just need to configure a couple registers for the source/destination pointers and number of transfers to make and off it goes.  I spend far more hours working in ISR code than I do in DMA-accelerated code because ISR code requires critical design skills and has to be coded, tested, verified, etc.  The DMA code is far smaller and the code I have to write myself is relatively trivial, and I'm getting maximum transfer speed in the bargain.
In my experience, lately with Atmel SAM3/4 processors, DMA runs a touch faster than an efficient ISR of my own crafting.  I had an application that would read in a pile of bytes from SPI every 5 msec.  A lot of floating point math was occurring in background tasks so I wanted the CPU to be as free as possible for those tasks.  The initial implementation was ISR, and I then moved to DMA to compare and try to buy a little more CPU time between samples.  The transfer speed gain was slightly improved, but only by a little.  It was barely measurable on the o-scope.
That is because on recent microprocessors that I've seen, ISR and DMA are operating in almost the same fashion - they take CPU cycles as required and the DMA is doing essentially the same operations with the CPU as I would have coded in an efficient ISR.
In rare cases, I've seen peripherals that have their own RAM area that was ONLY accessible by DMA.  This was on Ethernet MACs or USBs.
Answer: DMA is most likely used here so that the DAC can have some regular timing, generate a waveform by changing the analog output at some known interval.
Yes if it is a shared bus then...you have to share.
The cpu is not always using the bus, thus it is sometimes a good idea to share with a dma engine.  And of course that means priorities get involved, sometimes it is just who got there first (for example have a command fifo in front of the resource, and fifo up requests, in the order  they arrive, yes that would be not-necessarily-deterministic).  In a case like this you may want the dma to have priority over the cpu so that time sensitive things like DACs or ADCs have deterministic timing.  Depends on how they chose to implement it.
Folks sometimes have this often incorrect assumption that dma is free.  It isnt it still consumes bus time, if shared with the cpu (which it eventually is as it talks to a resource the cpu can talk to) then the cpu and/or the dma is held off, so the cpu still has to wait some time, in some implementations (likely not your microcontroller) the cpu is completely held off until the dma completes, cpu is stopped for the duration.  Just depends on the implementation.  The free part of it is that the cpu doesnt have to be constantly being interrupted or polling or holding its breath for some event to feed data.  It can take its time to create the next buffer to dma over.  It does have to watch for the dma transfer to complete and deal with that but instead of say every byte it is now multiple bytes, some block of data.
There is no one universal answer.  "It depends"...on the specific design of the specific thing you are using.   Even within one chip/board/system design there may be multiple dma engines and there is no reason to assume they all work the same way.  For every instance you have to figure it out, and unfortunately, they often dont document it or document it well enough.  So you may have to create some experiments if it is a concern.
Comment: note embedded has nothing to do with it.  the point of dma is to gain performance by possibly doing work for the cpu so it doesnt have to have code, and to take advantage of normally unused bus cycles and do work there.  Also for things as in your question of feeding data at the right time ideally without cpu overhead.  these advantages are useful embedded or not.
Answer: The answers so far talk about the "speed" the CPU can do work and how DMA benefits that.    However there is another consideration, power.
If the CPU wished to send out a packet of data on a slow link, it would need to be awake for most of the time if using polling or interrupts, however the main CPU maybe able to be in a sleep state while DMA is being done.
Answer: Some processors like the STM32H7 series have a lot of RAM options and heaps of close coupled RAM.  Having separate RAM banks allows DMA to hammer one lot of RAM whilst the processor is processing data in the close-coupled ram that doesn't require caching and doesn't get hammered by DMA.  To move data around you can use MDMA.  I built an FMCW radar set using one of these.  The ADC's get IQ data from two inputs into one SRAM. I then scale the data and perform the floating point 256 bin complex fft in dtcm ram. Then FIFO the result into a 2d array in AXI ram using MDMA.
I the take a second fft 64 bin across the fifo for the velocity vector. I then do the magnitude of the complex data and send the resulting data 128 & 64 floating point values out to another H7 using SPI at 12.5 MHz for the detection. I do all of this in 4 ms.
The sampling rate is of the ADC's is 84 kHz and using oversampling I'm getting about 18 bits resolution.
Not bad for a general purposes processor only running in the MHz range and with no external RAM.
Also the large caches this device has improved performance for calcs outside of the dtcm helps as well.


How do I find out what tool a shortcut is triggering?

Question: I used to have problem with connecting two objects, because when I smooth the final object, there was a darker line on the connected parts (for example when I was making head, I've had eyes darker this way). Then I found out that I can get rid of it by hitting Ctrl+N, but I don't realy know what it does. I can just see that the lines are gone. So, what does Ctrl+N do?
Comment: You might be interested in [this comment](http://blender.stackexchange.com/questions/19399/what-setting-locks-local-rotation-and-scaling-of-an-object#comment27856_19401).
Answer: In future, to find out what tool is being triggered by a shortcut, you can search in the 'Input' section of the 'User Preferences'.
Going to File> User Preferences (Ctrl+Alt+U)> Input, you can use the search field to search for tools assigned to shortcuts. The 'Filter Method' drop down box must also be set to 'Key-binding' for this to work:

This will yield a list of all tools in blender using that shortcut. For example, "ctrl n" would result in showing that that shortcut will 'Make Normals Consistent' for meshes in edit mode. 'Make Normals Consistent' will make sure all faces of the mesh are facing the right way and shaded correctly see: Render has strange artifacts. It also lists other commands that use the same shortcut such as 'Reload Start-up File':

You can also look in the bottom of the toolbar (T) in the 3D view immediately after using the shortcut to see what was triggered:
Comment: In Blender 2.8, the section where the search can be found is now named _Keymap_, instead. Otherwise, the answer still applies
Answer: In Edit mode, which I'm assuming from the information that you are referring to, Ctrl+N recalculates the normals of the object to try to make them consistent. The direction of the normals tells Blender what is the inside and what is the outside of an object.


SCM8014 to FVS338

Question: I have a SMC8014 Router/Modem that Comcast provided me with their business class service.  It was not filtering malicious traffic as aggressively as I had hoped, so I purchased a NetGear ProSafe FVS338, and put this behind the SMC8014, and all my machines behind that.  After some brief configuration, all machines can see out to the internet.
I also have a single web server, and I have not been able to configure things so that incoming requests can reach it.  This is where I need help!
I would like to have the FVS339 do NAT, so that I can assign a 192.168 address to my webserver.  I've tried everything I know of, and I can't get things going.
I set the SMC8014 to have a LAN facing IP of 10.0.0.1, and I assigned the FVS339 a WAN facing IP of 10.0.0.2.  I would like to be able to tell the SMC8014 to just forward all traffic to 10.0.0.2, but I haven't had any success.
In my (unfortunately limited) understanding, what I probably want here is a static route, but I don't know how to cofigure one, or if this is really what I want.  The SMC8014 wants a Destination IP, a Subnet Mask and a Gateway IP.
Any help would be appreciated.
Answer: First some advice: use one router or the other, not both (at least until you understand this better).
For outgoing connections, the router does DNAT = Dynamic Network Address Translation, where several internal IP addresses appear to be connecting from your external address.  For incoming connections to your webserver the router does SNAT = Static NAT, forwarding the incoming connections to the internal IP address. You should be able to find config options for SNAT.

SCM8014 to FVS338


Does the US president have the authority to ban TikTok?

Question: Donald Trump, the president said that he wants to ban TikTok. Would such a ban violate the first amendment? If not does he have the power to act via executive order or does it have to go through Congress?
Comment: Tiktok is banned in India but India is a different country...
Answer: He has that power, as spelled out here, relying primarily on 50 U.S.C. 1701. This executive order already exists, so one path is to simply put Tik Tok on the Commerce Department's entity list. The specific list as of July 22 is here – you can find Huawei already on the list, for example. A First Amendment lawsuit is not likely to succeed, since there is no First Amendment right to directly or indirectly threaten national security, foreign policy, and the US economy (the compelling government interest). The courts will generally defer to the executive branch in its judgment regarding the necessity of a restriction. You could argue (as a proponent of Bytedance's side) that it is only necessary to ban the program on military devices, but the counter-argument is that a less restrictive action is not effective in addressing the compelling governmental interest.
Comment: There *is* a 1st Amendment concern here; the right of individuals to run whatever code they want (because a number of decisions say code is speech), and to associate with whom they want (e.g. other TikTok users). Of course government interest may override that, but I don't think it can be dismissed out of hand.
Comment: @PaulJohnson In *Bernstein,* the Court said encryption software was speech, and could be published. It said nothing about running code.
Comment: @Justaguy True, but the effect of running code is arguably part of its expression. Imagine if the law allowed the production of a movie but prohibited running it through a projector. While there is no actual precedent on the point, this does not imply that there is no 1stA issue.
Comment: The 1st Amendment certainly does not let you run whatever code you want. Look at the DMCA. Part of it protects copyright, which is in the Constitution, but part of it makes running code that circumvents digital locks illegal.
Comment: @Oliver You can run the code, its just illegal to use it to circumvent copy protection on a copyrighted work. The DMCA also forbids the distribution of circumvention tools. All this is part of the copyright exception to the 1st Amendment.  https://en.wikipedia.org/wiki/United_States_free_speech_exceptions#Speech_owned_by_others
Comment: @PaulJohnson The circumvention of copy protection IS the running of code. Maybe you mean that you can run code EXCEPT code that breaks digital locks. My point was just that not all code can be run. And no, it does not violate copyright to break a lock. If it were then Congress would not have been purchased to pass the DMCA because software companies could have just sued digital lock breakers for copyright infringement.


Why is the volume of a sphere $\frac{4}{3}\pi r^3$?

Question: I learned that the volume of a sphere is $\frac{4}{3}\pi r^3$, but why? The $\pi$ kind of makes sense because its round like a circle, and the $r^3$ because it's 3-D, but $\frac{4}{3}$ is so random! How could somebody guess something like this for the formula?
Comment: Heh "pi makes sense because it's round like a circle"... nice way to describe one of the fundamental transcendentals :)
Comment: So along that reasoning the volume of the 4D sphere is $\frac{1}{2}\pi^2 r^4$ because it is double as round as circle?
Comment: hopefully we'll get that darn math markup working soon, :)
Comment: "$\frac 4 3$ is so random": so, in your opinion are there numbers "randomer" than others? You could just have taken a look at the Wikipedia page on the sphere; it puzzles me how this has so many upvotes (although I favorited it myself).
Comment: How about higher dimensional spheres?
Comment: The negative solution to Hilbert's third problem (http://en.wikipedia.org/wiki/Hilbert%27s_third_problem) strongly suggests (if not shows outright) that this and related questions require calculus in an essential way, and that calculus-free "derivations" are just hiding something.
Answer: In addition to the methods of calculus, Pappus, and Archimedes already mentioned, Cavalieri's Principle can be useful for these kinds of problems.
Suppose you have two solid figures lined up next to each other, each fitting between the same two parallel planes. (E.g., two stacks of pennies lying on the table, of the same height). Then, consider cutting the two solids by a plane parallel to the given two and in between them. If the cross-sectional area thus formed is the same for each of the solids for any such plane, the volumes of the solids are the same.
If you're willing to accept that you know the volume of a cone is 1/3 that of the cylinder with the same base and height, you can use Cavalieri, comparing a hemisphere to a cylinder with an inscribed cone, to get the volume of the sphere. This diagram (from Wikipedia) illustrates the construction: look here
Consider a cylinder of radius $R$ and height $R$, with, inside it, an inverted cone, with base of radius $R$ coinciding with the top of the cylinder, and again height $R$. Put next to it a hemisphere of radius $R$. Now consider the cross section of each at height $y$ above the base. For the cylinder/cone system, the area of the cross-section is $\pi (R^2-y^2)$. It's the same for the hemisphere cross-section, as you can see by doing the Pythagorean theorem with any vector from the sphere center to a point on the sphere at height y to get the radius of the cross section (which is circular).
Since the cylinder/cone and hemisphere have the same height, by Cavalieri's Principle the volumes of the two are equal. The cylinder volume is $\pi R^3$, the cone is a third that, so the hemisphere volume is $\frac{2}{3} \pi R^3$. Thus the sphere of radius $R$ has volume $\frac{4}{3} \pi R^3$.
Comment: Here's a nice visual image http://www.its.caltech.edu/~mamikon/SpheReduced.html
Comment: Very nice--this is the answer I wanted to have, but I couldn't get the picture/comparison straight in my head.
Comment: @DerekJennings adobe flash no longer supported :)
Answer: The volume of a sphere with radius $a$ may be found by evaluating the triple integral$$V=\iiint \limits _S\,dx\,dy\,dz,$$where $S$ is the volume enclosed by the sphere $x^2+y^2+z^2=a^2$. Changing variables to spherical polar coordinates, we obtain$$V=\int \limits _0^{2\pi}d\phi \int \limits _0^\pi d\theta \int \limits _0^ar^2\sin \theta \,dr=\int \limits _0^{2\pi}d\phi \int \limits _0^\pi \sin \theta \,d\theta \int \limits _0^ar^2\,dr=\frac{4\pi a^3}{3},$$as expected.
Comment: I dont want to criticize the validity of the result, but frankly the use of higher mathematics as a means to prove lower mathematics seems irrational and circular in reasoning.  To respect the natural conceptual evolution of mathematics is, to me, the foremost way to proving math and explaining it to students.
Comment: His proof is not circular, but his answer is more about practicing integral calculus than answering the above question. You can develop integral calculus without mentioning spheres or balls.
Answer: A complete answer using the disk method would be the following.
If you revolve $y=\sqrt{r^2-x^2}$ about the $x$-axis (and form a solid) you get the volume of a sphere.

Form a disk with height $f(x)$, and find its area.

The area of the red disk above is $\pi r^2$, or $\pi f(x)^2$, or we could say $\pi \sqrt{r^2-x^2}^2=\pi \left (r^2-x^2\right )$ at any point $x$ between $x=-r$ and $x=r$.
To find the volume of a sphere of radius $r$ then, just add up the areas of infinitesimally thin disks on as $x$ goes from $-r$ to $r$.
To work it out:\begin{align*}\int \limits _{-r}^r\pi \sqrt{r^2-x^2}^2\,dx & =2\pi \int \limits _0^rr^2-x^2\,dx \\
& =2\pi \left (\left .r^2x-\frac{1}{3}x^3\right )\right |_0^r \\
& =2\pi \left (r^3-\frac{1}{3}r^3\right ) \\
& =\frac{4\pi}{3}r^3.
\end{align*}
Comment: I think this is the most appropriate answer to the question. There's something about figuring this one out on your own that's very satisfying since you really spend a lot of your life taking this along with several other formulas on faith, but once you see that the derivative of pi*r^2 is the circumference, you start to see why pi isn't just 3.whatever but is truly a ratio that relates a circle's circumference to its diameter.
Comment: This is exactly how I first found the volume of the sphere (and likely thousands of people before me), it's the most straightforward way.
Comment: There's a lot in common between 3D printing and volume integrals...
Comment: Is it x or y going from r to -r on the red disk?
Answer: I'll add a Chinese version for fun.
The ancient Chinese had another way to calculate this volume.

The principle is same as Cavalieri's Principle; the difference is using the intersection of two perpendicular cylinders, a "bicylinder", to pack the sphere. The Chinese name for this shape is 牟合方蓋 or "mouhefanggai" (meaning two square umbrellas).
Every plane (parallel to the cylinders' axes) intersects in a square with the bicylinder and intersects in a circle with the sphere (for more pictures and an animation, see http://phdfishman.blogspot.com/2010/02/blog-post_07.html ). This means that the volume ratio of the sphere to the bicylinder is proportional to the areas of the circles and squares: $\dfrac{\pi r^2}{(2r)^2}=\dfrac{\pi}{4}$.
Now the question becomes calculating the volume of the bicylinder (white). It is also very difficult, so add a cube (red) packing the bicylinder (white). Now when the plane intersects the cube, it forms another larger square. The extra area in the large square (the big square from the cube minus the smaller square from the bicylinder), is the same as $4$ small squares (blue). As the plane cutting through the solids moves, these blue squares will form $4$ small pyramids in the corners of the cube with isosceles triangle sides and their apex at the edge of the cube. Moving through the whole bicylinder generates a total of $8$ pyramids.
Now we can calculate the volume of the cube (red) minus the volume of the eight pyramids (blue) to get the volume of the bicylinder (white). The volume of the pyramids is:$$8\cdot \frac{1}{3}r^2\cdot r=\frac{8}{3}r^3,$$and then we can calculate that the bicylinder volume is $(2r)^3-\dfrac{8}{3}r^3=\dfrac{16}{3}r^3$.
Finally, using the ratio of the volumes of the bicylinder and the sphere from above, the sphere's volume is $\dfrac{\pi}{4}\dfrac{16}{3}r^3=\dfrac{4\pi}{3}r^3$.
Now you can see that $3$ is from the pyramids and $4$ is from the cube! They are not random.

This picture shows the geometric relationships.
Answer: Pappus's centroid theorem (second theorem) says that the volume of a solid formed by revolving a region about an axis is the product of the area of the region and the distance traveled by the centroid of the region when it is revolved.  A sphere can be formed by revolving a semicircle about is diameter edge.
The area of the semicircle is $\frac{1}{2}\pi r^2$.  The centroid of the semicircle can be found by intersecting two lines that both divide the area of the semicircle into two equal parts.  One such line is perpendicular to the diameter edge through the center of the semicircle (this is a line of symmetry of the semicircle).  Another such line is parallel to the diameter edge, $\frac{4r}{3\pi}$ away from it (verification of this is left as an exercise for the reader).  When revolved about the diameter edge of the semicircle, the centroid travels $2\pi\cdot\frac{4r}{3\pi} = \frac{8}{3}\cdot r$, so the volume of the sphere is $\frac{1}{2}\pi r^2\cdot\frac{8}{3}\cdot r = \frac{4}{3}\pi r^3$.
Answer: To give you a larger perspective, the volume of an $n-1$-sphere in $\mathbb{R}^n$ is given by $C_n r^n$, where $r$ is the radius and $C_n=\frac{\pi^{n/2}}{\Gamma(\frac{n}{2} + 1)}$. For even $n$, this reduces to $C_n =\frac{\pi^{n/2}}{\left(\frac{n}{2}\right)!}$, and for odd $n$, it becomes $C_n =2^{(n+1)/2}\frac{\pi^{(n-1)/2}}{n!!}$, where $n!!$ denotes the double factorial.
Thus in the case $n=3$, the constant is $2^2 \frac{\pi^1}{3!!} = \frac{4 \pi}{3}$.
The point of this is to show you that the general formula also involves factors in the denominator, and that the formula for $n=3$ is not 'random' but rather fits into a general pattern.
Comment: I've never seen this result - it blows my mind!
Answer: In the diagram below on the left, we will assume that the the size of $\triangle PQR$ is infinitesimal compared to $\triangle PNO$, and thus, the  green arc and the segment $\overline{PR}$ are essentially equal in length. Note that both $\angle NPO$ and $\angle QPR$ are complementary to $\angle OPQ$, and therefore, equal. Thus, the right triangles $\triangle PNO$ and $\triangle PQR$ are similar (corresponding sides are colored similarly). Since $\triangle PNO$ and $\triangle PQR$ are similar,
$$
\overline{NP}\cdot\overline{PR}=\overline{OP}\cdot\overline{PQ}\tag{1}
$$
The inner circumference of the green annulus on the sphere to the right is $2\pi\overline{NP}$ and its outer circumference is $2\pi\left(\overline{NP}+\overline{QR}\right)$, while its width is $\overline{PR}$. Therefore, its area is between $2\pi\overline{NP}\cdot\overline{PR}$ and $2\pi\left(\overline{NP}+\overline{QR}\right)\cdot\overline{PR}$.
The circumference of the red strip on the cylinder to the right is $2\pi\overline{OP}$, while its width is $\overline{PQ}$. Therefore, its area is $2\pi\overline{OP}\cdot\overline{PQ}$.
According to $(1)$, the difference between the area of the green annulus on the sphere and the red strip on the cylinder is less than $2\pi\overline{QR}\cdot\overline{PR}$.  Summing $\overline{QR}$ as we walk down the sphere gives $2\overline{OP}$ (one as $\overline{NP}$ increases and one as it decreases), thus, the difference between the area of the sphere and the area of the cylinder is less than $4\pi\overline{OP}\cdot\max\overline{PR}$, which can be made to vanish by making $\overline{PR}$ as small as we wish.
Thus, the area of the sphere is equal to the area of the cylinder. Since the circumference of the cylinder is $2\pi r$ and its height is $2r$, we get that the area of the cylinder, and therefore the sphere, is $4\pi r^2$.
$\hspace{4mm}$
To compute the volume of the sphere, we just sum the surface area of all spherical shells times their thickness:
$$
V=\int_0^r4\pi t^2\,\mathrm{d}t = \frac43\pi r^3\tag{2}
$$
Answer: This was first "guessed at" by Archimedes, by what fraction of the volume of a cylinder a sphere is.  That is, a sphere that is contained within that cylinder.  From that, he figured out $4/3$.
You can do it these days with the tools of calculus.  One way would to use the [Disk Method], over the graph of a semicircle.  Another would be to use spherical coordinates and calculate the 3D Integral.
All of these methods should give you $\frac{4}{3} \pi  r^3$
Note that it's not just $r^3$ because it's "3D"; but also because it's the only way the dimensional analysis would work; that is, the units would have to be in $\text{distance}^3$.  But that might be what you said, but just clarifying.

Answer: I wanted to post this as a comment to the answer by Justin L. but it is my first posting here so I couldn't. Archimedes was so proud of his proof that the volume of a sphere is two-thirds of the volume of a cylinder of the same height and diameter that he asked that a sculpture illustrating this would be placed at his tomb. The tomb was later found by the Roman orator Cicero who describes it as follows:
"I managed to track down his grave. The Syracusians knew nothing about it, and indeed denied that any such thing existed. But there it was, completely surrounded and hidden by bushes of brambles and thorns. I remembered having heard of some simple lines of verse which had been inscribed on his tomb, referring to a sphere and cylinder modelled in stone on top of the grave. And so I took a good look round all the numerous tombs that stand beside the Agrigentine Gate. Finally I noted a little column just visible above the scrub: it was surmounted by a sphere and a cylinder."
The American painter Benjamin West imagined the scene in his 1797 painting "Cicero Discovering the Tomb of Archimedes".
Answer: To expand on what anosov_diffeomorphism said:
Suppose we agree that the surface area of a sphere is 4 π r2 (If we do not agree on this, that would be a great question to ask on this site, and then someone can edit this answer to link to it!). Now if I have a sphere of radius r, and I increase the radius by a tiny amount, dr, then the new, expanded sphere has a volume that is bigger, by the volume of the thin spherical shell that was just added. If dr is small enough, then it doesn't much matter whether we look at the inner or outer radius of that shell, and we can just say that the shell's volume is approximately 4 π r2 dr. So the difference in volume between two spheres of radius $r_1$ and $r_2$ is $\int_{r_1}^{r_2}$ 4 π r2 dr, which is 4/3 π r^3
Comment: This answer is very clear ! Now, why is the area of the sphere 4 π r² ?
Comment: I like this explanation, but it has been pointed out that working out the surface area of a sphere is pretty much as hard as working out its volume.
Answer: Integration. $$\int 4\pi\cdot r^2 dr = 4/3 \pi r^3.$$
Comment: @Kaestur: Let me rephrase. It's valid mathematically, but doesn't really answer the question, because the formula for the surface area is not more obvious really...
Comment: What is that expression you are integrating? Looks like the formula we learned for surface area. Why would that be related?
Comment: He's integrating the radius from 0 to r to get the volume, which is acceptable, though it begs the question of how you got the surface area in the first place.
Comment: @Noldorin: It's in the back of my geometry textbook! My teacher said its like how they stitch together baseballs. But why is that acceptable? Is there a picture or something that could help explain it?
Comment: An example of what I spoke of in a previous comment above. Using the consequences of a truth to prove that truth is nonsense.
Answer: To add to the approach of @bobobobo, it can be shown that we can construct the volume $V_n$ of an $n$ dimensional sphere from the volume $V_{n-1}$ of an $n-1$ dimensional sphere using the following recurrence relation:
$$V_n = 2r V_{n-1} \int_0^{\frac{\pi}{2}}\cos^n\theta d\theta$$
using this relation starting with $V_0 =1$ we get:
$$V_1 = 2r V_0 = 2r$$
$$V_2 = \frac{\pi}{2}r V_1 = \pi r^2$$
$$V_3 = \frac{4}{3}r V_2 = \frac{4}{3}\pi r^3$$
continuing...
$$V_4 = \frac{3\pi}{8}r V_3 = \frac{1}{2}\pi^2 r^4$$
Comment: http://en.wikipedia.org/wiki/N-sphere
Answer: If we already knew that the surface of the sphere is $4\pi r^2$, then we could go like this:
We could divide the surface into small polygons (you can imagine them infinitesimally small). The area of these polygons approximate the area of the surface. Now the volume of the sphere would be approximated by the pyramids obtained from the polygons, each of them having volume $(1/3)*\text{base}*\text{height}$.
Since height is approximately $r$ (as we make the polygons smaller) and the bases together give the area of $4\pi r^2$, we arrive to $V=\frac43 \pi r^3$.
(Although I have to admit that I liked this better as a way of deriving the formula for the surface area from the volume.)
Comment: Hi Martin! If we already knew that the surface of the sphere is $4\pi r^2$, then we could … just integrate it. Couldn't we?
Comment: @Pierre: Of course we could. But this reasoning could work for people which have not learned integrals yet, just based on their geometric intuition. (But the intuition is, of course, very close to the intuition behind the integral.)
Comment: Thanks! I was basically kidding. I of course knew that you were aware of this. Note that many (if not most) of the other answers do use integrals. But again, I fully agree with you.
Comment: @NicolasBarbulesco There are, unsurprisingly, several posts on this site discussing this. For example: [How to intuitively see that the $\text{volume of a pyramid }= 1/3 \times (\text{ area of base}) \times (\text{height})$](http://math.stackexchange.com/questions/8909/how-to-intuitively-see-that-the-textvolume-of-a-pyramid-1-3-times-text) or [Volume of Pyramid](http://math.stackexchange.com/questions/100715/volume-of-pyramid)
Comment: But why the volume of a pyramid is 1/3 × base × height ?
Answer: Archimede found that the volume of a ball is 2/3 of the volume of its enclosing cylinder : a hat box with a basket ball fit inside. Why exactly 2/3 ? This is the pure beauty of maths. Archimede found this beautiful result and was so fond of spheres and cylinders.
Now, what is the volume of the cylinder ?
VC = area of the base disc × height

The area of the base disc is π r2. Archimede also found this result, and he proved it. Let's accept it for now.
The height of the cylinder is the total height of the ball, so 2 r.

So VC = π r2 × 2 r = 2 π r3.
The volume of the ball is 2/3 × VC = 4/3 × π r3.
Comment: I believe it is [Archimedes](https://en.wikipedia.org/wiki/Archimedes) rather than Archimede.
Answer: This expands on the answer by MatrixFrog which starts with the formula for the surface area $A$ of a sphere of radius $R$, namely  $ A_R = 4 \pi R^2$.
I will show mathematically that the assumption that the volume of a shell of small thickness $t$ is approximately given by $V \approx 4 \pi R^2 .t$ is valid, using high school maths and no calculus.
Let us model the sphere (radius $R$) as a set of concentric, contiguous shells of common thickness $t$.  The outermost shell is defined by an outer (zero-thickness) sphere of radius $R$ and by an inner (zero-thickness) sphere of radius $R-t$.  The innermost shell is defined by an outer (zero-thickness) sphere of radius $t$ and its inner boundary is the centre point of the sphere; the innermost shell is therefore a small sphere.
Now let us express the volume of the major sphere as the sum of the volumes of the shells (with outer radii: $ x=t,2t,3t,...,R-t,R$). And let us approximate the volume of each shell by the product of its surface area $A_x = 4 \pi x^2$ and its thickness $t$. So
$$
V_R \approx \sum_{x=t}^{x=R} 4 \pi x^2 t \approx 4 \pi t \sum_{x=t}^{x=R}  x^2.
$$
Now let us replace $x$ by $i.t$ and define $N = R/t$, then we obtain:-
$$
V_R \approx  4 \pi t \sum_{i=1}^{i=N}  i^2t^2 \approx  4 \pi t^3 \sum_{i=1}^{i=N}  i^2.
$$
Using the power sum formula:-
$$\sum_1^N k^2 = (N/6)(N+1)(2N+1) =  \frac{2N^3+2N^2+2N+1}{6}$$
we get
$$
V_R \approx   4 \pi t^3 \frac{2N^3+2N^2+2N+1}{6}.
$$
replacing $N$ by $R/t$
$$
V_R \approx   \frac{4}{6} \pi t^3 \left[ \frac {2R^3}{t^3}+ \frac{2R^2}{t^2}+ \frac{2R}{t} +1 \right]
\approx   \frac{4}{3} \pi \left[ R^3+ R^2t+ Rt^2 + \frac{t^3}{2} \right].
$$
Now clearly as $t \rightarrow 0$ so all the terms in $t$ also go to zero and we are left with $V_R \rightarrow \frac{4}{3} \pi  R^3.$
Answer: This is my attempt at determining where the $\frac{4}{3}$ in the equation for the volume of a sphere ($\frac{4}{3} \pi r^2$) comes from.
I concluded my answer by conceptualizing the definition of a sphere with respects to its derivative (a circle) and the basic definition of such.
If we choose to define a circle by its circumference ($2\pi r$), then it follows that its area is equal to $\int_0^r 2\pi t dt = \pi r^2$ where it's center is located at the origin of a cartesian plane.
We should note that a sphere is scaled by its horizontal and vertical surface-components (circles). With this we can define a sphere as $(2\pi r)_{xy}(2\pi r)_{xz}=4\pi r^2$, or the Surface Area of a Sphere. A sphere defined as such holds true that its volume (or area) is equal to $\int_0^r 4\pi t^2dt=\frac{4}{3}\pi r^3$.
Note: I am using the term scaled specifically to avoid confusion in the usage of multiplication vs. addition.
Proof (by Contradiction): If you add the horizontal and vertical surface-components of a sphere, you will find that you have the circumference of a circle multiplied by a scalar factor of 2 or $(2\pi r)_{xy}+(2\pi r)_{xz}=4\pi r=2*2\pi r$.
Proof (by Conceptualization): You are are integrating across a 3-Dimensional object that has both height (on the xy-plane) = $r_{xy}$ and width (on the xz-plane) = $r_{xz}$.
Comment: This is same of my thought.
Answer: $$
\begin{array}{rlcccc}
\large\mbox{Cone:}
&
{\rm d}V
& = &
\pi\left(r \over h\right)^{2}h'^{2}\,{\rm d}h'
& = &
\pi r^{2}h\,
\overbrace{\left(h' \over h\right)^{2}\,{\rm d}\left(h' \over h\right)}^{1/3}
\\[3mm]
\large\mbox{Cylinder:}
&
{\rm d}V
=
&&& = &
\pi r^{2}h\,\phantom{\left(h' \over h\right)^{2}}
\underbrace{\,{\rm d}\left(h' \over h\right)}_{\vphantom{\Large A}1}
\end{array}
$$
Also, according to the Gauss Theorem, any volume is a sum of pyramids:
$$
V
=
\int_{V}{\rm d}V
=
\int_{V}{\nabla\cdot\vec{r} \over 3}\,{\rm d}V
=
\int_{V}{\vec{r}\cdot{\rm d}\vec{S} \over 3}
$$
We can think the cone is a "perfect sum of pyramids" since we just need to integrate
( with the vertices as the origin ) over the base.
Answer: I am no where near as proficient in math as any of the people who answered this before me, but nonetheless I would like to add a simplified version;
A cylinder's volume is:
$$\pi r^2h$$
A cone's volume is $\frac{1}{3}$ that of a cylinder of equal height and radius:
$$\frac{1}{3}\pi r^2h$$
A sphere's volume is two cones, each of equal height and radius to that of the sphere's:
$$\frac{1}{3}\pi r^2h + \frac{1}{3}\pi r^2h$$
The height of the sphere is equal to it's diameter $(r + r)$ so the earlier equation can be rewritten as;
$$\frac{1}{3}\pi r^2(r + r) + \frac{1}{3}\pi r^2(r + r)$$
If we simplify it;
$$\frac{1}{3}\pi r^2(2r) + \frac{1}{3}\pi r^2(2r)$$
Following the math convention of numbers before letters it changes to:
$$\frac{1}{3}2\pi r^2r + \frac{1}{3}2\pi r^2r$$
Combining like terms;
$$r^2\cdot r= r^3$$
and
$$\frac{1}{3}\cdot 2 = \frac{2}{3}$$
The equation now becomes
$$\frac{2}{3}\pi r^3 + \frac{2}{3}\pi r^3$$
Again add the like terms, being the $\frac{2}{3}$ together;
$$\frac{2}{3} + \frac{2}{3} = \frac{4}{3}$$
Finally we get to how $\frac{4}{3}$ is part of the equation;
$$\frac{4}{3}\pi r^3$$
Comment: This statement is not at all obvious or elementary. "A sphere's volume is two cones of equal height and radius to that of the sphere's". The assertion about the cone and the cylinder is a little easier to prove, but it too is not obvious. So you have not really provided an answer to this to year old  question. I think the accepted answer is closest to what you have in mind. If you want to help here I think you should pay attention to new questions that don't yet have answers.
Comment: Well I wasn't really going for elementary, just a dumbed down version that worked for me that might help others starting at University Math. The other answers were great with backgrounds of why a sphere fits into a cylinder, etc, so I left that part out of mine. I personally wasn't able to figure out where 4/3 came from using any of their answers, so I contributed mine to help those that may see things my way. I agree it is an old question, but I had this question in 2019 that I couldn't find the answer to with those answers.
Answer: Let us consider the following sphere of radius r with an inscribed pyramid with base area G:

We can calculate the volume of the inscribed pyramid as follows:
$V_{pyramid} = \frac{1}{3} \cdot G \cdot r$
Notice that we can now express $V_{sphere}$ as the sum of the volume of infinitely small pyramids over the total surface area of the sphere, whereby $A_{sphere} = 4 \cdot \pi \cdot r^2$. When doing so, we get the following result:
$V_{sphere} = \sum volume\:of\:pyramid \\
= \sum \frac{1}{3} \cdot G \cdot r \\
= \sum \frac{1}{3} \cdot (4\pi r^2) \cdot r \\
= \frac{4}{3} \pi r^3$
So what do we take from this? The factor $\frac{4}{3}$ can be intuitively considered as a composition of the factor $4$ deriving from the area of the sphere and the factor $\frac{1}{3}$ coming from the volume of a pyramid.


Electrum receive tab

Question: I have requested some bitcoin from my friend and gave him the adress that is displayed in the "receive" tab in the electrum client.
After he sent them, I made a request for that amount in electrum and it is apparently "paid", as you may see below.
However, it does not show up in my history as an incoming payment. How do i get it to show up there?
Answer: Always when in doubt, check online block explorers (at least two as all of them are buggy to some extend and might freeze for some hours/days):
blockchain.info
insight.bitpay.com
blocktrail.com/BTC
etc.
...is your transaction there (you can search for your receiving address)? Is it confirmed? When it is not there at all you know it is not problem with your local wallet. If the tx is there you have probably problem with synchronization of your wallet - you can try to select different server to connect to (in Electrum's settings). You can also try running Electrum with different directory ('-D' command line parameter) to force it to download its metadata again and recreate your wallet from seed. You can also try to install Electrum on different machine & restore your wallet there. Maybe check your firewall, too.
Answer: What color circle icon do you see in the bottom right of the electrum window? If it's not green or blue try switching servers.
Also what version of electrum are you using? Old versions had problems syncing so I suggest using the latest version.

Electrum receive tab


When is it appropriate to use a program during games with a longer timeframe, such as correspondence chess?

Question: Are there rules about when a player may use a chess engine to aid his game?  Is it always frowned upon?  Do you have to specially ask?  Not that you can stop your opponent from using an engine, but is it cheating, or is it ever acceptable?  Thinking about it, I'm not sure what the point of two players using engines would be.
Comment: Are you asking for an opinion? It seems obvious to me that anything not relying on the skills of the opponents is cheating, unless so agreed beforehand.
Answer: If you haven't agreed before the game then you should assume that it's not allowed. It will usually be regarded as cheating. If you wish to use a computer you should ask your opponent before you do so.
Playing with the assistance of a computer is sometimes called Advanced Chess. If you agree before hand that it's allowed, then there's no problem and both can use a computer freely. Some Advanced Chess tournaments are also played with standard time controls.

Thinking about it, I'm not sure what the point of two players using engines would be.

The point of Advanced Chess is that a computer is strong at fast and accurate calculation but weak at strategy, while the human is stronger at strategy but more prone to errors in complex tactic situations. The human can use their strategic ability to guide the computer into strong strategical positions or won end game positions, while the computer can check that there are no blunders that the human may have missed. If played well, the playing strength of the human-computer team can be higher than each individual playing alone.
Comment: Daniel δ: "I think in general people tend to overestimate the importance of the computer in the competitions. You can do a lot of things with the computer but you still have to play good chess." - Viswanathan Anand
Comment: I realize a human-computer team would be stronger than a human alone, but would it be stronger than a computer alone?  In other words, wouldn't it be a computer match?
Answer: Anything agreed upon by the participants is ok.  In the case of using a program, without some agreement this would be no more acceptable than having someone else play the game on your behalf.
Comment: Yes, this is very simple and it works to big degree. Of course, the venue or event or website being played may have specific rules so those MUST be followed. Then, you should agree what actions are allowed with your opponent before the game.
Answer: Correspondence chess
In earlier times we used to analyze actual positions of correspondence chess games of a club member to help him win his games. Nowadays it is more common to ask the computer instead to check the validity of positions. Therefore in my opinion nothing has changed, except that the computer is more of a tactical genius than the common club player. Although there is some truth in the saying 'chess is all tactics', I think most correspondence chess players use chess engines mostly for checking against tactical loopholes, while using databases to check for common motives or win probabilities. But for the strategy part of the game, it is the human mind that wins the day (as long as chess is not fully calculable from start to end). Except for playing strength levels where cheap tactics always decide a game, the help of a computer is not a replacement for thinking yourself. I know of several very good correspondence chess players which would gladly play any player who restricts himself to using chess engine moves, because they expect to beat such an opponent easily. The moment this won't be true anymore correspondence chess will be dead (or at the very least be reduced to a clumsily slow chess engine testing ground).
Tournament Chess
Rules will usually try to regulate the allowed use of computers. The earlier practice of adjourned games was abandoned because of computer help becoming available, not the least because tablebases allowed perfect endgame play. In tournament halls the use of a cell phone or chess computer will often lose you the game instantly. In club matches the frequent use of the toilet room with a computer will be considered cheating, too. I remember some experiments with chess players being allowed the use of a computer during the game ("advanced chess"), but it never became popular. As long as you do not register the computer as a player (instead as yourself), the use of a database, cheat slip or chess engine is probably everywhere considered cheating. In the 80s there were some tournaments where chess computers where allowed to enter, and I remember dimly that former world championship candidate Robert Huebner forfeited a game once because he refused to play against a computer in such a tournament.
Online Chess
Extremely critical is the use of computers during online play, because no one can see what you are doing in person (like setting up a second computer to calculate moves for you, while "you" play a game on the first computer). Most playing sites have special rooms where the help of computer is allowed - everywhere else this is considered cheating. Of course, the use of a computer is a must to play online at all, but only as a human interface device (for inputting and receiving moves). Mind you can often register a chess engine as a separate player, so everyone playing it knows he is playing against a computer. But if you state you are playing yourself although you use a chess engine I'd consider it cheating.
Answer: First, two players using engines happens to compare the strength of engines (or the computers they're running on, but usually the first option). This is typically arranged as a computer chess tournament, or a "free for all" type match, where it is explicitly allowed to use engines.
I know that a lot of the chess websites actually have detection algorithms, where they compare your moves to those of popular engines, if people flag you as a potential cheater. Usually, the idea is to not use an engine, so that you're actually competing human to human. Often, in correspondence chess, it is acceptable to refer to books (and sometimes game databases), but not analysis engines.


My hard drive does single clicks every once in a while. Is this considered the click of death?

Question: I've watched a few youtube videos demonstrating the so called click of death and they all show a hard drive that 'clicks' nonstop.  My hard drive will occasionally make a clicking sound, but it happens sporadically and it's usually just one click. Does this indicate imminent failure as well?
Answer: No, some HDDs click. This however does not mean that you should not have any backup.
Comment: +1 for backup.  Should have it whether or not your HDD is making noises.
Comment: Occasional clicks are thermal recalibration routines and not to be worried about.
Answer: I do not think so.
My thoughts are more on entering some power save mode. Some disks (e.g. my old 2.5" HD) have click-like sound when stopping spindle in order to save power.
Answer: The clicking you hear may be the read head of the HD going back to it's resting position. This is most easily demonstrated with recent MacBook laptops because they have a feature where if the computer detects a sudden change in acceleration (like if you dropped it) it will move the HD's read head off the platters into a safe position to prevent a subsequent impact from causing the read head to touch the platters and possibly damaging the disk. So, when you jostle or shake your MacBook, you will often hear a single click from the hard drive quickly moving the head to a safe position.


What is the origin of cattywampus

Question: Idiom.
The trucks were parked cattywampus in the lot. Other spelling, catawampus.
Comment: Probably related to "kitty-cornered", et al.
Comment: The etymology is a mess and intertwined with the folklore of Native Americans, the early Scots and Welsh Appalachian settlers, and particularly, the early river people of the Carolina lowlands and the upper Tennessee River. https://en.wikipedia.org/wiki/Wampus_cat. Catawampus doesn't just mean something is sitting askew. It means it got knocked that way having suffered some violence and indignity.
Comment: Welcome to EL&U. Please note that it is a general expectation of the site that you indicate your initial research— what do dictionaries show? What have you found on the web? I strongly encourage you to take the site [tour] and review the [help] for additional guidance.
Comment: Many thanks for the generous comments you all made. I am not able to make this Comments system work well because I'm new to the site, but I wanted you to know I'm grateful for your help. In my next comment I'll put the excerpt from my book so you can see how I used "cattywampus."
Comment: Excerpt  from Rebel Love Song, releasing Dec. 15 on Amazon U.S:    "It was getting toward the balmy late afternoon of the birthday party, guests standing in groups in the ranch yard, preparing to walk to town or ride home. A few were jawing and eating dessert. Some of the hard-working miners had heaped their plates with pie, cake, fudge, pulled candy, and cookies and were finishing off the sweets. Children shrieked and played tag, while the horses grazed on spring grass in a fenced meadow and wagons stood cattywampus near the barn. Two boys about fourteen  sat on the meadow fence....
Answer: 'Catawampus' in early dictionaries
The first dictionary coverage of a catawampus-like word is actually a phrase. From John Bartlett, Dictionary of Americanisms, first edition (1848), page 66:

CATAWAMPTIOUSLY CHAWED UP. Completely demolished, utterly defeated. One of the ludicrous monstrosities in which the vulgar language of the Southern and Western States abounds. [Example:] In this debate Mr. B. was 'catawamptiously chawed up;' in his arguments were not only met, but his sarcasm returned upon himself with great effect. —Charleston [South Carolina] Mercury

The second edition of Bartlett (1859) at page 71 essentially repeats the first editions definitions for "Catawampously or Catawamptiously," but includes two additional examples, including this one from an 1857 speech by Frederick Douglass:

There is something cowardly in the idea of disunion. Where is the wealth and power that should make us fourteen millions take to our heels  before three hundred thousand slaveholders, for fear of being catawamptiously chawed up?

And as late as the fourth edition of Bartlett (1877), at page 105, there is still no hint of the "diagonal" meaning in the entry for the term.
Maximilian Schele de Vere, Americanisms: The English of the New World (1872) offers this discussion on page 590:

Catawampous, or catawamptious, a word enlarged in the West from catamount. This animal had already furnished the hunter with the expression, "he dropped on him like a catamount on a coon," and hence, no doubt, the further development of the word. "He was catawamptiously chawed up," was said of  a political character, who had been fiercely attacked by a host of adversaries in the Legislature of Missouri; and even orators of greater pretension, addressing a body of national representatives have not disdained to use the phrase. To chaw up, for demolish, is also used without such energetic qualification, and occasionally applied to one's own words, for the common term to eat.

Bartlett (1848) reports that "Although this animal [the catamount] is peculiar to North America, a similar name, that of catamountain, for the wild cat, is common in the old authors, from which we probably borrowed it. The catamount of North America is a larger and very different animal from the wild cat of Europe." Merriam-Webster's Eleventh Collegiate Dictionary (2003) says catamount may refer to a cougar (aka mountain lion, puma, or panther), a lynx, or some other wild cat.
John Farmer, Americanisms—Old & New (1889), page 128, has this:

CATAWAMPTIOUSLY. — With avidity; fierce eagerness. A negro derivative from CARAMOUNT, and founded on the ferocity exhibited by animals of that species in attacking their prey.  In the South-west the simile "like a catamount attacking a coon" is part of the popular speech, and from this is obtained TO BE CA[T]AWAMPTIOUSLY CHAWED UP, an idiom signifying complete annihilation.

Charles Dickens, in one of the chapters of Martin Chuzzlewit (1843–1844) set in the United States has young Martin's servant Mark Tapley report the following conversation with a rustic local:

'Am I rightly informed,' he says; not exactly though his nose, but as if he'd got a stoppage in it, very high up: 'that you're a-going to the Walley of Eden?' 'I heard some talk on it,' I told him. 'Oh!' says he, 'if you should ever happen to go to bed there—you may you know,' he says, 'in course of time as civilization progresses—don't forget to take a axe with you.' I looks at him tolerable hard. 'Fleas?' says I. 'And more,' says he. 'Wampires?' says I. 'And more,' says he. 'Musquitoes, perhaps,' says I. 'And more,' says he. 'What more?' says I. "Snakes more,' says he; 'rattlesnakes. You're right to a certain extent stranger. There air  some catawampous chawers in the small way too, as graze upon a human pretty strong; but don't mind them, they're company. It's snakes,' he says, 'as you'll object to: and whenever you wake and see one in a upright poster on your bed,' he says, 'like a corkscrew with the handle off a-sittin' on s bottom ring, cut him down, for he means wenom.'

Subsequently the word seems to have broadened in meaning and spelling. From Robert Hendrickson, The Facts on File Dictionary of American Regionalisms (2000):

catawampus (1) Cater-cornered. "He walked catawampus across the street." Also heard as CATTYWAMPUS. (2) A hobgoblin or fierce imaginary monster; also called wampus.
...
cattywampus (1) Catawampus, askew, awry, positioned diagonally, cater-cornered, oblique. (2) Very big, a monster of its kind. "'I'll bet we kin ketch us a cattywampus in one o' them ponds.' {Jody said}." (Marjorie Kinnan Rawlings, The Yearling, 1938)

Early occurrences of 'catawampus' and its variants in the wild
The earliest instance of the spelling catawampus in Elephind search results is from "A Few Days in the Diggings" (an article about the California Gold Rush) in the [Springfield] Illinois Daily Journal (February 24, 1849):

Toted my tools to Hiram K. Doughboys boarding shanty and settled with him for blankets and board , at thirty dollars per diem. Catawampus prices here, that's a fact; but every body's got more dust than he knows what to do with.

The earliest Elephind match for the spelling catawampous is from the Anti-slavery Bugle (September 30, 1854):

...I lick them cussed Britishers, I hope, Into a 'tarnal and Immortal smash, Whittle down all their greatness to a pint, Scuttle their island, 'nihilate John Bull, And of his catawampous carcase leave no more than an invisible grease-spot.

And the earliest Elephind match for catawamptiously is from "McArone's War Correspondence" (dated December 21, 1864), in the Sacramento [California] Daily Union (February 15, 1865):

You see, there are not so many fighting-men down yonder as there used to be. They had but two armies — Lee's and Hood's — and couldn't very well afford to lose one of them.
Having lost one — poor Hood's force is pretty catawamptiously chawed up — I rather think that the Confederacy had better lay its bundle right down and hang its fiddle right up.

The "oblique" sense of catawampus may appear as early as "Ye Merrie Klan of Comus! The King of Gaiety and His Pageant," in the Houston [Texas] Daily Mercury (December 19, 1873):

He [Triton] was followed by one "of those pert little "smart Alecks," who wear jockey-caps and look catawampus out of their eyes. He frisked his caudality around in a lively manner, and seemed as self-sufficient as if he had played "hookey" from school in entire week without having been detected.

But the meaning of catawampus here isn't entirely clear—it may mean "dangerously or insolently," rather than "obliquely." Nevertheless J.E. Lighter, Random House Historical Dictionary of American Slang (1993) firmly establishes that both the "ferocious" meaning and the "diagonal" meaning were in existence by 1851:

catawampus adj. {orig. unkn.} Midland. 1. ferocious or impressive [Citations to Martin Chuzzlewit (1843) and to Davy Crockett's Almanac (1847) omitted.] 2. out of shape;diagonal, crooked, or askew. Also adv. [First cited example:] 1851 Spirit of Times (Nov. 8) 453: They sed that he and his wife and children had their faces so wrinkled up an turned catter-wompus like, that the skeeters couldn't lite on um long enuf to bite.

Lighter also notes a very early instance of catawampus as a noun:

catawampus n. a peculiar or remarkable thing or person. Often joc[ular]. [First cited example:] 1833 Paulding Lion of the West 21: On my way I took a squint at my wild lands along by the Big Muddy and Little Muddy to Bear Grass Creek, and had what I call a rael {sic}, roundabout catawampus, clean through the deestrict.

Lighter also notes instances of catarumpus as a noun from 1848, of the adverb catawampously from 1834 (cited in the Dictionary of American Regional English: "The gineral was catawampously inclin'd tu the United States' service"), and of the verb catawampus from 1839 (cited Mitford Mathews, Dictionary of Americanisms on Historical Principles [1951]: "a catawampussed fix"). The longer version of the March 8, 1839, quotation cited from Mathews is from the New Orleans Picayune and uses catawampussed as an adjective meaning "Confounded, 'bodaciously used up'":

Things have been a goin' on in a catawompussed fix for a long time, nary party ownin' land yet both makin' jest as free as though they had it reg'larly deeded over to 'em.

Mathews also cites an early use of catawampus used as an interjection:

1938 Matschat Suwannee River 19 At her refusal, he drank deeply. 'Catawampus! Kin lick my weight in in wildcats after that.'

The other interesting thing about Mathews's treatment of the word is that it identifies the noun as meaning "A bogy, sprite, hobgoblin. Used jocularly of a person" as early as 1844 (Carlton, New Purchase: "The tother one what got most sker'd, is a sort of catawampus.")

Conclusions
The word catawampus in various spellings and syntactical guises has been in use in the United Sates since at least 1833, when James Paulding used the expression in his play about David Crockett, The Lion of the West. It appears as part of a letter from Colonel Nimrod Wildfire [Crockett] of Kentucky to his uncle, Peter Freeman:

FREEMAN. ...(Reads.) "Uncle Peter—Washington, July 1st. The very day I got your coaxing letter I packed up my shirts and some other plunder and set right off a horse-back under high steam. On my way I took a squint at my wild lands along by the Big Muddy and Little Muddy to Bear Grass Creek, and had what I call a rael, roundabout catawampus, clean through the deestrict. If I hadn't I wish I may be te-to-taciously ex-flunctified."
MRS. FREEMAN. There, Mr. Freeman, what do you term that?
FREEMAN. The veritable Kentucky vocabulary

As this excerpt suggests, some of the earliest people to record the expression did not natively used it themselves, but picked it up to convey local (or distant) color. Under the circumstances it would not be shocking if these writers misunderstood and misused the expression in their own writing.
Most early uses of the expression emphasize a sense of wildness and ferocity, and this in turn helps explain why early dictionaries connected the word with catamounts—large North American wildcats. That early association lives on in the name Wampus Cats, which high schools in Conway, Arkansas; Leesville, Louisiana; Itasca, Texas; Atoka, Oklahoma; and Clark Fork, Idaho all claim for their sports teams. Four of these five high schools are located in the south-central United States.
Harold Wentworth, American Dialect Dictionary (1944) notes that in certain regions of the United States, catawampus could be (1) an exclamation (along the lines of "thunderation!" or "hoky smokes!"), (2) "an imaginary fierce animal," or (3) "cattycorner." The same dictionary states that in west Texas in 1915 "catawampus cat" was a dialectal term for "a virago."
The true origin of cattywampus may be lost (if it was ever known), but any serious attempt to account for the name should, I think, take seriously the strong tendency of dictionaries during the 1800s to link the term to catamounts—and to the survival of wampus cats even today.
As for why catawampus became associated with cattycorner in the sense of "diagonal," it bears noticing that numerous regional variations on catty-corner existed during the first half of the twentieth century, including cattycornered, kittycorner, kitty-cattycornered, catawampous, caterwampust, caterin', catabiassed, cat-a-cornered,catercornered, catter-cornered, catterwampusin, catty-stranglin', cat-a-goggling, and cattywampus. Under the circumstances, the surprise isn't that cattywampus was one of the many terms used in various parts of the country, but that caterwauling (for example) managed to escape.
Comment: The way that catawampus and wampus cat, which were entirely fictitious bogies, became associated with the catamount is a mystery. The obvious explanation is that it happened in the NC or TN (the Eastern Catamount was still around at the time), and western migration did the trick. I have my doubts. Too much changed. One theory is that the Carolina Lowcountry legend made it down to the Panama Canal Zone, where it combined with local legends involving very real, very dangerous wildcats. This mash-up, which now involved real cats, was spread to the rest of the states by the returning workers.
Comment: @PhilSweet: Interesting comment. I'd love to read a more detailed account of the geographical migration of the word and evolution of its meaning along the lines you describe. Bartlett in 1848 seem to think that _catawampus_ illustrates a western  U.S. tendency to invent to multisyllable nonsense words (like the later _hornswoggle_, _skullduggery_, _shenanigan_, and _slang-whanger_). The _catamount_ connection emerges in DeVere 24 years later, but his confidence doesn't so much establish the validity of the connection as encourage his contemporaries to share that confidence, justified or not.
Comment: I fear that if this ever got put down properly, it would read like *The Golden Bough*
Answer: According to etymonline.com

also catawampous, cattywampus, catiwampus, etc. (see "Dictionary of American Slang" for more), American colloquial. First element perhaps from obsolete cater "to set or move diagonally" (see catty-cornered); second element perhaps related to Scottish wampish "to wriggle, twist, or swerve about." Or perhaps simply the sort of jocular pseudo-classical formation popular in the slang of those times, with the first element suggesting Greek kata-.
Earliest use seems to be in adverbial form, catawampusly (1834), expressing no certain meaning but adding intensity to the action: "utterly, completely; with avidity, fiercely, eagerly." It appears as a noun from 1843, as a name for an imaginary hobgoblin or fright, perhaps from influence of catamount. The adjective is attested from the 1840s as an intensive, but this is only in British lampoons of American speech and might not be authentic. It was used in the U.S. by 1864 in a sense of "askew, awry, wrong" and by 1873 (noted as a peculiarity of North Carolina speech) as "in a diagonal position, on a bias, crooked."
Answer: From Wiktionary:

The crooked sense may at least partly derive from the same source as the "cater" in cater-corner, which some would derive from Middle French catre ("four")- in reference to four corners/square- from Old French quatre ("four"), from Latin quattuor. This is disputed by others, who suggest a possible Old Norse or other Scandinavian origin. See cater-corner and cater-corner for more.

cater-corner:

cater- + corner, where cater- is of disputed origin. Liberman argues that this is a prefix meaning "crooked, angled, clumsy", of North Germanic origin; compare cater-cousin.[1] The verb cater ("move diagonally, place diagonally, cut diagonally") is attested from 1577 (Liberman proposes this as a backformation from cater-), and in 19th century Lancashire dialect, cater-cornered refers both to stone blocks that are out of square, and people who walk twisted (with one side in front of the other), especially if partially paralyzed.[1] Further awkward and clumsy are of Scandinavian origin, and Old Irish cittach ("left-handed, awkward") is cognate to cater- words, also suggesting a Scandinavian origin.
A commonly proposed etymology (proposed in the 19th century) derives cater, from French quatre ("four") (hence "four corner" – at the opposite corner of a square), and similarly cater-cousin from "fourth cousin", while Liberman rejects this as implausible – similar terms from French are simply calqued as "four corners" (as in "four corners of the world", from French "les quatre coins du monde"), the English term cater ("four") (from French) was primarily used in dice, the domestication of a specialized foreign term as an adverb for "across" seems implausible, there are many Germanic terms that appear to be cognates, and other terms with cater- are found in English dialects.[1]
caterpillar and caterwaul are unrelated (derived from cognates to cat), but may have influenced the pronunciation of earlier *cate- (later cater-), or undergone similar sound changes.[1]
Comment: Thank you so very much for all the kind replies. I thought I would show you how I used "cattywampus" in my current novel, Rebel Love Song, to be released in the U.S. on Kindle on Dec. 15:

What is the origin of cattywampus


Testing malware or bad url's from a SIEM

Question: What would be a good approach for testing malware or bad URL's from things picked up from my SIEM to validate them? I was told to set up a VM for these tests but don't want it to hit the internal network.
Answer: If you have no skills in malware analysis and reverse engineering, you should try Free Automated Malware Analysis Sandboxes and Services first and install a hardened Cuckoo Sandbox in a VPS to get a detailed dynamic analysis.
To do malware analysis and reverse engineering in a VM safely and effectively, you need to learn a lot from books, videos, articles and tutorials. Browsing the website Tuts 4 You would give you lots of useful reading materials.
Practical Malware Analysis: The Hands-On Guide to Dissecting Malicious Software [Michael Sikorski, Andrew Honig] is classic book for you to start the malware analysis journey.
Reverse Engineering for Beginners is a good frequently updated book to learn reverse engineering.
Open Security Training provides high quality free courses on reverse engineering & malware analysis topics.
Hasherezade has more tips for you on her blog:
https://hshrzd.wordpress.com/how-to-start/
Answer: Sandboxes are "a virtual space in which new or untested software or coding can be run securely". Cuckoo Sandbox is a great example of this technology being used to triage malicious files.
As far as a "good approach" - this would depend on your SIEM, and how you are looking to implement it. Are you looking to automatically detonate files which you receive over e-mail? All files downloaded? Depending on the scale of the effort, it would be worth looking at some of the commercial solutions.
Answer: VirusTotal.com can be helpful to verify badness, plus, they have a free API for low volume automation.
If you use a VM then be sure to isolate it per the vendor instructions. If transferring bad binaries to the VM with a thumb drive or CD then I prefer to mismatch my host and VM OS, so there is no way the host OS could even run the malware in question. VMs are nice because they can enforce isolation and segmentation.
Manual malware analysis can be extremely effective with the right tools and training. I highly recommend SANs FOR508 training which uses the free SIFT workstation. "The SIFT workstation is a group of incident response and forensic tools designed to perform detailed digital forensic examinations in a variety of settings. It can match any current incident response and forensic tool suite."
If you're trying to put together tools yourself, you'll need to know what forensic things you need to do, then find the tools to do it. If you're going to build a house, you'll need to know what tools can do what, and if/when you need them. Personally, I'm totally happy to have different VMs with different toolkits built by really smart people. Then I can just "strap on" whatever I need that day and go to work. If I need a new tool, I find or build it, then I add it to my growing toolkits. You can always add more to it, so why start with less?
Some tools/distros:

Training. No substitute for knowing normal.
VirtualBox SIFT install instructions
SIFT docs, manual, and list of tools
REMnux Distro: A Linux Toolkit for Reverse-Engineering and Analyzing Malware
How to Install SIFT Workstation and REMnux on the Same Forensics System
FLARE VM by FireEye Windows malware analysis distro
Volatility
plaso
So many more... to many to list...

A little Google fu in this direction should get you closer... Though it sounds like you will have more specific questions as you refine your needs. Feel free to comment to start a conversation as you do.
Comment: What if i want to build one from scratch? What is a good distro and tools?
Comment: Frankly, I don't really see why you'd want to build your own toolkit from scratch, especially if you don't know what you need. Far better to stand on the solders of others who know what should be in a toolkit. I use the SIFT workstation (especially volatility tools), Sysinternals Suite, REMux distro. Could also look into FLARE by FireEye. None of these tools will compensate for knowing what to look for, and how things should behave "under the hood." updating my answer to include some more things
Comment: I recommend different strategies in my answer, but if you do want to build malware analysis tools and develop on them, check out -- https://github.com/cryps1s/DARKSURGEON
Answer: Always dump the full-system memory before processing malware. If you can't, then, worse, you'll have to use Scylla via x64dbg toolchains in order to do a full program analysis of the PE/ELF/Mach-O malware, or perhaps ViperMonkey if it's VBA code. There's a lot of types of code, so this may get even worse from here. The problem is that if you don't dump, you're going to have to unpack which means reading and practicing all of the techniques laid out in the books Practical Malware Analysis, as well as the newer Packt Pub books, Learning Malware Analysis, and, Mastering Reverse Engineering. Sometimes these techniques are useful for uncovering other issues such as identifying environmentally-keyed payloads or context-aware malware, even if the malware doesn't do sandbox evasion. I suggest running all of this on bare metal that is blown away and recreated by CloneZilla or FogProject after each project. Running a significantly out-of date AV program with running web browsers and attached to a Windows Domain (not your actual production domain but a mocked-up one) might be overkill, but it doesn't hurt. Don't log in as John Smith either. Malware knows you're up to something.
If the dumped/unpacked malware can't be matched by Malpedia Yara rules, or by writing and organizing your own Yara rules (especially iterations of the Malpedia rules) with YaraGuardian, then you will probably need to go back to those x64dbg/Scylla and/or ViperMonkey methods. Running Yara first often informs a malware analyst about how to proceed next. For a pipeline, check out cse-assemblyline.
For bad URLs, connect to them through an Algo VPN hosted on some virtualized providers that can't be connected to you or your org, and be sure to try different providers, User Agents, et al -- and match it up with what was logged in your SIEM data to ensure that the webapp response isn't a relay or lying to you. This may require mocking up a realistic browser scenario, testing timing conditions, and other timing or order-of operations problems. If the app response is code, analyze the code (going back to the principles above). You may also want to analyze the surrounding infrastructure. Often this is true more for C2 then for doors (i.e., malicious URIs), but Maltrail supplies a lot of interesting starting and connecting dots for your puzzle-solving initiatives.
I do not recommending using VirusTotal (or anything where you submit something to some unknown online web service or similar), or running malware in a VM or Sandbox -- especially not an appliance. It's best to store all of the malware you receive and tag them appropriately, preferably in both Viper and MISP.
If malicious logic actually did execute or install in any of your production (including and especially laptops, servers, desktops, IoT devices, etc) environments, then you may want to add DFIR capabilities, such as SkadiVM, Splunk TA-Volatility, or Volexity. It's good to know everything that happened, especially if the malicious logic included an implant-level component, such as Remote Access Trojans (RATs) do.
Then, if you're really good, you'll be sharing malware intelligence via MISP with other groups that do so.
Comment: https://www.unpac.me
Comment: https://brightcloud.com/tools/url-ip-lookup.php


How can I pause a render in progress and then resume it at a later time?

Question: I would like to pause a render that I have started, with the intention of resuming it at a later time (but during the same Blender session).  How can I do this?
Comment: Animations can be paused just by clicking the X on the render, then setting the start frame to the last completed frame. CharlesL wrote an answer that covers this.
Comment: Are you talking about an animation, or a single picture?
Comment: @KyleWilley, mostly a single picture, although if I could get a method for an animation as well that would be nice.
Answer: On Mac OS it is not necessary to have started Blender from the command line.  You may use the "kill" command to send a stop and continue signal...
$ ps -ax | grep Blender
3554 ??       750:42.18 /.../.../Contents/MacOS/Blender
$ kill -s SIGSTOP 3554
$ kill -s SIGCONT 3554

There is a way to 'pause' Blender (or any software for that matter), but it relies on the operating system rather than Blender itself.
Mac OS X and Linux:

You must start Blender from the command line or terminal.
At any time, you can completely suspend Blender by pressing Ctrl+Z from the terminal window.
The terminal should say something like:
^Z
[1]+  Stopped                 /Applications/blender.app/Contents/MacOS/blender

You cannot interact with it until you you type fg in the terminal. Which will bring Blender back to the foreground.

Windows:

Have the console window open (Window > Toggle System Console)
Use the cursor to highlight any of the text in this window will freeze the console and pause Blender. This is a super hacky way to actually pause Blender, but it works in a pinch. See https://stackoverflow.com/questions/30418886/how-and-why-does-quickedit-mode-in-command-prompt-freeze-applications for detailed explanation of why this happens.
Comment: Ah, if we go the OS way, then you can get the Process Explorer from http://technet.microsoft.com/en-us/sysinternals and suspend your Blender process using that.
Comment: There's no need to start Blender from the terminal. You can simply send the signals to the process. `kill -s SIGSTOP $(pidof blender)` to stop it and use `-s SIGCONT` to resume it. On KDE you can do this using the system activities(`Ctrl+Esc`).
Comment: Great tip! I always used this to simply kill the application, can't believe this was there all along.
Comment: Linux option works like a charm. Windows version does not work anymore.
Comment: This does work.  Just tried it with v2.91.  It doesn't pause immediately.  But it will pause at the end of the currently rendered frame.
Answer: Blender Internal and Cycles lack such functionality (but we'd love to have that for Renderfarm.fi)
Comment: Yes, theoretically. But the functionality itself doesn't exist (as in pause and resume buttons, without further need for user interaction).
Comment: This could be implemented, hypothetically, by saving the data of the scene, then continuing with samples. AFAIK this could happen easily *between* samples by saving the image and the random seed parameters the raytracer uses.
Comment: @jesterKing, just a small note, avoid excessive self-promotion (not coming down on you, and I appreciate your work, but on SE self-promotion can be frowned upon).
Comment: I'm not tech guy but if is used tile rendering there could be chance to resuming rendering from last finished tile theroretically
Comment: Doesn't Renderfarm.fi render at lower sample counts with various seeds? If so, could you stop after rendering the current seed, and then resume later? You would still have to wait for that seed to finish.
Answer: Pausing from the Operating System:
Linux
If you are on Linux
you can send signals with these commands:
# To pause Blender:
killall -s STOP blender

# To start it again:
killall -s CONT blender

Some advantages to this are that it will work
for any task, not just rendering, and that you
do not have to start blender from a terminal.
For Mac, omit -s and use Blender, not blender.
Windows
You can use process explorer for this. See this question on StackOverflow.
Pausing from Blender:
Pausing F12 renders from Blender is not implemented yet,
however it is on the Cycles Todo List.
Comment: On Windows, you can use built-in functionality instead, with Resource Monitor > `RMB` menu > Suspend Process ([from the same SO thread](http://stackoverflow.com/a/21649539/2182077)).
Comment: On mac, you can use `killall -STOP blender` and `killall -CONT blender`
Comment: I tested this on OS X and it seems that -s does something else, like simulates what would be done or something (see man killall). And omitting -s just causes Blender to be killed. I did have success with the method Mike Pan suggested though.
Comment: On Linux (Ubuntu) you can also stop and resume a process:
Comment: On Linux (Ubuntu) you can also stop and resume a process using System Monitor: Tap Super (windows) key once, and type "process" or "system", and choose the "System Monitor" icon. Then in the "Processes" tab right-click the blender entry and choose "Stop". When you want it to resume do the same thing, but choose "Continue". The command line is easier of course... but only if you can remember what to type. :) Sorry for double post. Can't edit a comment after 5 mins? What rubbish is that? ;P
Answer: Mixing Smaller Renders
For a still image, a possible solution is to render
less samples multiple times with the seed changed each time, and mix
the images according to the samples. For example:
You have a scene which you would like to render at 3000 samples.

First night you render 1000 samples with seed 0.
Second night you render 1000 samples with seed 1.
Third night you render 500 samples with seed 2.
Fourth night you render 500 samples with seed 3.

The you take an image editor and put these images as layers:

First render: alpha 0.33
Second render: alpha 0.5
Third render: alpha 0.5
Fourth render: alpha 1.0

Each layer's alpha is: current samples /
(all layers samples below + current samples)
5 samples:

15 samples:

Mixed image:

Added Note
As mentioned in the comments: The resulted image may have a slight light-loss compared to the full sampled image, however will also have less noise. You get (almost, very near, way below significance) the same result as using Clamp Direct and Clamp Indirect with the number of samples of the individual renders. So this light-loss will be the same as if you were to set Clamping to 100 for example, which is usually very small. When the Clamp values are already set and lower than the samples, then no additional light-loss should occur.
We discussed this topic in the comment section of some old blog posts, it might be worth reading them:
https://sinmantyx.wordpress.com/2015/02/21/grave-of-the-blender-fireflies/
https://sinmantyx.wordpress.com/2015/03/18/perfect-clamp-1/
https://sinmantyx.wordpress.com/2015/03/18/perfect-clamp-2/
Comment: Short answere: Only an approximation. Longer one: You get (almost, very near, way below significance) the same result as using "clamp direct" and "clamp idirect" with the number of samples of the individual renders (if these values are already set and lower, then no difference). So the light loss will be the same as if you would set claming to 100 for example.
Comment: Does this give you exactly the same result as if you had used higher samples in the first place or just an approximation?
Comment: If you are more interested, look at the end of my edit.
Answer: For one frame you could try to use border select then render. You could render parts of your image you need and mix the layers later in GIMP. I use it whenever I add details to a model and don't want to render the whole scene again.
Comment: You certainly can break up a render into parts this way (on Renderfarm.fi we use this to split workload between nodes), but it is quite a labour intensive way to do things if you don't have a good automation behind it (Renderfarm.fi has a Tomcat7 servlet running doing all this delegation and stitching).

You can add that for Cycles you could render in batches of ie. 10 or 50 samples, and then average the results all into one (which I implemented on Renderfarm.fi as well ;) Just take care that each batch is rendered with a different seeds
Comment: A python script to do stuff like this would be awesome. (I think i'm going to try and learn python now) but to able to define different numbers of samples for different parts of the render... :D
Answer: You can pause viewport rendering in Cycles (but not 'Render' menu rendering) by pressing the pause button in the bottom right-hand corner of the 3D view.
Answer: If you're rendering an animation, render out the frames individually as PNGs first. If do so, you can stop rendering a frame and come back to render the rest later without any corruption. Once you want the animation as a video file, load the PNGs as an image strip in Blender's video editor and render the video out(it will be really fast because it's just sticking the images together).
Comment: It'll be compressed using whichever format you decide to use.
Comment: Will this just stick the PNGs together into a movie without doing any compression, or will it compress them using the methods of whatever format you are using (Theora, MPEG, etc)?
Answer: For animations that output to a sequence of individual image files an important checkbox is the Overwrite checkbox in the Output subtab of the Render tab of the Properties window.  It defaults to checked.  If you uncheck that box you can interrupt a render, shut down your laptop, turn it back on, and click the render animation button and it will not overwrite the frames that have already been stored to the directory, instead starting calculations at the first missing frame.
A drawback is that if you change the scene and want to discard the rendered frames containing stale data, you have to delete them from the directory some other way (using windows explorer, or linux rm)
Another drawback is that blender's default output directory is /tmp, which some flavors of linux wipe clean every time you reboot the computer.  I use /var/tmp/blender/projectname/ instead.
Comment: you can also manually set the start frame to the frame after the last one which was rendered in the previous session when you resume the render, then you don't need to uncheck the overwrite button
Answer: there is a very fast and easier way , Just set the start frame, then the end frame , and when you want to pause it , just change the end frame to the one currently rendering and then set the start frame to the last frame you render , and repeat.
Comment: No real need to do this when rendering image sequences. To keep the frames you already rendered you just need to uncheck the "Overwrite" box on the output section. All existing rendered files will be kept and rendering will start on the first unrendered frame.
Answer: I have been working on a solution, it's a workaround that uses Windows suspend thread function in c++ to pause/unpause blender, but it also minimizes blender in the taskbar in a tray icon, because windows will throw out "Blender has stopped working" if you suspend it and the window still maxmized, it supports Windows 64bit and blender 2.79 https://gum.co/bpupp , support for other platforms coming soon
Answer: Here is how I learned how to do it. In the properties go to  render tab, scroll down to output; in the file format,(default is ffmpegvideo) select png. After selecting png, create new folder, name it and select accept at the top right. Now render the image or animation.
  Now to the pause. If you open the new folder on your computer you can see each image being rendered one at a time.
  If for example you have an animation 240 frames and around the twenty fourth frame you want to stop or pause. Just let the twenty fourth frame finish rendering and click the escape tab on the keyboard twice.  All rendering has stopped.
  You can now close blender, and continue render later.
When you are ready to continue rendering, open the folder animation is saved in, you should be able to see the last frame that was rendered.
So if the last frame rendered was twenty four, go the the timeline in blender and set start frame to twenty five, and then render.
 It should continue rendering from frame twenty five. Here is a tutorial that helped me.  https://www.youtube.com/watch?v=GviUB3irccI


What makes a 5/8 wavelength vertical desirable?

Question: An ordinary 1/4 wavelength vertical is smaller and resonant without any loading coil or matching network. What's the advantage to a 5/8 wavelength vertical? Why 5/8 in particular, and not something longer or shorter?
Answer: Indeed, why?  A 5/8λ isn't resonant where a 1/4λ or 1/2λ would be.
The reason is the radiation pattern.  The pattern for a 1/4λ monopole is essentially a doughnut, tasty and a pretty good pattern especially for a VHF antenna. Extending the antenna changes the current distribution.  This flattens out the pattern removing power from the useless (for VHF purposes) vertical dimension and giving more horizontal gain and at a lower angle.  See the following illustration from the late great L. Cebik:

Depending on the source, they will quote anywhere from 1.2dB to 3.5dB gain over the 1/2λ design.  There has also been some discussion that in some areas (urban and mountainous terrain) the lower angle of radiation is a detriment and a standard 1/4λ or 1/2λ antenna is to be favored.  I don't know. I guess they are pretty cheap, if this is a concern you can buy one mount and two and antenna, compare them for a bit and return the loser.
So, why 5/8λ?  Why not long longer? After all more gain is better right?  Well, inspecting the figure above you will notice the appearance of high angle lobes.  As you lengthen the antenna past 5/8λ these lobes become more pronounced and break up the pattern in undesirable ways. Making it shorter maintains a good pattern, but the gain is less.  So, 5/8λ is about optimal for this style of antenna.
Comment: Cebik's graph above is part of his introduction in an article titled "The 5/8-Wavelength Mystique" highlighting the misleading ideal 5/8 wave pattern.  He goes on to debunk the 5/8 advantage claims in his four page article.
Comment: "(in urban and mountain) the lower angle of radiation is a detriment and a standard 1/4λ or 1/2λ antenna is to be favored."   The courage classic bike race event that is in the rigid mountains favors 5/8 and they work much better then quarter as for 25 years of ham experience in the race.
Answer: A 5/8 wave provides a style of vertical radiation pattern which doesn't offer energy in some of the mid- upper angles but compresses that 1/4 wave donut like stepping on it, to being flatter but WIDER.
If you're attempting to contact a station 10 miles past the donut of energy created by the 1/4 wave, then you won't be heard, if you then switch to a 5/8 wave you will concentrate the transmitted power into a flatter-lower angle and wider donut pattern of energy and now you might be heard where you weren't making it before when using the 1/4 wave.
The downside is the lack of midrange energy at the medium upper angles and is where a 1/4 wave might be the better choice when attempting to transmit over a range of nearby hills which could block and deflect the low angle energy of a 5/8 but the upper angle energy of a 1/4 wave might propagate successfully over that range of hills or obstructions.


What's the difference between stabilizing selection and balancing selection?

Question: I came across these terms in Darwin's "Origin of Species" and I wasn't sure what the difference is.
Answer: Usual meaning
Usually, Stabilizing selection is a concept that applies to a phenotypic trait while balancing selection is a concept that applies to a given locus.
Balancing selection can either be due to negative-frequency dependence selection or due to overdominance (=heterozygous advantage at a single locus).
What Darwin may have meant
Because Darwin didn't know about genes, he was necessarily not using the term balancing selection as I am using it. I can think of several more or less related pattern of selection that might fall withing the definitions for "stabilizing selection" and/or "balancing selection". Maybe he meant "frequency-dependent selection", "positive selection for an intermediate trait", "varying selection through time (temporally heterogenous environment)" and "varying selection through space (spatially heterogenous environment)". Eventually again, that might mean "positively correlated traits that undergo opposite selection pressure (or the opposite)" but that would definitely be surprising.
Comment: I think the key distinction here is that stabilizing selection promotes a monomorphic population whereas balancing selection preserves polymorphism.