This post is part of a series of articles about LISP, a function called SUBST, Clojure, and other interesting stuff. You may want to read the previous post before continuing with this post. Part 1: Introducing LISP In part 1 of this series, we learned about the nine special forms of LISP, the building blocks [...]
Entries from February 2012 ↓
The Fantastic SUBST Function (part 2)
February 29th, 2012 by Ulrik Sandberg — Dynamic languages
Tags: clojure, lisp, recursive
Configure Morphia to work without a default constructor
February 28th, 2012 by Johan Haleby — Java, Tips & Tricks
In my current project we’re migrating our existing entity model to MongoDB and have turned to Morphia for mapping our Java objects to and from its MongoDB representation. Our Java entities are immutable and preferably we’d like to keep it that way. Morphia, like most other mapping frameworks, require us to have a default constructor [...]
Mockito and Dependency Injection
February 25th, 2012 by Mattias Severson — Java, Testing
When writing your Java unit test you will soon need a way to handle the dependencies of your classes under test. Mockito have some nice features that simplify the creation and usage of mock objects that have improved gradually during the last couple of years. Class under test Imagine that you write an Example class [...]
Tags: dependency injection, Java, java ee, junit, mocking, mockito, spring
The Fantastic SUBST Function (part 1)
February 16th, 2012 by Ulrik Sandberg — Dynamic languages
When John McCarthy in 1960 wrote his famous paper on the programming language LISP, he used a particular function to illustrate what you could do with the language. The language consisted of only nine “special forms”, primitive building blocks by which any computable function could be created. The function was called SUBST, and it included [...]
Tags: clojure, lisp, recursive
Komarro – A new interesting mock framework for Java
February 13th, 2012 by Johan Haleby — Java, Testing
Mocking is a well-known and estabilished concept in our field of work as developers. There are a lot of frameworks for creating and setting up expectations on mock objects in all kinds of different languages. For me as a Java developer my introduction with mocking was through the EasyMock project. Due to the techincal limitations [...]
Tags: easymock, mocking, mockito, powermock, tdd
ReSharper live template for an INPC property
February 13th, 2012 by Andreas Hammar — .Net, Tips & Tricks
I’ve considered ReSharper a must-have for Visual Studio for many years, and their live templates are code snippets on steroids. Here I share with you my simple but effective template for generating properties. What it does is add the backing field in camelCase (with an underscore) matching your public name written in PascalCase. All you [...]
Tags: .Net, windows phone, windows phone 7
How to really fix the too many open files problem for Tomcat in Ubuntu
February 11th, 2012 by Johan Haleby — Tips & Tricks
A couple of days ago we ran into the infamous “too many open files” when our Tomcat web server was under load. There are several blogs around the internet that tries to deal with this issue but none of them seemed to do the trick for us. Usually what you do is to set the [...]
How you list the available goals for a maven plugin
February 11th, 2012 by Tobias Södergren — Tips & Tricks
I’ve been attending an excellent lab by Sune Simonsen which was about how to create a Javascript twitter client. The lab utilizes the maven-lab-plugin, which can be used to create step-by-step labs using Maven. During the lab, i wanted to know which step I was at and I figured that there should be a goal [...]
Builder pattern with a twist
February 7th, 2012 by Uzi Landsmann — Java, Tips & Tricks
The builder pattern is great, isn’t it? It lets you create nice immutable classes without the need for multiple constructors and it gives the API users freedom in choosing which arguments they want to use when creating the instance. But what happens when you want to tell the user that she must call one builder [...]
Unboxing Dropbox and SharpBox
February 6th, 2012 by Johan Silfversparre — .Net
How to programmatically upload a file to your Dropbox account. On a train trip during the New Year’s weekend, I spent time testing and collecting notes about how to interact with Dropbox. I will share my findings with you in this blog post. Dropbox “Dropbox is a free service that lets you bring your [...]
