(Beginner Question:) I initialized some global variables via user defined functions, and compared their execution sequence with main(). Result shows that these global variables' initialization come first.    I am not sure whether there is any execution sequence outside main function. May I confirm this is always the case (that global declarative region comes before main())?    It is confusing to see that c being declared after main() but executed earlier.  Below is the code I used:  int foo(string);  int a = foo("a");       /* global var init */  int main(int argc, char **argv) {   cout &lt;&lt; "main() is now executed" &lt;&lt; endl;   return 0; }  int b = foo("b");       /* global var init */  int foo(string s){   cout &lt;&lt; "foo() is now executed for : " &lt;&lt; s &lt;&lt; endl;   return 42; }  int c = foo("c");       /* global var init */   Result:  foo() is now executed for : a foo() is now executed for : b foo() is now executed for : c main() is now executed   Answer:    No it is not fixed order.  See n3797, 3.6.2/5: It is implementation-defined whether the dynamic initialization of a non-local variable with static or thread storage duration is done before the first statement of the initial function of the thread.
C++ guarantees that variables in a compilation unit (.cpp file) are initialised in order of declaration. For number of compilation units this rule works for each one separately (I mean static variables outside of classes).  But, the order of initialization of variables, is undefined across different compilation units.  Where can I see some explanations about this order for gcc and MSVC (I know that relying on that is a very bad idea - it is just to understand the problems that we may have with legacy code when moving to new GCC major and different OS)?
Alternatively, why does the force created by blowing out air feel so much stronger than the force created by sucking in air?  Ok, so forget the human factor involved in blowing out candles. Consider a vacuum cleaner with a suction end and a blower end. Anyone who has tried it out notices the blower end creates a much stronger force than the suction end, despite the discharge being (more or less) equal at both ends.  Why does this happen? Animations about a young man pulled into a fantasy setting with dragons? I'm looking for an animation (more likely a film not a series) that I watched as a kid, watched early 90's I'm sure it contained a book loving male main character (wears glasses might have even had an amulet) who gets pulled into a fantasy via a magic book  Setting with dragons and an evil wizard, I remember it being on TV as I never had it on VHS.  Same sort of animation technique as visionaries or thundercats.  Thanks. Can't download any apps on iPad 1 I have an iPad 1 with iOS 5.1.1 that won't download any apps or update its OS. It was donated to my school so it was totally wiped before we got it.  I've tried the work around previously mentioned of downloading the apps in iTunes then dragging them over to my device that is also connected to iTunes. When I do this, a dialogue box comes up saying it was unable to install the app because the app requires a newer version of iOS. I'm really hoping Apple didn't make it so a perfectly good piece of tech is obsolete by not making iOS upgrades or apps compatible with their older technology. So just now, I had a bug in my site that caused my custom navigation bar's buttons to be sized and spaced incorrectly. I had no idea where this bug came from, and had to search around for awhile to find the answer. It turns out that SharePoint decided it would be a good idea to inexplicably add a few lines of:  nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;  nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;   between my   in my DevHome.aspx (I'm using Angular for this particular project). So, why does Sharepoint do this, and how do I prevent it? This is not the first time SharePoint has randomly added an nbsp to my page.  Thanks in advance. Proof that $1729$ is the smallest taxicab number Due to this question and answer , I assume 1k = 1000, 2k= 2000...  I don't believe it. Or maybe I am wrong. Please check the below images.        You will see 2kviews. But when you navigate to it, the actual view count is 15xx.         What is going on? Is it a bug? Solution check: Let $f_n$ be fibonacci numbers. Prove: $\sum_{k=0}^{n-1} \binom{n+k}{2k+1} = f_{2n-1}$ and $\sum_{k=0}^n \binom{n+k}{2k} = f_{2n}$ "There are several reasons proposed for the collapse of the bridge." There are several reasons proposed for the collapse of the bridge.   Is this present simple tense or the present perfect tense? I thought it might be the latter since there is a retrospective aspect to the sentence. However, I am quite unsure. Determine number of real roots of $f(x)=x^{5}+x^{3}-2x+1$.   I used Descartes's rule of sign to determine the number of positive and negative roots; there is only 1 negative (hence minimum 1 real root) and two positive roots. These 2 positive roots can be anything- a complex pair, or two real roots- but what about the other 2 roots? Is there any flaw in my understanding of rule of signs? How can I find the exact number of real roots?  Thanks in advance. In MySQL 5.0 why does the following error occur when trying to create a view with a subquery in the FROM clause?     ERROR 1349 (HY000): View's SELECT contains a subquery in the FROM clause   If this is a limitation of the MySQL engine, then why haven't they implemented this feature yet?  Also, what are some good workarounds for this limitation?  Are there any workarounds that work for any subquery in the FROM clause or are there some queries that can not be expressed without using a subquery in the FROM clause?    An example query (was buried in a comment):  SELECT temp.UserName  FROM (SELECT u1.name as UserName, COUNT(m1.UserFromId) as SentCount        FROM Message m1, User u1        WHERE u1.uid = m1.UserFromId        Group BY u1.name HAVING SentCount &gt; 3 ) as temp Get Absolute Position of element within the window in wpf I would like to get the absolute position of an element in relation to the window/root element when it is double clicked. The element's relative position within it's parent is all I can seem to get to, and what I'm trying to get to is the point relative to the window.  I've seen solutions of how to get a the point of an element on the screen, but not in the window. In The Force Awakens, Finn and Poe steal and escape in a TIE wearing no personal life support apparatus. TIEs have been upgraded with shields, hyperdrives (for "/sf"), weapons etc, but as far as I know they weren't upgraded with built in life support.   Finn and Poe should have frozen and/or suffocated after hitting space in the TIE. In the Rebels series, Sabine did the same thing. I've looked at what Wookieepedia states about the TIE as well as the old video game Star Wars "TIE Fighter".  Does the movie or any other work explain how Poe and Finn survived? How do I use a C# keyword as a property name? Using asp.net MVC I'd like to do this inside a view:  &lt;%= Html.TextBox("textbox1", null, new { class="class1" }) %&gt;   This statement does not compile because class is keyword in C#. I'd like to know how I can escape the property names such that this compiles.  It is possible to get this to compile if I change the "class" property to "Class" (uppercase C). But this is not suitable because strict xhtml says that all attributes (and element) names must be lowercase. I just went to install Java 8 on my ancient laptop that runs Windows XP SP3.  Java pops up a message:     Java 8 requires a newer version of Windows. You may continue with the installation, but for Java to work as specified we recommend upgrading your computer's operating system.   Will Java fail to work properly on Windows XP? Or is this just Oracle trying to be secure? Unsupervised learning for anomaly detection I've started working on an anomaly detection in Python.  My dataset is a time series one. The data is being collected by some sensors which record and collect data on semiconductor making machines.  My dataset looks like this:  ContextID   Time_ms Ar_Flow_sccm    BacksGas_Flow_sccm 7289973 09:12:48.502    49.56054688 1.953125 7289973 09:12:48.603    49.56054688 2.05078125 7289973 09:12:48.934    99.85351563 2.05078125 7289973 09:12:49.924    351.3183594 2.05078125 7289973 09:12:50.924    382.8125    1.953125 7289973 09:12:51.924    382.8125    1.7578125 7289973 09:12:52.934    382.8125    1.7578125 7289999 09:15:36.434    50.04882813 1.7578125 7289999 09:15:36.654    50.04882813 1.7578125 7289999 09:15:36.820    50.04882813 1.66015625 7289999 09:15:37.904    333.2519531 1.85546875 7289999 09:15:38.924    377.1972656 1.953125 7289999 09:15:39.994    377.1972656 1.7578125 7289999 09:15:41.94     388.671875  1.85546875 7289999 09:15:42.136    388.671875  1.85546875 7290025 09:18:00.429    381.5917969 1.85546875 7290025 09:18:01.448    381.5917969 1.85546875 7290025 09:18:02.488    381.5917969 1.953125 7290025 09:18:03.549    381.5917969 14.453125 7290025 09:18:04.589    381.5917969 46.77734375   What I have to do is to apply some unsupervised learning technique on each and every parameter column individually and find any anomalies that might exist in there. The ContextID is more like a product number.  I would like to know which unsupervised learning techniques can be used for this kind of task at hand.  Thanks Merge two PDF files containing even and odd pages of a book I have two searchable PDF  documents, say even.pdf and odd.pdf which contain even and odd pages of a book, respectively.   I can decompile each PDF to separate files 001.pdf 002.pdf 003.pdf, et cetera. The question is how to merge them?  They are both even and odd sequences numbered 1, 2, 3. If the numbering in the decompile process with pdftk were different, e.g. 1, 3, 5 for even and 2, 4, 6 for odd instead of 1, 2, 3, 4, I could simply merge them.  Can I do this any other way? Badge overflow on users with too many badges When a user has &quot;too much&quot; reputation and &quot;too many&quot; badges, the design of the user card breaks:    The badge counters overflowing to another line. Can anything be done about this? For example, expanding the rep and badges to their own lines:  NameRepBadges Let $f$ be a real, continuous function defined on $[0,\infty)$ such that $xf(x)$ is increasing for all sufficiently large values of $x$. Show that if   $$\int_0^x f(y)\,dy \sim Ax^\alpha \quad \left(\,x\to \infty\right)$$  for some positive constants $A$ and $\alpha$, then  $$f(x)\sim \alpha Ax^{\alpha -1} \quad \left(\,x\to \infty\right).$$  Clearly, I have to use differentiation somewhere, but I don't know how to manipulate $\lim_{x\to \infty}\frac{\int_0^x f(y)\,dy}{Ax^\alpha}=1$ to get the desired result.  From suggestions given, I know that by L'hospital's rule, it's enough to show that the limit $\lim \frac{f(x)}{\alpha Ax^{\alpha -1}}$ exists, and this limit equals $ \lim \frac{xf(x)}{\alpha Ax^{\alpha}}$. From here, I'll need to use the given assumption that $xf(x)$ is eventually increasing. But how can I show the existence of the limit based on these facts?  I would greatly appreciate any solutions, hints or suggestions. I'm doing a masters course at a different university than I did my undergrad (both in maths). I did well in my undergrad but now I'm finding it very difficult. The shock of the change is hard to cope with.  I'm not just finding it very difficult, but I get zero feedback: we don't have any tests and I was not able to make friends so I don't know how others are finding it. I'm starting to think that I might be an idiot.   How can I build some confidence in my abilities at the same time as I rush and struggle to keep up with the massive rate of new material I need to learn? How might I get myself some reassurance that I can actually pass, or stop worrying about this so much? (I feel terribly guilty using so much money from my family to be here) It's possible that I don't really have a chance at all but knowing that would be fine. I have a complex embedded Linux software running on a gentoo derivative, on which a certain piece of code gets executed regularly every ~84 minutes. Sweeping through the main code to find places where this code might get executed was unsuccessful, and crontab also seems no possible explanation.   My question: Is it possible, by modifying the code in question, to find out which other process/code/file/service started it in the first place? Are there some information in the /proc directory I can use? Or is it impossible to find out the process that executed the given code?