I have a couple of questions regarding § 5.1.2.2.2 in the standard.        The function called at program startup is named main. The implementation declares no prototype for this function. It shall be   defined with a return type of int and with no parameters:       int main(void) { /* ... */ }      or with two parameters (referred to here as   argc and argv, though any names may be used, as they are local to the   function in which they are declared):       int main(int argc, char *argv[]) { /* ... */ }      or equivalent;10) or in some other   implementation-defined manner.      What does "some other implementation-defined manner" refer to? Does it refer to footnote 10, which states:     Thus, int can be replaced by a typedef name defined as int, or   the type of argv can be written as char ** argv, and so on.   ...or the actual definition of main? If so, does this mean that given a certain implementation, the compiler can say main should be defined however it wants (this runs contrary to what I've read on the internet saying it must be int main. For example, in § 5.1.2.2.3 it states:         If the return type of the main function is a type compatible with int, a return from the initial call to the main function is equivalent   to calling the exit function with the value returned by the main   function as its argument;11) reaching the } that terminates the main   function returns a value of 0. If the return type is not compatible   with int, the termination status returned to the host environment is   unspecified.      ...which seems to leave a lot of leeway to the implementation.     — The parameters argc and argv and the strings pointed to by   the argv array shall be modifiable by the program, and retain   their last-stored values between program startup and program   termination.   What does "retain their last-stored values mean"? Does this mean functions like  violate the standard because they permute argv?
What is the correct (most efficient) way to define the main() function in C and C++ — int main() or void main() — and why? And how about the arguments? If int main() then return 1 or return 0?  There are numerous duplicates of this question, including:       — For C++, with a very good answer indeed.     Related:
Allow setuid on shell scripts The setuid permission bit tells Linux to run a program with the effective user id of the owner instead of the executor:  &gt; cat setuid-test.c  #include &lt;stdio.h&gt; #include &lt;unistd.h&gt;  int main(int argc, char** argv) {     printf("%d", geteuid());     return 0; }  &gt; gcc -o setuid-test setuid-test.c &gt; ./setuid-test  1000  &gt; sudo chown nobody ./setuid-test; sudo chmod +s ./setuid-test &gt; ./setuid-test  65534   However, this only applies to executables; shell scripts ignore the setuid bit:  &gt; cat setuid-test2  #!/bin/bash id -u  &gt; ./setuid-test2  1000  &gt; sudo chown nobody ./setuid-test2; sudo chmod +s ./setuid-test2 &gt; ./setuid-test2  1000     Wikipedia :     Due to the increased likelihood of security flaws, many operating systems ignore the setuid attribute when applied to executable shell scripts.   Assuming I'm willing to accept those risks, is there any way to tell Linux to treat the setuid bit the same on shell scripts as it does on executables?  If not, is there a common workaround for this problem? My current solution is to add a sudoers entry to allow ALL to run a given script as the user I want it run as, with NOPASSWD to avoid the password prompt. The main downsides to that is the need for a sudoers entry every time I want to do this, and the need for the caller to sudo some-script instead of just some-script SSH access to office host behind NAT router I would like to access the ssh port of my office linux host from home. Unfortunately the host is located behind a NAT router. So, the IP address is not publicly available. There is however access to another internet host (Server) which is unfortunately only non-root access. After a while of searching I do not find a suitable solution.  Following setup:   Office PC (linux, root access) behind NAT (IP not public) but full Internet access. Server PC (linux, no root access) static and public IP and full Internet access. Home PC (linux, root access) behind NAT (IP not public) but full Internet access.   Possible connections: Office PC --> Server &lt;-- Home PC  Not possible: Office PC &lt;-X- Server -X-> Home PC  Neither the Home PC, nor the Server can initiate access to the Office PC. But both the Office PC and the Home PC can initiate connections to the Server.  Reverse SSH tunnel not possible: I tried a method called reverse ssh-tunnel. Unfortunately this requires GatewayPorts on Server set to "yes" in /etc/ssh/sshd_config, where I have no root access.  In principle it should be possible:   0) On the Server I start a userspace program which listens on 2 ports (1 incoming, 1 outgoing)  1) On my office PC I run a another program which keeps a TCP connection open to the outgoing port on the server.  2) From home I connect to Server's incoming port.  There should be a standard solution for this out there.  What is the quickest and cleanest solution to solve this?  Frank I have a 32-bit machine, can I use programs that are meant for 64-bit processors? I am using a 32-bit machine, but I am having to use a relatively obscure semantic database which only comes in 64-bit versions.  What are my options for running it in my local dev environment?  Currently when I try to run it, I get an error message that looks like this:  cannot execute binary file   and when I check my machine info, I get this:  $ uname -a Linux slabrams-desktop 2.6.32-29-generic #58-Ubuntu SMP Fri Feb 11 19:00:09 UTC 2011 i686 GNU/Linux I’m not sure What it is? I’m trying to get a glossy shade to building in my scene as soon as I put roughness to zero I see these trees in glass. I have no trees in my scene anywhere, background is black. Even when I render I see these trees. How can I get rid of them and still keep my glossy building material. How to capture a still image from digital video? How do I set read/write permissions my hard drives? Are there surface-mount pin header footprints for KiCAD? I'm designing a small module that breaks out a DIP SPI EEPROM to a 2x5 pin header socket(more info here: ). I want to mount the socket on the end of the board, with the pins lying parallel to the board.  I think two 5x1 surface-mount header footprints, on both sides of the board right near the end would do the job. Trouble is, KiCAD doesn't come with such a footprint(if it does, I haven't found it yet). Where might I find one? If one doesn't exist, that's OK; I'll have a shot at making my own. zsh I/O redirection: redirecting and then piping; what is going on? Is (rest) mass quantized? I learned today in class that photons and light are quantized.  I also remember that electric charge is quantized as well.  I was thinking about these implications, and I was wondering if (rest) mass was similarly quantized.  That is, if we describe certain finite irreducible masses $x$, $y$, $z$, etc., then all masses are integer multiples of these irreducible masses.  Or do masses exist along a continuum, as charge and light were thought to exist on before the discovery of photons and electrons?  (I'm only referring to invariant/rest mass.) I have an email account that has passed 60GB of emails, and currently I'm having a lot of trouble using an email client to archive emails of last year (2011).  Via terminal, I am trying to use  to locate the files between 2011-01-01 and 2011-12-31, but no avail.  How can I find files between two dates?  If relevant, the end goal will be a batch that will move each file found, matching the date interval, to a folder. CSS 100% height with padding/margin With HTML/CSS, how can I make an element that has a width and/or height that is 100% of it's parent element and still has proper padding or margins?  By "proper" I mean that if my parent element is 200px tall and I specify height = 100% with padding = 5px I would expect that I should get a 190px high element with border = 5px on all sides, nicely centered in the parent element.  Now, I know that that's not how the standard box model specifies it should work (although I'd like to know why, exactly...), so the obvious answer doesn't work:  #myDiv {     width: 100%     height: 100%;     padding: 5px; }   But it would seem to me that there must be SOME way of reliably producing this effect for a parent of arbitrary size. Does anyone know of a way of accomplishing this (seemingly simple) task?  Oh, and for the record I'm not terribly interested in IE compatibility so that should (hopefully) make things a bit easier.   EDIT: Since an example was asked for, here's the simplest one I can think of:  &lt;html style="height: 100%"&gt;     &lt;body style="height: 100%"&gt;         &lt;div style="background-color: black; height: 100%; padding: 25px"&gt;&lt;/div&gt;     &lt;/body&gt; &lt;/html&gt;   The challenge is then to get the black box to show up with a 25 pixel padding on all edges without the page growing big enough to require scrollbars. How to get text from an element , when getText fails I have the following element element(by.css(&quot;span[aria-label='Picker ID, TESTUSER']&quot;)  I want to assure the text on this filed is TESTUSER, so I tried:  expect(element(by.css(&quot;span[aria-label='Picker ID, TESTUSER']&quot;)).getAttribute('value')).toEqual('TESTUSER');  then I got the error: Expected null to equal 'TESTUSER' So I tried: element(by.css(&quot;span[aria-label='Picker ID, TESTUSER']&quot;)).getText().then(function (value) {         console.log(value);       })  And I got this error: Expected '' to be 'TESTUSER'.  How to get the value of this field and expect it is TESTUSER? Looking for a short story about an artist and a forger Back in the late 1970s to early 1980s, I read a short story about an artist and a forger.  Between the two of them, they managed to start a revolution that brought down a corrupt dictatorship.  It was science fiction:   The dictatorship was interplanetary, maybe interstellar.   The artist used some kind of advanced technology to make his art works.   Plot:  The artist is one of the best (if not the best) at what he does.  The dictator wants the artist to make what amounts to a family portrait in whatever medium it is he works in.  Think of it like painting - you create the image manually (not a photograph) but it is much more than just a flat image.    The artist doesn't like the dictator - maybe on general principles, maybe because he knows the dictator personally - and refuses to make the "portrait."  The dictator has the artist arrested, and will only let the artist free again if he makes the portrait.  The artists makes the portrait.  He does the work while in the prison or jail.  That's where the forger comes into things. The forger is also in jail for something or other.  The forger makes copies of art works.  He of course recognizes the artist, and knows what the artist works with.  The forger can somehow see what the artist is working on.  The artist finishes the portrait.  At first the dictator is thrilled.  It looks exactly the way he wanted it.  As time goes by, though, the people looking at the picture see that it represents the vileness and corruption of the dictator.  The more you look at it, the more of the evilness of the dictator you see in it.  That is the genius of the artist, and whatever medium he is using.  Once you notice the hidden levels of the portrait, you can't unsee them and you see more and more of it as you look.  I think the effect carries over into reality as well.  Once you've seen the dictator's corruption in the portrait you also begin to see it in the dictator and his works as well.  This of course seriously pisses off the dictator, who has the artist killed and the portrait destroyed.  While in prison, the forger watched as the artist created his masterpiece, and recognized it for the subversive thing it is.  He also recognized it as the ultimate rebellion from the artist - the artist knows what will be seen, and that he will be killed for it.  All of that inspires the forger to do something more meaningful with his life than make forgeries for the money.  The forger is released from prison.  He saw the completed portrait, and knows how it was made.  He begins making forgeries of the portrait - like, hundreds if not thousands of them.  These are distrubuted throughout the nation/empire.  The people realize what evil is controlling them once they see it in the copies of the portrait, and eventually a revolution rises and brings down the dictatorship.  It was probably older than the 1970s.  I expect earlier than 1960.  Any ideas? How can I calculate the R-squared of a regression with arima errors using R? If I have an arima object like a:  set.seed(100) x1 &lt;- cumsum(runif(100)) x2 &lt;- c(rnorm(25, 20), rep(0, 75)) x3 &lt;- x1 + x2  dummy = c(rep(1, 25), rep(0, 75))  a &lt;- arima(x3, order=c(0, 1, 0), xreg=dummy) print(a)   .  Series: x3  ARIMA(0,1,0)                      Call: arima(x = x3, order = c(0, 1, 0), xreg = dummy)   Coefficients:         dummy       17.7665 s.e.   1.1434  sigma^2 estimated as 1.307:  log likelihood = -153.74 AIC = 311.48   AICc = 311.6   BIC = 316.67   How do calculate the R squared of this regression? How can I backup my RAW photos while travelling without Internet access? This question seems similar to , but my needs are different :   I shoot in RAW exclusively I'm looking for a 100% offline solution: while traveling, Internet won't be accessible the "laptop" solution is too heavy for me: I'm looking for a lightweight solution the simplest, the better: one device to rule them all   EDIT:  I'm using good old Compact Flash cards (yes, the bigger ones), so I need a device that can read it. If it can read from other cards, this question might be interesting for more people than myself  - that's the whole purpose of the website.    Also asked by :  Portable Storage Device while traveling  I need storage device which is able to read CF cards and make a backup of my photos while traveling. I do not want to carry laptop (it's bulky) and tablet (too little storage) but looking into some other solutions.   So far I found:   Epson PXXXX - price is blocker for me Jobo Giga Vu - same as above Nexto DI - bit better, but still a lot Hyperdrive Colorspace UDMA - this looks the best for price/options Wolwerine PicPac - cheap, bad opinions DigitalFoci PhotoSafe - same as above Ex-Pro® Picture 2 Drive - didn't find much about it   So ladys &amp; gents what do you use? On every other site on Stack Exchange I can click on the site's title and be taken directly to the questions...     Except Meta.stackexchange.com   Here I actually have to click on the word "Questions" as there is no link active on the Meta title and logo.  Now I agree this isn't a big deal, however as I typically visit stack exchange pages up to a couple of hundred times a day, this one that doesn't fit spoils my flow. I am pretty certain it used to work.  It works for me in Firefox, and Safari on iPad, but even closing and reopening Chrome doesn't fix the issue.  Chrome is on Version 53.0.2785.116 How to replace ${} placeholders in a text file? Which facility upgrade unlocks maneuver nodes in KSP Which  unlocks  in career mode in KSP?  The  hints that maneuver nodes are now unlocked with a facility upgrade:     Are there any perks for upgrading?      The building in question   will upgrade visually, both from the outside and the inside. More   gameplay mechanics will be also be unlocked as the player progresses   through the different building tiers. For example, allowing EVAs in   space or being able to use maneuver nodes in the map view. So, I'm running linux Mint (but I guess the same applies to Ubuntu) and as is common knowledge, their TeX distribution tends to be slightly outdated. Now I can't have none of that and decide to install it with the install-tl from the TeXlive homepage. Somehow, I cannot install it as a normal user (this I find normal as it is installing in the root directory), so I proceed to install TeXlive   sudo perl ./install-tl   and add the paths to .bashrc. All is well and my TeXlive installation works. Except for the texhash option. Running it as a normal user is no problem, except that I installed TeXlive as root, and so running texhash as normal user doesn't do anything (directory not writable. Skipping...). No problem I think, I'll just do it as root. But somehow texhash isn't installed for root.  Now, texhash is somehow connected to updating the directory tree, but I don't really know what it does. I use it on my ~/texmf/ folder to add my packages to a global path (I think), but when looking at info for this question I see in a comment for  question that this is apparently not needed, though I don't understand what I'm to do now.  So if I'm not adding new packages from CTAN or updating, I really don't need texhash and all is good?   To summarize: I'd like to know:    Why should I need texhash? Can I avoid installing as root on linux Mint/ubuntu ( they say you don't have to be root, that it's even discouraged)? Should I somehow install texhash for root?   I realize this might be a vague question at best, but I didn't find an answer I readily understood, so I'd appreciate any thought on this. There's a spaceship, nearing the end of its journey. Everybody on board is in cryosleep. For some reason the wake-up system malfunctions, and the ship will fly on indefinitely. The people at the space port realise this, and try to wake someone up. Their last resort is finding someone on board who is telepathic, and wake this person up. They find one, but it turns out to be an unborn baby.