I'm reading Head First C and going well so far but I'm having trouble with this example -   int doses[] = {1, 3, 2, 1000}; printf("Issue dose %i", 3[doses]);   Result = "Issue dose 1000"  I know what this does, it accesses index 3 of the doses array. More technically my understanding is that it adds the size of three integers to the pointer address for the first element in the array ( the doses variable )   The book explains that it works because   doses[3] == *(doses + 3) == *(3 + doses) == 3[doses]   I'm with it up until that final jump between *(3 + doses) == 3[doses]. Given that doses[3] is easy for me to grasp maybe I'm not understanding the significance of the [] correctly?
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]?
Proving ${n \choose p} \equiv \Bigl[\frac{n}{p}\Bigr] \ (\text{mod} \ p)$ Attributes from an hstore-column as separate columns in a view? Let's assume we have a table where it has two columns, one an ID and one an hstore column, which stores key/value pairs.  You could query that column as such:  SELECT name, attributes-&gt;'device' as device FROM products WHERE attributes-&gt;'edition'= 'ebook'   Can you create a view for this table where the keys/values appear as columns in the view instead of all in the hstore column?  Example: I have an hstore key where it might have the key of amenity.  I want to create a view showing the the ID and the amenity values in a new view. Where do the regions of Westeros appear to align as of the season 6 finale? Based on , my understanding is that there are 9 regions of Westeros subject to the rule of the Iron Throne, from Dorne joining up to Cersei killing Robert.  With whom does [insert region] align in what appears to be Daenerys vs Cersei?   Kingdom of the North -- Daenerys probably but currently busy with White Walkers Kingdom of the Mountain and the Vale -- Daenerys probably but currently busy with White Walkers (supposedly; depends on what Littlefinger has in mind) Kingdom of the Isles and Rivers (Iron Islands) -- Daenerys Kingdom of the Isles and Rivers (Riverlands) -- Cersei because the Freys are with the Lannisters? Kingdom of the Rock -- Cersei because she is a Lannister Kingdom of the Stormlands -- Cersei? Kingdom of the Reach -- Daenerys after invitation of Varys and Ellaria Principality of Dorne -- Daenerys after invitation of Varys presumably Crownlands -- Cersei since Cersei is currently occupying the Iron Throne   Am I understanding this right? Anything wrong? Why are there directories called Local, LocalLow, and Roaming under \Users\\AppData? I have a workstation running Windows Server 2008 that's logged into an  domain, and I have a dual boot with Ubuntu Linux. When running Linux, I'd like to be able to use the same Thunderbird profile I use under Windows, so I pointed Thunderbird to use a profile I found under:  \Users\(myname)\AppData\Local\Thunderbird\Profiles   It turns out it was not the correct profile -- it had the right configuration, but the Inbox was an old version. I eventually found out the correct path was:  \Users\(myname)\AppData\Roaming\Thunderbird\Profiles   What's the rationale behind those different places to store application data? Book or web site resources for an absolute beginner to learn about stocks and investing? I'm completely new to the world of investing and stocks. Knowing that I shouldn't invest or buy stocks until I know it well enough, I was wondering which cheap or affordable resources would be the best to get started?  I've seen quite a lot of books and websites that teach investing, but it's hard to choose.  To narrow it down, what book and/or what website would you recommend that does a good job teaching investing in stocks to beginners? I have studied some of Einstein's Theory of General Relativity, and I understand that it states that gravity isn't a force but rather the effects of objects curving space-time. If this is true, then why are we instructed in middle school that it is a force? Function in Table Electric monopoles do exist, but why cannot magnetic monopoles exist?    The question is closed because I need to clarify it, but I don't know how I could ask it another way. However, I've recieved many answers that were appropiate and added something to my knowledge, so I consider it answered. So I have these two wheels parented to the leg of a robot. I wanna make them spin a few times but they're spinning around the wrong axis. With other objects I could just press R, Y, Y to make them spin right when they're already at an angle, but for some reason it doesn't work with these. Would be amazing if someone helped me fixing this! Double Negation in C++ Let $S=\{\{x\}\mid x \in \mathbb{R}\}$. Is $\sigma(S)$ included in the Borel $\sigma$-algebra on $\mathbb{R}$? Is $\sigma(S)$ equivalent to the Borel $\sigma$-algbrea on $\mathbb{R}$?    I think the answer to the first question is yes. Because the Borel sets include singletons, the Borel $\sigma$-algebra must contain the smallest sigma-algebra of the set of all singletons.   Here's my attempt at the second question: my answer would be no. Countable unions (or intersections) of countable sets are countable, so that any $X \in \sigma(S)$ is either countable or a compliment of a countable set. Therefore, the interval $(0,1) \not \in \sigma (S)$ but it is included in the Borel $\sigma$-algebra. My issue here is that I don't know how to formalize this statement, if it is even correct. When I look at the black and white photographs from professional photographers, I notice that they have a special look. Not a specific style—obviously each photographer has her own style—but a look which make them different from similar color photos, a special feeling, which makes them shine specifically as black and white and makes color irrelevant.  When I convert my own photos to black and white in Lightroom, they don't have any special look. They just look like any other of my photos, simply converted to black and white. I imagine that there are two reasons for that:   Some scenes are better for black and white. Talented and/or experienced photographers know which scenes would be beautiful in black and white, and shoot specifically those scenes. Moreover, they know how to adapt the scene itself and the lighting to black and white (for instance by not relying on the color contrast itself).  In my case, I don't think much about shooting for black and white. It comes only in post-processing, when I either think that the photo will look great in black and white (and very often, it doesn't), or I find the colors to be poor and turn the photo to black and white (which actually doesn't make the photo any better). Post-processing is much more complex than clicking on black and white button in an app. It involves not only adjusting black and white mix (i.e. raising or lowering the lightness of specific colors), but doing lots of other adjustments.  In my case, I do black and white mix, but other adjustments I do are similar to what I would do for a color photo: actually, I may even do them on a color photo, and only then turn it to black and white.   So, what should I take in account if I want to have decent black and white photographs? Are there specific techniques, tips, tricks or warnings for someone who usually shots in color and wants to start black and white photography?  Let me show some examples. Are those scenes not great for black and white photos in the first place? Or can they be salvaged through proper post-processing?  1.  First, a poorly done photo from Scotland with dubious composition and very poor colors that I was unable to correct in Lightroom.  The same image in black and white isn't much better. The difference between the trees and the grass on the hill is barely visible. Houses on the hill fade with the sky much more than in the original version.      2.  Here's a photo of a cute pet.  In black and white, the gap between the mouse's ear and the background is barely visible. There is absolutely no benefit compared to the original.      3.  Finally, an example of a much more contrasty picture. The black and white version is weird, since the lack of color makes it difficult to understand whether the soil is the actual sand or something else. I find the sky to be weird as well, and making the blue channel darker or lighter in Lightroom haven't changed that. Isomorphism of a product $C_n \times C_m$ of cyclic groups with the cyclic group $C_{mn}$ Let $n$ is a natural number. Prove that $$\left\lfloor\frac{n}{1}\right\rfloor+\left\lfloor\frac{n}{2}\right\rfloor+....+\left\lfloor\frac{n}{n}\right\rfloor+\left\lfloor{\sqrt{n}}\right\rfloor$$   is even.   I used induction and the inequality $$x-1&lt;\lfloor{x}\rfloor\le{x}$$ to prove it.  Is there any other, nicer way to do it? I'm looking to book flights from) Philadelphia (PHL) to Detroit (DTW). Direct flights are quite expensive. I noticed, in expanding a search to surrounding airports, that I can book from Allentown (ABE) to Detroit for far less, and the connection is through Philadelphia.  Can I book this flight but board in Philadelphia? I'll be traveling with carry-on luggage only, so on the return, it's obviously no problem. But would I be allowed through security and on to the plane in PHL with out having flown from Allentown? How can I selectively disable paste blockers As  shows, we nearly always use the possessive form of personal pronouns for friend of mine/his/ours/etc.  But when it comes to actual names, we prefer  without the possessive apostrophe. That preference is even more marked with, say, . Not that I think the usage itself is particularly American - it's much the same with .  Personally, I find friend of him grates. In general I've no strong feelings either way as to whether it's friend of Peter or friend of Peter's (though I deplore the possessive in ), but in line with many others, I really don't like the possessive in relation to things like countries.  Why is this?   Edit: Noting an apparent "progression" (pronoun -> person -> nation) marked by reduction in use of the possessive, I checked at a finer "granularity". NGram shows that although it does occur,  virtually "flatlines" against friend of mine. But the bias reduces through of you, of us, and by the time I get to  it's much less extreme. There seems to be something "egocentric" about the double possessive.  Presumably when babies learn to speak, they soon notice that possessive pronouns, possessive apostrophes, and the word "of", all do the same job. Parents would correct a child who says "of mine's", but probably wouldn't even notice the same "redundancy" in "of Peter's". Younger speakers are unlikely to even be talking about something "of America's". Perhaps as we mature we tend to discard the "double possessive" for the more "distant" things that only adults are likely talk about, but we keep it for "closer" people because that's how we spoke when we were younger.  EDIT2 I note that I'm a great fan of him is vanishingly rare compared to ...fan of his, but with ...fan (of John) the double possessive occurs far less often than ...friend (of John's). Usage seems to be affected by the noun before "of" as well as the one after it. This is getting complicated... InDesign: How to restore text-frame position/size to be managed by the master page instead of the actual page? I have some designer that moved slightly a text-frame and in order to be managed again by the master page we need to remove the page and create a new one inserting the content in it.  Is there any different way to do it?  I would like to be able to restore the "power" of positioning/size to the master page because now we need to change the master-page to position the text-frame a little bit to the right and in the case above mentioned will not be updated.  Thanks VirtualBox: using physical partition as virtual drive Background: I am using VirtualBox installed on Windows 7. From within VirtualBox I am using Xubuntu as a virtual OS. The reason I chose this approach is so that I don't have to keep turning off Windows and rebooting from Xubuntu every time I needed to switch OSes. And VirtualBox's seamless mode is pretty amazing to allow me see Xubuntu and Windows 7 all in one screen.   Issue: Now I am thinking of a way to have Xubuntu more integrated into my system. By this I mean I want to have a physical partition for Xubuntu. But I want to still have the feeling of the seamless mode.  Question: So finally, my question is: is it possible to load a partition in VirtualBox as a virtual OS?   Case examples: Ideal scenario would be: I physically boot up and login to Windows 7. Now I want to access Xubuntu, so I load VirtualBox and access my Xubuntu partition without rebooting. And the other way around too, i.e. I boot up the system, login to Xubuntu, and can access the actual Windows 7 partition through VirtualBox.   Other info: Please note that I am not talking about getting access to files, as I have a completely separate partition for my files, and am very familiar with VirtualBox's Shared Folders option. How do I use SQL's GETDATE() and DATEADD() in a Linq to SQL expression? If I have a Linq to SQL expression like this:    from subscription in dbContext.Subscriptions  where subscription.Expires &gt; DateTime.Now select subscription   I want this to to use the SQL Servers GETDATE() function instead of the time of the machine running the C# program.  The next question would be how to translate this:  DateTime.Now.AddDays(2)   to this:  DATEADD(dd, 2, GETDATE())