I'm trying to get size of an array in c and for some reason I'm getting a wrong answer for this popular method.      int innerprod(int *v, int *u) {    int n = sizeof(v)/sizeof(v[0]); printf("%d\n",n);             // ouptut here is giving me '2' for a '3' size array           double result = 0.0; for (int i = 0; i &lt; n; i++) {     result += v[i]*u[i];     printf("%d\n",v[i]*u[i]); }     return result; }  int main() { int V[3] = {3,4,-1};   //a 3 size array int W[3] = {7,-2,3}; int x = innerprod(&amp;V,&amp;W); printf("%d\n",x); }
First off, here is some code:  int main()  {     int days[] = {1,2,3,4,5};     int *ptr = days;     printf("%u\n", sizeof(days));     printf("%u\n", sizeof(ptr));      return 0; }   Is there a way to find out the size of the array that ptr is pointing to (instead of just giving its size, which is four bytes on a 32-bit system)?
What is the weight equation through general relativity? The gravitational force on your body, called your weight, pushes you down onto the floor. $$W=mg$$ So, what is the weight equation through general relativity? What are the best books to study Neural Networks from a purely mathematical perspective? I am looking for a book that goes through the mathematical aspects of neural networks, from simple forward passage of multilayer perceptron in matrix form or differentiation of activation functions, to back propagation in CNN or RNN (to mention some of the topics).  Do you know any book that goes in depth into this theory? I've had a look at a couple (such as Pattern Recognition and Machine Learning by Bishop or Deep Learning by Goodfellow, Bengio and Courville) but still have not found a rigorous one (with exercises would be a plus). Do you have any suggestions? Let , $\Delta = B(0,1)$.  If $f:\Delta \rightarrow \Delta$ is holomorphic, and $f(0)=0$, prove that $|f(z)+f(-z)| \leq 2|z|^2$.  My attempt so far:  $\displaystyle f(z) = \sum_{n=0}^{+\infty} a_n z^n = \sum_{n=0}^{+\infty} a_{2n} z^{2n} + \sum_{n=0}^{+\infty} a_{2n+1} z^{2n+1}$  $\displaystyle f(-z) = \sum_{n=0}^{+\infty} a_n (-z)^n = \sum_{n=0}^{+\infty} a_{2n} z^{2n} - \sum_{n=0}^{+\infty} a_{2n+1} z^{2n+1}$  Then, $\displaystyle f(z)+f(-z) = 2  \sum_{n=0}^{+\infty} a_{2n} (z^2)^n =: 2 g(z^2)$  If $g(\Delta) \subset \Delta$, as $g(0) = 0$, I can invoke Schwarz Lemma and I win. However, I don't know how to prove this. Could anyone help me? Thanks! Do these leaves signify anything? Occasionally, you can see little tufts of leaves blowing in spots on the map      Do these mean anything? How can I make a perfect sweep with bevel object in Bezier curve(3d) (Pipe) Show that a ring is commutative if it has the property that ab = ca implies b = c when $a\neq 0$ Show that a ring is commutative if it has the property that ab = ca implies b = c when $a\neq 0$.   This is my proof to show that a ring is commutative if it has the property that ab = ca implies b = c.  We need to show that if x, y ∈ R then xy = yx. Let a = x, b = yx and c = xy. Then ab = x(yx) = (xy)x = ca. Thus, by the hypothesis, b = c, or xy = yx. Thus, for x, y ∈ R we have xy = yx.   How would I show when $a\neq 0$? I encountered this particular combinatorial identity :$$\begin{align}&amp;1\dbinom{n-1}{r-1}+2\dbinom{n-2}{r-1}+\cdots+(n+1-r)\dbinom{r-1}{r-1}\\=&amp;\dbinom{n}{r}+\dbinom{n-1}{r}+\cdots+\dbinom{r}{r}\\=&amp; \dbinom{n+1}{r+1}\end{align}$$How does one figure it out? I have the following page (deadlink: http://www.workingstorage.com/Sample.htm ) that has a footer which I can't make sit at the bottom of the page. I want the footer to  stick to the window bottom when the page is short and the screen is not filled, and stay at the document end and move down as normal when there is more than a screenful of content (instead of overlapping the content).  The CSS is inherited and befuddles me. I can't seem to change it properly to put a minimum height on the content or make the footer go to the bottom. Update: Failed to lock /var/cache/apt/archives/lock How does the comma operator work in C++?  For instance, if I do:  a = b, c;     Does a end up equaling b or c?   (Yes, I know this is easy to test - just documenting on here for someone to find the answer quickly.)  Update:  This question has exposed a nuance when using the comma operator.  Just to document this:  a = b, c;    // a is set to the value of b!  a = (b, c);  // a is set to the value of c!   This question was actually inspired by a typo in code.  What was intended to be  a = b; c = d;   Turned into  a = b,    //  &lt;-  Note comma typo! c = d; I was thinking of how to create an IV for a block cipher that doesn't require stored state, and I came up with the idea of using an HMAC of the (padded) plaintext and a (possibly distinct) key as the IV.  This seems to be secure:   The IV will only be reused if there is an HMAC collision or if the plaintext and key are the same.  The former would imply that the HMAC is broken and the latter is harmless, since it is just producing the output twice. The HMAC is verified after decryption, but before padding is checked, so padding-oracle attacks should not be an issue.   In particular, if the HMAC and the block cipher use different keys, there seems to be a very simple proof of security, assuming that either (1) the HMAC cannot be distinguished from a random function or (2) the block cipher is secure against maliciously-chosen (but unique) IVs:   The attacker cannot forge the HMAC, since this would require knowledge of the signing key. Since the signing and encryption keys are different in this case, and the HMAC is assumed random, malicious IVs cannot be triggered by an attacker.   Alternatively, if the cipher is secure against malicious (but unique) IVs, then the security of the cipher+security of the HMAC seem to prove the security of the system.  This (obviously) provides no protection against replay attacks, but that requires state anyway.  However, I am not a cryptographer so I do not trust my conclusions on this matter.  If this technique is secure, it would appear to be quite useful in practice, as it is simple and provides both encryption and authentication. I have the low battery alarm disabled in the BIOS settings on my Lemur laptop, but the alarm still sounds when the battery is low.  The sound is a very loud and annoying beep that repeats every couple seconds. The laptop will last another 20 minutes without being plugged in so the battery level isn't properly being detected anymore anyways. I found that if I mute my audio then the beep stops but I obviously cannot listen to anything anymore. If i turn the volume back on even to just 1% the battery alarm is audible again at full volume.  I remember there used to be a mixer somewhere that could control the internal speaker and so if I could find that again then maybe i could mute that and fix this problem.   I have Ubuntu 14.04.  Note that I'm not talking about a low battery notification, which is something through gnome; as opposed to a low battery ALARM which is this very loud beep every couple seconds coming through the internal speaker.  Nevertheless, here are my gnome power settings:  $ gsettings list-recursively org.gnome.settings-daemon.plugins.power org.gnome.settings-daemon.plugins.power button-power 'interactive' org.gnome.settings-daemon.plugins.power critical-battery-action 'nothing' org.gnome.settings-daemon.plugins.power percentage-low 1 org.gnome.settings-daemon.plugins.power priority 0 org.gnome.settings-daemon.plugins.power lid-close-suspend-with-external-monitor false org.gnome.settings-daemon.plugins.power idle-dim false org.gnome.settings-daemon.plugins.power button-hibernate 'hibernate' org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'suspend' org.gnome.settings-daemon.plugins.power button-sleep 'suspend' org.gnome.settings-daemon.plugins.power button-suspend 'suspend' org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 0 org.gnome.settings-daemon.plugins.power time-low 1200 org.gnome.settings-daemon.plugins.power lid-close-ac-action 'nothing' org.gnome.settings-daemon.plugins.power notify-perhaps-recall true org.gnome.settings-daemon.plugins.power percentage-critical 1 org.gnome.settings-daemon.plugins.power percentage-action 1 org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'suspend' org.gnome.settings-daemon.plugins.power time-action 120 org.gnome.settings-daemon.plugins.power lid-close-battery-action 'nothing' org.gnome.settings-daemon.plugins.power idle-brightness 30 org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0 org.gnome.settings-daemon.plugins.power time-critical 300 org.gnome.settings-daemon.plugins.power active true org.gnome.settings-daemon.plugins.power use-time-for-policy false $ Can I completely disable Cortana on Windows 10? I've a Skype interview for PhD application (it will make me miss  today.) I've been asked, in advance, to prepare a short presentation and then there would be some discussion with the panel (I guess.) I expect that they will ask if I have some questions so, I'm wondering what are the best (type of) questions one might consider? Infinite Series $\sum\limits_{n=1}^{\infty}\frac{1}{4^n\cos^2\frac{x}{2^n}}$ How to prove that  $$\sum_{n=1}^{\infty}\frac{1}{4^n\cos^2\frac{x}{2^n}}=\frac1{\sin^2x}-\frac1{x^2}$$ Find a bijection from $\mathbb R \to  \mathbb R-\mathbb N$. I want to set my function up such that all natural numbers get mapped to $n+.1$ and reals of the form $n+.1$ to $2n+.1$ is this correct? Proving orthogonality of vectors in a complex vector space I'm taking a course in Real Analysis and have come across the following question which I initially thought looked quite simple:  Let $X$ be an inner product space over $\mathbb{K}$ ($\mathbb{K} = \mathbb{C}$ or $\mathbb{R}$) Show that x and y are orthogonal if and only if $||\lambda x  + \mu y||^2 = ||\lambda x||^2 + ||\mu y||^2$ for all $\mu, \lambda \in \mathbb{K}$.  I have proven the statement in one direction (starting with orthogonality and ending up with $||\lambda x  + \mu y||^2 = ||\lambda x||^2 + ||\mu y||^2$). However, I seem to be getting stuck trying to go in the other direction. The following is what I have so far:  $||\lambda x  + \mu y||^2 = ||\lambda x||^2 + 2\bar{\lambda}\mu Re&lt;x,y&gt; + ||\mu y||^2$  Then we must have 2$\bar{\lambda}\mu Re&lt;x,y&gt; = 0$ for the desired equality to hold, and so $Re&lt;x,y&gt; = 0$.   However, for orthogonality I want $&lt;x,y&gt; = 0$ and can't see how I can make this next step.  Any help would be greatly appreciated. Grandi's Series; tends to $1/2$, but why is this considered a valid sum? Is it possible to have a pair of Gaussian random variables for which the joint distribution is not Gaussian? Somebody asked me this question in a job interview and I replied that their joint distribution is always Gaussian. I thought that I can always write a bivariate Gaussian with their means and variance and covariances. I am wondering if there can be a case for which the joint probability of two Gaussians is not Gaussian? Why does the Lasso provide Variable Selection?