So what's the right way to know if an error has occured when writing through a PrintWriter?
Some days ago I realized that  (as well as ) never throw an IOException when writing, flushing or closing.  Instead it sets an internal flag (trouble=true) when an error occurs. It's not possible to get the exact exception, but only if there was some exception ().  My question is: why would one want to have such behavior? Isn't that bad API design?
Why are one-way plane tickets more expensive than return tickets? How to block sites with iptables Co-Buyer Automobile As a co-buyer on an automobile, can the other party take full possession? Both parties names are listed as the Purchaser's. Only one purchaser signed the retail order for the motor vehicle, and if so, how can one become a no co-buyer? Consider the following code:  foo () {     echo $* }  bar () {     echo $@ }  foo 1 2 3 4 bar 1 2 3 4   It outputs:     1 2 3 4       1 2 3 4   I am using Ksh88, but I am interested in other common shells as well. If you happen to know any particularity for specific shells, please do mention them.  I found the follwing in the Ksh man page on Solaris:     The meaning of $* and  $@  is   identical  when  not  quoted  or  when  used  as a parameter   assignment value or as a file name. However, when used as  a   command argument, $* is equivalent to ``$1d$2d...'', where d   is the first character of the IFS variable,  whereas  $@  is   equivalent  to  $1 $2 ....   I tried modifying the IFS variable, but it doesn't modify the output. Maybe I'm doing something wrong? Selecting a Textbox Item in a Listbox does not change the selected item of the listbox A positive polynomial is the sum of two squares in $\mathbb{R}[X]$ Let $P\in\mathbb{R}[X]$ be a positive polynomial.  I want to show that there exists $A,B\in\mathbb{R}[X]$ so that $P=A^2+B^2$    $\displaystyle P=a\prod_{k=0}^q(x-a_k)\prod_{k=0}^{2p}(x-b_k)=a\prod_{k=0}^q(x-a_k)\prod_{k=0}^p(x^2-2\Re(b_k)+|b_k|^2)$ where $a$ is the leading coefficient, $a_k$ are the real rooks, $b_k$ are the complex roots.  What can i do now ? I know that the identity $(a^2+b^2)(c^2+d^2)=(ac-bd)^2+(ad+bc)^2$ should come in handy, but I can't figure out :  1) How to show that the product real roots is a square  2) How to use the above identity for the complex roots.  If I can solve those two points, then I can solve the problem. Consider the sum of $n$ uniform distributions on $[0,1]$, or $Z_n$. Why does the cusp in the PDF of $Z_n$ disappear for $n \geq 3$? I've been wondering about this one for a while; I find it a little weird how abruptly it happens. Basically, why do we need just three uniforms for $Z_n$ to smooth out like it does? And why does the smoothing-out happen so relatively quickly?  $Z_2$:     $Z_3$:    (images shamelessly stolen from John D. Cook's blog: )  Why doesn't it take, say, four uniforms? Or five? Or...? Often I need two (or more) map frames in map layout to present different data next to each other. It is easy to make multiple map frames in QGIS Print Composer. BUT...  It is in the nature of my work that very often I need to update some map frames because data I am presenting in map changed or I need to add/remove layer, change scale, projection etc.  So if I create one map frame, lock it (Lock layers for map item), create second map frame with different layers, scale,projection etc. and than realize I need to change something in first frame, I can't find a simple way to do it...  To simply do that in Mapinfo, there are more Map Windows, in ArcGIS there are multiple Data Frames. What is in QGIS to achieve that? Is there a ZIP code I can enter when paying-at-the-pump in the USA with a foreign credit card? In the USA, many  fuel dispensers that accept credit cards require a  that corresponds to the billing address of the credit card.  In Canada, for instance, we have , so it's not obvious what you're supposed to type in since the gas dispensers have only numeric keypads.  Entering '00000' or '90210' seems to always result in failed authorization.  Is there a zip code that works for credit cards with foreign billing addresses? How best to sum up lots of floating point numbers? Currency formatting in Python I am looking to format a number like 188518982.18 to £188,518,982.18 using Python.  How can I do this? Python: reload component Y imported with 'from X import Y'? Should we @Override an interface's method implementation? Make cd automatically ls I find that I often do the following:  %&gt; cd bla/bla %&gt; ls   I would like it that whenever I cd into a directory it automatically does an ls.  I fiddled with my .bashrc for a while, but couldn't figure out how to make it happen. Incoming light reacts with the several types of cone cells in the eye. In humans, there are three types of cones sensitive to three different spectra, resulting in trichromatic color vision. Each individual cone contains pigments composed of opsin apoprotein, which is covalently linked to either 11-cis-hydroretinal or more rarely 11-cis-dehydroretina.  The opsins (photopigments) present in the L and M cones are encoded on the X chromosome.  A very small percentage of women may have an extra type of color receptor because they have different alleles for the gene for the L opsin on each X chromosome. X chromosome inactivation means that only one opsin is expressed in each cone cell, and some women may therefore show a degree of tetrachromatic color vision. Tetrachromacy is also demonstrated among several species of birds, fish, amphibians, reptiles and insects.  Humans cannot see ultraviolet light directly because the lens of the eye blocks most light in the wavelength range of 300–400 nm.  So, besides above mentioned exceptions, is it possible due to mutations or genetic engineering to see UV or infrared. What kind of mutations should be made or are the changes to be made in the opsines to big to create 'alien' eyes? Dataset collapsing/reducing Array Modifier - Fit Curve too short I want to create a simple road. To do this I first want to apply an 'Array Modifier' which fits the curve. So in the Array modifier I changed the 'Fit Type' from 'Fixed Count' to 'Fit Curve'. But now the Path is much shorter than the road it self.  And If I extrude the curve the road goes even longer and longer. Is there a way the road is as long as the path? Can this statistic be shown not to be sufficient for $\theta$? This problem comes from , who do not rigorously demonstrate (in their solution key) that the statistic is not sufficient.  Let $X_1,\dots,X_n$ be a random sample from a population with PDF $f(x|\theta)=\theta x^{\theta-1} \cdot 1_{\{x\in(0,1)\}}$ for $\theta&gt;0$. Show that $\sum_i X_i$ is not sufficient for $\theta$.  If you write out the PDF $p(\vec{x}|\theta)$ of the random sample, it is clear by the factorization theorem that $\prod_i X_i$ or $\sum_i \log(X_i)$ are sufficient for $\theta$; the PDF $p$ also suggests $\sum_i X_i$ is not sufficient for $\theta$. However, to rigorously demonstrate this, we need to analyze $p(\vec{x},\theta)/q(T(\vec{x},\theta)$, where $p$ is the distribution of sample $\vec{x}$, $q$ is the distribution of the statistic $T(\vec{X})=\sum_i X_i$. But finding the distribution of $T(X)=\sum_i X_i$ seems impractical. I have observed that $f$ is the PDF of a Beta($\theta$,1) distribution, but checking online, the distribution of the sum of Beta random variables doesn't appear to have a closed form. Are there any alternative routes (e.g., showing there is no factorization involving $T(\vec{X})$)? Did C&amp;B leave out a full explanation that $\sum_i X_i$ is not sufficient because none actually exist? What are the different widely used RAID levels and when should I consider them? This is a  about RAID levels.    What are:   the RAID levels typically used (including the RAID-Z family)?  deployments are they commonly found in? benefits and pitfalls of each? Note: I am very new to the more advanced side of electricity. I do not have a firm grasp on the exact mechanics.  Lets say I have an example circuit:  5V Power Supply -&gt; LED -&gt; Resistor -&gt; Ground  Now the LED is receiving 20ma and 5V. If I were to switch the LED and the resistor however, the LED should receive less voltage but the same current, so wouldn't it be dimmer? Or would it receive the same voltage?  I've looked at these two threads and their answer doesn't help.