[Announcement] Apache Commons Pool 1.5.2 Released
The Apache Commons team is pleased to announce the release of version 1.5.2 of Commons Pool. Commons Pool provides a general purpose object pooling API, an implementation toolkit and some pool implementations. Version 1.5.2 is a patch release including bug fixes and documentation improvements. Source and binary distributions are available for download from the Apache Commons Pool download site: http://commons.apache.org/pool/download_pool.cgi Please verify signatures using the KEYS file available at the above location when downloading the release. For more information on Apache Commons Pool, visit the Pool home page: http://commons.apache.org/pool/ Feedback, suggestions for improvment or bug reports are welcome via the Mailing Lists and Issue Tracking links here: http://commons.apache.org/pool/project-info.html Phil Steitz - On behalf of the Apache Commons community - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Unicode Upload with FileUpload
Hello, I'm new to this list and hopefully it is OK to ask my question here ... ;-) I'm using FileUpload to get data from a HTML form via POST method (Apache Tomcat). It works fine, but the encoding of the file is always damaged. For example, I have text files (XML) in UTF-8 encoding with german special characters, but when uploading the file and printing its content to the browser, all special characters are gone or replaced by something strange. This is the code I use (avoiding to write the file to the harddisk, I used the most simple way from the manual): - // Create a factory for disk-based file items FileItemFactory factory = new DiskFileItemFactory(); // Create a new file upload handler ServletFileUpload upload = new ServletFileUpload(factory); // Parse the request List /* FileItem */ items = upload.parseRequest(request); String xml = ; Iterator iter = items.iterator(); while (iter.hasNext()) { FileItem fi = (FileItem) iter.next(); if (fi.isFormField() fi.getFieldName().equals(nameCorpus)) { nameCorpus = fi.getString(); } else { byte[] data = fi.get(); int c; for (i = 0; i data.length; i++) { c = data[i]; xml = xml + (char) c; //out.print( (char)c ); } }// if else } //while out.print(xml); - It would be nice, when somebody has an idea how I can preserve the Unicode content of the file ...? Thank you very much in advance, Tom -- Thomas Zastrow Seminar fuer Sprachwissenschaft Universitaet Tuebingen Wilhelm Str. 19 D-72074 Tuebingen http://www.thomas-zastrow.de Tel.: 07071/29-73968 Fax: 07071/29-5214 - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Basic Maths Help
Hi, I'm hoping that someone with a bit more maths knowledge than I have can help me with my current problem. I've got a data set that contains the daily closing price for a number of different stocks. What I want to do is find an equation that fits those points and then use it to predict the future price. In the past I've written an application that did a simple least squares linear regression (what is handled by the SimpleRegression class I believe) e.g. finding a line of best fit with the formula y = mx + c. What I need now is something that can give me a formula of y = ax^n + bx^n-1 mx + c where I can choose n, the number of terms. I think this can be handled by general least squares but the simple case I implemented in the past was already pushing my understanding of maths. Is this what the GLSMultipleLinearRegression class does? If so what do I need to read up on to understand it? Many thanks, Graham
Re: Basic Maths Help
Hi Graham, You want multiple linear regression. Check out this page from the commons-math docs. http://commons.apache.org/math/userguide/stat.html#a1.5_Multiple_linear_regression HTH Sujit On Mon, 2009-07-13 at 17:25 +0100, Graham Smith wrote: Hi, I'm hoping that someone with a bit more maths knowledge than I have can help me with my current problem. I've got a data set that contains the daily closing price for a number of different stocks. What I want to do is find an equation that fits those points and then use it to predict the future price. In the past I've written an application that did a simple least squares linear regression (what is handled by the SimpleRegression class I believe) e.g. finding a line of best fit with the formula y = mx + c. What I need now is something that can give me a formula of y = ax^n + bx^n-1 mx + c where I can choose n, the number of terms. I think this can be handled by general least squares but the simple case I implemented in the past was already pushing my understanding of maths. Is this what the GLSMultipleLinearRegression class does? If so what do I need to read up on to understand it? Many thanks, Graham - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Re: Trying to send HTML email but coming through as text email (GERONIMO ISSUE)
Hi Thomas, maybe this related to this blog entry ... can you check? http://www.jroller.com/melix/entry/apache_cxf_maven_javamail_awful Cheers, Siegfried Goeschl SHAW, Thomas wrote: Hi, I am trying to send html emails from my application running on a geronimo server on windows and using eclipse for development. When I run this code on the J2EE preview server it works but when i run it on Geronimo is doesnt. Here is the code that sends the email where i have added comments shows other code i have tried. Beneath the code the email that comes through to outlook 2000 Thanks Session session = Session.getDefaultInstance(props, null); Message msg = new MimeMessage(session); msg.setFrom(new InternetAddress(from)); msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse( to, false)); msg.setSubject(subject); StringBuffer sbuf = new StringBuffer(body); msg.setContent(new String(sbuf.toString().getBytes(), iso-8859-1), text/html; charset=\iso-8859-1\); msg.setSentDate(new Date()); //msg.setHeader(Content-Transfer-Encoding, 7bit); Transport.send(msg); Also Tried HtmlEmail email = new HtmlEmail(); email.setHostName(props.getProperty(mail.smtp.host)); email.addTo(to); email.setFrom(from); email.setSubject(subject); email.setHtmlMsg(body); email.send();*/ Result: MIME-Version: 1.0 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//ENhtmlhead= meta http-equiv=3DContent-Type content=3Dtext/html; charset=3DISO-8859-1= /titleGEQ004A_quote_1207.html/title/headbody%@ include view=3Dgl= adiator_mirror_page_left %table width=3D600 border=3D0 cellspacing=3D= 0 cellpadding=3D0 tr td width=3D200 height=3D10 bgcolor=3D#= 009933/td td width=3D350 bgcolor=3D#009933/td td width=3D= 50 bgcolor=3D#009933/td /tr tr td valign=3Dtoptable wid= th=3D200 border=3D0 cellspacing=3D0 cellpadding=3D0 tr = tda href=3Dhttp://www.gladiator.co.uk/?media=3Dqfuem;img src=3Dhttp= ://localhost/GladQE/pages/gladiator/emails/GEQ004A/gc_home_pic_top_0806.jpg= width=3D171 height=3D112 border=3D0/a/td /tr tr = tda href=3Dhttp://www.gladiator.co.uk/?media=3Dqfuem;img src=3Dh= ttp://localhost/GladQE/pages/gladiator/emails/GEQ004A/gc_home_pic_bot_0806.j= ** This email is sent for and on behalf of Admiral Group plc ** Admiral Group plc is registered in England and Wales at Capital Tower, Greyfriars Road, Cardiff CF10 3AZ (Reg. No. 03849958). EUI Limited (Reg No: 02686904) is a subsidiary of Admiral Group plc and is authorised and regulated by the Financial Services Authority (Firm reference number: 309378). These details can be confirmed by visiting the Financial Services Authority's Register, www.fsa.gov.uk/register. EUI Limited acts for, and on behalf of, other regulated insurance companies. Further details may be provided on request. Any opinions expressed in this email are those of the individual and not necessarily the company. This email and any files transmitted with it, including replies and forwarded copies (which may contain alterations) subsequently transmitted from the Company, are confidential and solely for the use of the intended recipient. It may contain material protected by attorney-client privilege. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that you have received this email in error and that any use is strictly prohibited. If you have received this email in error please notify the Information Security Officer by telephone on +44 (0) 29 2043 4252. Please then delete this email and destroy any copies of it. Security Warning: Please note that this email has been created in the knowledge that Internet email is not a 100% secure communications medium. We advise that you understand and accept this lack of security when emailing us. Viruses: Although we have taken steps to ensure that this email and any attachments are free from any virus, we advise that in keeping with good computing practice the recipient should ensure they are actually virus free. We may monitor the content of emails sent and received via our network for viruses or unauthorised use and for other lawful business purposes. This e-mail has been scanned for all viruses by Messagelabs. The service is powered by MessageLabs. - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Re: Release codec 1.4?
Hi, I'm mostly happy with the state of the CODEC in the repository. Base64 can be properly streamed when using the repository version, and I believe it's at least 33% faster than any of these: 1. http://iharder.sourceforge.net/base64/ (2 times faster) 2. sun.misc.BASE64Decoder (2 times faster) 3. openssl enc -base64 -d (about 33% faster?) Obviously I wish the patch I submitted for CODEC-75 would be applied (I'm privately forking for my own needs). yours, Julius On Sun, Jul 12, 2009 at 4:55 PM, da...@davidkarlsen.com wrote: On Sun, 12 Jul 2009, Gary Gregory wrote: Note that due to the Caverphone class, the requirement for a Codec 1.4 release will be changed from Java 1.3.1 to 1.4.2. I think this is fine and reworking Caverphone to be Java 1.3 compliant is not worth the effort. Is that an issue for anyone? Not for me - and can't really imagine for any else either, actually 1.4 was EOSL October last year: http://java.sun.com/j2se/1.4.2/download.html If they haven't moved yet they'll have bigger problems than commons codec requiring it from v1.4 :) And - a big thanks! -- David J. M. Karlsen - +47 90 68 22 43 http://www.davidkarlsen.com http://mp3.davidkarlsen.com - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org -- yours, Julius Davies 250-592-2284 (Home) 250-893-4579 (Mobile) http://juliusdavies.ca/logging.html - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
RE: Release codec 1.4?
Julius, I will look at CODEC-75 this week. Gary -Original Message- From: Julius Davies [mailto:juliusdav...@gmail.com] Sent: Monday, July 13, 2009 11:05 AM To: Commons Users List Subject: Re: Release codec 1.4? Hi, I'm mostly happy with the state of the CODEC in the repository. Base64 can be properly streamed when using the repository version, and I believe it's at least 33% faster than any of these: 1. http://iharder.sourceforge.net/base64/ (2 times faster) 2. sun.misc.BASE64Decoder (2 times faster) 3. openssl enc -base64 -d (about 33% faster?) Obviously I wish the patch I submitted for CODEC-75 would be applied (I'm privately forking for my own needs). yours, Julius On Sun, Jul 12, 2009 at 4:55 PM, da...@davidkarlsen.com wrote: On Sun, 12 Jul 2009, Gary Gregory wrote: Note that due to the Caverphone class, the requirement for a Codec 1.4 release will be changed from Java 1.3.1 to 1.4.2. I think this is fine and reworking Caverphone to be Java 1.3 compliant is not worth the effort. Is that an issue for anyone? Not for me - and can't really imagine for any else either, actually 1.4 was EOSL October last year: http://java.sun.com/j2se/1.4.2/download.html If they haven't moved yet they'll have bigger problems than commons codec requiring it from v1.4 :) And - a big thanks! -- David J. M. Karlsen - +47 90 68 22 43 http://www.davidkarlsen.com http://mp3.davidkarlsen.com - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org -- yours, Julius Davies 250-592-2284 (Home) 250-893-4579 (Mobile) http://juliusdavies.ca/logging.html - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Re: Basic Maths Help
Thanks guys that's really useful and tells me I'm at least looking in the right area. I understand some of what you are talking about but the rest leaves me scratching my head in bewilderment. Do you happen to know of any good sites where I could learn about this? Many years ago I did advanced mathematics but that was focused on engineering rather than statistics so the ideas aren't completely alien to me. The solution I have at the moment gives really poor results so throwing polynomials at it would probably be an improvement but I understand what you are saying about over fitting to noise. 2009/7/13 Ted Dunning ted.dunn...@gmail.com And if you are really working on time series for stocks, you will likely have explosively bad results applying a simple polynomial fit. You should, at least, remove the long-term exponential trend. This is probably best done using something like lowess smoothing. If you are looking at long-term data, you should also rescale as a percentage of long term trend. Then for modeling the data, you have to be very careful to avoid over-fitting to noise. Simply throwing polynomials at the problem is the road to ruin. Without significant math skills it will be difficult to get really good results. You might try penalizing your fit by also minimizing the summed squares of your coefficients. This is equivalent to weight decay in neural networks. Commons math is probably a very nice way to implement such algorithms in production. For exploratory development, I would recommend R instead. On Mon, Jul 13, 2009 at 10:26 AM, Sujit Pal sujit@comcast.net wrote: Hi Graham, You want multiple linear regression. Check out this page from the commons-math docs. http://commons.apache.org/math/userguide/stat.html#a1.5_Multiple_linear_regression HTH Sujit On Mon, 2009-07-13 at 17:25 +0100, Graham Smith wrote: Hi, I'm hoping that someone with a bit more maths knowledge than I have can help me with my current problem. I've got a data set that contains the daily closing price for a number of different stocks. What I want to do is find an equation that fits those points and then use it to predict the future price. In the past I've written an application that did a simple least squares linear regression (what is handled by the SimpleRegression class I believe) e.g. finding a line of best fit with the formula y = mx + c. What I need now is something that can give me a formula of y = ax^n + bx^n-1 mx + c where I can choose n, the number of terms. I think this can be handled by general least squares but the simple case I implemented in the past was already pushing my understanding of maths. Is this what the GLSMultipleLinearRegression class does? If so what do I need to read up on to understand it? Many thanks, Graham - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org -- Ted Dunning, CTO DeepDyve 111 West Evelyn Ave. Ste. 202 Sunnyvale, CA 94086 http://www.deepdyve.com 858-414-0013 (m) 408-773-0220 (fax)
Re: Basic Maths Help
Ahh... excellent. Chris Bishop's book Pattern Recognition and Machine Learning is a *really* excellent resource for relatively modern machine learning. Also good is Andrew Gelman's book Data Analysis Using Regression and Multilevel Hierarchical Models, but you will have to read between the lines quite a bit with that to do time-series stuff. On the web, I would recommend you look into Gaussian Processes. This web site seems to be a good introduction with good further links: http://www.gaussianprocess.org/ David Mackay is always worth listening to: http://videolectures.net/gpip06_mackay_gpb/ That should keep you pretty engaged for a bit. When you come up for air, drop on over to the Apache Mahout mailing list where I can provide more information. On Mon, Jul 13, 2009 at 11:37 AM, Graham Smith gra...@crazysquirrel.comwrote: Do you happen to know of any good sites where I could learn about this? Many years ago I did advanced mathematics but that was focused on engineering rather than statistics so the ideas aren't completely alien to me.
Re: [Sanselan] Writing XMP leads to semi-corrupted IPTC
+dev Hi Jonathan, Sanselan is in the process of moving into the Commons project - bear with us. dev, user: how does Commons handle issue tracking? Should we open an issue for this issue in our old JIRA issue tracker? Jonathan: once we've sorted out the issue tracking question, please open an issue. It would be very helpful if you could attach/contribute an image and source that reproduce the issue. A code snippet that demonstrates how you are using Sanselan is fine. Matthew On Mon, Jul 13, 2009 at 6:25 PM, Jonathan Gilesjonat...@jonathangiles.net wrote: Hi there everyone, I'm trying to use Sanselan to write XMP data to an image. The problem is that in doing so, it appears to corrupt the other IPTC data such that it is not visible in all circumstances (i.e. Windows Explorer doesn't display it). It's there in the file, just not in the expected location perhaps. Is there a way to handle this such that the added XMP doesn't change the content of the rest of the file? I tried re-writing the IPTC metadata but to no avail. Perhaps I haven't discovered the magic sequence of events that need to be followed. Any pointers would be much appreciated! Cheers, Jonathan Giles - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Re: [Sanselan] Writing XMP leads to semi-corrupted IPTC
On Tue, Jul 14, 2009 at 1:47 AM, Charles Matthew Chencharlesmc...@gmail.com wrote: +dev Hi Jonathan, Sanselan is in the process of moving into the Commons project - bear with us. dev, user: how does Commons handle issue tracking? Should we open an issue for this issue in our old JIRA issue tracker? Looks to me like the existing Sanselan JIRA issue tracker has just been moved under commons. So yes nothing changes with creating issues - you can either point people to the same JIRA url here: http://issues.apache.org/jira/browse/SANSELAN or theres a page on the Sanselan site which provides guidance and useful urls for the Sanselan JIRA instance: http://commons.apache.org/sanselan/issue-tracking.html Niall Jonathan: once we've sorted out the issue tracking question, please open an issue. It would be very helpful if you could attach/contribute an image and source that reproduce the issue. A code snippet that demonstrates how you are using Sanselan is fine. Matthew On Mon, Jul 13, 2009 at 6:25 PM, Jonathan Gilesjonat...@jonathangiles.net wrote: Hi there everyone, I'm trying to use Sanselan to write XMP data to an image. The problem is that in doing so, it appears to corrupt the other IPTC data such that it is not visible in all circumstances (i.e. Windows Explorer doesn't display it). It's there in the file, just not in the expected location perhaps. Is there a way to handle this such that the added XMP doesn't change the content of the rest of the file? I tried re-writing the IPTC metadata but to no avail. Perhaps I haven't discovered the magic sequence of events that need to be followed. Any pointers would be much appreciated! Cheers, Jonathan Giles - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org