Since my pet project (I will eventually blog about that) is in desperate need of a database and I’m doing enough Java on my day job I decided to give a Scala ORM framework a shot.
I have to warn you that I’m kind of a Scala hacker. I abuse it like a scripting language and usually grab some examples, put them together and wait for my colleagues to say “You don’t want that” or “You’re doing it wrong”. So don’t hesitate to correct me, maybe I’ll learn something too
To get some grip on the configuration of the Weblogic domains and servers at my current client, I created a tool that reads domain config files and translates them in a graph. I decided to solve this problem in Scala, mainly because I read about its powerful native XML parsing capabilities. Parsing XML turned out to be a total no-brainer, but I managed to learn something about how to solve problems the Scala way, so this is a story about Scala rather than parsing XML in Scala.
(more…)
Tags: Scala
Filed under Scala | 8 Comments »
I live in Utrecht, a city where it seems the municipality tries to annoy car drivers as much as possible. Public transport isn’t an option, even despite the traffic jams it’s slower, less reliable and don’t get me started on the attitude of bus drivers. When you want to travel from one place in Utrecht to another it’s often a good idea to find the nearest highway, it might be much longer, but often much quicker. Instead of complaining (which will stop now
) there might be a solution. I have a theory that a trip is much faster when you avoid traffic lights and use the highway as much as possible. To prove that theory, test my new (Android 2.2) phone, fresh up my Scala knowledge and have a cool pet project I started logging my trips.
In this article I will show you how to collect the data, parse and convert it to a usable format and show it on a map. This is just a first prototype and proving my theory will probably take a lot more time which I don’t have because I’m in traffic jams all the time
.
If you don’t like all the technical mumbo jumbo, just scroll to the maps, they’re cool to look at.
(more…)
Tags: geotools, GIS, openstreetmap, qgis, Scala
Filed under Java | 3 Comments »
If there is anything that made Java popular during the last decade, then it must be the community. This may sound like a paradox at first: popularity does sort of imply the existence of a community. But it’s really not just the existence or even the size of the community. It’s the vibe that counts.
(more…)
Tags: Scala
Filed under Java | No Comments »
Right now I’m following some geospatial tweets and came across an interesting one about a new option to add a geospatial index to a MongoDB. Since I’ve done some stuff with Scala recently I decided to insert the data into MongoDB with Scala using scamongo. Unfortunately the scamongo Scala driver for MongoDB gave me too much trouble, so I switched to the java driver.
Tags: geohash, geospatial, GIS, index, mongodb, Scala, spatial
Filed under General | 2 Comments »
Scala Labs at the J-Fall conference was the first in a series of public events in which we want to show the power and fun of Scala to a broad audience of developers.
Before I tell you about our experience at the JFall, I would like to explain how Scala Labs got started. This relatively new upcoming language on the Java Virtual Machine has been drawing more and more attention and many of our developers have started playing with over the last couple of months. In August some of us decided to organize an internal technology day, so all of our developers could get a better understanding of this new language and discover its merits. Because everyone was very enthousiastic about the entire day we figured that it would be a nice to organize something similar outside of Xebia as well. The exercises from that day became the basis of the Scala Labs exercises that we used at the JFall.
(more…)
Tags: Scala
Filed under General | No Comments »
Besides organizing a Scala workshop at the J-Fall meeting we also presented five technical posters to serve as discussion points for anyone interested (or just walking by). Unlike traditional meeting sessions we could interact directly, somewhat similar to open space sessions.
(more…)
Tags: Domain Driven Design, fitnesse, Frameworks, GIT, Scala
Filed under Architecture, Java | 1 Comment »
Last week me and some of my colleagues had the pleasure of being on the receiving end of an excellent training given by Jonas Bonér. The topic was his new pet project: the Akka framework. Perhaps you’ve played around with Scala lately, and also have taken the first steps in using its Actor library. Simply stated, an Actor is a unit of execution that (usually asynchronously) processes messages and encapsulate their state. An actor does not expose its state, and messages are processed sequentially. The Actor model has been around for quite some time, but today the best-known Actor implementation is Erlang.
The Actor model has been implemented in the standard Scala library by Philipp Haller (for the interested reader, a solid reference is for instance this article explaining how actors in Scala work). In most Actor examples written in Scala, it is not uncommon to find only EchoActors, PingPongActors, and FibonacciSolvingActors. Nice examples, but perhaps you might wonder if they are of any use in enterprise Scala at all. Next to this, if you’re interested in concurrent, message passing processing models, STM’s, NoSQL data stores, and occasionally wonder what the future in enterprise computing might bring, than Akka might be just the framework you’re looking for. This blog is intended to provide a brief introduction into one feature of this framework: Akka’s supervisor Actors. It is mostly based on the knowledge extracted from Jonas during the training, and I hope to whet your appetite for it.
Tags: akka, Akka, Scala
Filed under General | 12 Comments »
In my efforts to teach myself Scala, I tried solving a problem I’ve tackled in various languages, 6510 assembly code (didn’t get far…), pl/sql, Java (with and without Drools) and Groovy among them. Usually I get bogged down in some detail of the language so I never get to reap any actual benefits of my efforts in daily life. The plus side of this never ending task is that by now I don’t have to spend effort on defining a problem but instead can start coding right away.
So this story is about how to parse text in Scala and is part of THE software package that will automagically generate a menu for a week and the shopping list for that menu together with whatever else my family will need that week and send it to www.albert.nl and have the groceries delivered to my door.
(more…)
Tags: Scala
Filed under General | 9 Comments »
Aliens sending messages, Water flowing over a map and finding the hidden Welcome message in a String… Yes, Google Code Jam has returned for the 2009 edition! I participated in the Qualification Round and managed to solve all but 1 input set….
(more…)
Tags: Functional Programming, Google, google code jam, Scala
Filed under General, Java | 5 Comments »