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 [...]
Entries Tagged 'Java' ↓
Experimenting with Scala Parallel Collections (contd.)
October 18th, 2011 by Amir Moulavi — Java
Tags: collection, parallel, scala
Getting started with Android NDK
October 13th, 2011 by Per-Erik Bergman — Android, Embedded, Java, Tips & Tricks
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: Java, ndk, programming, tutorial
Injectors and Extractors in Scala
October 11th, 2011 by Amir Moulavi — Java
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: case, extractor, injector, scala
Simple Parsing of Complex JSON and XML Documents in Java
October 9th, 2011 by Johan Haleby — Java, Testing, Tips & Tricks
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 [...]
Scala Type Variances – Part three
October 5th, 2011 by Amir Moulavi — Java
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: lower-bound, scala, subtyping, type, upper-bound, variance
Scala Type Variances – Part two
October 4th, 2011 by Amir Moulavi — Java
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: contravariant, scala, subtyping, type, variance
Scala Type Variances – Part one
October 3rd, 2011 by Amir Moulavi — Java
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: covariant, scala, subtyping, type, variance
Experimenting with Scala Parallel Collections
October 2nd, 2011 by Amir Moulavi — Java
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: collection, parallel, scala
IntelliJ IDEA performance improvement
September 26th, 2011 by Mattias Severson — Java, Tips & Tricks
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: home directory, idea, intellij, performance, tools
Infinitest
September 21st, 2011 by Anders Eriksson — Java, Testing, Tips & Tricks
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: automated testing, Java, junit
Multipart Form Data File Uploading Made Simple with REST Assured
September 15th, 2011 by Johan Haleby — Java, Testing, Tips & Tricks
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: automated testing, http, rest
Create ‘native’ Java applications on OS X and Windows using Maven plugins
August 15th, 2011 by Tobias Södergren — Java, Tips & Tricks
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: desktop, Java, maven, native
Apache Camel automatic type conversion
August 12th, 2011 by Jan Kronquist — Java
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: camel, integration, Java
OSGi quick start
July 15th, 2011 by Jan Kronquist — Java
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: Deployment, karaf, osgi
Apache Camel and SOAP
July 14th, 2011 by Jan Kronquist — Java
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: camel, integration, Java, sample
