I have a problem with outputstream, I have this Java Spring code:     @RequestMapping(value=&quot;/downloadZip&quot;, produces=&quot;application/zip&quot;) public void downloadZip(HttpSession session,HttpServletResponse response) throws IOException {     OutputStream out = response.getOutputStream();     FileInputStream in = new FileInputStream(FileManager.EXPORT_FOLDER + File.separator + FileManager.EXPORT_FILE);     byte[] buffer = new byte[4096];     int length;     while ((length = in.read(buffer)) &gt; 0){         out.write(buffer, 0, length);     }     in.close();     out.flush();     response.flushBuffer(); }  The &quot;file&quot; that i'm exporting it's a ZIP file with other two files in it. The thing is that I call from the front this api to download the zip file, and it downloads ok, but with no extension and with other name that i don't have in anywhere of the application, it's like, the FileManager.EXPORT_FILE name is &quot;FileToDownload.zip&quot; and when i download the file it's called &quot;file&quot; and that &quot;file&quot; name i don't have it anywhere and when i uncompress that file it's good, but i need the extension, any clues? Thanks a lot!
Web applications that want to force a resource to be downloaded rather than directly rendered in a Web browser issue a Content-Disposition header in the HTTP response of the form:  Content-Disposition: attachment; filename=FILENAME  The filename parameter can be used to suggest a name for the file into which the resource is downloaded by the browser.  (Content-Disposition), however, states in  (The Filename Parameter) that the file name can only use US-ASCII characters:     Current [RFC 2045] grammar restricts   parameter values (and hence   Content-Disposition filenames) to   US-ASCII.  We recognize the great   desirability of allowing arbitrary   character sets in filenames, but it is   beyond the scope of this document to   define the necessary mechanisms.   There is empirical evidence, nevertheless, that most popular Web browsers today seem to permit non-US-ASCII characters yet (for the lack of a standard) disagree on the encoding scheme and character set specification of the file name. Question is then, what are the various schemes and encodings employed by the popular browsers if the file name “naïvefile” (without quotes and where the third letter is U+00EF) needed to be encoded into the Content-Disposition header?  For the purpose of this question, popular browsers being:   Firefox  Internet Explorer  Safari Google Chrome  Opera
Indirect return of all elements in an array The Bash man page describes use of ${!a} to return the contents of the variable whose name is the contents of a (a level of indirection).  I'd like to know how to return all elements in an array using this, i.e.,  a=(one two three) echo ${a[*]}   returns  one two three   I would like for:  b=a echo ${!b[*]}   to return the same.  Unfortunately, it doesn't, but returns 0 instead.  Update  Given the replies, I now realise that my example was too simple, since of course, something like:  b=("${a[@]}")   Will achieve exactly what I said I needed.  So, here's what I was trying to do:  LIST_lys=(lys1 lys2) LIST_diaspar=(diaspar1 diaspar2)  whichone=$1   # 'lys' or 'diaspar'  _LIST=LIST_$whichone LIST=${!_LIST[*]}   Of course, carefully reading the Bash man page shows that this won't work as expected because the last line simply returns the indices of the "array" $_LIST (not an array at all).  In any case, the following should do the job (as pointed out):  LIST=($(eval echo \${$_LIST[*]}))   or ... (the route that I went, eventually):  LIST_lys="lys1 lys2" ... LIST=(${!_LIST})   Assuming, of course, that elements don't contain whitespace. How to cheat and avoid cheating in Flash games? Constructing primitive cell using information from ChemicalData text processing rows to columns for a block NOTE: I would appreciate it if you provided a hint and not the whole solution.  BdMO 2014 Nationals:     In acute angled triangle ABC, considering a portion of side BC as diameter a    circle is drawn whose radius is 18 units and it touches AB and AC side. Similarly,    considering a portion of sides AC and AB as diameters, two other circles are    drawn whose radii are 6 and 9 units respectively. What is the radius of the incircle    of ∆ABC?   The main problem with this  problem is that the figure is incredibly messy.So I drew one circle,and tried getting information from it.I noticed that if $O$ is a centre of one of the above (semi)circles,and if $O$ is located on $AB$, then $CO$ is an angle bisector.Therefore,if we connect all the vertices with the centres,their intersection would be the incentre.Then we need to drop a perpendicular from this point to get the inradius.But that hardly helps us.I have found some similar triangles in the figure.But that does not help me at all.  I have also tried backtracking.I tried to put myself in the problem-maker's shoes and tried to imagine what I would do if I had to create a problem like this.Unfortunately,I couldn't do it..  Any insightful comment,hint will be very much  appreciated. Suppose $f$ is entire and    $$\iint_\mathbb{C}|f(z)|^2dxdy &lt; \infty$$Prove that $f\equiv 0.$   So far I have:  Suppose $f$ is bounded.  Then $f$ is constant by virtue of Liouville and so the conclusion is obvious.  Thus, assume $f$ non-bounded.  Then  $$\Big|\iint_\mathbb{C}f^2(z)dA\Big| \leq \iint_\mathbb{C}|f(z)|^2dxdy &lt; \infty$$ We can parameterize \begin{align*} \iint_\mathbb{C}f^2(z)dA &amp;= \int_0^{\infty}\int_0^{2\pi}f^2(re^{i\theta})\;d\theta\;rdr \\ &amp;= \int_0^{\infty}\int_0^{2\pi}f^2(re^{i\theta})\;ire^{i\theta}[-i\frac{1}{r}e^{-i\theta}]d\theta\;rdr \\ &amp;= \int_0^{\infty}\oint_{C_R}f^2(z)\;[-i\frac{1}{z}]dz\;rdr \\ &amp;= \int_0^{\infty}2\pi r dr\frac{1}{2\pi i}\oint_{C_R}\frac{f^2(z)}{z}dz \\ \\ &amp;= 2\pi f^2(0)\int_0^\infty rdr  \end{align*}  Whence f(0) = 0.  And I have no idea where to go from there.  The "entire" bit seems to suggest Liouville but I have already dealt with the bounded case.  Please advise ... import os xp1 = "\Documents and Settings\" xp2 = os.getenv("USERNAME") print xp1+xp2   Gives me error   File "1.py", line 2  xp1 = "\Documents and Settings\"                                ^ SyntaxError: EOL while scannning single-quoted string   Can you help me please, do you see the problem? Is there some easy way to pad Strings in Java?  Seems like something that should be in some StringUtil-like API, but I can't find anything that does this. Can you help me with my software licensing issue? Forced to Quit PhD although the hard and proved work Is there a standard idiom for comparing version numbers?  I can't just use a straight String compareTo because I don't know yet what the maximum number of point releases there will be.  I need to compare the versions and have the following hold true:  1.0 &lt; 1.1 1.0.1 &lt; 1.1 1.9 &lt; 1.10 Does a monk's Unarmored Movement speed increase apply to the fly speed gained from a Fly spell? What Is Exponentiation? Some months ago, I linked to  in the CSS chat room and  in case anybody who cared happened to drop by:  In case anybody else noticed that  questions are now highlighted a little differently, I'm actively investigating this; here's the meta thread  It was unpinned quite some time ago by one of the other room owners. I don't need it anymore anyway since the issue has been . I notice, however, that it's still visible in the starred list, with the only regular (not pinned) star being my own:  When I try to click on the star to unstar it, chat thinks I'm trying to do otherwise and simply tells me I can't star my own messages. I can easily delete this message, but I'd very much like to unstar it instead, thankyouverymuch. How can I use $variable in a shell brace expansion of a sequence? I want to use $var in a shell brace expansion with a range, in bash. Simply putting {$var1..$var2} doesn't work, so I went "lateral"...   The following works, but it's a bit kludgey.    # remove the split files echo rm foo.{$ext0..$extN} rm-segments &gt; rm-segments source rm-segments   Is there a more "normal" way? The usual explanation for warm fluids rising past cooler ones is that the warmer fluid has a lower density.  I'm trying to understand what this looks like at a molecular scale.  The density seems to be a large-scale phenomenon, and I don't understand how it can affect whether a particular molecule rises or falls.  Consider a cylinder of fluid that is being heated at the bottom.  The molecules at the bottom have a higher average energy.  How does this result in the tendency of the warmer molecules at the bottom to move upwards past the cooler ones? What's a word for a positive kind of "envy" without the sense of resentment? Imagine your college buddy is now running a multi-billion dollar company, while you're still stuck at the same white-collar day job 5 years after graduation. You chat with him and want to express the idea that you're happy for him and fancy having his lifestyle--something like "I wish I could buy a yacht and cruise around the world like you do; I'm glad you're doing really well!"  Basically, it's the feeling of envy when you take out the resentment from it. Is there a word for it?   (I thought about "admire", but found it too strong and broad) I have a windows 7 user who belongs to admin group. I want to execute sc command that requires admin privileges. I DON'T want to open an elevated cmd, want to be able to simply Win+R->Enter command, enter password and that's all. I tried the runas command, but it doesn't seem to work:  &gt;runas /user:me "cmd"   and it asks for a password, and then the command is executed with normal privileges. I know I could use /user:administrator but I don't know the admin pass and I think the admin user (me) should work. How do you make sure email you send programmatically is not automatically marked as spam? This is a tricky one and I've always relied on techniques, such as permission-based emails (i.e. only sending to people you have permission to send to) and not using blatantly spamish terminology.  Of late, some of the emails I send out programmatically have started being shuffled into people's spam folder automatically and I'm wondering what I can do about it.  This is despite the fact that these particular emails are not ones that humans would mark as spam, specifically, they are emails that contain license keys that people have paid good money for, so I don't think they're going to consider them spam  I figure this is a big topic in which I am essentially an ignorant simpleton. Is "flu" the only disease usually accompanied with "the"? From what I understand, you don't usually use "the" with diseases / illnesses / disorders ("have Alzheimer's / diarrhea / claustrophobia / dyslexia, etc." not "have the..."), but it's perfectly normal to say "have the flu". Is the flu the only exception?   Edit (this is only a side part, and can be glossed over if you will, so it's not a duplicate imo): What's so significant about the flu that other conditions don't have, so that it's entitled to "the"?