We’ll show you an easy-as-pie way to implement a local cache using the good old ConcurrentHashMap and lambda expressions.
Sometimes I encounter weird looking if statements. By weird I'm thinking of multiple negations all over the code base.
In this article we will see how to configure and integrate SpringMVC4, Spring Data JPA with Hibernate and SpringSecurity using JavaConfig.
The code snippet is rather straightforward, iterating over a loop and generating classes at the runtime. When facing an Error, the code above is well prepared to catch it and print out the stacktrace. Apparently, the situation is a bit more complex than this - half an hour later I found myself still staring at a somewhat different error message. I
Memory mapped files are a good and often overlooked tool. I
It's a well known deficiency of most existing sampling Java profilers that their collection of stack traces has to happen at a safe point. A while back Jeremy Manson open sourced some proof of concept code where calls are made to the AsyncGetCallTrace JVMPI method which avoids the need for threads to reach a safe point in order to read their call trace. I've taken this code dump and started converting it into a usable open source project.
In particular, we current have over three thousands tests, and they take hours to run. We are doing a lot of stuff there “let us insert million docs, write a map/reduce index, query on that, then do a mass update, see what happens”, etc.
There is an irresistible attraction to writing custom caching solutions, since it seems to be the easiest path to “improving” the overall application performance.
This post is about a recent performance tuning exercise. A closer look to the application revealed it consisting of several batch jobs bundled together. The troubled application was a pretty innocent-looking small JAR file. Which, to my luck also bundled the load tests.
If you used earlier versions of Neo4j via its Java API with Java 6 you probably have code similar to the following to ensure write operations happen within a transaction
Last week Alistair and I were working on an internal application and we needed to make a HTTPS request directly to an AWS machine using a certificate signed to a different host.
I would like to describe a pure-Scala approach to modularity that we are successfully using in a couple of our Scala projects.
Interestingly, boolean types have been introduced only late in the SQL standard, namely in SQL:1999.
Java 7 has eased some pain in the area of exception handling when the new try-with-resources and multi-catch syntaxes were introduced.
Within this post we will have a deeper look into the new Date/Time API we get with Java 8 (JSR 310).
I’ve never thought I would see an unresponsive server due to a bad regex matcher but that’s just happened to one of our services, yielding it it unresponsive.
Manage mid-size, large, big or huge Visual Studio solutions, and improve build time and development performance.
Having realised that Java 8 is due for its GA release within the next few weeks I thought it was about time I had a look at it and over the last week have been reading Venkat Subramaniam’s book.
This story goes back at least a decade, when I was first approached by a PHB with a question “How big servers are we going to need to buy for our production deployment”. The new and shiny system we have been building was nine months from production rollout and apparently the company had promised to deliver the whole solution, including hardware. Oh boy, was I in trouble.
Python has a number of different concurrency constructs such as threading, queues and multiprocessing. The threading module used to be the primary way of accomplishing concurrency. Unfortunately, threads in Python are severely limited by the Global Interpreter Lock (GIL) which causes all your threads to run on the same core.
I will put my captain Obvious cape now and write in short how to get rid of methods with many parameters, especially if some of the parameters are optional, or depend on each other somehow (e.g. go in pairs, one excludes another, etc.).
In my continued reading of Venkat Subramaniam’s ‘Functional Programming in Java‘ I’ve reached the part of the book where the Stream#collect function is introduced.
We all hate dependency hell, and on any Java project of any size, you'll hit it eventually.
Sometimes you have to hack. You just have to. Don’t listen to XKCD. You don’t always regret hacking.
The use of graphics processing unit (GPU) in modern browsers, particularly for page rendering, means that there is no more excuse for laggy animation. In some cases, when the intended animation is not necessarily GPU friendly, some tricks need to be employed so that the graphics operations do not cause a potential performance problem.