char temp1[4] = "abc"; char *temp2 = "123"; strcpy(temp1,temp2);   if I want to copy a string literal to an array, it works well, but if I do it in the opposite way, I get an error:  char temp1[4] = "abc"; char *temp2 = "123"; strcpy(temp2,temp1);   The feedback from compiler is "Segmentation fault".  So what's the differences? Is there anyway to copy a string to a string literal?  Thx.
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.
How to trick windows 7 to use only a part of the screen Possible Duplicate:          I have a broken 20" LCD monitor which displays random pixels in the top 200 lines of pixels. I want to limit the display in such a way that when I maximize a window it will not be in the bad area and to limit the cursor position so it won't be in the bad area. Drop Tables with Bigger size We have a mysql database with a size of 2 TB, in which we have for to five big tables ranging from 110GB to 350GB. When we try to drop these tables the mysql goes to the defunct mode and hangs in that state for a long time. Is there a solution to drop these tables without mysql hanging. We have a machine which has a memory of 122GB and swap of 60 GB. We use an InnoDB Engine Hope the information suffices kindly help us with this issue Is one time pad cipher reuse and random key secure? I would like to make some changes to the core toolbar module across all my sites, and I don't want to modify the actual core's css.  It looks like I should be able to override the core css found in modules/toolbar/toolbar.css by simply copying this file into my sites directory at /sites/modules/toolbar/toolbar.css.  I tried doing this, cleared the Drupal cache, but nothing happened.  What am I missing? Postgres : Relation does not exist error Accurately simulating the lots of dice rolls without loops? OK so if your game rolls lots of dice you can just call a random number generator in a loop. But for any set of dice being rolled often enough you will get a distribution curve/histogram. So my question is there a nice simple calculation I can run that will give me a number that fits that distribution?  E.g. 2D6 - Score - % Probability  2 - 2.77%  3 - 5.55%  4 - 8.33%  5 - 11.11%  6 - 13.88%  7 - 16.66%  8 - 13.88%  9 - 11.11%  10 - 8.33%  11 - 5.55%  12 - 2.77%  So knowing the above you could roll a single d100 and work out an accurate 2D6 value. But once we start with 10D6, 50D6, 100D6, 1000D6 this could save a lot of processing time. So there must be a tutorial / method / algorithm that can do this fast? It is probably handy for stock markets, casinos, strategy games, dwarf fortress etc. What if you could simulate the outcomes of complete strategic battle that would take hours to play with a few calls to this function and some basic maths? Is it true that the order of $ab$ is always equal to the order of $ba$? In  (the original movie), Marty comes back from 1955 10 mins early to prevent Doc from being shot (which he fails at). He then rolls up to the Lone Pine Mall and sees himself hit 88 mph and shoot back to 1955 (again). Marty then carries on with this life as usual. What happens to the Marty that goes back to 1955 at the end of the film?  This obviously is a recursive problem where it would create another timeline and Marty would keep coming back 10 mins early to view another Marty zip back to 1955? Adding dynamic graphics to an animation Numbering side-by-side equations or inline equations Number of planks required to stop the bullet How do I uninstall Windows 8 and install Windows 7? I have a friend, who just got a new Toshiba Satellite C series with Windows 8. I tried to uninstall Windows 8 and install Windows 7 but was unable to do so.  I did everything I could:   Boot disk - would not load (error message Media -- Fail) Boot USB - would not load (error message Media -- Fail) Loading Windows 7 disk from system, fails with different errors   Does anybody know what I can do in order to install Windows 7? I am looking to identify a story that I read around 2001 (it is probably much older).  Someone showed me the story on pages printed from the internet, and it was attributed to Isaac Asimov (although I cannot state that is the true author).    The story is told in glimpses at different points of time in the future.  In each glimpse, humans are asking a more and more "intelligent" computer how to prevent the universe from collapsing into a singularity in the future, and the computer states it needs more computational power and resources to solve this problem.  At some point, man becomes one with the computer, and the computer exists in hyperspace (or subspace?).    In the final glimpse, it is the end of time and the universe is collapsing into a singularity.  At the instant the universe reaches the singularity, the computer figures out how to prevent it and says "Let there be light" and the universe begins to expand again.  Is anyone familiar with this story? What is the method for converting radians to degrees? I run into this occasionally and always forget how to do it.  One of those things that pop up ever so often.  Also, what's the formula to convert angles expressed in radians to degrees and back again? How to explain dropout regularization in simple terms? An entire function whose real part is bounded must be constant. Change the height of a function being plotted Let $N$ be a normal subgroup of $G$. Let $G/N = \{gN : g \in G \}$. Show that the $(G/N, \circ, 1_{G/N})$ is a group, where:  $\circ : G/N \times G/N \rightarrow G/N$ is defined by $(gN \circ hN) = ghN$ and $1_{G/N} = 1*N$.  Thanks for your help. Why too many capacitors in parallel for Vdd supply net? Can't we just add all to replace with one big capacitor? Prove $ \sin x + \frac{ \sin3x }{3} + ... + \frac{ \sin((2n-1)x) }{2n-1} >0 $ Prove that for $ 0&lt;x&lt; \pi $, $$ \quad S_n(x) = \sin x + \frac{ \sin3x }{3} + ... + \frac{ \sin((2n-1)x) }{2n-1} &gt;0 \quad \forall n = 1,2,... $$  Having trouble with this problem. This is an olympiad-style question, so an answer that doesn't use calculus or analysis would be preferred. A possible approach is induction, but for this we need to find a function in terms of $n$ and $x$ so that we can actually use the inductive step. If anyone has any ideas they would be appreciated.  If you really want to go down the calculus route (at this point I don't mind), then $ S_n' (x) = \cos x + \cos 3x + ... +\cos((2n-1)x) $ , which you can find a closed form for, but I don't know how useful that is.