Pages

OLSMultipleLinearRegression parabola

I moved the content that was here to Biting Code, my blog dedicated to Java and JVM-based languages.

Estimating a second degree curve through the Apache Commons Math class OLSMultipleLinearRegression.

Go to the full post

The simplest OLSMultipleLinearRegression example ever

I moved this post to Biting Code, my blog dedicated to JVM languages.

A very simple example of Multivariate Linear Regression by Ordinary Least Squares by Apache Commons Math OLSMultipleLinearRegression

Go to the full post

From array of primitives to Collection

I moved this post to Biting Code, my blog dedicated to JVM languages.

Convert an array of objects to a standard Java Collection it is quite easy, thanks to Arrays.asList(), but in case of primitive values we have to be more explicit.

Go to the full post

SummaryStatistics vs. DescriptiveStatistics

I moved this post to Biting Code, my blog dedicated to JVM languages.

Introduction to a couple of Java classes, SummaryStatistics and DescriptiveStatistics, that are part for the Apache Common Math library

Go to the full post

Random expectation

I moved this post to Biting Code, my blog dedicated to JVM languages.

A single random extraction from a pseudo-random distribution should be, well, unexpected. Not much to say more.

More interesting is pondering on a number of extraction from such a distribution. I have done some testing on the expected mean in a few of such distributions available through the Java Random class.

Go to the full post

Using random to generate pi

I moved this post to Biting Code, my blog dedicated to JVM languages.

You can see it just as a clever trick, but it is useful as an example of a different way of thinking. It shows how we can use the properties of a pseudo-random sequence to infer results that sometimes would be difficult to get using classic methods.

Go to the full post

From Collection to array

I moved this post to Biting Code, my blog dedicated to JVM languages.

Concrete classes in the Java Collection hierarchy support cloning, but this is not available to the root Collection interface. So, if we don't know the actual type of a collection, we have to fall back to the Collection.toArray() methods.

Go to the full post

String, StringBuffer, StringBuilder

This post has been moved to Biting Code, my blog dedicated to JVM languages.

What is the difference among the Java classes String, StringBuffer, and StringBuilder. And when use one class or the other.

Go to the full post

Shallow copy

This post has been moved to Biting Code, my blog dedicated to JVM languages.
Difference between shallow copy and deep copy, the Object.clone() method, a couple of useful array management functions, System.arraycopy() and Arrays.copyOf(), deep copy of arrays, and how the fact that standard wrappers type are immutable impacts on this.

Go to the full post

When null does not mean false

This post has been moved to Biting Code, my blog dedicated to JVM languages.
If you have a background in other languages than Java, you could expect that null would be considered equivalent to false. This could lead to some unpleasant surprise.

Go to the full post