Can anybody explain me why the following part of code produces the result 21? Here is the code:   int a[2][4]={3,6,9,12,15,18,21,24}; cout &lt;&lt; 2[1[a]];   Thanks in advance!
As Joel points out in , in  (aka: K &amp; R), there is mention of this property of arrays in C: a[5] == 5[a]  Joel says that it's because of pointer arithmetic but I still don't understand. Why does a[5] == 5[a]?
File upload to Heroku not working I ride regularly in the city with my a few valuables with me. My purse, phone, keys, company ID card etc. I hate having a bag on me while ride so I am looking for a solution to have these few items in a bike bag, but also have them safe if I stop somewhere to run into  a shop or a cafe for 15 minutes.   My original idea was to look for a small saddle or top tube bag that is lockable and also safely locked to the frame, and I can simply leave it there. As it turns out there is no such thing! Or I just did not find it?  My second idea was to search for a similar bag, but which is easily detachable and I can take it with myself as a waist bag for example. Same story, I couldn't find anything like this on the market.  Do you know any bag that could work for me? Or do you have an alternate suggestion for my conundrum?   Thank you very much if you take the time to answer! Ride safe! János 3 prong to 4 prong dryer cord change My 2 year old whirlpool dryer has a 3 prong cord. My new house has a 4 prong. The dryer doesn't have a spot for 4 wires. The ground wire coming from the dryer is attached to the dryer itself. A new 4 pronged dryer cord has white, red, black, and green wires. Maybe the green wire hooks to the ground screw with the one coming from the dryer? PostgreSQL crash when connection failed Error log is:  016-02-21 21:22:34 GET DETAIL:  Connection matched pg_hba.conf line 83: "host    all             all             ::1/128                 md5" .... .... 2016-02-21 21:22:37 GET DETAIL:  Connection matched pg_hba.conf line 83: "host    all             all             ::1/128                 md5" 2016-02-21 21:22:37 GET FATAL:  password authentication failed for user "postgres" 2016-02-21 21:22:37 GET DETAIL:  Connection matched pg_hba.conf line 83: "host    all             all             ::1/128                 md5" 2016-02-21 21:22:37 GET LOG:  CreateProcess call failed: A blocking operation was interrupted by a call to WSACancelBlockingCall.       (error code 299) 2016-02-21 21:22:37 GET LOG:  could not fork new process for connection: No error 2016-02-21 21:22:37 GET LOG:  incomplete startup packet 2016-02-21 21:22:38 GET FATAL:  password authentication failed for user "postgres" 2016-02-21 21:22:38 GET DETAIL:  Connection matched pg_hba.conf line 83: "host    all             all             ::1/128                 md5" 2016-02-21 21:22:42 GET FATAL:  password authentication failed for user "postgres" 2016-02-21 21:22:42 GET DETAIL:  Connection matched pg_hba.conf line 83: "host    all             all             ::1/128                 md5" 2016-02-21 21:24:26 GET LOG:  could not receive data from client: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full. 2016-02-21 21:24:26 GET LOG:  incomplete startup packet 2016-02-21 21:24:29 GET FATAL:  password authentication failed for user "postgres" 2016-02-21 21:24:45 GET PANIC:  could not write to log file 000000010000000100000041 at offset 4259840, length 8192: Invalid argument 2016-02-21 21:24:45 GET STATEMENT:  COMMIT 2016-02-21 21:24:53 GET LOG:  server process (PID 470944) was terminated by exception 0xC0000409 2016-02-21 21:24:53 GET DETAIL:  Failed process was running: COMMIT 2016-02-21 21:24:53 GET HINT:  See C include file "ntstatus.h" for a description of the hexadecimal value. 2016-02-21 21:24:53 GET LOG:  terminating any other active server processes   Can anyone help to solve the problem? I spent many hours but didn't find a solution.   Postgres version 9.4 Operating System: Windows  postgresql.conf is:  listen_addresses = '*' port = 5432  max_connections = 100 shared_buffers = 128MB   dynamic_shared_memory_type = windows   pg_hba.conf is:  # IPv4 local connections: host    all             all             127.0.0.1/32            md5 host    all             all             0.0.0.0/0               md5 Is there a realistic way of implementing a multi-threaded model in PHP whether truly, or just simulating it. Some time back it was suggested that you could force the operating system to load another instance of the PHP executable and handle other simultaneous processes.  The problem with this is that when the PHP code finished executing the PHP instance remains in memory because there is no way to kill it from within PHP.  So if you are simulating several threads you can imagine whats going to happen.  So I am still looking for a way multi-threading can be done or simulated effectively from within PHP. Any ideas? Maximum Likelihood Estimation (MLE) in layman terms Could anyone explain to me in detail about maximum likelihood estimation (MLE) in layman's terms? I would like to know the underlying concept before going into mathematical derivation or equation. From  by Richard Brualdi  We have a chess master. He has 11 weeks to prepare for a competition so he decides that he will practice everyday by playing at least 1 game a day. To make sure that he's able to take a couple of breaks, he also decides that he wont play more than 12 games per week.  My question is, how do you prove/dis-prove that there will be a succession of (consecutive) days in which he will play k games, $k \geq  22$?  Specifically, I don't quite understand the use of the pigeonhole principle here.  Thanks in advance! :D  EDIT  I'll try to clarify what I'm asking:  The goal is to prove that for every possible practice schedule that the chess master makes, there will always be a consecutive sequence of days such that he plays exactly k games.  So for example, if k = 22, how do you prove that no matter what his schedule is like, he will always play exactly k games in r days, $1 \leq r\leq  77$.  My main question is: what is the general method for proving different values of k? Are there values of k (from 1 to 132 inclusive) that are impossible to obtain?  Note that he does not necessarily have to play 132 games within 77 days! Also, keep in mind the bounds of k. What's the difference between  and ,  and ? How do I add a new, valid tag when I don't have enough reputation? I'd like to post a question on StackOverflow, but I think I should be able to tag it with    . Poor me, there is no  tag; There is  and , I'm certainly not sure this is the right thing to do, so figure I'll start here.  Edit Question located here: The  specifically says not to ask  for career advice but people do it anyway.  Should I consider the Help Center outdated or only loosely enforced?    And what about a career advice site on the network?  There are 70+ sites, and most of them are for relatively narrow interests (which is not a criticism, I enjoy looking through the many sections).  A career section seems like it would be very popular.  Also, a careers section would help keep career questions off the other sites. It would seem that LIGO measures wibbles in the metric (not manifold) of spacetime:    It would seem that the expansion of the universe is an expansion of the metric of spacetime:    Imagine for a moment that LIGO is not an interferometer. (So, it just plain times speed changes, rather than using phase shift of orthogonal directions.)  If the ends of one of the arms was indeed receding away from each other, at a speed consistent with the expansion of the universe, is the sensitivity of real-world LIGO of the needed sensitivity of a machine which could measure that shift?  On other words: ideally I'd like to know these two meters:  (A) The left arm of LIGO is about 4km. It was stretched/shrunk (a few times) for roughly .01 seconds by the gravitational wave.  How many meters was it stretched/shrunk in .01 seconds?  (B) Assuming the same abstract LIGO arm was affectable and affected by the expansion of the Universe. How many meters is it stretch/shrunk every .01 seconds?    Note - of course, an interferometer is an ingenious device to measure extremely small changes in speed - assuming the changes are orthogonal. Of course, an interferometer, per se, can't at all measure the expansion of the universe since that is uniform in both directions. The sense of my question is, can something that measures distance changes > as accurately as &lt; the LIGO does, measure the expansion of the universe?  How big or small is the ongoing expansion of the universe compared to the wibble from the black hole system in question? The equivalent electric field of a magnetic field I'd love your help with finding the sign of the following integral: $\int_{0}^{2 \pi}\frac{\sin x}{x} dx$,I know that computing it is impossible.  I tried to use integration by parts and maybe to learn about the sign of each part and conclude something but It didn't work for me.  Any suggestions? Splitting file based on size, but make sure that it ends with newline I am able to use the split command successfully to split large file into multiple smaller files. This is being achieved by following command  split -b 1G $temp_path $final_filepath   But only caveat is that these files many times contain last line which is split across 2 files. Is there any way to avoid that using split or any other command ? From SL Loney Trigonometry:     Prove that   $$r^2+r_1^2+r_2^2+r_3^2=16R^2-a^2-b^2-c^2$$   for a triangle with sides $a$, $b$, $c$, circumradius $R$, inradius $r$, and exradii $r_1$, $r_2$, $r_3$.   This one is a really dirty question.   I have tried a lot of stuff like $r=4R\times \Pi(\sin\frac{A}{2}$) and  $r_1=4R\times\sin\frac{A}{2}\cos\frac{B}2\cos\frac{C}2$ etc..  There are other ways like $-r+r_1+r_2+r_3=4R$,  but all these are way too cumbersome or clumsy.   Anything more intuitive? MacBook Pro 2018 Random Restart > Previous shutdown cause: -20 Concatenate multiple files with two blank lines as delimiter? I'm trying to join Markdown files with two newlines between each file.   I've tried using the following command:  paste -sd '\n\n' file1.md file2.md   This joins the files with a newline, but not two newlines, as I need.   What command can I use to join an arbitrary number of files with two \n characters between each join? Let $f(z)$ be entire function. Show that if $f(z)$ is real when $|z| = 1$, then $f(z)$ must be a constant function using Maximum Modulus theorem Let $f(z)$ be entire function. Consider the functions $e^{if(z)}$ and $e^{−if(z)}$ and applying the Maximum Modulus Theorem, show that if $f(z)$ is real when $|z| = 1$, then $f(z)$ must be a constant function.  (We take $f(z)=u(z)+iv(z)$)  I am confused as so far I have $|g(z)|=|e^{if(z)}|=|e^{-v(z)}|$ and then since $f(z)$ is real, $f(z)=u(z)$ and $v(z)=0$ so I assumed it would follow that $|g(z)|=|e^{v(z)}|=1$.  Similarly, $|g(z)|=|e^{-if(z)}|=|e^{v(z)}|=1$.  Using Liouville I assumed one could say that both $g(z)$ and $h(z)$ are bounded entire functions, they are constant and so it follows that $v(z)$ is constant, meaning that both its partial derivatives are equal to 0 and, due to Cauchy Riemann, both of the partial derivatives of $u(z)$ are equal to zero.  It would then follow that $f(z)$ is constant.  I don't know how to go about the question using the Maximum Modulus Theorem, also I feel I am overlooking the importance of $|z|=1$ perhaps?  Any help would be much appreciated!! How can I get all three Kalos starters? Can you explain the "Axiom of choice" in simple terms? As I'm sure many of you do, I read the  webcomic regularly. The  involves a joke about the Axiom of Choice, which I didn't get.     I went to Wikipedia to see what the Axiom of Choice is, but as often happens with things like this, the Wikipedia entry is not in plain, simple, understandable language. Can someone give me a nice simple explanation of what this axiom is, and perhaps explain the XKCD joke as well?