Home » JVM Languages » Page 53

JVM Languages

GitHub Social Graphs with Groovy and GraphViz

The Goal Using the GitHub API, Groovy and GraphViz to determine, interpret and render a graph of the relationships between GitHub users based on the watchers of their repositories. The end result can look something like this. The GitHub V3 API You can find the full documentation for the GitHub V3 API here. They do a great job of documenting ...

Read More »

Power with control: Scala control structures and abstractions

So ramping up with the Scala 101 series, I thought now is an appropriate juncture to introduce control structures in Scala. To a certain extent, working with the Scala language presents a vista wherein the developer is afforded much greater freedom than in many other environments, but therein lies a great many choices and a sense of responsibility. As such, ...

Read More »

ScaTDD: Casting an eye over three major Test frameworks in Scala

Testing has traditionally been the gateway process for Scala development at a number of Java shops looking to evolve their tech stack with minimal disruption or committment. This posts hopes to cover three of the main testing frameworks in the Scala landscape, ( Specs2, Scalatest and Scalacheck) with an example of the classic FizzBuzz test, for how they can be ...

Read More »

Using Groovy scriptlets inside a *.docx document

Introduction One of my recent projects required automated generation of contracts for customers. Contract is a legal document of about 10 pages length. One contract form can be applied for many customers so the document is a template with customer info put in certain places. In this article I am going to show you how I solved this problem. Requirements ...

Read More »

A crash course in Scala types

After many years of Java development, discovering Scala’s type system and related features was something of a departure for me. Suffice to say GADT wasn’t my first four letter utterance when learning about pattern matching on types, let alone what, when and how to use variance annotations and generalized type constraints. To kick things off, here’s a ‘small but powerful‘ ...

Read More »

Partial updates in an immutable World

This post was prompted by a conversation with a good friend, who is an experienced Java developer taking their first, tentative, steps towards becoming a Scala programmer. Basically, the conversation went as follows: “…Immutability seems good and like a goal I should aim for. How can I get this in my domain objects without having to provide a multiplicity of ...

Read More »

Processing JSON in Scala with Jerkson

Introduction The previous tutorial covered basic XML processing in Scala, but as I noted, XML is not the primary choice for data serialization these days. Instead, JSON (JavaScript Object Notation) is more widely used for data interchange, in part because it is less verbose and better captures the core data structures (such as lists and maps) that are used in ...

Read More »

Squealer: An Anti-ORM Influenced Scala Tool

I was reading a blog post from Prismatic the other day and it got me thinking about how we, as programmers, have diverged so much from our roots. In the beginning, we designed small tools which did one thing and did it well. Now we’re more concerned with meeting deadlines and shipping code as fast as possible. We’ve fallen in ...

Read More »

Scala Basic XML processing

Introduction Pretty much everybody knows what XML is: it is a structured, machine-readable text format for representing information that can be easily checked for the “grammaticality” of the tags, attributes, and their relationship to each other (e.g. using DTD’s). This contrasts with HTML, which can have elements that don’t close (e.g. <p>foo<p>bar rather than <p>foo</p><p>bar</p>) and still be processed. XML ...

Read More »