[jira] Closed: (LANG-578) Problem while using simple quotes in ExtendedMessageFormat when a registry is specified

2009-12-31 Thread Olivier TERRIEN (JIRA)

 [ 
https://issues.apache.org/jira/browse/LANG-578?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Olivier TERRIEN closed LANG-578.


   Resolution: Duplicate
Fix Version/s: 3.0

I downloaded the new version of ExtendedMessageFormat class. It runs. 
I'll use it by shadowing the ExtendedMessageFormat 2.4 by waiting the release 
3.0.
Thanks.

 Problem while using simple quotes in ExtendedMessageFormat when a registry is 
 specified
 ---

 Key: LANG-578
 URL: https://issues.apache.org/jira/browse/LANG-578
 Project: Commons Lang
  Issue Type: Bug
  Components: lang.text.*
Affects Versions: 2.4
Reporter: Olivier TERRIEN
 Fix For: 3.0


 This runs successfully : 
 {code:java}
 ExtendedMessageFormat templateFormat = new ExtendedMessageFormat(''{0}'');
 System.out.println(templateFormat.format(new String[] { MESSAGE })); 
 {code}
 The result is 'MESSAGE'.
 This raises an error :
 {code:java}
 MapString, FormatFactory formatFactory = new HashMapString, 
 FormatFactory();
 formatFactory.put(formatDate, new FormatFactory() {
 @SuppressWarnings(all)
 public Format getFormat(String name, String arguments, Locale 
 locale) {
 return new SimpleDateFormat();
 }
 });
 ExtendedMessageFormat templateFormat = new ExtendedMessageFormat(''{0}'', , 
 formatFactory);
 System.out.println(templateFormat.format(new String[] { MESSAGE })); 
 {code}
 The result is an exception (java heap space).
 *way* : In _appendQuotedString_ method the code above doesn't seem to 
 increment the index pos before returning

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Created: (IO-225) UTF-8 support on CSV

2009-12-31 Thread Shibu Kumar Nair (JIRA)
UTF-8 support on CSV


 Key: IO-225
 URL: https://issues.apache.org/jira/browse/IO-225
 Project: Commons IO
  Issue Type: Bug
  Components: Streams/Writers
Affects Versions: 1.4
 Environment: Windows/Linux
Reporter: Shibu Kumar Nair


I have a struts 2 application from which user can download CSV file. 
The problem is 
 I download the CSV on the website then save to desktop of my computer and Open 
it on NOTEPAD... 
that works fine I could still see all the utf-8 text OK with no problem, but if 
I open the CSV file in Microsoft EXCEL, 
all the  utf-8 text are no longer readable. 

Does any one have the solution for this, how could I make it readable in MS 
Excel 
I am using org.apache.commons.io.FileUtils 
FileUtils.writeStringToFile(file, test); 
i also tried it with 
FileUtils.writeStringToFile(file, test,encoding) method 
Still the problem exists

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Closed: (IO-225) UTF-8 support on CSV

2009-12-31 Thread Joerg Schaible (JIRA)

 [ 
https://issues.apache.org/jira/browse/IO-225?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joerg Schaible closed IO-225.
-

Resolution: Not A Problem

Please ask questions on the user's list, you're welcome there. JIRA is a bug 
tracking system and not a communication forum.

 UTF-8 support on CSV
 

 Key: IO-225
 URL: https://issues.apache.org/jira/browse/IO-225
 Project: Commons IO
  Issue Type: Bug
  Components: Streams/Writers
Affects Versions: 1.4
 Environment: Windows/Linux
Reporter: Shibu Kumar Nair

 I have a struts 2 application from which user can download CSV file. 
 The problem is 
  I download the CSV on the website then save to desktop of my computer and 
 Open it on NOTEPAD... 
 that works fine I could still see all the utf-8 text OK with no problem, but 
 if I open the CSV file in Microsoft EXCEL, 
 all the  utf-8 text are no longer readable. 
 Does any one have the solution for this, how could I make it readable in MS 
 Excel 
 I am using org.apache.commons.io.FileUtils 
 FileUtils.writeStringToFile(file, test); 
 i also tried it with 
 FileUtils.writeStringToFile(file, test,encoding) method 
 Still the problem exists

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (MATH-320) NaN singular value from SVD

2009-12-31 Thread Axel Kramer (JIRA)

[ 
https://issues.apache.org/jira/browse/MATH-320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12795591#action_12795591
 ] 

Axel Kramer commented on MATH-320:
--

This statement should print the values of the original matrix approximately:
{code:java} 
  System.out.println(svd.getU().multiply(svd.getS()).multiply(svd.getVT()));
{code} 

This is true for
{code:java} 
public void testMath320A() {
{code} 
but not for
{code:java} 
public void testMath320B() {
{code} 

 NaN singular value from SVD
 ---

 Key: MATH-320
 URL: https://issues.apache.org/jira/browse/MATH-320
 Project: Commons Math
  Issue Type: Bug
Affects Versions: 2.0
 Environment: Linux (Ubuntu 9.10) java version 1.6.0_16
Reporter: Dieter Vandenbussche

 The following jython code
 Start code
 from org.apache.commons.math.linear import *
  
 Alist = [[1.0, 2.0, 3.0],[2.0,3.0,4.0],[3.0,5.0,7.0]]
  
 A = Array2DRowRealMatrix(Alist)
  
 decomp = SingularValueDecompositionImpl(A)
  
 print decomp.getSingularValues()
 End code
 prints
 array('d', [11.218599757513008, 0.3781791648535976, nan])
 The last singular value should be something very close to 0 since the matrix
 is rank deficient.  When i use the result from getSolver() to solve a system, 
 i end 
 up with a bunch of NaNs in the solution.  I assumed i would get back a least 
 squares solution.
 Does this SVD implementation require that the matrix be full rank?  If so, 
 then i would expect
 an exception to be thrown from the constructor or one of the methods.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Issue Comment Edited: (MATH-320) NaN singular value from SVD

2009-12-31 Thread Axel Kramer (JIRA)

[ 
https://issues.apache.org/jira/browse/MATH-320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12795591#action_12795591
 ] 

Axel Kramer edited comment on MATH-320 at 12/31/09 12:02 PM:
-

This statement should print the values of the original matrix approximately:
{code:java} 
  System.out.println(svd.getU().multiply(svd.getS()).multiply(svd.getVT()));
{code} 

This is true for
{code:java} 
public void testMath320A() {
{code} 
but not for
{code:java} 
public void testMath320B() {
{code} 

For reference values try wolfram alpha:
N[SingularValueDecomposition[{{1,2},{1,2}}]]

  was (Author: axelclk):
This statement should print the values of the original matrix approximately:
{code:java} 
  System.out.println(svd.getU().multiply(svd.getS()).multiply(svd.getVT()));
{code} 

This is true for
{code:java} 
public void testMath320A() {
{code} 
but not for
{code:java} 
public void testMath320B() {
{code} 

For reference valus try wolfram alpha:
N[SingularValueDecomposition[{{1,2},{1,2}}]]
  
 NaN singular value from SVD
 ---

 Key: MATH-320
 URL: https://issues.apache.org/jira/browse/MATH-320
 Project: Commons Math
  Issue Type: Bug
Affects Versions: 2.0
 Environment: Linux (Ubuntu 9.10) java version 1.6.0_16
Reporter: Dieter Vandenbussche

 The following jython code
 Start code
 from org.apache.commons.math.linear import *
  
 Alist = [[1.0, 2.0, 3.0],[2.0,3.0,4.0],[3.0,5.0,7.0]]
  
 A = Array2DRowRealMatrix(Alist)
  
 decomp = SingularValueDecompositionImpl(A)
  
 print decomp.getSingularValues()
 End code
 prints
 array('d', [11.218599757513008, 0.3781791648535976, nan])
 The last singular value should be something very close to 0 since the matrix
 is rank deficient.  When i use the result from getSolver() to solve a system, 
 i end 
 up with a bunch of NaNs in the solution.  I assumed i would get back a least 
 squares solution.
 Does this SVD implementation require that the matrix be full rank?  If so, 
 then i would expect
 an exception to be thrown from the constructor or one of the methods.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Issue Comment Edited: (MATH-320) NaN singular value from SVD

2009-12-31 Thread Axel Kramer (JIRA)

[ 
https://issues.apache.org/jira/browse/MATH-320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12795591#action_12795591
 ] 

Axel Kramer edited comment on MATH-320 at 12/31/09 12:01 PM:
-

This statement should print the values of the original matrix approximately:
{code:java} 
  System.out.println(svd.getU().multiply(svd.getS()).multiply(svd.getVT()));
{code} 

This is true for
{code:java} 
public void testMath320A() {
{code} 
but not for
{code:java} 
public void testMath320B() {
{code} 

For reference valus try wolfram alpha:
N[SingularValueDecomposition[{{1,2},{1,2}}]]

  was (Author: axelclk):
This statement should print the values of the original matrix approximately:
{code:java} 
  System.out.println(svd.getU().multiply(svd.getS()).multiply(svd.getVT()));
{code} 

This is true for
{code:java} 
public void testMath320A() {
{code} 
but not for
{code:java} 
public void testMath320B() {
{code} 
  
 NaN singular value from SVD
 ---

 Key: MATH-320
 URL: https://issues.apache.org/jira/browse/MATH-320
 Project: Commons Math
  Issue Type: Bug
Affects Versions: 2.0
 Environment: Linux (Ubuntu 9.10) java version 1.6.0_16
Reporter: Dieter Vandenbussche

 The following jython code
 Start code
 from org.apache.commons.math.linear import *
  
 Alist = [[1.0, 2.0, 3.0],[2.0,3.0,4.0],[3.0,5.0,7.0]]
  
 A = Array2DRowRealMatrix(Alist)
  
 decomp = SingularValueDecompositionImpl(A)
  
 print decomp.getSingularValues()
 End code
 prints
 array('d', [11.218599757513008, 0.3781791648535976, nan])
 The last singular value should be something very close to 0 since the matrix
 is rank deficient.  When i use the result from getSolver() to solve a system, 
 i end 
 up with a bunch of NaNs in the solution.  I assumed i would get back a least 
 squares solution.
 Does this SVD implementation require that the matrix be full rank?  If so, 
 then i would expect
 an exception to be thrown from the constructor or one of the methods.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (MATH-320) NaN singular value from SVD

2009-12-31 Thread Luc Maisonobe (JIRA)

[ 
https://issues.apache.org/jira/browse/MATH-320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12795606#action_12795606
 ] 

Luc Maisonobe commented on MATH-320:


Thanks for the hint Axel!
The print statement is even not satisfying for testMath320A, the approximation 
is really too bad. I would expect about 13 exact figures, not 1 or 2.
The problem seems to be related to matrix U which is not correct. In fact, it 
is even not unitary (i.e. U^T^.U is not the identity matrix).
I'll look at this.

 NaN singular value from SVD
 ---

 Key: MATH-320
 URL: https://issues.apache.org/jira/browse/MATH-320
 Project: Commons Math
  Issue Type: Bug
Affects Versions: 2.0
 Environment: Linux (Ubuntu 9.10) java version 1.6.0_16
Reporter: Dieter Vandenbussche

 The following jython code
 Start code
 from org.apache.commons.math.linear import *
  
 Alist = [[1.0, 2.0, 3.0],[2.0,3.0,4.0],[3.0,5.0,7.0]]
  
 A = Array2DRowRealMatrix(Alist)
  
 decomp = SingularValueDecompositionImpl(A)
  
 print decomp.getSingularValues()
 End code
 prints
 array('d', [11.218599757513008, 0.3781791648535976, nan])
 The last singular value should be something very close to 0 since the matrix
 is rank deficient.  When i use the result from getSolver() to solve a system, 
 i end 
 up with a bunch of NaNs in the solution.  I assumed i would get back a least 
 squares solution.
 Does this SVD implementation require that the matrix be full rank?  If so, 
 then i would expect
 an exception to be thrown from the constructor or one of the methods.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Resolved: (MATH-320) NaN singular value from SVD

2009-12-31 Thread Luc Maisonobe (JIRA)

 [ 
https://issues.apache.org/jira/browse/MATH-320?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Luc Maisonobe resolved MATH-320.


Resolution: Fixed

This should be fixed in subversion repository now (r894908).
Thanks for reporting the bug and sorry for the delay.

 NaN singular value from SVD
 ---

 Key: MATH-320
 URL: https://issues.apache.org/jira/browse/MATH-320
 Project: Commons Math
  Issue Type: Bug
Affects Versions: 2.0
 Environment: Linux (Ubuntu 9.10) java version 1.6.0_16
Reporter: Dieter Vandenbussche

 The following jython code
 Start code
 from org.apache.commons.math.linear import *
  
 Alist = [[1.0, 2.0, 3.0],[2.0,3.0,4.0],[3.0,5.0,7.0]]
  
 A = Array2DRowRealMatrix(Alist)
  
 decomp = SingularValueDecompositionImpl(A)
  
 print decomp.getSingularValues()
 End code
 prints
 array('d', [11.218599757513008, 0.3781791648535976, nan])
 The last singular value should be something very close to 0 since the matrix
 is rank deficient.  When i use the result from getSolver() to solve a system, 
 i end 
 up with a bunch of NaNs in the solution.  I assumed i would get back a least 
 squares solution.
 Does this SVD implementation require that the matrix be full rank?  If so, 
 then i would expect
 an exception to be thrown from the constructor or one of the methods.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (MATH-321) Support for Sparse (Thin) SVD

2009-12-31 Thread Luc Maisonobe (JIRA)

[ 
https://issues.apache.org/jira/browse/MATH-321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12795630#action_12795630
 ] 

Luc Maisonobe commented on MATH-321:


A partial fix as been committed in subversion repository as of r894908.
The current implementation computes either the compact SVD (considering only 
positive singular values) or the truncated SVD (considering a user-specified 
maximal number of singular values).
The issue is however not completely solved yet as the underlying 
eigendecomposition still computes all eigenvalues,. The SVD upper layer only 
truncates this computation afterwards. This means lots of things are computed 
just to be discarded later.
I'll take care of this shortly.
Also note that this implementation still considers only dense matrices, not 
sparse ones. Any contributions for sparse SVD is welcome!

 Support for Sparse (Thin) SVD
 -

 Key: MATH-321
 URL: https://issues.apache.org/jira/browse/MATH-321
 Project: Commons Math
  Issue Type: New Feature
Reporter: David Jurgens

 Current the SingularValueDecomposition implementation computes the full SVD.  
 However, for some applications, e.g. LSA, vision applications, only the most 
 significant singular values are needed.  For these applications, the full 
 decomposition is impractical, and for large matrices, computationally 
 infeasible.   The sparse SVD avoids computing the unnecessary data, and more 
 importantly, has significantly lower computational complexity, which allows 
 it to scale to larger matrices.
 Other linear algebra implementation have support for the sparse svd.  Both 
 Matlab and Octave have the svds function.  C has SVDLIBC.  SVDPACK is also 
 available in Fortran and C.  However, after extensive searching, I do not 
 believe there is any existing Java-based sparse SVD implementation.  This 
 added functionality would be widely used for any pure Java application that 
 requires a sparse SVD, as the only current solution is to call out to a 
 library in another language.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (MATH-323) Add Semivariance calculation

2009-12-31 Thread Larry Diamond (JIRA)

[ 
https://issues.apache.org/jira/browse/MATH-323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12795667#action_12795667
 ] 

Larry Diamond commented on MATH-323:


Thanks - I'll hopefully get this over the weekend.  Those annoying people who 
pay me a salary have been actually consuming me time recently and I havent 
gotten done what I hoped.

Clearly, step one is those Documentation Goes Here bits. Getting those in 
there would clarify your third point and I see is ***KEY*** to publicly 
reusable software.

I agree with not using AbstractStorelessUnivariateStatistic - I have to read 
over AbstractUnivariateStatistic to make sure I can use it.  I'd like to extend 
something in the package.

I'll look at the UnivariateStatistic to see the constructors.  I can see that 
you'd want to calculate Upward and Downward on the same data (and really the 
full variance too), although yeah, once you have one you automatically have the 
other (full - downward = upward).
Clearly, those documentation bits would make what I'm talking about much 
clearer to all readers of this post.

Thanks for the note on the not using boolean there.  There was just no way that 
I could have people try to remember which direction was true and which 
direction was false.  That's just silly and cruel.



 Add Semivariance calculation
 

 Key: MATH-323
 URL: https://issues.apache.org/jira/browse/MATH-323
 Project: Commons Math
  Issue Type: New Feature
Affects Versions: 2.1
Reporter: Larry Diamond
Assignee: Phil Steitz
Priority: Minor
 Fix For: 2.1

 Attachments: patch.txt, patch2.txt, SemiVariance.java, 
 SemiVarianceTest.java, StatUtils.java, StatUtils.java, StatUtilsTest.java, 
 StatUtilsTest.java


 I've added semivariance calculations to my local build of commons-math and I 
 would like to contribute them.
 Semivariance is described a little bit on 
 http://en.wikipedia.org/wiki/Semivariance , but a real reason you would use 
 them is in finance in order to compute the Sortino ratio rather than the 
 Sharpe ratio.
 http://en.wikipedia.org/wiki/Sortino_ratio gives an explanation of the 
 Sortino ratio and why you would choose to use that rather than the Sharpe 
 ratio.  (There are other ways to measure the performance of your portfolio, 
 but I wont bore everybody with that stuff)
 I've already got the coding completed along with the test cases and building 
 using mvn site.
 The only two files I've modified is 
 src/main/java/org/apache/commons/stat/StatUtils.java and 
 src/test/java/org/apache/commons/math/stat/StatUtilsTest.java

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.