Entries Tagged 'Java' ↓

Experimenting with Scala Parallel Collections (contd.)

Amir Moulavi

In the previous post we went through Scala parallel collections and you saw how you can convert a sequential collection into a parallel one by using method par on that collection. In this post I want to show you how you can write your own parallel collection in Scala. The example I use for this [...]

Tags: , ,

Getting started with Android NDK

Per-Erik Bergman

You want to try out the Android NDK? I have gotten a lot of questions about how to setup and work with the NDK and I decided to write down how I do it. My goal with this entry is to gather all the information you need to get started with the Android NDK. I [...]

Tags: , , ,

Injectors and Extractors in Scala

Amir Moulavi

If you have used case classes in Scala, you can not neglect the power they bring to your applications. They provide a recursive decomposition mechanism via pattern matching. In this post I go through injectors and mostly extractors. You will see that how extractors can be employed for pattern matching. Consider that we need to [...]

Tags: , , ,

Simple Parsing of Complex JSON and XML Documents in Java

Johan Haleby

In this blog I’m going to demonstrate how to parse and validate more complex JSON and XML documents in Java using the REST Assured framework and the XmlPath and JsonPath components available in this framework. Since REST Assured is implemented in Groovy it can be really beneficial to take advantage of Groovy’s collection API. Let’s [...]

Tags: , ,

Scala Type Variances – Part three

Amir Moulavi

So far we have seen how to define covariant and contravariant subtypes in Scala. In this post we will study lower bounds and upper bounds and see how they can be of great help when designing your application. Lower bounds Consider the class I defined in the first post: Company is covariant in type T [...]

Tags: , , , , ,

Scala Type Variances – Part two

Amir Moulavi

In the previous post, I went through what covariant subtyping is. In this post we will study contravariant subtyping with a small example. Contravariant Subtyping Do you remember the definition of covariant? Contravariant is the other way around. I will clarify this by the following example (example is adopted from [1]). Consider we have a [...]

Tags: , , , ,

Scala Type Variances – Part one

Amir Moulavi

I remember when I started to learn Scala, I usually come up with brackets in the Scala API doc that have plus and minus characters inside. Honestly that scared me a little bit! But after I learned a bit about Scala type system, I know the purpose of theses type declarations and I appreciate their [...]

Tags: , , , ,

Experimenting with Scala Parallel Collections

Amir Moulavi

In this short post, I want to show you how you can avail from Scala parallel collections in your application and under which conditions it makes sense to use it. Parallel Collections were introduced in Scala 2.9 release which are built on the same abstractions and provide the same interfaces as existing collection implementation. It [...]

Tags: , ,

IntelliJ IDEA performance improvement

Mattias Severson

Working as a consultant, it is not unusual that I am referred to customer specific software environment with regard to computers, operating systems, networks and other configurations. However, since I work with Java, most tools are available online and they can easily be downloaded and installed on different platforms. IntelliJ IDEA is no exception, but [...]

Tags: , , , ,

Infinitest

Anders Eriksson

The Infinitest Eclipse plug-in looks for unit tests and have them run as soon as changes are detected. Just as modern IDEs have provided automatic compilation for ages this can now also be provided for unit testing. The test outcome shows up as a green or red bar in the bottom of the Eclipse application [...]

Tags: , ,

Multipart Form Data File Uploading Made Simple with REST Assured

Johan Haleby

From a client perspective it has always seemed to me that uploading a large file or stream to a server using multi-part form data encoding in Java is overly complex. To address this I implemented support for it in REST Assured 1.3. Example Let’s say you have a simple HTML page that performs file-uploading from [...]

Tags: , ,

Create ‘native’ Java applications on OS X and Windows using Maven plugins

Tobias Södergren

When building a desktop application, the target audience usually expects an executable to when launching it. If the application is written in Java you have the options to create a batch file to launch it, create an executable jar file, compile the application as a native application or wrap the application using a native ‘launcher’. [...]

Tags: , , ,

Apache Camel automatic type conversion

Jan Kronquist

Apache Camel has good support for type conversion and it is easy to add your own type converters. In this blog post I’ll show how to create a generic type converter using reflection. Type conversion is done by Camel either when you explicitly tell Camel to perform conversion or in some cases where Camel detects [...]

Tags: , ,

OSGi quick start

Jan Kronquist

OSGi has been looking promising for a long time, but I have felt that getting started have been really complicated and deploying dependencies have been messy, in particular for transitive dependencies. While I was looking into deployment options for Apache Camel I realized that a lot has happened with OSGi since last I looked. In [...]

Tags: , ,

Apache Camel and SOAP

Jan Kronquist

To learn more about Apache Camel I have implemented a non-trivial integration scenario using freely available SOAP web services to create a service that can return the weather at an airport. The webservices are: The Airport Information Webservice to find the location of an airport The National Digital Forecast Database Webservice provided by http://www.weather.gov/ to [...]

Tags: , , ,