How can I download my div as an image? (In JavaScript, Jquery or PHP)  I have a simple HTML code:  &lt;div id="downloadThis"&gt;   &lt;div style="width: 200px; height: 100px; background: red"&gt;&lt;/div&gt;   &lt;div style="width: 200px; height: 100px; background: blue"&gt;&lt;/div&gt; &lt;/div&gt; &lt;button id="downloader" onClick="download('downloadThis')"&gt;Download&lt;/button&gt;   And I want to download it as an image:  &lt;script&gt;   function download(id){     document.getElementById(id).downloadAsImage("jpeg");   } &lt;/script&gt;
Is it possible to to take a screenshot of a webpage with JavaScript and then submit that back to the server?  I'm not so concerned with browser security issues. etc. as the implementation would be for . But is it possible?
For fixed $z_i$s inside the unit disc, can we always choose $a_i$s such that $\left|\sum_{i=1}^n a_iz_i\right|<\sqrt3$? Let $z_1,z_2,\ldots,z_n$ be complex number such that $|z_i|&lt;1$ for all $i=1,2,\ldots,n$. Show that we can choose $a_i \in\{-1,1\}$, $i=1,2,\ldots,n$ such that $$\left|\sum_{i=1}^n a_iz_i\right|&lt;\sqrt3.$$ Prove that if a function $f: X\to Y$ continuous then its graph is closed What is the expression on RegularExpressionValidator to check if the Textbox text is 6 or more characters long? Quickly create a large file on a Linux system How can I quickly create a large file on a Linux () system?   will do the job, but reading from /dev/zero and writing to the drive can take a long time when you need a file several hundreds of GBs in size for testing... If you need to do that repeatedly, the time really adds up.  I don't care about the contents of the file, I just want it to be created quickly. How can this be done?  Using a sparse file won't work for this. I need the file to be allocated disk space. Idiom/Phrase for "results without work/effort" I'd be greatly appreciative of a cleverly devised idiom/phrase that depicts the following concept:     Results without work/effort.   ...and/or...     My Work/Effort; Your Result.   Any idioms/phrases you can recount or conceive would be of use.    Contextual Edit:  The idiom/phrase should be in the context of service offering/hiring or task delegation, not free-loading as most answers thus far have understandably assumed. E.g.     [You hire me for] My Work/Effort; [My work/effort produces] Your   Result. Is there any significant difference between Nikon and Canon? I already read it from manual but I can't see difference..  su - change user ID or become superuser  sudo -s [command]   The -s (shell) option runs the shell specified by the SHELL environment variable if it is set or the shell as specified in passwd(5).  If a                    command is specified, it is passed to the shell for execution.  Otherwise, an interactive shell is executed.  sudo -i disappear description in manual If I have an IEnumerable like:  string[] items = new string[] { "a", "b", "c", "d" };   I would like to loop thru all the pairs of consecutive items (sliding window of size 2). Which would be   ("a","b"), ("b", "c"), ("c", "d")   My solution was is this       public static IEnumerable&lt;Pair&lt;T, T&gt;&gt; Pairs(IEnumerable&lt;T&gt; enumerable) {         IEnumerator&lt;T&gt; e = enumerable.GetEnumerator(); e.MoveNext();         T current = e.Current;         while ( e.MoveNext() ) {             T next = e.Current;             yield return new Pair&lt;T, T&gt;(current, next);             current = next;         }     }   // used like this :  foreach (Pair&lt;String,String&gt; pair in IterTools&lt;String&gt;.Pairs(items)) {     System.Out.PrintLine("{0}, {1}", pair.First, pair.Second)  }   When I wrote this code, I wondered if there are already functions in the .NET framework that do the same thing and do it not just for pairs but for any size tuples.  IMHO there should be a nice way to do this kind of sliding window operations.  I use C# 2.0 and I can imagine that with C# 3.0 (w/ LINQ) there are more (and nicer) ways to do this, but I'm primarily interested in C# 2.0 solutions. Though, I will also appreciate C# 3.0 solutions. Topological/Geometrical justification for $\text{CFT}_2$ being special It is known as a fact that conformal maps on $\mathbb{R}^n \rightarrow \mathbb{R}^n$ for $n&gt;2$ are rotations, dilations, translations, and special transformations while conformal maps for $n=2$ are from a much wider class of maps, holomorphic/antiholomorphic maps. I was wondering to know if there is any topological or geometrical description for this.   To show what I mean, consider this example: in $\mathbb{R}^n$ for $n&gt;2$ interchanging particles can only change the wave function to itself or its minus. It is related to the fundamental group of $\mathbb{R}^n-x_0$ ($x_0$ is a point in $\mathbb{R}^n$ and $\pi_1(\mathbb{R}^n-\{x_0\})=e$ for $n&gt;2$) but this is not true for $n=2$.   I want to know whether exists any topological invariant or just any geometrical explanation that is related to the fact that I mentioned about conformal maps on $\mathbb{R}^n$. Finding UMVUE of $\theta$ when the underlying distribution is exponential distribution Hi I'm solving some exercise problems in my text : "A Course in Mathematical Statistics".  I'm in the chapter "Point estimation" now, and I want to find a UMVUE of $\theta$ where $X_1 ,...,X_n$ are i.i.d random variables with the p.d.f $f(x; \theta)=\theta e^{-\theta x}, x\gt0$.   I know that $E(X_i)=1/\theta,$ for each $i$, and also have that $\bar{X}$ (or equivalently $\sum_1^n X_i$) is a complete sufficient statistic for $\theta$. But I cannot go any further here. Somebody can help me? Earlier, I voted to close  as off-topic.  The question has since been closed.  There is an , but it didn't show up in the list when I selected "off-topic".  The options were:   Meta Stack Overflow Server Fault Super User Webmasters Programmers   Questions:   Should Wordpress appear in this list? Are there any other sites that should appear in the list?   Should all non-beta sites appear in that list by default? When I'm editing a stack snippet, I often want to copy code from the original question into the snippet. But while the snippet editor is on display, there's no way to access the question, other than opening another tab/window. What I often do instead is copy all the code in the question to the clipboard, open the snippet editor, then paste it all in and revise it to what I want. But when the original code is poorly designed, that ends up being more work than just copying the bits and pieces that I want.  There could be a "View Question" button that pops up the question over the snippet editor and allows copying. Or maybe the Snippet Editor could be draggable and resizable, so you can reveal the question and copy from it; but this would require that it not be purely modal. To install the graphics driver I need to exit GUI / Gnome and go to the terminal. How can I do this in Ubuntu 18.04? Ctrl(STRG)+Alt+F1...F7 does not work, neither on the desktop, nor on the login screen... Blank screen after installing nvidia restricted driver In a simple battery + resistor circuit, what form of energy is lost from the electrons upon exiting the resistor? I will give this question a little context. Firstly, as I understand it, as soon as I "close the switch" on a circuit, electric current pretty quickly establishes a steady state where, at any given cross section along a wire, the average kinetic energy of that slice is both constant and equal anywhere along the wire. (Please correct me if I am misunderstanding).   If the average kinetic energy is constant anywhere throughout the wire in the circuit (which confuses me, as I would think that the electrons should all accelerate after exiting the resistor since they are no longer being impeded as much), that means that the average velocity is constant. So, in the example of a simple circuit with a battery of v Volts and a resistor of o Ohms, my question is the following:  Because a 'voltage drop' is known to occur across the resistor, what type energy is being "traded" to generate the heat that radiates from the resistor? I would think that the reflexive answer is "electrical energy"...hence the VOLTAGE drop (the sacrificed energy is clearly not kinetic, as the velocity is constant everywhere). However, I find this confusing. Does this mean that if I had a positive test charge, it would be easier for me to bring it to the beginning of the resistor as compared to bringing it to the end of the resister?     Further, if the correct answer IS "electrical energy", why exactly DOES electrical energy get "dissipated" as the electrons pass through the resistor? I always here the comment Oh! It's because all the electrons are running into densely packed crap which impedes their flow but that to me sounds like a reason for their KINETIC energy to be reduced. However, clearly that's not the case. So, ultimately, I guess the real question is:  **What goes on in the resistor that is literally removing electrical energy **. I am sure that this is a quantum mechanics question, but my quantum mechanics knowledge is not terribly strong. If I could get an answer that is devoid of crazy wave function equations, I would greatly appreciate it. Thanks! Positioning relative to page in TikZ How to determine which program is making a certain sound in windows 7? I'm experiencing an annoying "female robotic" sound effect saying "loading complete" at uncertain interval in windows 7.  I want to shut down that noise for good. To do that, I have to determine which program is making this sound. I tried to open the "sound mixer" window, only to find to program last made any sound, one is official GTalk client, one is system sound. I tried to close GTalk and the sound still existed.  I started experiencing this issue not long after I installed a "driver" program for Rapoo E9198 wireless keyboard. I'm looking to have cell borders automatically applied when a cell is not empty. I thought I could use conditional formatting for this, but it doesn't seem to be an option. How do I delete a board when the admin is no longer part of the group? One of our programmers decided to leave us. We took him off the group, but his board that he is the only admin of is still hanging around. How do I remove it? If nonempty, nonsingleton $Y$ is a proper convex subset of a simply ordered set $X$, then $Y$ is ray or interval? This is from Exercise 7 in p. 92 in Munkres's Topology.  Except for the trivial cases such as $Y$ is empty set or singleton, it seems if $Y$ is convex in an simply ordered set $X$ then $Y$ is interval or ray.  But I cannot start my proof because I cannot use $\sup$ or $\max$ functions.  What should I do?