Structures initialization in c
C structure initialization?
What does "I have got some time on my hands" mean? My shift at work's kinda long, so I've got some time on my hands to, you know...whatever. Think, I guess.   What does "I have got some time on my hands" mean in the above quote? I have sucessfully installed AniMove by activating experimental plugins (yay! thanks gis.stackexchange). But I can't find it in Qgis! Yes I have activated it. Where is it? Is this a common bug? I searched for it the toolbox, I looked up the names of the several single tools based on this  and only found "Kernel Density", which is filed under SAGA. But I don't have SAGA installed (and don't know if I need to?) Let X be a T1 space, and show that X is normal if and only if each neighbourhood of a closed set F contains the closure of some neighbourhood of F Let $X$ be a $T_1$-space, and show that $X$ is normal if and only if each neighbourhood of a closed set $F$ contains the closure of some neighbourhood of $F$.  I saw this statement in the book Introduction to topology and modern analysis by Simmons. I tried to prove it but I did not get any where. How may it be proved? To find:  $$\int \sqrt{1+\sin(x)} dx$$  What I  tried:  I put $\tan(\frac{x}{2}) = t$, using which I got it to:  $$I = 2\int \dfrac{1+t}{(1+t^2)^{\frac{3}{2}}}dt$$  Now I am badly stuck. There seems no way to approach this one. Please give a hint. Also, can we initially to some manipulations on the original integral to make it easy? Thank you. The method format(String, Object[]) in the type String is not applicable for the arguments (...) How to check if specific column exists in an Access database table What's the typical microclimate in the aircraft passenger cabin? How to interpret autocorrelation plot in MCMC I am getting familiar with Bayesian statistics by reading the book Doing Bayesian Data Analysis, by John K. Kruschke also known as the "puppy book". In chapter 9, hierarchical models are introduced with this simple example: \begin{align} y_{ji}   &amp;\sim {\rm Bernoulli}(\theta_j)  \\ \theta_j &amp;\sim {\rm Beta}(\mu\kappa, (1-\mu)\kappa)  \\ \mu      &amp;\sim {\rm Beta}(A_\mu, B_\mu)   \\ \kappa   &amp;\sim {\rm Gamma}(S_\kappa, R_\kappa) \end{align} and the Bernoulli observations are 3 coins, each 10 flips. One shows 9 heads, the other 5 heads and the other 1 head.  I have used pymc to infer the hyperparamteres.  with pm.Model() as model: # define the          mu = pm.Beta('mu', 2, 2)     kappa = pm.Gamma('kappa', 1, 0.1)     # define the prior     theta = pm.Beta('theta', mu * kappa, (1 - mu) * kappa, shape=len(N))     # define the likelihood     y = pm.Bernoulli('y', p=theta[coin], observed=y)      # Generate a MCMC chain     step = pm.Metropolis()     trace = pm.sample(5000, step, progressbar=True)     trace = pm.sample(5000, step, progressbar=True)   burnin = 2000  # posterior samples to discard thin = 10  # thinning  pm.autocorrplot(trace[burnin::thin], vars =[mu, kappa])   My question is regarding the autocorrelation. How shall I interpret autocorrelation? Could you please help me to interpret the autocorrelation plot?    It says as the samples gets further from each other the correlation between them reduces. right? Can we use this to plot to find the optimum thinning? Does the thinning affect the posterior samples? after all, what is the use of this plot? Let $F$ be a finite field. How do I prove that the order of $F$ is always of order $p^n$ where $p$ is prime? Boy Born on a Tuesday - is it just a language trick? Finding $\lim_{n\to\infty}\int_0^{\frac{1}{2^n}}(1+\cos(x))^n\,dx$ During our studies on Riemann Integrals we were given the following question in my Calculus II course: $$ \forall n\in\mathbb{N}: \text{let } f_n(x)=(1+\cos(x))^n, f_n:[0,1]\to \mathbb{R}$$ $$\text{ Find}: \lim_{n\to\infty}\int_0^{\frac{1}{2^n}}f_n(x)\, dx $$ I have tried finding the limit using the squeeze theorem. I noticed that the function is defined on $[0,1]$, where $\cos(x)$ is positive and decreasing. I used the following boundaries: $$ 1\leq f_n\leq 2^n \implies \frac{1}{2^n} = \int_0^{\frac{1}{2^n}}1 \leq \int_0^{\frac{1}{2^n}}f_n(x) \leq \int_0^{\frac{1}{2^n}}2^n = 1  $$ but $ \displaystyle{\lim_{n\to\infty}}\frac{1}{2^n} = 0 $ which means I'm unable to apply the squeeze theroem. I've tried using tighter lower boundaries such as $1+\cos(1)$ But it didn't seem to work. I did some trial and error by calculaing the integrals manually for different values of $n$ and it does seem like $\displaystyle{\lim_{n\to\infty}}\int_0^{\frac{1}{2^n}}f_n(x) dx = 1 $ This means that somehow I should find a lower bundary which tends to 1 when $n\to\infty$. Any ideas on how to go forward from here are welcome. ReaderWriterLockSlim vs. Monitor I have an IDictionary&lt;TKey,TValue&gt; implementation that internally holds n other Dictionary&lt;TKey, TValue&gt; and distributes that insertions by the HashCode of the key to the invidual sub-dictionaries. With 16 sub-dictionaries, the number of collisions is pretty low on a 4-core machine.  For parallel insertions, i locked the Add-method with a ReaderWriterLockSlim, locking only the individual sub-dictionary:    public void Add(TKey key, TValue value)         {             int poolIndex = GetPoolIndex(key);             this.locks[poolIndex].EnterWriteLock();             try             {                 this.pools[poolIndex].Add(key, value);             }             finally             {                 this.locks[poolIndex].ExitWriteLock();             }         }   When inserting items with four threads, i only got about 32% cpu usage and bad performance. So i replaced the ReaderWriterLockSlim by a Monitor (i.e., the lock keyword). CPU usage was now at nearly 100% and the performance was more than doubled.   My question is: Why did the CPU usage increase? The number of collisions should not have changed. What makes ReaderWriterLock.EnterWriteLock wait so many times? Programming pattern to generate VGA signal with micro-controller? I want to generate VGA signal with micro-controller (like TI Tiva ARM which runs at 90/120Mhz speed).  I'm not sure how to make accurate timings with micro-controller. Which programming pattern I need to use?  Do I need any inline assembler code? How to wisely use interrupts?  Would be great if anybody show some pseudo code how to generate VGA signal.  I successfully generated VGA signal with FPGA. But I just can't figure out how to do it with MCU. What can I do if my USB flash drive is write-protected or read-only? What is the best way of defining white noise process so it is intuitive and easy to understand? Best books for mathematical background? How to remove Firefox's "inspect element" button? This is driving me crazy! When FF 12 came out, Firefox's own 'Inspect Element' button on the right-click menu took the place of there the Firebug 'Inspect Element' button used to be.  As I've been doing web development in Firefox forever, my muscle memory still clicks there when I want to use Firebug.    Is there any way to remove the Firefox internal 'Inspect Element' and replace the button on the menu with Firebug's, returning it to its original position (marked NO in the screenshot)? How to call a SOAP web service on Android I am having a lot of trouble finding good information on how to call a standard SOAP/WSDL web service with Android. All I've been able to find are either very convoluted documents and references to "kSoap2" and then some bit about parsing it all manually with . OK, that's fine, but it's 2008, so I figured there should be some good library for calling standard web services.  The web service is just basically one created in . I would like to have IDE support for generating the plumbing classes. I just need the easiest/most-elegant way to contact a  based web service from an Android-based phone. How does $cos(x) = \frac{\vec{v} \cdot \vec{w}}{|\vec{v}| \cdot |\vec{w}|}$ make sense? In Multivariable Calculus, the professor said that in order to compute the angle $x$ between two vectors $v$ and $w$, we use the formula: $\cos(x) = \frac{\vec{v} \cdot \vec{w}}{|\vec{v}| \cdot |\vec{w}|}$  He also mentioned "Projection" but I didn't understand much of it. The only thing I got was that we can create a right triangle by drawing a perpendicular line from one vector to the head of the other and compute the angle like that using $\cos$, but I don't understand why we're multiplying vectors, or dividing by their magnitudes…how do those operations make sense?  Also, in the specific example, the result of $\cos(x) = \frac{\vec{v} \cdot \vec{w}}{|\vec{v}| \cdot |\vec{w}|}$ ended up being $1/2 = \pi/2$. Where does $\pi/2$ come from here? I can't understand how we go from $1/2$ to $\pi/2$. Showing $\sum\limits_{p \in P} \frac{1}{p}$ where $P$ is the set of all primes is divergent