For a programming class, we have to make a procedure that only take in as parameter the pointer for an array: void myprocedure(int * myArray) and then outputs the elements in it. Since I only know how to do so using a for loop,I tried first to calculate the length of the array by using the line sizeof(myArray)/sizeof(int), only to later realize that sizeof(myArray) doesn't give the size of said array, but rather the size of the pointer.  I need a code that would either let me calculate the size of the array from my procedure, or output the elements in the array without having to know how much are there in.
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)?
How to decide which glm family to use? I have fish density data that I am trying to compare between several different collection techniques, the data has lots of zeros, and the histogram looks vaugley appropriate for a poisson distribution except that, as densities, it is not integer data. I am relatively new to GLMs and have spent the last several days looking online for how to tell which distribution to use but have failed utterly in finding any resources that help make this decision. A sample histogram of the data looks like the following:   I have no idea how to go about deciding on the appropriate family to use for the GLM. If anyone has any advice or could give me a resource I should check out, that would be fantastic. I am running QGIS 2.18.14 (QGIS code revision: ff83b9a479) on a windows 7 machine, it comes with GRASS 7.2.2 (Code Revision r71496), but it does not come with r.in.lidar. I have noticed QGIS 2.18.16.1 has the same problem and it shares the same GRASS 7.2.2 (Code Revision r71496).  I know there were some issues with it and later solved as I read , I also certailny used it short ago in 2017, so I wonder which version should I go for before starting the always risky attempt of a new installation. Determining application path in a Python EXE generated by pyInstaller I have an application that resides in a single .py file.  I've been able to get pyInstaller to bundle it successfully into an EXE for Windows.  The problem is, the application requires a .cfg file that always sits directly beside the application in the same directory.  Normally, I build the path using the following code:  import os config_name = 'myapp.cfg' config_path = os.path.join(sys.path[0], config_name)   However, it seems the sys.path is blank when its called from an EXE generated by pyInstaller.  This same behaviour occurs when you run the python interactive command line and try to fetch sys.path[0].  Is there a more concrete way of getting the path of the currently running application so that I can find files that are relative to it? Ball swung in a horizontal circle, can the string ever by exactly horizontal to the ground? You swing a ball on the end of a lightweight string in a horizontal circle at constant speed.  Can the string ever by truly horizontal?  If not, would it slope above the horizontal or below the horizontal?  Why? How can I restrict various roles with limit in creating nodes of a particular content type Change Folder Permissions Find full path of the Python interpreter? Help me to solve this problem please..  Let $Y_{(1)}, Y_{(2)}, Y_{(3)}, Y_{(4)}, Y_{(5)}$ denote the order statistics of a random sample of size 5 from a distribution having p.d.f. $f(y) = e^{(-y)}, 0 &lt; y &lt; \infty$, zero elsewhere. Show that $Z_1 = Y_{(2)}$ and $Z_2 = Y_{(4)} − Y_{(2)}$  are independent. Hint: First find the joint p.d.f. of $Y_{(2)}$  and  $Y_{(4)}$. Say an airplane flies at Mach 1. The doppler effect causes the front of the sound emitted by the plane to reach infinite frequency:    $f = \left ( \frac {343+0}{343-343} \right ) f_0 = ∞$  If the plane suddenly stopped, and there was an observer in front of the sound waves to receive the sound, what would the bunched up waves sound like to the observer? Would they cancel each other out and cause no sound? How can I figure out what's slowly eating my HD space? How do I perform a Perl substitution on a string while keeping the original? How to remove the "No front page content has been created yet." message from the front page? I only want blocks on the homepage. Because I don't have any nodes, and I want to keep the homepage as /node I am getting a "No front page content has been created yet." message on my page.  How do I get around this? First order differential equations with 2 varriables Does anybody know how to solve the following differntial equation?  $$w^2\cdot r+\frac{dw}{dt}\cdot r+\frac{dr}{dt}\cdot w=3g$$  where w and r are a function of time so $w(t)$ and $r(t)$. $g$ is a constant  EDIT: This equation came from a thought problem of mine which I will now explain since I still do not know how to approach the problem.  Basically I want to design a spiral track in which a vehicle will accelerate. However the total acceleration needs to be constant.   The vehicle will have 2 acceleration components, a radial component ($a_r$) and a change in speed component ($a_s$). Since we want constant acceleration: $a_r + a_s = constant$  From circular motion we know that $a_r = \omega ^2 r$ where $r$ is the radius, and $\omega$    Further we know that $v=\omega*r$, therefore: $a_s=\frac{d}{dt}(\omega r)$  For constant acceleration $a_{total} = a_r + a_s = \omega ^2 r + \frac{d}{dt}(\omega r) =constant$  Further usefull information: Length of the track covered at a certain time $l=v*t=\omega r t$  With all this the radius will be a function of time, $r(t)$ and the angular velocity will be a function of time, $\omega (t)$  Boundary conditions: $r(0)  = 0$ $\omega (0) = 0$  Now I would like to find a possible set of solutions to create a track by implementing end boundary conditions that i choose e.g. $v(t_{end})=100 [m/s]$ and $l(t_{end})=5000 [m]$  Here is a diagram for clarity: set 4-bit nibble in an int type Let $V$ be spherically symmetric and $W$ i.i.d. Gaussian. Then $E[V|V+W=t]=g(\|t\|)$ A random vector $V \in \mathbb{R}^n$ is said to be spherically symmetric. If for every orthogonal matrix  $A$   the distribution of $AV$ is the same as the distribution of $V$.   My question: Let $W$ be  i.i.d. zero mean Gaussian random variable.     Can we show that  for a spherically symmetric $V$ the conditional expectation  \begin{align} E[V|V+W=t]=   g(\|t\|).  \end{align}  That is the conditional expectation is only a function of the magnitude.   My attempt:  \begin{align} E[V|V+W=t]= \int  V  \frac{f_W(t-v)}{f_{V+W}(t)} dP_V(v)= \frac{\int  v  f_W(t-v) dP_V(v)}{f_{V+W}(t)}= \frac{E[ V  f_W(t-V) ]}{f_{V+W}(t)} \end{align}  Therefore, we can show that the two functions in the above ratio only depend on $\|t\|$.   Observe that we can write $t= \|t\| u_t$  where $u_t$ is a unit vector. Then, for any orthogonal matrix $A$ \begin{align} f_{V+W}(t)=f_{V+W}(\|t\|, u_t)&amp;= \frac{1}{(2\pi)^{n/2}} E[ e^{-\frac{\|t-V  \|^2}{2}} ]\\ &amp;= \frac{1}{(2\pi)^{n/2}} E[ e^{-\frac{\|t-AV  \|^2}{2}} ]\\ &amp;= \frac{1}{(2\pi)^{n/2}} E[ e^{-\frac{\|tA^{-1}-V  \|^2}{2}} ]\\ &amp;= \frac{1}{(2\pi)^{n/2}} E[ e^{-\frac{\|t A^T-V  \|^2}{2}} ]\\ &amp;= f_{V+W}(tA^T)\\ &amp;= f_{V+W}(\|t\|,  u_t A^T) \end{align}  Since, $A$ was arbitrary  we have that $f_{V+W}(t)=h(\|t\|)$(i.e., only depends on the magnitute).  Now I am not sure how to show that $E[ V  f_W(t-V) ]$ only depends on $\|t\|$? Why is the sample distribution the Exponential distribution Gamma distributed? Why is the image of a smooth embedding $f: N \to M$ an embedded submanifold? I'm reading An Introduction to Manifolds (Tu) and got confused on p.123 Theorem 11.13. Let me briefly explain what was done before that.  The author defines an embedding between two manifolds $f: N\rightarrow M$ as an injective immersion (differential is injective everywhere) with the additional property that $f(N)$ as a subspace of $M$ is homeomorphic via $f$ to $N$. Then a canonical form theorem is proven, namely, that for any point $p \in N$, there are charts $(U,\phi = x^1, \ldots, x^n) \ni p$ and $(V,\psi = y^1, \ldots, y^m) \ni f(p)$, such that the transition map takes the following form:  $$\psi \circ f \circ \phi^{-1} : (r^1,\ldots,r^n) \mapsto (r^1,\ldots,r^n,0,\ldots,0).$$  (I guess it is implicitly assumed that $f(U) \subset V$).  Now in the process of proving that $f(N) \subset M$ is an , he states that $f(U) \subset V$ is defined by the vanishing of the coordinates $y^{n+1},\ldots,y^m$. I can prove that $$ f(U) \subset \{q \in V: y^{n+1}(q) = \cdots = y^m(q)\} $$ but not the reverse inclusion. Can anyone explain why this should be true? A command-line clipboard copy and paste utility? In Windows I used command-line clipboard copy-and-paste utilities...      pclip.exe and gclip.exe     These were UnixUtils ports for Windows (but they only handled plain text). There were a couple of other native Windows utilities which could write/extract any format.    I've looked for something similar in Synaptic Package Manager, but I can't find anything.    Is there something there, that I've missed? ... or maybe this is available in Bash scripting?    The type of utility I'd like will be able to read/write via std-in/std-out or file-in/file-out, and handle Unicode, Rich Text Format, picture, etc. clipboard formats...    NB: I'm not after a clipboard manager. I want to prove the definition of limit of a function from definition (1) to definition (2).  (1) A function $f(x)$ is said to have $f^*$ as the limit as $x$ tends $x^*$ iff for every sequence $\{x_n\}$ with limit $x^*$, the limit $\lim_{n-&gt;\infty}f(x_n)$ exists and is equal to $f^*$. (2) A function is said to have $f^*$ as the limit as $x$ tends $x^*$ iff for each $\epsilon &gt;0$, there exists a $\delta_\epsilon &gt;0$ such that $|f(x)-f^*| &lt;\epsilon \forall |x^*-x|&lt;\delta_\epsilon$  I am confused about the steps. Suppose I am given an $\epsilon &gt; 0$ and $x^*$. I have to show the existence of a $\delta_\epsilon &gt;0$ such that for all $x$ satisfying  $|x^*-x|&lt;\delta_\epsilon$ I can construct a sequence $x_n$ which converges to $x^*$ and $x_n=x$ for some $n \geq N$. Then I can say that $f(x_n)-f^*=f(x)-f^* &lt; \epsilon$. I think I may have made some mistake about the steps.  My main confusion is the following : Suppose I choose $\delta_\epsilon=\epsilon$. Then if a sequence $\{x_n\}$ converges to $x^*$ then $x_n=x$ (where $x$ satisfies $|x-x^*|&lt;\epsilon$) for some $n\geq N$. Now, $\lim_{n-&gt;\infty}f(x_n)$ exists implies there exists an $M$ such that $\forall n\geq M$, $f(x_n)-f^* &lt;\epsilon$. Now, I need to show that for some $n \geq M$ indeed $x_n=x$. How do I show that ? This $M$ and $N$ are different. How do I delete folders and files that were older than 7 days on the command line? I want to delete folders and its files were created longer than 7 days using the command line.