I am trying to pass file data form my form to a new PHP page. This is my html &lt;form id=&quot;upload_flv&quot; enctype=&quot;multipart/form-data&quot; action=&quot;upload_file.php&quot; method=&quot;post&quot; style=&quot;margin-bottom:0;&quot;&gt;     &lt;span id=&quot;uploader&quot;&gt;         &lt;label for=&quot;myFile&quot;&gt; &lt;/label&gt;         &lt;input name=&quot;MAX_FILE_SIZE&quot; value=&quot;&lt;?php echo (int) get_true_max_filesize(); ?&gt;&quot; type=&quot;hidden&quot; /&gt;         &lt;input name=&quot;mediafile&quot; id=&quot;myFile&quot; type=&quot;file&quot; /&gt;         &lt;input type=&quot;submit&quot; class=&quot;btn&quot;  name=&quot;submit&quot; id=&quot;upload_submit&quot; value=&quot;Step 2 &amp;rarr;&quot; class=&quot;btn&quot; /&gt;     &lt;/span&gt;     &lt;/form&gt;  this is my ajax function $(document).ready(function () {              $('form').submit(function (e) {                 e.preventDefault();                  var Filedata = $('form').serialize();                 //alert(Filedata);                  $.ajax({                      type: &quot;POST&quot;,                     cache: false,                     url: &quot;../../upload_file.php?PHPSESSID=&lt;?php echo session_id();?&gt;&quot;,                     data: {Filedata: Filedata},                      success: function (msg) {                         //alert(&quot;Success!&quot;);                         window.location = &quot;addvideo.php?step=2&quot;;                                              }                  });              });          });  How to get this file data on upload_file.php?
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?
How to get client's IP address using JavaScript? Locking a file in Python I'm trying to typeset a table that would have a header in the first row (I'm not looking for a different/better solution to adding a header, but for a fix to this solution. Thanks). I want to achieve this by having a multicolumn cell spanning all the columns of the first row. The problem is that if the text is too long, the column widths are uneven, with the last column accumulating excess width. I would expect all of the columns to be of approximately the same width (although I cannot find a decent source that would say they should), given the fact that all the text in the second row is of approximately the same width.  I find this behaviour quite puzzling and have no idea what the cause could be. I know I could perhaps remedy this by manually setting the column widths, but am curious as to how to fix this without doing that (I do not need or indeed want the columns to be of the same width, but roughly proportional to the length of their content), preferably but not necessarily by using the tabular environment only (some other conflict with the document class I am using).   What is it that I'm doing or assuming wrong? And why?  MWE:  \documentclass{article} \begin{document}  \begin{tabular}{ccccc} \multicolumn{5}{c}{This is a piece of text. The longer it is, the longer the last column.} \\  1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 \\ \hline \end{tabular}  \end{document}   Resulting table. Notice how the last column of the second row accumulates excess width. What is the spell save DC and spellcasting modifier for a Rogue with Magic Initiate? As a rogue I'm planning to take Magic Initiate with warlock class. The Magic Initiate feat says:     [...] Your spellcasting ability for these spells depends on the class you   chose: Charisma for warlock [...]    cantrip 1: Booming blade or Green flame blade cantrip 2: Minor illusion 1st-level spell: Hex    My stats bonuses are: STR : -3 | DEX +6 | INT 0 | WIS +1 | CHA +4 | prof : 4  Questions:   Green flame blade :      [...] The second creature takes fire damage equal to your spellcasting   modifier. [...]   What is my spellcasting modifier? 0 from INT as rogue or +4 from CHA as warlock?   Minor illusion :      [...] If a creature uses its action to examine the sound or image, the   creature can determine that it is an illusion with a successful   Intelligence (Investigation) check against your spell save DC. [...]   What is my spell save DC? 12 (8 + 0 from INT + 4 from prof) or 16 (8 + 4 from CHA + 4 from prof)? \section*[toc]{normal section title} not working for me So I came across this exercise: Show that if $Y$ is path-connected then the set of homotopy classes $[I,Y]$ of maps of $I=[0,1]$ into Y has a single point.   But I am confused here. If $Y=S^1$ then not all loops are homotopic! I mean, isn't true that $\pi_1(Y)\subset [I,Y]$? Or maybe I don't understand the set $[I,Y]$ well! How to find original community description Before joining a community you can easily see the community description. For example, for example before joining the Programming Puzzles &amp; Code Golf Stack Exchange you see the description:     Programming Puzzles &amp; Code Golf Stack Exchange is a question and   answer site for programming puzzle enthusiasts and code golfers.   However, after joining I can no longer see this description. I can go to the on-topic page and see a different description:     Programming Puzzles &amp; Code Golf is for programming contests and   challenges. We welcome questions from beginners and experts alike.   Yet, I cannot seem to find the original description anywhere. Is there a way to find the original description while being logged into a Stack Exchange site?  Based on Rene's answer, I can click the Tour link on each site, but StackOverflow (and maybe other sites) do not have a tour link. Instead, I'd have to go there by manually typing it in the address bar. Is there a reason that this has been removed from the Stack Overflow page? How did the Death Star move? In the Star Wars saga, one of the most iconic weapons of the Empire was the Death Star: a self sustained weapons platform the size of a moon, with the capacity to destroy a planet. in A New Hope, we see the first Death Star in close proximity to the planet Alderaan, holding the planet hostage as the Empire tries to deduce the location of the Rebel Alliance's headquarters. In Return of the Jedi, we see the second Death Star in "dry dock" over the forest moon of Endor as it is being constructed.  My question is: How did the Death Star move? I imagine a spherical space station the size of a moon would be utterly massive, requiring a massive amount of thrust to move it. If it was constructed in low orbit of an inhabited planet/moon, the gravitational field would be immense, consisting of the planet/moon's gravity, and the Death Star's own considerable gravity. Breaking that gravitational field would be a massive task, yet we see no thrusters or engines on either Death Star. Were they hidden, stored under the station's surface while not in use? Was the station towed by another vessel? I installed Ubuntu 17.10. Now I am having trouble with gksu:  $ gksu -dg synaptic No ask_pass set, using default! xauth: /tmp/libgksu-HgUjgQ/.Xauthority STARTUP_ID: gksu/synaptic/8760-0-alex-XPS-15-9530_TIME4974977 cmd[0]: /usr/bin/sudo cmd[1]: -H cmd[2]: -S cmd[3]: -p cmd[4]: GNOME_SUDO_PASS cmd[5]: -u cmd[6]: root cmd[7]: -- cmd[8]: synaptic buffer: -GNOME_SUDO_PASS- brute force GNOME_SUDO_PASS ended... Yeah, we're in... Unable to init server: Could not connect: Connection refused (synaptic:8767): Gtk-WARNING **: cannot open display: :1 xauth: /tmp/libgksu-HgUjgQ/.Xauthority xauth_env: (null) dir: /tmp/libgksu-HgUjgQ   If I don't use -g, the password dialog is disabled. So looks like a problem with creating a tty for root.  Any advice? How can I redefine \int to put a negative space after the integral sign, but keep the limits properly set? I'd like to modify the \int command such that it adds an automatic negative space, e.g. \! after the integral sign. Preferentially, I'd like to be able to not edit any of my code, so cleverly redefining \int seems like my best option. Unfortunately, naive implementations get the limits wrong:  \documentclass{article} \usepackage[intlimits]{amsmath} \usepackage{ifthen}  \newcommand{\diff}[2][]{   \ifthenelse { \equal {#1} {} }   {\ensuremath{\mathop{\mathrm{d} #2}}}   {\ensuremath{\mathop{\mathrm{d}^#1 #2}}} }  \begin{document}  This is what I would want: \begin{equation}  \int_0^\infty \mspace{-4mu}\diff[3]{\boldsymbol r} f(\boldsymbol r), \end{equation} but with this ``user code", containing no negative spacing explicitly: \begin{verbatim}  \int_0^\infty \diff[3]{\boldsymbol r} f(\boldsymbol r), \end{verbatim} which for comparison with the above gives: \begin{equation} \int_0^\infty \diff[3]{\boldsymbol r} f(\boldsymbol r), \end{equation}  mostly because this gives me the option to remove it or change the spacing when I see fit. \end{document}   Which results in: What's the best way of handling permissions for Apache 2's user www-data in /var/www? Has anyone got a nice solution for handling files in /var/www? We're running Name Based Virtual Hosts and the Apache 2 user is www-data.  We've got two regular users &amp; root. So when messing with files in /var/www, rather than having to...  chown -R www-data:www-data   ...all the time, what's a good way of handling this?  Supplementary question: How hardcore do you then go on permissions?  This one has always been a problem in collaborative development environments. How to write permutations as product of disjoint cycles and transpositions $$\sigma=\begin{pmatrix} 1 &amp; 2 &amp;3 &amp; 4&amp; 5&amp; 6&amp;7 &amp;8 &amp;9 &amp;10 &amp; 11 \\ 4&amp;2&amp;9&amp;10&amp;6&amp;5&amp;11&amp;7&amp;8&amp;1&amp;3    \end{pmatrix}$$  (1) I am asked to write this permutation in $S_{11}$ as a product of disjoint cycles and also as a product of transpositions.   (2) Also find the order of the element. Is this permutation even or odd?  I think these are the disjoint cycles  $E_{1}=(1,4,10)$, $\;\operatorname{order}E_1 =3$  $E_{2}= (3,9,8,7,11),\;$ $\operatorname{order}E_{2} =5$  $E_{3}=(5,6),\;$ $\operatorname{order}E_{3} =2$  $S_{11}$=  $E_{1} \cdot E_{2}\cdot  E_{3}$  The order of $\operatorname{order}E_{3}$ is even so the order of the permutation is even. Why are they asking this? And what is the significance of it being even or odd?  Transpositions – I have read this a couple times but the one example in my textbook is rather unclear, I am not sure what this means?  I think the transposition for $E_{1}$ is $(1,4)(1,10)$ but I'm not sure what this means. Equation's symbols or parameters description are shown below, however, the = and the details of parameter are not aligned.     I want to make a parameters list for a equation like this, in which symbols, = and detail information are aligned in terms of vertical position.  where    ...    P   =   notional permeability factor    N   =   number of waves    Sd  =   damage level    ...   A tabular environment will produce more spacing before and after text. So how to make the = vertical aligned?   The codes is provided:  \begin{equation} \frac{H_s}{\Delta D_{n50} } = 1.0~ P^{0.13}~ \left(\frac{S_d}{N} \right)^{0.2} \xi_m^P~ \sqrt{\cot \alpha} \end{equation} where:   $H_s$ = significant wave height, equal to the average of the highest 1/3 of the waves  $\Delta$  = relative buoyant density, equal to $\rho_r / \rho_w - 1$, where     $\rho_w$ is the water density  $D_{n50}$ = nominal  diameter defined in Equation (2)  $P$ = notional permeability factor  $S_d$ = damage level   $N$ = number of waves  $\xi_m$ = breaker parameter based on mean wave period $T_m$  $\alpha$ = slope angle Install python packages for specific python version I understand that in Ubuntu 14.04, you have access to both python 2.7.6 and python 3.4.0. When getting python packages through the command line, how do I make sure that I am installing packages meant for python 2.7.6 and not for python 3.4.0? What are some examples of induction where the base case is difficult but the inductive step is trivial? According to :     ...proofs by mathematical induction   have two parts: the "base case" that   shows that the theorem is true for a   particular initial value such as n = 0   or n = 1 and then an inductive step   that shows that if the theorem is true   for a certain value of n, it is also   true for the value n + 1. The base   case is often trivial and is   identified as such, although there are   cases where the base case is difficult   but the inductive step is trivial.   What are some examples of proofs by induction where the base case is difficult but the inductive step is trivial? Blending colors in photoshop and illustrator Why girth of Petersen Graph is five? (Proof) I want to know, what is the mathematical proof that shows the shortest cycle in Petersen Graph has length five? Proof by induction that $2 + 4 + 6 + \cdots + 2n = n(n+1)$ Why is $\arctan(x)=x-x^3/3+x^5/5-x^7/7+\dots$?  Can someone point me to a proof, or explain if it's a simple answer?  What I'm looking for is the point where it becomes understood that trigonometric functions and pi can be expressed as series.  A lot of the information I find when looking for that seems to point back to arctan. Violation of linearity assumption in Logistic Regression I built a logistic model with 7 continuous independent variable and 8 categorical (dummy) variables in R. I tested for the linearity assumption using the Box Tidwell test and all my variables show high significance.  I am wondering now, if the assumption is violated what it would mean for the coefficient estimates and if I still can run the model with caution.   I read about the approach of using regression splines but I am confused how I would determine those and interpret the model then.