Madiba Soft | 18 Jul 09:44 2014
Picon

[email] Map cid's to attachments? (Rendering html content)

Hi,

I'm trying to figure out how to display the output of
MimeMessageParser's getHtmlContent() into a dojo html widget.
Obviously the cid: links are not understood by any parser.
In my previous implementation (using javax.mail) I simply replaced all
the cid: links with url's pointing back to a web service which served
those attachtments.

But with commons-email, I cannot find a way to figure out which cid:
corresponds to which attachment (parser.getAttachmentList();) since
the DataSource only shows the attachment name.

Could anyone point me at a way to figure out which cid maps to which attachment?

Please note I am loading emails from file, not constructing them
myself, so HtmlEmail is of no use, unless there is some why perhaps to
create an HtmlEmail from a saved email - but even then, the inlineEmbeds field
is proptected, so I cannot access it.

many thanks
Eldon Carman | 17 Jul 18:44 2014

[io] ByteArrayOutputStream/DataOutputStream without synchronization?

Hi,

I am looking for a version of ByteArrayOutputStream and DataOutputStream
without synchronization. Does Apache Commons IO have this as part of their
library? Or do you have a suggestion on an other class that has the same
functionality with out synchronization. In my case, I can get 10 to 20%
boost in performance by only removing synchronization from these class.

Thanks for your feedback,
Eldon
Andrew Martin | 17 Jul 18:24 2014

[daemon]

Hi,

 

I’m trying to run a java daemon using jsvc and the Daemon interface. The java project is a jar file which has a bunch of dependencies in a manifest file (including commons-daemon), and I add this jar file to the classpath when running jsvc. When I try to execute via jsvc however, I get this stacktrace in stderr:

 

java.lang.InstantiationException: com.mycomany.mypackage.MyClass

        at java.lang.Class.newInstance(Class.java:359)

        at org.apache.commons.daemon.support.DaemonLoader.load(DaemonLoader.java:190)

17/07/2014 17:03:34 9904 jsvc.exec error: Cannot load daemon

17/07/2014 17:03:34 9903 jsvc.exec error: Service exit with a return value of 3

 

Where MyClass is the class that I pass into jsvc.

 

I have tried using the –verbose option to help diagnose the problem, and with that I can see in stdout that it loads all the dependencies from the manifest just fine, but no additional information is provided to help diagnose the problem. Is there a way to get more information about what causes this InstantationException?

 

Best,

Andrew



  Andrew Martin
Software Engineering Co-op, Software Development | exactEarth Ltd.
 
60 Struck Ct. Cambridge, Ontario N1R 8L2
office. +1.519.622.4445
email. Andrew.Martin <at> exactearth.com

web. www.exactearth.com

 



This e-mail and any attachment is for authorized use by the intended recipient(s) only. It contains proprietary or confidential information and is not to be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail, any attachment and all copies and inform the sender. Thank you.

anshul gangwar | 16 Jul 14:16 2014
Picon

[SCXML] mapping of data types used to store values of datamodel with the java datatypes

Hi,

I have one query regarding datatypes used to store values of SCXM datamodel.

Suppose there is a string A = "1234567891". This variable is sent in
payload when event is fired and is assigned in the SCXML datamodel through
<assign> tag.
Now when I am fetching this variable A in invoker class, its value is in
exponential form. So, in order to get the actual value I have perform below
steps:

                double d =
Double.parseDouble(String.valueOf(lastParams.get("A")));
                String deviceId = BigDecimal.valueOf(d).toPlainString();

If the value of A does not reach to specific range then it simply convert
it into float instead of converting it in exponential form.

I would like to know how commons SCXML datatypes are mapped with the java
datatypes? Is this the right way of doing converting Integer values from
SCXML?
Which document can I refer for such details?

Thanks in advance.

Regards,
Anshul
Mansour Al Akeel | 15 Jul 15:02 2014
Picon

Parsing and solving algebraic equation from string

I am new to commons-math. I need to solve simple equations in the form
"x + 3 = 10"
The closest thing I was able to find is
http://commons.apache.org/proper/commons-math/userguide/linear.html#a3.4_Solving_linear_systems

However, this needs a square matrix, and can not build the
coefficients and constants from the string.
Is there a matrix builder that I can use to create the 2 dimensional
arrays to solve this equation ?

Thank you.
Thomas Neidhart | 11 Jul 17:06 2014
Picon

[ANNOUNCEMENT] Commons Logging 1.2 Released

The Apache Commons Team is pleased to announce the availability of
Apache Commons Logging 1.2.

Commons-Logging is a thin adapter allowing configurable bridging to other,
well-known logging systems.

Details of the changes and bug fixes in this release can be found
in the release notes at
  http://www.apache.org/dist/commons/logging/RELEASE-NOTES.txt

The most notable change being that support for Java 1.1 has been dropped,
which should result in improved performance, see [LOGGING-37] for more
information.

Source and binary distributions are available for download from the
Apache Commons download site:
  http://commons.apache.org/proper/commons-logging/download_logging.cgi

When downloading, please verify signatures using the KEYS file available
at the above location when downloading the release.

For complete information on Commons Logging, including instructions
on how to submit bug reports, patches, or suggestions for improvement,
see the Apache Commons Logging website:

http://commons.apache.org/proper/commons-logging/

Thomas, on behalf of the Apache Commons community
Thomas Neidhart | 11 Jul 16:59 2014
Picon

[ANNOUNCEMENT] Commons Email 1.3.3 Released

The Apache Commons Team is pleased to announce the availability of
Apache Commons Email 1.3.3.

Commons-Email aims to provide an API for sending email.
It is built on top of the JavaMail API, which it aims to simplify.

Details of the changes and bug fixes in this release can be found
in the release notes at
  http://www.apache.org/dist/commons/email/RELEASE-NOTES.txt

Source and binary distributions are available for download from the
Apache Commons download site:
  http://commons.apache.org/proper/commons-email/download_email.cgi

When downloading, please verify signatures using the KEYS file available
at the above location when downloading the release.

For complete information on Commons Email, including instructions
on how to submit bug reports, patches, or suggestions for improvement,
see the Apache Commons Email website:

http://commons.apache.org/proper/commons-email/

Thomas, on behalf of the Apache Commons community
DiFrango, Ronald (CONT | 11 Jul 16:49 2014
Picon

Commons Config: Variable Interpolation

I'm attempting to perform Variable Interpolation as outlined here:

http://commons.apache.org/proper/commons-configuration/userguide/howto_basicfeatures.html#Variable_Interpolation

I'm using an XML file as the starter so I added the following blurb to the beginning of the file:

<header>
              <result />
              <lookups>
                     <lookup config-prefix="expr"
                           config-class="org.apache.commons.configuration.interpol.ExprLookup">
                           <variables>
                                  <variable name="net" value="Class:java.net.InetAddress" />
                           </variables>
                     </lookup>
              </lookups>
       </header>

And then in my properties file that is loaded I did:

mobile.rest.host=${expr:$[net.localHost.hostName]}

But it did not work any thoughts on what I'm doing wrong?

Thanks,

Ron

________________________________________________________

The information contained in this e-mail is confidential and/or proprietary to Capital One and/or its
affiliates. The information transmitted herewith is intended only for use by the individual or entity to
which it is addressed.  If the reader of this message is not the intended recipient, you are hereby notified
that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any
action in reliance upon this information is strictly prohibited. If you have received this
communication in error, please contact the sender and delete the material from your computer.
Adam Bedrossian | 10 Jul 20:20 2014

[math] Problem with the BicubicSplineInterpolator?

I have encountered a use case with the BicubicSplineInterpolator where the
interpolated values that are being returned seem incorrect.  Furthermore,
the values do not match those generated by MatLab using the interp2 'cubic'
method.

Here is a snippet of code that uses the interpolator:

double[] xValues = new double[] {36, 36.001, 36.002};
        double[] yValues = new double[] {-108.00, -107.999, -107.998};

        double[][] fValues = new double[][] {{1915, 1906, 1931},
                                        {1877, 1889, 1894},
                                        {1878, 1873, 1888}};

        BicubicSplineInterpolator interpolator = new
BicubicSplineInterpolator();
        BicubicSplineInterpolatingFunction interpolatorFunction =
interpolator.interpolate(xValues, yValues, fValues);

        double[][] results = new double[9][9];
        double x = 36;
        int arrayIndexX = 0, arrayIndexY = 0;

        while(x <= 36.002) {
            double y = -108;
            arrayIndexY = 0;
            while (y <= -107.998) {
                results[arrayIndexX][arrayIndexY] =
interpolatorFunction.value(x,  y);
                System.out.println(results[arrayIndexX][arrayIndexY]);
                y = y + 0.00025;
                arrayIndexY++;
            }

            x = x + 0.00025;
            arrayIndexX++;
        }

If we focus just on the interpolated value at x = 36 and y = -107.99975
(the second iteration of the loop), the value = -3938.593749982256.
Compared to MatLab, the value is 1901.8438.

I've also posted this scenario on Stack Overflow which can be found here:
http://stackoverflow.com/questions/24618336/apache-commons-math-bicubicsplineinterpolator-is-returning-strange-interpolated

Am I using the interpolator incorrectly?  Is this something I should bug?

Thank you
Adam
Benedikt Ritter | 9 Jul 07:45 2014
Picon

[LANG] Feature request: Custom word boundary separators for WordUtils.wrap

Hello Andrew,

we use jira for tracking new ideas / feature requests [1]. Chances that
this will be implemented are even higher if you provide a patch with
acompanying unit tests ;-)

Currently I'm not sure whether this really belongs to lang. WordUtils is
supposed as a utility for simple use cases. We should make sure that it
doesn't become a full blown text parsing engine, since would be out of
scope for [LANG] imho.

br,
Benedikt

[1] https://issues.apache.org/jira/browse/LANG

2014-07-08 20:45 GMT+02:00 Andrew Pennebaker <andrew.pennebaker <at> gmail.com>:

> The current implementation of WordUtils.wrap behaves well for a lot of
> basic English language text, but I'd really like to word-wrap more
> complicated text, that contains hyphens and other punctuation. I want to be
> able to supply a dash, slash separator ("-/") to wrap so that
> "tomato-potato" wraps like:
>
> tomato-
> potato
>
> and "flammable/inflammable" wraps like:
>
> flammable/
> inflammable
>
> Currently, WordUtils.wrap does not appear to have an option for customizing
> word boundary separators, so these examples end up getting wrapped like:
>
> tomato-potato (with wrapLongWords false)
>
> flammable/inflammable
>
> When wrapLongWords is set to true, the current space-based wrapping is
> almost unreadable:
>
> tomato-po
> tato
>
> flamm
> able/inf
> lamma
> ble
>
> --
> Cheers,
>
> Andrew Pennebaker
> www.yellosoft.us
>

--

-- 
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter
Andrew Pennebaker | 8 Jul 20:45 2014
Picon

Feature request: Custom word boundary separators for WordUtils.wrap

The current implementation of WordUtils.wrap behaves well for a lot of
basic English language text, but I'd really like to word-wrap more
complicated text, that contains hyphens and other punctuation. I want to be
able to supply a dash, slash separator ("-/") to wrap so that
"tomato-potato" wraps like:

tomato-
potato

and "flammable/inflammable" wraps like:

flammable/
inflammable

Currently, WordUtils.wrap does not appear to have an option for customizing
word boundary separators, so these examples end up getting wrapped like:

tomato-potato (with wrapLongWords false)

flammable/inflammable

When wrapLongWords is set to true, the current space-based wrapping is
almost unreadable:

tomato-po
tato

flamm
able/inf
lamma
ble

--

-- 
Cheers,

Andrew Pennebaker
www.yellosoft.us

Gmane