Problems converting Javascript canvas to PNG I have this program which draws the Mandelbrot sets onto a canvas, and even does some creative things with the concept of it. I want this program to automatically save this canvas to my downloads folder once it's done as a .PNG file. I tried looking around this website for some help and the best thing I was able to find and somewhat understand enough to apply to my program is this:  var image = c.toDataURL("image/png").replace("image/png", "image/octet-stream"); window.location.href = image;   Where 'c' is the canvas. While this does save the image to my downloads folder, it doesn't actually store it as a PNG file. As far as I'm able to grasp it doesn't specify a filetype at all since properties of these files tell me the filetype is 'Bestand' which I'm sure is just the Dutch translation for 'file'. Does anyone know how to directly store this as a PNG file? Note: I tried opening the images in Paint and that does seem to be able to read the file. It seems to me the image is correctly saved but no filetype is specified, nor is a name of the file given at all.
Is there any way to specify a suggested filename when using data: URI? If for example you follow the link:  data:application/octet-stream;base64,SGVsbG8=  The browser will prompt you to download a file consisting of the data held as base64 in the hyperlink itself.  Is there any way of suggesting a default name in the markup?  If not, is there a JavaScript solution?
Is infinity a real number? Is infinity a real number?  If not, why not?  I want some very good arguments.   Thanks.  $$\rightarrow\leftarrow\Huge\Huge\Huge\boldsymbol\infty$$ In An Introduction to Statistical Learning (James et al.), in section 3.7 exercise 5, it states that the formula for $\hat{\beta}_1$ assuming linear regression without an intercept is  $$\hat{\beta}_1 = \dfrac{\displaystyle\sum\limits_{i=1}^{n}x_iy_i}{\displaystyle \sum\limits_{i=1}^{n}x_i^2}\text{,}$$ where $\hat{\beta}_0 = \bar{y}-\hat{\beta}_1\bar{x}$ and $\hat{\beta}_1 = \dfrac{\displaystyle S_{xy}}{S_{xx}}$ are the usual estimates under OLS for simple linear regression ($S_{xy} = \displaystyle\sum\limits_{i=1}^{n}(x_i - \bar{x})(y_i - \bar{y})$).  This is not the actual exercise; I am merely wondering how to derive the equation. Without using matrix algebra, how do I derive it?   My attempt: with $\hat{\beta}_0 = 0$, we have $\hat{\beta}_1 = \dfrac{\bar{y}}{\bar{x}} = \dfrac{S_{xy}}{S_{xx}}$.  After some algebra, it can be shown that $\displaystyle S_{xy} = \sum\limits_{i=1}^{n}x_i^2 - n\bar{x}\bar{y}$ and $\displaystyle S_{xx} = \sum\limits_{i=1}^{n}x_i^2 - n\bar{x}^2$. From here, I'm stuck. Is there a way to separate variables between multiple notebooks? What is the actual mechanism behind the reflection of various colored light by material of different color? When light (composed of photons with different frequency and wavelength) falls on a material, some of it gets absorbed and some get reflected depending upon the color of the material on which it strikes. And the material reflects the light of its own color only, thereby absorbing all the other colored light. So, my questions are:  How would a photon with certain wavelength (say 400 nm) decide to get reflected after striking the material of red color?   What is the actual mechanism behind the reflection of various colored light by the material of different color? Android SQLite database: slow insertion How to change an application icon programmatically in Android? There was a foolish (in my opinion) question asked on Scifi.SE       James bond keeps returning with a different face, albeit usually a similar one, and often operates with high-tech gadgetry that seem to be on par with the Doctor's sonic screw driver.   In my opinion each new actor represents a reboot of the franchise using the new face, not a continuation of the story.   Is there any continuity between versions of James Bond which change actors? I'm not talking about characters like M or Q, I'm talking about events or past advisories being referenced in a different Bond movie where the main actor was someone else. Where do I ask where to ask? If I have a specific question I want to ask about, but I don't know which Stack Exchange site would be on topic for asking that question, where can I ask where to ask that question?  Is there any generic place where we can ask for advice? Is it here?  This is not about a specific question but in general.  For example: "Where should I ask for advice about fishing?", or if I need to know where I should ask "What would be the best fishing rod to fish for salmon?" (regardless of how good/bad these examples are) I am a Canadian citizen, and I intend to travel to the US for a student clinical elective at a university in Texas for the months of September and October. The university will help me obtain an F-1 status. However, I want to attend a few conferences and educational seminars which are being held in November/December for which I will be using a B1/B2 visa.  Will I have to leave the US and come back in November using a B1/B2 visa, or is there another way to change my visa status, or can I apply for both visas upon entering the US? Gravitational wave solutions to the Einstein field equations It is well known that general relativity predicts gravitational waves, but I would like to know how. What solution(s) to the Einstein field equations yield something which can be interpreted as a wave(-like) phenomenon? Subdivision surface modifier creates pinching at corners I've only been 3D modelling for a few days now, so this may just be a newbie mistake:  However, because this model is for use in a game I am trying to stay away from proximity loops for performance reasons. Instead, I have used edge creases to maintain the structure of the model. It has led to certain vertices not being affected by the subsurf modifier, causing undesirable lighting at high subsurf levels.  Manually moving each point in a bit seems kind of sloppy but I'm not too sure what the best way to go about this is.  If any more information is needed I'll give what I can, thanks in advance :) Prove that for any infinite poset there is an infinite subset which is either linearly ordered or antichain. I used to do a full factory wipe then flashed a stock firmware with Odin, that helped me get back to having access to my mobile network then I flashed to Resurrection Remix 5.5.3 and lost access to my mobile network (Emergency Calls Only) I checked my IMEI and it appears to be valid. I didn't backup my /efs I didn't do anything to it. What seems to be the solution? I have a Samsung Galaxy S3 (I-9300) Why isn't Higgs coupling considered a fifth fundamental force? When I first learned about the four fundamental forces of nature, I assumed that they were just the only four kind of interactions there were. But after learning a little field theory, there are many other kinds of couplings, even in the standard model. So why isn't the Yukawa Higgs coupling considered a fifth fundamental force? To be a fundamental force, does there need to be a gauge boson mediating it? Add a property to a JavaScript object using a variable as the name? What is the yield keyword used for in C#? In the  question one of the answers had the following code snippet:  IEnumerable&lt;object&gt; FilteredList() {     foreach(object item in FullList)     {         if(IsItemInPartialList(item))             yield return item;     } }   What does the yield keyword do there?  I've seen it referenced in a couple places, and one other question, but I haven't quite figured out what it actually does.  I'm used to thinking of yield in the sense of one thread yielding to another, but that doesn't seem relevant here. How can one use multi threading in PHP applications Is there a realistic way of implementing a multi-threaded model in PHP whether truly, or just simulating it. Some time back it was suggested that you could force the operating system to load another instance of the PHP executable and handle other simultaneous processes.  The problem with this is that when the PHP code finished executing the PHP instance remains in memory because there is no way to kill it from within PHP.  So if you are simulating several threads you can imagine whats going to happen.  So I am still looking for a way multi-threading can be done or simulated effectively from within PHP. Any ideas? Autosegmental Representation in tikz-qtree This is what I want to achieve    and this:    But all I've been able to make with tikz-qtree is the following:  \documentclass[12pt,a4]{article} \usepackage[utf8]{inputenc} \usepackage{tipa,tikz,tikz-qtree} \begin{document}  \begin{tikzpicture} [baseline] \tikzset{frontier/.style={distance from root=90pt}} \Tree [.$\sigma$ [.O [ p ] ] [.R [.$\mu$ a ] [.$\mu$ : ] ] ] \end{tikzpicture} \begin{tikzpicture} [baseline] \tikzset{frontier/.style={distance from root=90pt}} \Tree [.$\sigma$ [.O [ p ] ] [.R [.$\mu$ a ]  ] ] \end{tikzpicture}   And this:  \begin{tikzpicture}[baseline] \tikzset{frontier/.style={distance from root=90pt}} \Tree [.$\sigma$ [.O [ l ] ] [.R [.$\mu$ a ] [.$\mu$ l ] ] ] \end{tikzpicture} \begin{tikzpicture} [baseline] \tikzset{frontier/.style={distance from root=90pt}} \Tree [.$\sigma$ [.O [ : ] ] [.R [.$\mu$ a ] [ l ] ] ] \end{tikzpicture} \end{document}   Which renders:    and    The important part here is the linking from the leaves to more than one parent (it would be nice if I had the option of making the line dashed too). Now, pst-asr doesn't quite achieve what I want it to. It's important that I have the moras ('mu's). (Also it's a pstricks package, which means I must typeset it in DVIPSPDF.) I have tried a bit of the forest-package (especially forest-GP1), but I can't make that work as I want either. Lastly, some have recommended xyling, but I find that package very difficult to use.  Any recommendations?  Thanks. Pixel RGB with ImageMagick and Rails Integral involving Cosine function What will be the formula for the following:  $$\int_0^\infty \cos(x)dx.$$