Hi all I am really new to C (just started this week), and want to make sure that I am not looking down the wrong rabbit home and hoping to perhaps get pointed to the right rabbit hole.  I create a struct:  #define MAX 64 #define ARRAY_SIZE 2048  struct object {     int q, c, p;     char name[MAX]; //Stores string up to 63 characters     char arr[ARRAY_SIZE][MAX]; // Creates an array of 2048 cells with string of length 63 max };  int main(){ ... ... int variable = 30; struct object l[variable]; //This is where the crash happens. But only when either variable is too large (for instance works on 15 just fine, but anything over 20 it crashes), or when Array_SIZE is too larger, for instance works fine with 1024 but 2048 crashes. ... ... }   The error I get on crash is the following: Process returned -1073741571 (0xC00000FD) in the cmd window. And the following in the debugger in the IDE: Program received signal SIGSEGV, Segmentation fault. [Inferior 1 (process 12120) exited with code 030000000375]  Am I doing something obviously wrong with how I declare an array of structs? Why would large numbers not work but lower numebrs work?  Does the above error indicate I am accessing something out of bounds somewhere? Ive been up and down the code and cant seem to find any reason why larger numbers dont work and lower ones do. My memory footprint doesnt seem to be the issue, just a few megs of memory.  I need help with what to look for (I cant find any instances of accessing anything out of bounds, so I get the feeling Im not chasing the right rabbit and need to look for something else)? Or maybe Im doing something illegal for C without knowing it?
The following code is generating a stack overflow error for me  int main(int argc, char* argv[]) {     int sieve[2000000];     return 0; }   How do I get around this? I am using Turbo C++ but would like to keep my code in C  EDIT:  Thanks for the advice.  The code above was only for example, I actually declare the array in a function and not in sub main.  Also, I needed the array to be initialized to zeros, so when I googled malloc, I discovered that calloc was perfect for my purposes.  Malloc/calloc also has the advantage over allocating on the stack of allowing me to declare the size using a variable.
find spectrum matrix A Let $A = \left[ \begin{array}{*{20}{c}} 0&amp;b&amp;0&amp;0&amp;0&amp;0\\ c&amp;0&amp;b&amp;0&amp;0&amp;0\\ 0&amp;c&amp;0&amp;b&amp;0&amp;0\\ 0&amp;0&amp;c&amp;0&amp;b&amp;0\\ 0&amp;0&amp;0&amp;c&amp;0&amp;b\\ 0&amp;0&amp;0&amp;0&amp;c&amp;0 \end{array} \right]_{n \times n}$.  Why does matrix $A$ have spectrum $\sigma (A) = \left\{ 2\sqrt {bc} \cos \left(\frac{\pi k}{n + 1}\right):k = 1,2,\ldots,n \right\}$? How to float until on left (or right) page? I have two sideways tables that I want on two facing pages so the reader can turn the entire book and read them both in one turn. For the moment I keep moving them around to keep them on facing pages. Is there a way I can make the first one float until it's on a left page and then place the other one right after? Or perhaps some similar way to automatically get them on the same spread? Is it possible to see the history of changes to a particular line of code in a Subversion repository?  I'd like, for instance, to be able to see when a particular statement was added or when that statement was changed, even if its line number is not the same any more. $\prod_{k=0}^{\infty} \cos(x \cdot 2^{-k}).$ Task is to find $$\prod_{k=0}^{\infty} \cos(x \cdot 2^{-k}).$$  I tried to make it with double-angle formula: $\prod_{k=0}^{\infty} \cos(x \cdot 2^{-k}) = \frac{\prod_{k=0}^\infty \sin(x2^{1-k})}{2^\infty \cdot \prod_{k=0}^\infty \sin(x \cdot 2^{-k})} $ I'm sad to admit, that I'm stuck with that one. So I would appreciate any help, such as pointing the right direction. This is a Q&amp;A so I answer it myself. I searched for an answer to this question for ages and didn't find anything so I'll add this here if anybody else struggles with the same issue.  So, how can I merge two edge loops to one? I do not want to connect them (I have seen many answers that suggest to just bridge the edge loops), nor do I want to merge each vertex by hand. I just want each vertex to be merged with the closest opposing vertex.  Also, I find it highly unpractical and in most situations useless to remove doubles after moving the vertices to overlap each other by scaling and moving the edge loops. This is another common suggested answer. Sorry if this is very basic but here's a question.   Let $\mathbf{v}=(v_1,\ldots, v_n)\in k^n$ where $k=\bar{k}$.      Why do we have   $$ \sqrt{\sum_{i=1}^n |v_i|^2} \leq \sum_{i=1}^n |v_i|,  $$   where the left-hand side can be thought of as the $2$-norm $\|\mathbf{v}\|_2$ on $L^2(k^n)$?   $\mathbf{General \; case}$: If this is true for $p=2$-norm, I am guessing that this is true for all $p\geq 1$:  $$ \left( \sum_{i=1}^n |v_i|^p\right)^{1/p}\leq \sum_{i=1}^n |v_i|.  $$     In fact, does this inequality hold when $p$ is a rational number? How to delete Windows.old in Windows 8 It seems to be a common thing that a Windows Update creates a Windows.old folder under C:\Windows.old My question is now, can it be deleted with Windows 8 and how can I do that?  If I try to manually delete it in Windows Explorer it does not let me, a permissions issue. Bounded in Probability and smaller order in probability I wanted to prove that if $X_n$ is bounded in probability and $Y_n = o_p(X_n)$, then $Y_n \rightarrow 0$ in probability   I  know the following definitions that is $X_n$ is bounded in probability meaning that   $P(|X_n|&lt;M)&gt;1-\epsilon$  and I know that $Y_n = o_p(X_n)$ implies that $Y_n/X_n \rightarrow0$ in probability How do I destroy Nekker nests? I'm having this XML document with namespaces and I want to extract some nodes using XPath.  Here's the document:  &lt;ArrayOfAnyType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/"&gt;   &lt;anyType xsi:type="Document"&gt;     &lt;Id&gt;5&lt;/Id&gt;     &lt;Title&gt;T1&lt;/Title&gt;   &lt;/anyType&gt;    &lt;anyType xsi:type="Document"&gt;     &lt;Id&gt;15&lt;/Id&gt;     &lt;Title&gt;T15&lt;/Title&gt;   &lt;/anyType&gt; &lt;/ArrayOfAnyType&gt;   What's the XPath expression going to be if I want to extract all "anyType" elements with xsi:type="Document"?  I've tried this:   //anyType[@xsi:type="Document"]   and it doesn't work: In the 10 k tools,  is described as if I had approved it:    However, the review item itself (correctly) displays that I rejected this edit:    Going by   , this should be fixed, but it isn’t.  This could be solved by replacing approved by to reviewed by in the list or making an explicit list, who approved and rejected an edit (which is probably more complicated). I am extremely poor in solving a problem quickly, which leaves me doing badly in olympiads and other contests. But, if I just don’t give up on a problem, no matter how much time it takes, I usually end up solving it. To have a future in mathematics or physics, is it necessary for me to excel at contests, because these days children excelling at contests have an advantage over those who don’t (not complete advantage, but advantage nonetheless)? What font is "z" in "z-score"? Is there a free site to play Yu-Gi-Oh? Every Artinian ring is isomorphic to a direct product of Artinian local rings Proposition. Let $R$ be commutative ring with $1_R$. We assume that $R$ is an Artinian ring and $M_1,\dots,M_n$ its maximal ideals. Then         $R/\mathrm{Jac}(R)\cong (R/M_1)\times \dotsb \times (R/M_n)$.   The ring $R$ is isomorphic to the direct product of a finite number of Artinian local rings.      Proof. 1. It's obvious that $M_i+M_j=R,\ \forall 1\leq i \neq j \leq n$. So, from Chinese Remainder Theorem, we have  $$R/\bigcap_{i=1}^{n}M_i = R/\mathrm{Jac}(R) \cong (R/M_1)\times \dotsb \times (R/M_n),$$ as we wanted.    Since $R$ is an Artinian ring, we have $\mathrm{Jac}(R)^m=\{0_R\}$, for some $m\in \Bbb Z^+$. But,  $$\{0_R\}\subseteq M_1^m\dotsb M_n^m=(M_1\dotsb M_n)^m\subseteq (\bigcap_{i=1}^{n}M_i=\mathrm{Jac}(R))^m=\{0_R\}.$$ So, if we apply CRT we will take  $$R\cong R/\{0_R\}\cong R/M_1^m\dotsb M_n^m\cong (R/M_1^m)\times \dots \times (R/M_n^m).$$   Questions.   1) Are these thoughts complete and correct?  2) Why $R/M_i^m$ are artinian local rings?  3) Could you please elaborate some examples as an application? Footnotes in tables? I would like to have footnotes in tables, but the \footnote command does not work inside a table environment.  Googling one finds that this is , at least in the UK.  That link contains a list of solutions to the problem, but since the author of the FAQ does not believe that this is good style, no comparison is made between the different methods.  I am sure that there are good typographical reasons why in most situations it is undesirable to have footnotes in tables (although I have never come across them), however I have recently felt the need to do just this in a paper I am currently writing.  Therefore I'd like to ask two questions:   What are the arguments against footnotes in tables? If one really must go against the advice in 1., which method (whether considered in the  or not) would you recommend?   Thanks in advance.  Added  In response to ShreevatsaR's comment: I do not much care for where the text of the footnote appears.  I do however insist on the footnote marks being attached to the relevant entries in the table, so that I can avoid having to reference "the second entry in the eighth line of the table", etc... The equivalent electric field of a magnetic field The closest I can get to making mesh lights affect their environment in Blender Eevee is giving them an Emission material and turning on "Bloom". But this isn't emitting proper light, it just looks like it is, but it doesn't light the surroundings whatsoever.     I would like to be able to light a scene with meshes without having to put point lamps everywhere just to make them emit light. What kinds of desktop environments and shells are available? How to compare (probability) predictive ability of models developed from logistic regression? I know some well-known measures are $c$ statistic, Kolmogorov-Smirnov $D$ statistic. However, as far as I know, those statistics take into account only of the rank order of the observations, and is invariant under changing the intercept of the logistic regression model (e.g. in oversampling-correction exercise).  In my current application, I need to depend on the accuracy of the logistic regression to predict probability of event. I know only of qualitative way of assessing models for probability prediction ability, namely by plotting "QQ-plot" of the actual vs predicted probability of event:   Score the validation dataset using the developed model. Rank the observations according to the predicted probability and group into $n$ buckets according to their rank of predicted probability. (First 1/n would go to the first bucket, next 1/n would go to the next ...) Calculate the average predicted and actual probability of Event for each bucket. Create a scatter plot of Predicted vs Actual - one point for each bucket.   I am wondering:   Is the "Q-Q plot" I mentioned above a legitimate way to assess predictive performance of models developed from logistic regression? If so, where may I find more reference for that? Is there any known quantitative way to assess the probability prediction ability of this kind of model?