I was trying to solve   When i create a char * and pass it into scanf:  char* input = ""; scanf("%s", input);   It behaves . However, when i change the definition and initalize 1000 chars to \0:  char input[1000] = { '\0' };   It behaves properly. Why is it that way?
The following code receives seg fault on line 2:  char *str = "string"; str[0] = 'z';  // could be also written as *str = 'z' printf("%s\n", str);   While this works perfectly well:  char str[] = "string"; str[0] = 'z'; printf("%s\n", str);   Tested with MSVC and GCC.
Strange grey bordering/outline in Illustrator I made a couple of vector shapes in AI and I get this strange thin border appearing around them. I can't get rid of it. Any suggestions?    Zoomed in: Why does the sum of the reciprocals of factorials converge to $e$? I've been asked by some schoolmates why we have $$ \sum_{n=0}^\infty \frac{1}{n!}=e.$$ I couldn't say much besides that the $\Gamma$ function, analytic continuation of the factorial, is defined with an integral involving $e$. Then I also know that actually $$ \sum_{n=0}^\infty \frac{x^n}{n!}=e^x.$$ Is there a reason for these facts?  P.S. I added the tag "intuition", please remove it if you think it is not pertinent. One of the most common gauges in QED computations are the $R_{\xi}$ gauges obtained by adding a term  \begin{equation} -\frac{(\partial_\mu A^{\mu})^2}{2\xi} \end{equation} to the Lagrangian. Different choices of $\xi$ correspond to different gauges ($\xi=0$ is Landau, $\xi=1$ is Feynman etc.) The propagator for the gauge field is different depending on the choice of gauge. The choice of Landau gauge forces $\partial_\mu A^\mu=0$, but I have never seen a similiar statement for the other gauges. I would like to know what constraint on the gauge field is produced by the other covariant gauges. For instance, what is the constraint on $A_\mu$ when $\xi=1,2,3,...$ etc. Is it still $\partial_\mu A^\mu=0$ or something different (it seems like it should be different)? Tourism on Schengen business visa? I am an Indian citizen living in UK on a tier 2 visa. Recently, I have received Short stay Schengen visas (multiple entry, business trips for 1 year) for travelling to France. (Applied at French embassy Edinburgh)  Unfortunately, the tickets I have provided in my visa application needs to be cancelled as my business trip got cancelled. And I will be travelling for business probably after 4 months.  So, for now, I am planning my first entry to France for tourism purpose.  Is it okay to travel with Short stay Schengen visas (business) for tourism purpose for the very first entry to France?   I am worried because my itinerary provided for visa application is changed now. And moreover it is now for a tourism purpose. It's stated that the gradient of:  $$\frac{1}{2}x^TAx - b^Tx +c$$  is   $$\frac{1}{2}A^Tx + \frac{1}{2}Ax - b$$  How do you grind out this equation? Or specifically, how do you get from $x^TAx$ to $A^Tx + Ax$? I wonder whether there is any automatic way of determining (at least roughly) the Big-O time complexity of a given function?  If I graphed an O(n) function vs. an O(n lg n) function I think I would be able to visually ascertain which is which; I'm thinking there must be some heuristic solution which enables this to be done automatically.  Any ideas?  Edit: I am happy to find a semi-automated solution, just wondering whether there is some way of avoiding doing a fully manual analysis. Most games build on other games' successes and many are downright clones. Where is the limit of imitation before legal issues come into play? Is it down to literary or graphic work like characters and storyline that cause legal problems, or can someone actually claim to own gameplay mechanics?  There are so many similar clone games out there that the rules are probably very slack or nonexistent, but I'd like to hear the views of more experienced developers / designers. Capacitor Voltage Rating How to find the voltage rating of a capacitor after knowing the capacitance value.  Example, For a power supply, If the input voltage is 60V and output is 5V. The input capacitor(C1) value is 100uf and output capacitor value is 1000uf.  What is the voltage rating for both the capacitors and how to find them. Prove $\binom{n}{a}\binom{n-a}{b-a} = \binom{n}{b}\binom{b}{a}$ I want to prove this equation, $$ \binom{n}{a}\binom{n-a}{b-a} = \binom{n}{b}\binom{b}{a} $$ I thought of proving this equation by prove that you are using different ways to count the same set of balls and get the same result. But I'm stuck. Help me please.   (Presumptive) Source: Theoretical Exercise 1.14(a), P19, A First Course in Pr, 8th Ed, by S Ross. Would it be considered cheating to ask for homework help on the internet, if I openly acknowledge the help received? Cannot change lock screen background on Ubuntu 18.04 Before you mark the question as a duplicate, I read all of the posts regarding this, but nothing helped me. I'd like to change the background picture of the lock screen.    I changed the ubuntu.css and gdm3.css accordingly to   #lockDialogGroup {   background: #000000 url(file:///usr/share/wallpapers/minimalistic-gray_00323985.jpg);   background-repeat: no-repeat;   background-size: cover;   background-position: center; }   Which results in a change of the Background of the log in screen, not the lock screen. When I press super + L the screen containing time has the correct background. When I swipe it up to tipe in my password, the purple Ubuntu screen still appears. If I click to change the user, the log in screen appears with the right background. I have the same background picture enabled in gnome tweaks for desktop background and lock screen.   I'm running Ubuntu 18.04 GNOME on a TuXedo Laptop. And I use Communitheme - maybe thats the problem?  Any ideas why it doesn't work? (I rebooted multiple times, so that's not the problem.)  EDIT: The output of sudo nano /usr/share/gnome-shell/modes/ubuntu.json is  {     "parentMode": "user",     "stylesheetName": "ubuntu.css",     "enabledExtensions": ["ubuntu-dock@ubuntu.com", "ubuntu-appindicators@ubuntu.com"] } "Dangling Participles" My case here is that I was writing something for school, and my teacher explained an error which I really can't see. She referred to articles about &quot;dangling participles&quot;, which was previously unknown to me. I find it hard to relate the examples I've found about it to my situation. So this is a text I've written and the bold part is where the problem arises: (You could read only the bold part if you please)  Wandering, and lost in his thoughts, there is a deep despair occupying the mind of this man. He is barely aware of his surroundings, except for those few moments when the loud blissful voices break through the protective barriers, developed by his immense sadness and grave frustration, into his mind. ”How can they all possibly be so happy?” he thinks to himself. Staring blindly, with his head low, as he walks in a slow pace, whispering ”Mary, Mary, my Mary,” over and over again. Yesterday was her funeral. She had passed away from a severe type of cancer, at a relatively young age. It was his wife. They had been together since high school and were greatly attached to each other. Having spent nearly half his life by her side, we cannot but imagine his grief. Indeed, he could hardly picture a life without her. So, alone he roams in the midst of all the seemingly incessant cheering and noises, drowned by his sorrow.  Her comments on that part was:  we is slightly out of place here – see my comment below These few sentences are about him and his emotions, so ‘we’ seems out of place. If the sentence starts: ‘Having spent nearly half his life by her side’, the reader expects it to continue: ‘he’. After all we have not spent half our lives by her side.  Is she right? If so, could anyone try to explain why? What is C# analog of C++ std::pair? I'm interested: What is C#'s analog of std::pair in C++? I found System.Web.UI.Pair class, but I'd prefer something template-based.  Thank you! Let $a,b,c\in\mathbb{R}^*_+$, $abc=1$.  How can i show that $\left(a-1+\frac{1}b\right)\left(b-1+\frac{1}c\right)\left(c-1+\frac{1}a\right)\leq1$ ?  I got $\left(ab-b+1\right)\left(bc-c+1\right)\left(ca-a+1\right)\leq abc=1$, but i can't go any further ...  If i expand it :   $2-ab-\frac{b}a-c-ac-\frac{a}c-b+2a+\frac{2}a-bc-\frac{c}b-a+2b+\frac{2}b+2c+\frac{2}c-4$  Which gives using $c=\frac{1}{ab}$ :   $5ab-\frac{b}a-\frac{1}{ab}-a^2b+\frac{1}a+b+\frac{1}b-2$ Prove if $|z| < 1$ and $ |w| < 1$, then $|1-zw^*| \neq 0$ and $| {{z-w} \over {1-zw^*}}| < 1$ Prove if $|z| &lt; 1$ and  $ |w| &lt; 1$, then $|1-zw^*| \neq 0$ and $| {{z-w} \over {1-zw^*}}| &lt; 1$Given that $|1-zw^*|^2 - |z-w|^2 = (1-|z|^2)(1-|w|^2)$I think the first part can be proven by saying $|1-zw^*| = 0$ if and only if $zw^*$ = 1.  And given the conditions that cannot be true. However I don't know if this part is right. What is the best way to sort the results of a sql query into a random order within a stored procedure? SemanticImport vs Import differ on same CSV file? Firstly I do not want to round my numbers, I am using base 10 figures so excel should have no bother doing simple add and subtract.  A|  665.110000000000000000000000000000 B|  4.990000000000000000000000000000 C|  =a1+b1 D|  670.790000000000000000000000000000 E|  1,335.890000000000000000000000000000 F|  =e1-(c1+d1)   I should get -5 however F1  returns   -4.999999999999770000000000000000   It is a financial document therefore I want to avoid rounding, more to the point. Why should I need to? I've put cell formatting to Currency with 2 decimal placed and I will get the correct display value but for all calculations I will still get -4.9999...7 which leads to further errors with conditional formatting etc. Prevent ligatures in Safari (Mavericks/iOS7) via CSS Why is my profile image different? When I first signed up on a Stack Exchange site and got a profile image, it was this one (see my current user card I'm actually not sure what I look like any more):     Later, I got  and SEDE profiles, and my user image there was a different identicon. Because . I would have a picture of it, but that's the problem. ... Thanks to , I have a picture:     On those two sites, it changed from that purple one to this new one recently:   I don't know when the change happened exactly, but I KNOW I didn't change it (I don't know how to change it, otherwise I would have changed it to my main pink one).  Why did this change? Can I get my other icon back or will I be stuck with this new one?   Also, are the gravatars at Area 51 and SEDE securely generated?    After looking in my profile settings, I really confused (I am seeing my wrong avatar in more and more places since I first posted this.):        Seriously.......    What...?    (I'm using this , but be warned that they will try to IP block you after a certain number of requests to force you to pay... May look for a better alternative later.)