Accueil / Java Techs / Groovy

Groovy

Groovy

How to create a temporary file to store data

Create temporary files

Your application has to write data out in a temporary file to reprocess them before rendering to users. The file will be created temporarily and swept our when the application restarts or shuts down. How do we create such a ...

Lire la suite...

Fastest way to get the first n elements of a List into an Array

Fastest way to get the first n elements of a List or an Array

def s = ‘Hello Groovy world!’ assert s.take(5) == ‘Hello’ assert s.drop(6) == ‘Groovy world!’ Python Let’s assume an arbitrary list/array: in_list = list(range(10)) // Python2: in_list = range(10) // in_array = [i for i in range(10)] Slicing the list ...

Lire la suite...

(English) An annoyed error needed to be paid more attention when using RestBuilder grails plugin

Désolé, cet article est seulement disponible en Anglais.

Lire la suite...

L’opérateur de spaceship Groovy a expliqué

Have you ever heard of the spaceship operator? If it is the case, how does it look like? To be honest, I have known it recently when I used this comparison operator to sort an array list of objects. In ...

Lire la suite...

(English) ArrayList in Java

Désolé, cet article est seulement disponible en Anglais.

Lire la suite...

Utilisation des propriétés du système dans Grails

Désolé, cet article est seulement disponible en Anglais.

Lire la suite...

Combine two lists in Groovy

Combination or concatenation of two or multiple lists are believed to appear quite frequently in programming. This article aims to show you how to union two lists in Groovy in different ways. Combine lists with addAll The java.util.ArrayList.addAll(Collection<? extends E> c)  ...

Lire la suite...

(English) Unveil magic of hibernate lazy loading

SQL logging in hibernate

Désolé, cet article est seulement disponible en Anglais.

Lire la suite...