I keep getting a segmentation error when I try to add a character to the string test.  I have tried multiple iterations and can't figure out why I get the error.  I tried having the test set to \0.  I can't figure out how I am accessing outside test.  #include &lt;stdio.h&gt; #include &lt;cs50.h&gt; #include &lt;ctype.h&gt; #include &lt;string.h&gt;  #define _XOPEN_SOURCE #include &lt;unistd.h&gt; #include &lt;crypt.h&gt;  //this intializes the argument count and argument vector int main(int argc, string argv[]) {     //this makes sure it is a string     if (argv[1] != NULL) {         //this makes sure that the user typed 2 arguments,          //  the second being the keyword         if (argc != 2) {             printf("no hash inputed\n");             return 1;         }          //main program once the keyword has been verified         int h_len = strlen(argv[1]);          string hash = argv[1];         string test = "A";         int p_len = 0;         printf("H len is %i and P len is %i\n", h_len, p_len);         printf("%s and test: %s\n", hash, test);          //this will iterate through the 1st space and test the charachters         for (int j = 0; j &lt; 4; j++) {              //iterates through the characters that can be used in the  password             //for (int i = A; i &lt; z; i++)             //for (char ch = 'A' ; ch &lt;= 'z' ; ch == 'Z' ? ch = 'a' : ++ch )             for (char i = 'A'; i &lt;= 'z'; i++) {                 //this skips the ASCII inbetween Z and a                 if (i &gt; 'Z' &amp;&amp; i &lt; 'a') {                     i = 'a';                 }                 printf("%c", i);                  //test[j] = test[j] + (char)i;                 test = strncat(test, &amp;i, 1);                 printf("  test is %s\n", test);                 ...
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.
I'm trying to update my system using apt-get, but it's giving me this error  Err http://bd.archive.ubuntu.com raring Release.gpg          Could not connect to bd.archive.ubuntu.com:80 (116.193.170.18), connection timed out Err http://bd.archive.ubuntu.com raring-updates Release.gpg   Unable to connect to bd.archive.ubuntu.com:http: Err http://bd.archive.ubuntu.com raring-backports Release.gpg   Unable to connect to bd.archive.ubuntu.com:http: Reading package lists... Done W: Failed to fetch http://bd.archive.ubuntu.com/ubuntu/dists/raring/Release.gpg  Could not connect to bd.archive.ubuntu.com:80 (116.193.170.18), connection timed out W: Failed to fetch http://bd.archive.ubuntu.com/ubuntu/dists/raring-updates/Release.gpg  Unable to connect to bd.archive.ubuntu.com:http: W: Failed to fetch http://bd.archive.ubuntu.com/ubuntu/dists/raring-backports/Release.gpg  Unable to connect to bd.archive.ubuntu.com:http: W: Some index files failed to download. They have been ignored, or old ones used instead.   I am not a Ubuntu master but I can understand this is not a computer error. Any clues on how to fix it? which vectors are perpendicular to each other?  $\vec a = (1, -2, 3)$, $\vec b = (5, 4, 1)$, $\vec c = (1, 0, -5)$  Do i just take the dot product of 2 of them. If the dot product they are at $90^\circ$? But how do i know if there perpendicular? Convert a character digit to the corresponding integer in C java.lang.NoClassDefFoundError: org/apache/xpath/XPathAPI "24 hours' notice" or "24 hours notice"? Which one is correct?  1: Well, you canceled on Tuesday and our policy is 24 hours' notice for all cancellations. 2: Well, you canceled on Tuesday and our policy is 24 hours notice for all cancellations.  To me personally, the first one makes more sense grammatically. But I've also heard that the second version is how they typically write it on paper forms at hospitals (that's what native speakers say). Could you please clarify my confusion? Continuum between addition, multiplication and exponentiation? I noticed this  which attempts to find the shades of grey between a linear and log scale where results are between zero and one.  However, I was looking for the more general case where we find the continuum between the operators themselves - add, multiply, and exponentiation or even higher.  The function could be a hyperoperation$(n,x,y)$, where $x$ and $y$ are the numbers to operate on, and $n$ is allowed to be a non-integer number for the type of operator. So $n=1$ would be 'addition', $n=2$ would be multiplication, and $n=3$ would be exponentiation. But one would also have $n=2.5$ to be the shade of grey BETWEEN multiplication and exponentiation, or $n=3.5$ or $4$ for beyond exponentiation and tetration).  I want the formula to work with real numbers, not just integers. Any thoughts?  These related posts may also be of interest: Is using 15 amp components on a 20 amp breaker against code? Anonymous Types - Are there any distingushing characteristics? Is there anything to use, to determine if a type is actually a anonymous type? For example an interface, etc?  The goal is to create something like the following...  //defined like... public static T Get&lt;T&gt;(this IAnonymous obj, string prop) {     return (T)obj.GetType().GetProperty(prop).GetValue(obj, null); } //...  //And then used like... var something = new { name = "John", age = 25 }; int age = something.Get&lt;int&gt;("age");   Or is that just the beauty of an anonymous type? Nothing to identify it self because it takes a new shape?  Note - I realize that you can write an extension method for the object class, but that seems like a little overkill, in my opinion. How to reach local computer via machine name instead of IP? Developer here prototyping a mobile app, somewhat new to mobile:   I have a simple HTTP service running (currently) on my main laptop with machine name latitude. Another laptop named vaio sharing the same WiFi network can access that service via http://latitude:8080 -- in other words, it can easily resolve the (current) IP 192.168.x.y (or whatever dynamic IP it has at that moment) of latitude somehow. Now my HTC Android phones, connected to the same WiFi network, can reach the IP address of latitude so opening in its browser http://192.168.x.y:8080 works. But I'd like to use the machine name here, too, like when I access the HTTP service from vaio, simply by typing http://latitude:8080 and have the phone resolve the current dynamic IP of latitude. This doesn't work, only get the standard browser error page: "Webpage not available".   Is there some DNS setting in Android I need to tweak? Haven't found anything from playing around with Settings, and a question like this is notoriously hard to google, too...  The One V has Android 4.0, and the One M7 has Android 4.2 in case that makes a difference.  (Note, this should work even when the Android is not USB-connected to my computers and is not acting as a WiFi Hotspot -- obviously, since it's consuming my main WiFi network anyway). Baking with oven without bottom heating element My mom wants to do baking but her oven doesn't have bottom heating element. It only has an element on top, with a fan at the back.  She told me that she can't make me a good pizza or cake without it.  Is there any way around? jQuery Validate Plugin - How to create a simple custom rule? Positive operator is bounded For a real Banach space $X$ let $A:X\rightarrow X^*$ be a positive operator in the sense that $(Ax)(x)\geq 0$ for all $x\in X$. Show that $A$ is bounded.   I don't know how to do that, maybe it's an application of the closed graph theorem? What is the command that lets me see what and where devices are mounted?  I'm having trouble changing songs on my old iPod, and I have a feeling it's because of the mount point. Parallel website running a copy of my original website We have been working on a gaming website. Recently while making note of the major traffic sources, I noticed a website that I found to be a carbon-copy of our website. It uses our logo, and everything else the same as ours, but with a different domain name.   Their domain name is not however pointing to our site because at several places the links are like: carbonccopy-website/our-links. This website even has links to some images as: carbonccopy-website/our-images.   How could they have done that, and what can I do to stop it? So people have had similar problems showing colors on .ply files  and   but I don't think this is the same case.  I've exported a .ply file from a program called paraview with color info on it.  I've uploaded the file  and as you can see, the color info came with it.  But for whatever reason when I import it into blender and go look for the per-vertex color info where I would expect to find it, its empty:   Am I doing something wrong?  It seems like there had been a problem with impo but this is 2.81.  I would assume it was fixed? How to evaluate $\int_{0}^{2\pi}e^{\cos \theta}\cos( \sin \theta) d\theta$? For $\alpha \in \mathbb{R}$, define $\displaystyle I(\alpha):=\int_{0}^{2\pi}e^{\alpha \cos \theta}\cos(\alpha \sin \theta)\; d\theta$. Calculate $I(0)$. Hence evaluate $\displaystyle\int_{0}^{2\pi}e^{\cos \theta}\cos( \sin \theta)\; d\theta$.  Hint: To evaluate the integral that expresses $\displaystyle\frac{dI}{d\alpha}$, consider $\displaystyle\frac{\partial}{\partial \theta}(e^{\alpha \cos \theta}\sin(\alpha \sin \theta))$.  How do I do this question? I think this might have something to do with the Fundamental Theorem of Calculus, but I'm not sure.  I computed $\displaystyle I(0)=\int_{0}^{2\pi} d\theta=2 \pi$, and $\displaystyle I(1)=\int_{0}^{2\pi}e^{\cos \theta}\cos( \sin \theta) d\theta$. Following the hint I get  $$\begin{align} \frac{\partial}{\partial \theta}(e^{\alpha \cos \theta}\sin(\alpha \sin \theta)) &amp; =\alpha e^{\alpha \cos \theta} \sin (\alpha \sin \theta) + e^{\alpha \cos \theta}\cos(\alpha \sin \theta) \alpha \cos \theta \\ &amp; =  \alpha e^{\alpha \cos \theta} \sin (\alpha \sin \theta) + \frac{dI}{d \alpha} \cos \theta. \\ \end{align}$$  Is this correct so far?  The answers in the question referred as a duplicate does not help. I'm in a course dealing with real values, not complex. Pages: How to put a word between horizontal rules How can I make something that looks like this?  --------   Text   ---------  where the horizontal rules extend to the margin on either side? ContentVersion Content-Type I need to stream a file from Salesforce in our webapplication. To make sure the file is properly opened, I have to set Content-Type header.  How to retrieve the Content-Type (MIME) of a file?  I expect values like: image/png, application/pdf, text/html etc.  How to get these values? I am using the Java and a SOAP client to retrieve the data. How do I install the latest version of gcc and g++?  I am using a variety of C++11 and C++1y features; which is why I need this. Where is the "Manipulate Centers Only" button in Blender 2.8? I have looked just about everywhere on the Internet and I can't find the answer to this question. Where the hell is the "Manipulate Centers Only" button in Blender 2.8???? It's the the double arrow icon here:    I seem to have enabled it somehow and I can't scale or rotate my object.