When I use the size of function in the main function it works correctly. However when i use it in the reverse function it only returns 8. Any ideas why or did i incorrectly use it.(This is the beginning of a assignment where I must reverse a string passed to the reverse function. I may only pass the string and nothing else and cannot use the string.h library. If there is another way to accomplish this please let me know. I was planning on using the sizeof function to get the size then looping through the array and use a temp variable to reverse it as I loop.)       #include &lt;stdio.h&gt; char reverse(char *x); int main(int argc, char* argv[]) { char word[] = "Apple pies"; printf("%s\n", word); reverse(word); printf("%s\n", word); printf("%s\n", reverse(word)); printf("%s\n", word); return 0; } char reverse(char *x) {     char crud;     int lc =0;     size_t length = 0;      char *tmp = x;      while (*tmp++)      ++length;     while (length &gt; lc)     {         crud = x[length];         x[length] = x[lc];         x[lc] =crud;         length--;         lc++;      } }
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 do I check if an element is hidden in jQuery? Is it possible to toggle the visibility of an element, using the functions .hide(), .show() or .toggle()?  How would you test if an element is visible or hidden? What novel had an isolationist Earth and the rest of humanity in a war of attrition against aliens? Does moving variable declaration outside of a loop actually increase performance? Looking for the name of a post apocalyptic/sci-fi tv show or film Every once in a while this starts nagging me, I have really no idea and not much to go on so here goes...  A man wearing a blue? uniform walks into a town that looks abandoned and empty and all covered in dust.  The skies are brown/dirty with no sun.  He goes into the upstairs of one of the houses. He stops at I think a fireplace, examines something, or it’s like he’s remembering something.  Then downstairs in the street, a man/person wearing rags/robes with bandages covering his face starts banging on a fire hydrant with a stick/pipe. More people in bandages/robes start appearing, there's a chase in the town. I don't remember much but he's chased into wastes? through a gully or ditch and then a vehicle (only really remember that it was steel in colour) shows up and a woman comes and shoots one or two of the people chasing him.   That’s about all I remember. I was about 6 or 7 maybe and it was afternoon maybe a little later.  I thought maybe Star Trek, but after searching I don't think it is. I think it might be 80's, maybe early 90's. I think it's sci-fi rather than post-apocalyptic. Indefinite Integral of $\sqrt{\sin x}$ $$\int \sqrt{\sin x} ~dx.$$  Does there exist a simple antiderivative of $\sqrt{\sin x}$? How do I integrate it? Each site got a &quot;hot&quot; tab, where its contents are calculated based on . However take a look on the screenshots below and see for yourself that &quot;hot&quot; got nothing to do with many of the questions listed there. :    :    As you can see, there are questions with negative score, no answers, and even closed. I won't be surprised to see spam in there as well. This can't be any worse. What I suggest, instead of fixing the formula or patching it, simply have the hot tab show the same questions as the Hot Network Questions sidebar. (from the specific site only, of course.) Since the hot questions &quot;pool&quot; (as seen ) is limited to 100 for the whole network, either expand it or have the per-site list show questions with less hotness points - it would still be better than what we have now. Suppress black box at end of line Under TeX, when I write a line too long, it prints a fat black box at the end of the line.  That is probably a feature, but I dislike it.  How to turn that OFF? Is there a command-line option or something else?   I usually use LaTeX, but I have a complicated file which happens to be plain TeX. My Ubuntu laptop which was working fine until recently. My desktop disappeared and all the desktop icons are gone. All I have access to is the terminal. In an attempt to fix the problem, I installed GNOME but it made the computer give the error:     Warning! Failed to connect to lvmetad. No such file or directory Falling back to internal scanning.    I can press Ctrl+Alt+F1 to start tty1 but I can't get to a graphical user interface. What did I do wrong and how do I fix it?.  The operating system is ubuntu Linux Ubuntu 14.04 System Logging LWC Navigation: "this[f.NavigationMixin.Navigate] is not a function" When attempting to use the Lightning navigation service in my component's base class (.js), I get the following error when functionally testing in the UI:  this[f.NavigationMixin.Navigate] is not a function  I am calling the NavigationMixin function provided by the lightning/navigation module. I have imported the module: import { NavigationMixin } from 'lightning/navigation';  And am calling the function as below: this[NavigationMixin.Navigate]({     type: 'standard__recordPage',     attributes: {         recordId: this.org.Id,         objectApiName: 'Account',         actionName: 'view'     } }); Proposition      Let $\mathcal{P_e}$ be the set of functions $p_e(x) = a_o + a_2x^2 +  \cdots + a_{2n}x^{2n}$, $p_e : \mathbb{R} \to \mathbb{R}$      Show that all $f:[0,1]\to\mathbb{R}$ can be uniformly approximated by   elements in $\mathcal{P_e}$   Attempt:    Since we are talking about polynomials let's try play with Weierstrass Theorem  By definition $\mathcal{P_e}$ is dense in  $C^0([0,1], \mathbb{R})$ , if for every funciton $f \in C^0([0,1], \mathbb{R})$, $\exists p_e \in \mathcal{P_e}$ such that $\forall \epsilon &gt; 0, \forall x \in [0,1], ||p_e-f||&lt; \epsilon$  So we want to show $\|p_e - f\| &lt; \epsilon$  Try something like...since every continuous function is approximated by polynomials i.e. $\forall \epsilon &gt; 0,\ \|f - p\| &lt; \epsilon$, therefore let $p$ be a polynomial, $p = a_0 + a_1x + a_2x^2 + a_3x^3 + \cdots$  $$\|p_e - f\| \leq \|f - p\| + \|p - p_e\|$$  $$\Rightarrow \|p_e - f\| &lt; \epsilon + \|p_o\|,$$ where $p_o$ is an odd polynomial  $$\Rightarrow \|p_e - f\| &lt; \epsilon + \sup_x|a_1+a_3+\cdots+a_{2_n+1}|$$  Stuck.   In any case, $p$ and $p_o$ is poorly defined. What would be the standard approach to prove the proposition? Short example of regular expression converted to a state machine? Why is the application of probability in QM fundamentally different from application of probability in other areas? fake proof of $\forall a. \forall b. a = b \to 1 = 0$ I saw a less formal version of this fake proof that claimed to prove $2=1$ but because it assumed $a=b$ from the start I knew why it was wrong. It does seem however that the proof can be used to prove an certain implication I find very odd however. Clearly $\forall a. \forall b. a = b \to 0 = 1$ is false because I could pick $a$ and $b$ to be $1$ and then I would have derived 0 = 1 with no other conditions. So there must be something wrong with this proof that I am not seeing.  proof of $\forall a. \forall b. a = b \to 0 = 1$:  $a = b \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, (assume)\\ a+a=a+b  \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, (x=y \to f(x) = f(y), f(x)=a+x)\\ 2a=a+b \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,  (a+a=2a)\\ 2a-2b=a+b-2b \,\,\, (x=y \to f(x) = f(y), f(x)=x-2b)\\ 2(a-b)=a+b-2b \,\, (distributive)\\ 2(a-b)=a-b \,\,\,\,\,\,\,\,\,\,\,\,\,\, (-b=b-2b)\\ 2=1 \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, (x=y \to f(x) = f(y), f(x) =x/(a-b))\\ 1=0 \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, (x=y \to f(x) = f(y), f(x) =x-1) $  now that I have "proven" $\forall a. \forall b. a = b \to 0 = 1$ I can now pick a and b to be 1.  $ 1 = 1 \to 1=0 \,\,\,\,\,\, (a=1, b=1, above)\\ 1 = 1 \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, (\text{reflexivity})\\ 1=0 \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, (\text{modus ponens}) \\ $  So now it seems that I have managed to derive $1=0$. Clearly I messed up given that no one has been able to show $ZFC$ inconsistent and ostensibly this fits well within the most studied aspects of $ZFC$. Either that or a random guy that makes meme's online found the most profound result in mathematics ever.  So where have I missed the mistake? Mandatory excerpt for custom post type Just received ~70 unsolicited password reset mails from Super User, so abusive... Align equation left Inverse public-key encryption I'm in the need of an inverse public-key encryption method where you encrypt with the private key and decrypt with the public key. In other words an asymetric encryption where you can't generate the encryption key from the decryption key. Does such encryption exist? If yes which, and which would be the fastest?  If nothing like that exists I would be glad if you helped me out with my situation:    I need to authenticate users logging in from my Java application in the way that the response from the server cannot be falsified and thus giving the user full access to the application. Using public key encryption was an obvious method, I would decrypt data received from the client to confirm the credentials. This won't work because if someone manages to decompile and get the private key from the code, they would be able to generate the public key, which would make them able to crack my application again. So any ideas how I can get this secure? I have an Ubuntu 14.04 server that has no external monitor connected.  I use NoMachine to remote control the machine.  When I do so, the Unity/Gnome interface doesn't see any monitors connected, so I can only use 800x600 when connecting with NoMachine.  If I plug in a monitor, I can set the resolution to whatever size the NoMachine window is on the remote computer.  Is there a way to create a "fake" monitor device on Ubuntu so I can set a desktop resolution in Unity/Gnome? Unable to locate package kubuntu-plasma5-desktop on 14.04 I am attempting to install kubuntu-plasma5-desktop on Kubuntu 14.04 amd64, following    sudo apt-add-repository ppa:neon/kf5 sudo apt update sudo apt install project-neon5-session project-neon5-utils project-neon5-konsole  sudo apt-add-repository ppa:kubuntu-ppa/next sudo apt-add-repository ppa:ci-train-ppa-service/landing-005 sudo apt update sudo apt install kubuntu-plasma5-desktop   Unable to locate package kubuntu-plasma5-desktop  How can I fix this error?