So, I'm trying to POST using jQuery Ajax.   It's work fine if i don't use files upload.  How i get the multiple data uploaded and send it to server ?  Is it possible to do this..?  Thank in ADvance.  HTML :  &lt;form id="uploadimage" method="POST" enctype="multipart/form-data" action=""&gt;   &lt;input type="text" name="rsdtIncdSourceID"  id="rsdtIncdSourceID" &gt;   &lt;input type="text" name="rsdtTrnsId"  id="rsdtTrnsId" &gt;    &lt;input name="rsdtDescription" id="rsdtDescription" &gt;   &lt;select name="rsdtMsrsId" id="rsdtMsrsId"&gt;     &lt;option&gt;&lt;/option&gt;   &lt;/select&gt;   &lt;input type="file" id="input-file" required multiple&gt; &lt;/form&gt; &lt;button class="btn btn-xl  wow fadeInUp" id="btnPost"&gt;Process&lt;/button&gt;   JS :   $(function(){    var $rsdtIncdSourceID   = $('#rsdtIncdSourceID'); var $rsdtTrnsId         = $('#rsdtTrnsId'); var $rsdtMsrsId         = $('#rsdtMsrsId'); var $rsdtDescription    = $('#rsdtDescription'); var $rsdtFiles          = $('#input-file'); **// HOW TO GET THIS VALUE ?**   $('#btnPost').on('click', function(){      var match = {         rsdtIncdSourceID: $rsdtIncdSourceID.val(),         rsdtTrnsId: $rsdtTrnsId.val(),         rsdtMsrsId: $rsdtMsrsId.val(),         rsdtDescription: $rsdtDescription.val(),         rsdtFiles: $rsdtFiles.files[0],  **// HOW TO add THIS VALUE ?**     };      $.ajax({                 type:'POST',                  url:'http://xxxx:802/api/v1/transaction/matching/confirm',                 data: match,                 success: function(data, textStatus, jqXHR) {                     var userObj = JSON.parse(jqXHR.responseText);                     alert($rsdtDescription.val());                   },                 error: function(jqXHR, textStatus, errorThrown) {                     alert(textStatus);                   }      });  });    });
I would like to upload a file asynchronously with jQuery.     $(document).ready(function () {     $("#uploadbutton").click(function () {         var filename = $("#file").val();          $.ajax({             type: "POST",             url: "addFile.do",             enctype: 'multipart/form-data',             data: {                 file: filename             },             success: function () {                 alert("Data Uploaded: ");             }         });     }); }); &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"&gt;&lt;/script&gt; &lt;span&gt;File&lt;/span&gt; &lt;input type="file" id="file" name="file" size="10"/&gt; &lt;input id="uploadbutton" type="button" value="Upload"/&gt;     Instead of the file being uploaded, I am only getting the filename. What can I do to fix this problem?
I propose to let users vote on closing activities of moderators and other users with closevoting power.  Like this:       closed as exact duplicate by Michael Mrozek, waiwai933, Arjan, YOU, Yi Jiang 6 hours ago      This question covers exactly the same ground as earlier questions on this topic; its answers may be merged with another identical question.   Make it like this:     closed as exact duplicate by Michael Mrozek, waiwai933, Arjan, YOU, Yi Jiang 6 hours ago   fair/unfair close? [agree] [disagree]      This question covers exactly the same ground as earlier questions on this topic; its answers may be merged with another identical question.   Then the system will gather statistics and automatically grant more closing powers to those users who enjoy support of the community and revoke those powers from those mostly casting contradictory votes.  It would seem that granting the same powers to everybody has not resulted in balance but in public disorder. Perhaps it is reflective of American lifestyle (everybody has the right and means to shoot anybody), but it's not the best way to run a society by far.  What I'm trying to say is that while granting powers to everybody in advance is generous, the maturity to wheel these powers in a fair way must be proven. By introducing community feedback this assessment process can be automatized. Convert string to Title Case with JavaScript Methods to compute $\sum_{k=1}^nk^p$ without Faulhaber's formula As far as every question I've seen concerning "what is $\sum_{k=1}^nk^p$" is always answered with "Faulhaber's formula" and that is just about the only answer.  In an attempt to make more interesting answers, I ask that this question concern the problem of "Methods to compute $\sum_{k=1}^nk^p$ without Faulhaber's formula for fixed $p\in\mathbb N$".  I've even checked this  without finding what I want.  Rule #1: Any method to compute the sum in question for arbitrary $p$ is good, either recursively or in some manner that is not in itself a closed form solution.  Even algorithms will suffice.  Rule #2: I don't want answers confined to "only some values of $p$".  (A good challenge I have on the side is a generalized geometric proof, as that I have not yet seen)  Exception: If your answer does not generalize to arbitrary $p$, but it still generalizes to an infinite amount of special $p$'s, that is acceptable.  Preferably, the method is to be easily applied, unique, and interesting.  To start us off, I have given my answer below and I hope you all enjoy. WinError 32 error when trying to delete shapefiles with QGIS python Prove $R < ( 1 + (\sum |a_{i}|^{p} )^{q/p})^{1/q}$ for absolute value of polynomial zeros Let $X_1, \cdots, X_n$ be a random sample from the PDF: $f(x;\theta) = (\theta + 1) x^{\theta}$ with $0&lt;x&lt;1$ and $\theta &gt; -1$.  The likelihood function is: \begin{align} L(\theta) &amp;= f(x_1, \cdots, x_n; \theta) \mathbb{1}\{0&lt;x&lt;1\} \mathbb{1}\{\theta &gt;-1\}\\ &amp;= \prod_{i=1}^{n}{f(x_i ; \theta)}\mathbb{1}\{0&lt;x&lt;1\} \mathbb{1}\{\theta &gt;-1\}\\ &amp;= \prod_{i=1}^{n}{(\theta+1)x_i^{\theta}}\mathbb{1}\{0&lt;x&lt;1\} \mathbb{1}\{\theta &gt;-1\} \\ &amp;=(\theta+1)^n \left( \prod_{i=1}^n{x_i}\right)^\theta \end{align}  We look at the log likelihood $l(\theta)$ and take the derivative of this since it is easier to deal with and it is allowed because the log is monotonic:  \begin{align} l(\theta) = n\log(\theta+1) + \theta \left( \sum_{i=1}^n{\log(x_i)} \right) \end{align}  $\implies \frac{d}{d\theta} = \frac{n}{\theta+1} + \sum_{i=1}^n{\log(x_i)} = 0$  $\implies \hat{\theta}_{MLE} = -\frac{n}{\sum_{i=1}^n{\log(x_i)}} - 1$  However, this doesn't look right. Intuitive explanation for formula of maximum length of a pipe moving around a corner? For one of my homework problems, we had to try and find the maximum possible length $L$ of a pipe (indicated in red) such that it can be moved around a corner with corridor lengths $A$ and $B$ (assuming everything is 2d, not 3d):    My professor walked us through how to derive a formula for the maximum possible length of the pipe, ultimately arriving at the equation $L = (A^{2/3} + B^{2/3})^{3/2}$.  The issue I have is understanding intuitively why this formula works, and exactly what it's doing. I understand the steps taken to get to this point, but there's an odd symmetry to the end result -- for example, is the fact that $\frac{2}{3}$ and its inverse are the only constants used just a coincidence, or indicative of some deeper relationship?  I also don't quite understand how the formula relates, geometrically, to the diagram. If I hadn't traced the steps myself, I would have never guessed that the formula was in any way related to the original problem.  If possible, can somebody give an intuitive explanation as to why this formula works, and how to interpret it geometrically?    Here's how he found the formula, if it's useful:  The formula is found by finding the maximum possible length of the pipe by expressing the length in terms of the angle $\theta$ formed between the pipe and the wall, and by taking the derivative to find when $\frac{dL}{d\theta} = 0$, which is the minimum of $\frac{dL}{d\theta}$ and is therefore when $L$ is the smallest:  $$ L = \min_{0 \leq \theta \leq \frac{\pi}{2}} \frac{A}{\cos{\theta}} + \frac{B}{\sin{\theta}} \\ 0 = \frac{dL}{d\theta} = \frac{A\sin{\theta}}{\cos^2{\theta}} - \frac{B\cos{\theta}}{\sin^2{\theta}} \\ 0 = \frac{A\sin^3{\theta} - B\cos^3{\theta}}{\sin^2{\theta}\cos^2{\theta}} \\ 0 = A\sin^3{\theta} - B\cos^3{\theta} \\ \frac{B}{A} = \tan^3{\theta} \\ \theta = \arctan{\left( \frac{B}{A} \right)^{\frac{1}{3}}} \\ $$  At this point, we can substitute $\theta$ back into the original equation for $L$ by interpreting $A^{1/3}$ and $B^{1/3}$ as sides of a triangle with angle $\theta$ and hypotenuse $\sqrt{A^{2/3} + B^{2/3} }$:  $$ \cos{\theta} = \frac{A^{1/3}}{ \sqrt{A^{2/3} + B^{2/3} }} \\ \sin{\theta} = \frac{B^{1/3}}{ \sqrt{A^{2/3} + B^{2/3} }} \\ \therefore L = A^{2/3} \sqrt{A^{2/3} + B^{2/3} } + B^{2/3} \sqrt{A^{2/3} + B^{2/3} } \\ L = (A^{2/3} + B^{2/3}) \sqrt{A^{2/3} + B^{2/3} } \\ L = (A^{2/3} + B^{2/3})^{3/2} \\ $$  The equation for the formula for the maximum length of the pipe is therefore $L = (A^{2/3} + B^{2/3})^{3/2}$. I have looked in several different Fate games' rulebooks, including Fate Core, DFRPG, Atomic Robo, FAE, and Jadepunk, which all describe Boosts as temporary Aspects you get to invoke for free, one time, and which disappear after being invoked.  In the other "invoke for free" situation I'm aware of (on Aspects newly-created via the Create Advantage action), they aren't singled out as "temporary."  I looked in many books but I'm interested in Fate Core.  So I haven't been able to figure out whether Boosts need to be invoked immediately or they disappear, without having been invoked at all? I had a look at Knuth's The Art of Computer Programming, book 1. In chapter 1, section 1.2.2, exercise 25, he presents the following algorithm for calculating logarithm:  given $x\in[1,2)$, do the following:  L1: [Initialize] Set $y\leftarrow0$, $z\leftarrow x/2$, $k\leftarrow1$.  L2: [Test for end] If $x=1$, stop.  L3: [Compare] If $x-z&lt;1$, go to L5.  L4: [Reduce values] Set $x\leftarrow x-z$, $z\leftarrow x/2^k$, $y\leftarrow y+\log_b(2^k/(2^k-1))$, and go to L2.  L5: [Shift] Set $z\leftarrow z/2$, $k\leftarrow k+1$, and go to L2.  (The algorithm needs an auxiliary table which stores $\log_b2$, $\log_b(4/3)$, and so on, to as many values as the precision of the computer.  Then Knuth concludes: this exercise is to explain why the above algorithm will terminate and why it computes an approximation of $y=\log_b x$.  Well, I see that it works, but I am not able to explain why... Let's say I fire a bus through space at (almost) the speed of light in vacuum. If I'm inside the bus (sitting on the back seat) and I run up the aisle of the bus toward the front, does that mean I'm traveling faster than the speed of light? (Relative to Earth that I just took off from.) When is $(p - 1)! + 1$ a power of $p$? A friend asked me this question:     If $p$ is a prime, prove that $(p - 1)! + 1$ is a power of $p$ if and only if $p = 2, 3$ or $5$.   Clearly one direction is obvious, namely that $p=2,3,5$ implies $(p - 1)! + 1$ is a power of $p$.  The other direction is not clear to me. Since by Wilson's theorem $p$ divides $(p - 1)! + 1$ so we need to show that if there are no other prime factors then $p=2,3,5$. Can someone give me a hint for establishing this?  Thanks How to connect to a MS Access file (mdb) using C#? How do I extract all the external links of a web page and save them to a file? How do I extract all the external links of a web page and save them to a file?  If you have any command line tools that would be great. Automorphisms of the complex plane How can it be shown that $$Aut(\mathbb{C})=\{f|f(z)=az+b,a\neq 0\},$$ where an automorphism of $\mathbb{C}$ is defined as a bijective entire function with entire inverse?  If $f$ is of the form $f(z)=az+b$, with $a\neq 0$, then obviously $f$ is in $Aut(\mathbb{C})$. How can I prove the converse? Making an Emission shader emit a different colour of light than the colour assigned to the object? Do sets, whose power sets have the same cardinality, have the same cardinality? Is it generally true that if $|P(A)|=|P(B)|$ then $|A|=|B|$?  Why? Thanks. How to initialize all members of an array to the same value? I have a large array in C (not C++ if that makes a difference). I want to initialize all members of the same value.  I could swear I once knew a simple way to do this. I could use memset() in my case, but isn't there a way to do this that is built right into the C syntax? Can I run out of disk space by creating a very large number of empty files? It is well-known that empty text files have zero bytes:    However, each of them contains , which according to my research, is stored in , and do use space.   Given this, it seems logical to me that it is possible to fill a disk by purely creating empty text files. Is this correct? If so, how many empty text files would I need to fill in a disk of, say, 1GB?    To do some checks, I run df -i but this apparently shows the % of inodes being used(?) rather than how much they weigh.  Filesystem             Inodes  IUsed    IFree IUse% Mounted on udev                   947470    556   946914    1% /dev tmpfs                  952593    805   951788    1% /run /dev/sda2            28786688 667980 28118708    3% / tmpfs                  952593     25   952568    1% /dev/shm tmpfs                  952593      5   952588    1% /run/lock tmpfs                  952593     16   952577    1% /sys/fs/cgroup /dev/sda1                   0      0        0     - /boot/efi tmpfs                  952593     25   952568    1% /run/user/1000 /home/lucho/.Private 28786688 667980 28118708    3% /home/lucho Why does Skynet take prisoners? In the Terminator franchise, extermination camps are often mentioned. But from a machine-logic POV, wouldn't it make more sense to just kill all humans on sight, period? Or herd them into small areas and nuke them? (even today's military electronics are hardened against EMPs and Skynet wouldn't care about the environment.)   IIRC, the reasoning behind ghettoization / concentration camps / extermination camps / gas "showers" is to misdirect or mislead people both inside and outside the country as to what was really going on. But Skynet doesn't have to worry about bad publicity, and can manufacture all the free labor it needs. Is there any in-universe explanation for keeping large groups prisoners? Run multiple Python scripts in Blender from the command-line I have 8 python scripts and I need to lunch them at once. For one script, I used   blender --background --python script1.py   for the eight scripts, I tried this command but it does not work.  blender --background --python *.py