Why / how does this C code compile? and What does it do?
How does Duff's device work?
Auto generate an Index Is there any way to auto-gererate an index for the makeidx package? I've written ~270 pages and didn't think of adding \index{} everywhere.  Do I really need to go over everything and add \index{}? Ok. So I read books as a kid, this may have been mid to late 1980s. Definitely before 1993. These details I remember, they might be from the same book or from several:   Slower than light space travel with severe time dilation. There were boardings of space ships, but the fighting odds could be very uneven because a foe could be from your future or your past, depending on when you started your space journey, because of relativistic time dilation. No faster than light travel, no time travel either. Just regular physics. To fight better in melee, soldiers would have (more or less willingly, I think they knew beforehand) false memories or notions implanted of the enemy as horrible human beings so soldiers could kill them more easily without remorse. Towards the end of the story, veterans of the war are described as not quite feeling at home after the war. One planet (home?) or country is described as inhabited entirely of clones, Adams and Eves, I think homosexual, or that sexuality could be switched deliberately. I think the veterans find at the end a refuge somewhere more like the home they are used to. The reason so much has changed is of course the time dilation. They spent maybe decades in the war, while on the planets centuries or millenia passed. I think one moral (there may be many more I missed as a child) of the story was the futility of war. If I recall correctly, the war was resolved in a way that made the efforts of the veterans seem for nothing. How can I maximize the "blurry background, sharp subject" (bokeh) effect? Covering ten dots on a table with ten equal-sized coins: explanation of proof Note: . I have moved it here because:   I am curious about the answer The OP has not shown any interest in moving it himself     In the Communications of the ACM, , Peter Winkler asked the following question:     On the table before us are 10 dots,   and in our pocket are 10 $1 coins.   Prove the coins can be placed on the   table (no two overlapping) in such a   way that all dots are covered. Figure   2 shows a valid placement of the coins   for this particular set of dots; they   are transparent so we can see them.   The three coins at the bottom are not   needed.   In the , he presented his proof:     We had to show that any 10 dots on a   table can be covered by   non-overlapping &#36;1 coins, in a problem   devised by Naoki Inaba and sent to me   by his friend, Hirokazu Iwasawa, both   puzzle mavens in Japan.      The key is to note that packing disks   arranged in a honeycomb pattern cover   more than 90% of the plane. But how do   we know they do? A disk of radius one   fits inside a regular hexagon made up   of six equilateral triangles of   altitude one. Since each such triangle   has area $\frac{\sqrt{3}}{3}$, the hexagon   itself has area $2 \sqrt{3}$; since the   hexagons tile the plane in a honeycomb   pattern, the disks, each with area $\pi$,   cover $\frac{\pi}{2\sqrt{3}}\approx .9069$ of the   plane's surface.      It follows that if the disks are   placed randomly on the plane, the   probability that any particular point   is covered is .9069. Therefore, if we   randomly place lots of &#36;1 coins   (borrowed) on the table in a hexagonal   pattern, on average, 9.069 of our 10   points will be covered, meaning at   least some of the time all 10 will be   covered. (We need at most only 10   coins so give back the rest.)      What does it mean that the disks cover   90.69% of the infinite plane? The easiest way to answer is to say,   perhaps, that the percentage of any   large square covered by the disks   approaches this value as the square   expands. What is "random" about the   placement of the disks? One way to   think it through is to fix any packing   and any disk within it, then pick a   point uniformly at random from the   honeycomb hexagon containing the disk   and move the disk so its center is at   the chosen point.   I don't understand. Doesn't the probabilistic nature of this proof simply mean that in the majority of configurations, all 10 dots can be covered. Can't we still come up with a configuration involving 10 (or less) dots where one of the dots can't be covered? Paging Lucene's search results I am using Lucene to show search results in a web application.I am also custom paging for showing the same. Search results could vary from 5000 to 10000 or more. Can someone please tell me the best strategy for paging and caching the search results? How do I determine whether a drive is an HDD or SSD in Windows 8? Finding CPU usage of a service Because my laptop fan was spinning up for no reason, I had a look at the CPU usage and I see  svchost with 12.5% CPU, which is basically a full core.  Now, I'm aware that  svchost runs services and I know how to display the services it runs in Task Manager or Process Explorer ().  Now I know which services are run, but I don't know which service eats the CPU time. I could disable one service after another, but I don't really like doing this (it could break things that are currently in use and I could forget turning the service back on later).  Therefore I'd like to know whether it's possible to instruct Windows to run only one service per svchost the next time I boot my PC. While I might have the slight disadvantage of several processes, I could immediately find out which one it is and it would be a much easier decision of whether or not to stop or restart the service. I got my Galaxy S4 today (i337M), it's wayyy better than my old SII hehe.  I immediately removed the stock Bell firmware and put the latest snapshot available from CyanogenMod.  I'm wondering if it's possible to convert apps like S Planner, S Note, S Health to CyanogenMod.  Current stock android version available for i337M is 4.2.2. Latest Android version for CM is 4.4.  If I install CM 4.2, can I import/install the APKs and then upgrade to 4.4?  Hope you'll be able to help me :) Number of $(0,1)$ $m\times n$ matrices with no empty rows or columns Ubuntu Server VM: copy paste? I've installed Ubuntu Server under Virtualbox just to get a nice little shell. I've also installed the VirtualBox "Guest Additions" and set "Shared Clipboard: Bidirectional".  I still can't seem to get any copy-paste working. Am I missing something here?    I've installed  which gives mouse support in server mode (no X), and allows copy-paste using the mouse, but still the VirtualBox integration doesn't work. Testing convergence of series $\sum_{n=3}^\infty\frac{1}{n (\ln(n))^p(\ln\ln(n))^q}$ Lets have this problem. $$\sum_{n=3}^\infty\frac{1}{n (\ln(n))^p(\ln\ln(n))^q}$$ I have rewritten this to a form $$\sum\frac{1}{np'^{\ln\ln(n)}q'^{\ln\ln\ln(n)}}$$ For $p,q\in\mathbb{R}$. Obviously, $p',q'&gt;0, p=\ln(p'),q=\ln(q')$ How can I tell what version of Linux I'm using? Often times I will ssh into a new client's box to make changes to their website configuration without knowing much about the server configuration. I have seen a few ways to get information about the system you're using, but are there some standard commands to tell me what version of Unix/Linux I'm on and basic system information (like if it is a 64-bit system or not), and that sort of thing?  Basically, if you just logged into a box and didn't know anything about it, what things would you check out and what commands would you use to do it? I have been reading Stack Exchange for years - mostly not logged in, and have never posted (this is my first). I'm simply not very talkative, and very good at googling.  Recently a few occasions have come up when I've wanted to comment on a question.  I wanted either to ask for, or provide, clarification which did not warrant a new answer.  How do I gain enough reputation to comment without:   asking questions which have already been answered or that I can figure out on my own, or posting my comment like as an answer (i.e. being  rude)? How to add http:// if it doesn't exist in the URL How can I request a random row (or as close to truly random as is possible) in pure SQL? Calculate the limit including binomial coefficients $\lim\limits_{n\to\infty}{\sum\limits_{k=n}^{5n}{k-1 \choose n-1}(\frac{1}{5})^{n}(\frac{4}{5})^{k-n}}$  It's clear that we can simplify the limit a little bit, after which we get:  $\lim\limits_{n\to\infty}{(\frac{1}{4})^{n}\sum\limits_{k=n}^{5n}{k-1 \choose n-1}(\frac{4}{5})^{k}}$  I could further simplify the expression, but I feel like there's a more elegant solution.   Give me a hint, please Terminal appears with much delay when shortcut is used When I press Ctrl+Alt+T the Terminal opens after around 30 seconds. That's pretty annoying. If I open it with Alt+F2 and enter gnome-terminal the window appears instantly as usual.  I'm using Ubuntu 16.04 with gnome3.  Thank you for your help in advance! How to find the smallest $n$ such that $n^a\equiv 1 \pmod p$ Numbered list in rows in tables I want to have numbered listing in each row, I've tried with \rownumber, but it doesn't work. I wrote a number at the beginning, but Could it be automatically?  Can you help me? This is my code:  \documentclass[10pt, a4paper]{article}  \usepackage{fontspec} \setmainfont{Arial}  \usepackage{color, colortbl} \definecolor{Gray}{gray}{0.9}  \begin{document}  \begin{table}[h!] \tiny \begin{tabular}{|&gt;{\raggedright\arraybackslash}m{30mm}|&gt; {\raggedright\arraybackslash}m{5mm}|&gt;{\raggedright\arraybackslash}m{5mm}|&gt;{\raggedright\arraybackslash}m{5mm}|&gt;{\raggedright\arraybackslash}m{5mm}|&gt;{\raggedright\arraybackslash}m{5mm}|&gt;{\raggedright\arraybackslash}m{5mm}|&gt;{\raggedright\arraybackslash}m{5mm}|&gt;{\raggedright\arraybackslash}m{5mm}|&gt;{\raggedright\arraybackslash}m{5mm}|&gt;{\raggedright\arraybackslash}m{5mm}|&gt;{\raggedright\arraybackslash}m{5mm}|&gt;{\raggedright\arraybackslash}m{5mm}|} \hline \multicolumn{1}{|&gt;{\centering\arraybackslash}m{30mm}|}{\rowcolor{Gray}\textbf{Text}} &amp; \multicolumn{1}{|&gt;{\centering\arraybackslash}m{5mm}|}{\textbf{Sem 1}} &amp; \multicolumn{1}{|&gt;{\centering\arraybackslash}m{5mm}|}{\textbf{Sem 2}} &amp; \multicolumn{1}{|&gt;{\centering\arraybackslash}m{5mm}|}{\textbf{Sem 3}} &amp; \multicolumn{1}{|&gt;{\centering\arraybackslash}m{5mm}|}{\textbf{Sem 4}} &amp; \multicolumn{1}{|&gt;{\centering\arraybackslash}m{5mm}|}{\textbf{Sem 5}} &amp; \multicolumn{1}{|&gt;{\centering\arraybackslash}m{5mm}|}{\textbf{Sem 6}} &amp; \multicolumn{1}{|&gt;{\centering\arraybackslash}m{5mm}|}{\textbf{Sem 7}} &amp; \multicolumn{1}{|&gt;{\centering\arraybackslash}m{5mm}|}{\textbf{Sem 8}} &amp; \multicolumn{1}{|&gt;{\centering\arraybackslash}m{5mm}|}{\textbf{Sem 9}} &amp; \multicolumn{1}{|&gt;{\centering\arraybackslash}m{5mm}|}{\textbf{Sem 10}} &amp; \multicolumn{1}{|&gt;{\centering\arraybackslash}m{5mm}|}{\textbf{Sem 11}} &amp; \multicolumn{1}{|&gt;{\centering\arraybackslash}m{5mm}|}{\textbf{Sem 12}}\\ \hline 1. Text text text text text text text text text text text text text &amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;\\\hline 2. Text text text text text text text text text text text text text &amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;\\\hline 3. Text text text text text text text text text text text text text  &amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;\\\hline 4. Text text text text text text text text text text text text text &amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;\\\hline  \hline \end{tabular} \end{table}  \end{document} FM transmitter design? I stumbled across a relatively simple FM radio transmitter online.    Credit:   I wanted to understand how it works (it is called "super simple" on the website), but several hours I have nothing but a vague understanding.   I believe R2, L1, C3 form an oscillator, and then the transistor Q1 is used to modulate the signal. C1 would just be used to remove any DC offset. However, this leaves R1, C2, C4, C5, and R3 and,  for these components,  I have no clue what they do.   Could someone please explain how this "super simple" transmitter works?