RSSAmplifier

Blog

Stuff and Thoughts on IT Stuff

Recent content on Stuff and Thoughts on IT Stuff

grison.meRSS feed ↗51 posts

Latest posts

Error Prone

I discovered error-prone some years ago, but didn’t take a chance to use it, but this week I was reminded about it by someone on Twitter and decided now it was time. What is error prone? Error Prone is a static analysis tool for Java, developed by Google, designed to identify and correct bugs in Java code at compile-time. Key features include: Bug Pattern Detection: Scans for common mistakes…

Using htmx.org

I’ve been reading a lot about htmx and decided I would need to check it out. I don’t have a particular project I am working on currently, so instead I just ported the famous Spring PetClinic project to use htmx besides its standard stack which is based on Spring Boot, Thymeleaf and Spring Data JPA. The last one we don’t care for this project. What is htmx? As explained on htmx…

Practical Vavr

I’ve been writing a book named Practical Vavr lately 📘 Practical Vavr is all about making you want to use Vavr in your day to day Java programming, it’s about crafting robust and elegant Java code while embracing functional programming concepts 👌. If you want to improve your Java code quality, by using a well-thought and beautifully designed functional programming library, then you…

Covid19 and Babashka

I was browsing endlessly on Twitter and I got this tweet from Mohammed Aboullaite in my timeline: When it comes to building a command line tool, #Java is generally not the first language that comes to mind! I spent the day playing with @picocli building a #covid19 tracker CLI, compiled to native binary using @graalvm! It was funhttps://t.co/ngLKr2JUwY — Mohammed Aboullaite (@laytoun) May 9,…

WebAuthn and Clojure

As I said in my previous post Raytraclj, a raytracer in Clojure I was working on a new article. In the last week I’ve been playing with WebAuthn, and I wanted to integrate it with Clojure. There’s already a Java library named Webauthn4J which does all the heavy stuff, so it was just a matter of exposing it with a Clojure wrapper. That’s what I did with the cljwebauthn library.

Raytraclj, a raytracer in Clojure

I was preparing an article about Clojure and buddy (it is coming) and then my friend David told me: You already know your backend, APIs and stuff. Why don’t you get out of your comfort zone and do some 3D. He was right 🤠 I thought about writing a raytracer because it’s cool and I know nothing, so I searched on the web and found this gem named Ray Tracing in One Weekend.

Guide to starting with Clojure

This guide is aimed to the developer who’s interested in Clojure and want to install it and start using it right away. It will cover the installation of Clojure, some of the build tools and how they work, the configuration of an editor, of the REPL and a small hello world demonstrating how things like build, and test works. If you’re new to Clojure, at the end of this guide you should…

Fun with GTFS & Clojure

.highlight .c1 { color: #b546c2 !important; } Hi people of the internet! Today I’ll be talking about Clojure to parse and extract stuff on GTFS files, wrap all that in a simple REST API using Clojure again, and then expose this API on the net so that my iPhone can consume it and tell me what are my next bus rides. So much fun to come. I’ve got a bus next monday morning (just kidding,…

Longitude

My brother just offered me this book named Longitude: The True Story of a Lone Genius Who Solved the Greatest Scientific Problem of His time, by Dava Sobel. ISBN: 9780802714626 Anyone alive in the eighteenth century would have known that “the longitude problem” was the thorniest scientific dilemma of the day—and had been for centuries. Lacking the ability to measure their longitude,…

Vavr Functional Programming Context Pattern

FP pattern with Vavr & Java If you don’t know Vavr: Vavr is a functional library for Java. It helps to reduce the amount of code and to increase the robustness. A first step towards functional programming is to start thinking in immutable values. Vavr provides immutable collections and the necessary functions and control structures to operate on these values. The results are beautiful and…

Introduction to Functional Programming with Vavr

Pure functions, High Order functions, Immutability, Composition, Currying, Recursion, Lazy, Functors, Foldable, Applicative, Category, Semi Group, Monoid, Monad. Concepts I won’t write something easier to follow than: http://adit.io/posts/2013-04-17-functors,_applicatives,_and_monads_in_pictures.html I encourage you to follow it, but for this article I will take some of its examples and just…

TechEmpower framework benchmarks & Duct

Hey people of the internet, in order to continue our serie on Clojure & Duct, I decided to implement the TechEmpower frameworks benchmark this time using the Duct framework, as it is not already listed in Round 16 and I saw no Pull Request about it on their Github, and because this is fun & quick. TechEmpower frameworks benchmark This project provides representative performance measures across a…

Duct modules for MongoDB and Immutant

Hey that’s me again ! As I’m planning to implement the TechEmpower framework benchmark for the Clojure’s Duct framework I wanted to use MongoDB (because no Clojure framework was using it for this benchmark) from a duct application, and also be able to run it on Immutant because I’ve seen that it was the top performer for both the json and plaintext tests, so why not run…

Duct and Redis

I was showing duct to a friend not versed into Clojure at all, and he told me that he did not understand what was going on. How he was supposed to add redis to the stack, that he saw the duct redis module but didn’t even know where to start from there. Duct is super awesome, Clojure is too obviously, the litterature on duct is not really thorough on the web, you have some wiki pages on the…

Did you mean Elixir?

So I was procrastinating on HN and I saw the following post « Elm and Phoenix/Elixir in Production for France TV », something like 3 days ago. You can find the HN comments here. It’s been some time I read about Elm and Elixir on HN, but I did not have the chance, or took the time to try these two piece of technology. So here we are, I’ll try to implement the Norvig’s Did you mean…

Redux4j, Implementing Redux in Java

Hi people of the internet! After multiple months having fun with React and Redux, here’s what I thought: « why can’t we have some fun implementing it in Java 8? » That’s what we’re going to do right away, just for fun :) To be honest my first idea was to write it in Clojure and make on article of it, but there was nothing new nor hard about it, so get back to classic.

Monster Component in Java with Spring

So yesterday I was browsing twitter and clicked on a link going to Antonio’s blog. I don’t even remember what I was looking for. Thing is I scrolled through the blog items and I stumbled upon the Monster Component in Java EE 7 article, and wow what an achievement. Read it. https://antoniogoncalves.org/2013/07/03/monster-component-in-java-ee-7/ I definitely needed to do the same thing using the…

Quora homework question, Smile and Clojure

Looking at my twitter feed I saw the following Quora question: How do I write a program that produces the following output?. People were all trying to create some cyphered program that would produce the desired output, the perl one was funny. At the time I didn’t found a Clojure take on this hard problem. Code! So, here’s a Clojure one with magic randomness immutability. (defn foo [a…

Sample Clojure webapp running on clever-cloud

Why? There is no official clojure & leiningen support at the moment on clever-cloud, even if I’m sure that this is totally on track? 😃. But it’s really easy to achieve it by building locally (or Jenkins or whatever) and using the JAR deployement support of clever-cloud. Prerequisites You will need Java and Leiningen installed on your machine, but if you are already a fan of Clojure,…

harpoon, GitHub WebHook server in Go

harpoon is a simple Go program that listens for GitHub hooks like push on specific git repository refs and execute a defined command when it occurs. It can be configured in a TOML configuration file. That’s nothing fancy, just didn’t want to install the whole nodejs + npm or Apache + PHP just for this. You can take a look at the project on my blog or my GitHub:…

go-tablib, tabular datasets in CSV, JSON, YAML, ...

go-tablib is a format-agnostic tabular dataset library, written in Go. This is a port of the famous Python’s tablib by Kenneth Reitz with some new features. Export formats supported: JSON (Sets + Books) YAML (Sets + Books) XLSX (Sets + Books) XML (Sets + Books) TSV (Sets) CSV (Sets) ASCII + Markdown (Sets) MySQL (Sets) Postgres (Sets) Loading formats supported: JSON (Sets + Books) YAML (Sets…

OCaml development box using Docker

I ve just had to reinstall some software on my mac, and I decided to switch to Docker for my OCaml developments and tests. Here s what I did:

Redis mass import

Story goes like this, I m following Peter Lawrey on twitter, if you don t know him that s because either you re better at Java than him and thus you didn t had to read anything related to Java on StackOverflow in the past decade, or you re just not programming, in which case you won t care about what I m going to write. OK so not even one paragraph and I m already digressing, let s get back on…

MonMet now with OCR magic

I ve just received my new iPhone and I wanted to install MonMet on it, but I discovered that the service provided by the bus company has changed. Since my favorite bus stops were already saved on my Nexus 5 I did not saw it coming. The time table page has changed. It now displays a PNG image instead of textual content an image. They don t provide any public API either, so there s no way we can…

Popcorn Recall: one day hack with ionic

PopCorn Recall is an ionic application whose goal is to recall movies you wanted to see but didn t. It searches for movies on IMDb via omdbapi.com It s a one night dev project, it certainly misses some love to shine. How to use git clone https://github.com/agrison/recall-popcorn.git cd recall-popcorn ionic run android # or ionic run ios Credits Splashscreen PopCorn image come from DeviantArt by…

Five programming problems every Software Engineer should be able to solve in less than 1 hour

So while browsing the web or twitter I don t remember, I found a blog article Five programming problems every Software Engineer should be able to solve in less than 1 hour , where the author explains that he s found five little programming riddles that a Software Engineer should be able to solve easily, otherwise he s not .. that good! I wrote a solution in Python because it shines for such…

Go Challenge #1

I took part of the Go Challenge #1. It was a fun little problem to solve, took me a few hours. Waiting to see the results of the other players to learn some proper Go This is my submission: decoder.go package drum import ( 'bytes' 'encoding/binary' 'encoding/hex' 'fmt' 'os' 'strconv' 'strings' ) // DecodeFile decodes the drum machine file found at the provided path // and returns a pointer to a…

Forking JOhm

JOhm JOhm is a blazingly fast Object-Hash Mapping library for Java inspired by the awesome [Ohm][1]. The JOhm OHM is a modern-day avatar of the old ORM s like Hibernate with the difference being that we are not dealing with an RDBMS here but with a NoSQL rockstar. JOhm is a library for storing objects in [Redis][2], a persistent key-value database. JOhm is designed to be minimally-invasive and…

MonMet: ionic experiment

This is a weekend project, I wanted to use ionic framework for a complete little project. I discovered that the Met (official bus company in Metz) official application is completely bloated, you can t search easily for bus stations, the UI is SLOW, and you can t save favorites, nor see easily the timetable. So here it is, a small weekend project using ionic, spring boot and redis. The code is…

Experiment with Websockets

Sermonis, an experimentation with Websockets For the past week I did some experimentations with some interesting technologies, and at the end I had some kind of real time webchat application platform where users could create chat rooms (with or without passwords) and share URLs to friends so that they could join the discussion. The Sermonis application was born. Its goal is to provide users an…

Learning Scala

I‘m really learning Scala, in depth this time. Indeed, I‘ve been reading Programming in Scala these days. While learning it I discovered what are implicits, and how cool they are. I ll let you discover what they are by reading the [following article][1] since they explain that way better than me. A cool use of implicits is that you can extend the Scala language with cool new syntaxes features, for…

Releasing Some Code

Releasing Some Code I‘ve been holding on my [New Year Resolutions][1] lately. I have released some code to [GitHub][2], more precisely [jssg][3], [legacy4j][4]. JToml: TOML for Java Yesterday while reading [Hacker News][5] a thread about [TOML][6] appeared and since there were no parser available in Java for the moment, I decided to create one, so if it can be of any use sooner or later (personal…

Coding challenge: Maman les petits avions

So Olivier Croisier created a little challenge on his website via this blog post Coding challenge: Maman les petits avions This is my answer in OCaml to this challenge: (* See: http://thecodersbreakfast.net/index.php?post/2013/02/18/Coding-challenge-maman-les-petits-avions --- compile & run: $ ocamlfind ocamlc -package batteries -linkpkg avions.ml -o avions $ ./avions *) open Batteries;; (* The…

Magical Java puzzle, Pat the Unicorns

Yesterday while browsing the web I found that blog post by ZeroTurnaround: Magical Java puzzle, pat the Unicorns . It seemed interesting to find an easy and elegant solution. This is what I came up with: /** See: http://zeroturnaround.com/fun/magical-java-puzzle-pat-the-unicorns/ */ import java.util.*; public class Unicorn { static Set<Integer> lines = new HashSet<Integer>(); public static boolean…

Enjoying IntelliJ

IntelliJ Ok, it is official, I‘m using [IntelliJ IDEA][1] since more than one week now, and I‘m enjoying it. I‘ve been wanting to test it since a long time, I have seen so many people at Devoxx, at local JUGs using it, that it must be a good IDE, so I had to test it. Notice that I am an Eclipse power user, I love the hell out of it, but I will try to go with a simple pros and cons of my first week…

Website Update

Website update, using Jssg You are seeing the new design of this site, and I wanted to talk a little bit about it, so let‘s get started. It has been years since I did not touched this site, and I wanted to refresh it in some way. The previous web site was using Jekyll as a static site generator. While I wanted to refresh the visual aspects I quickly checked about Jekyll alternatives.

Did You Mean

Peter Norvig s Did You Mean ? Almost one year and a half ago, I did found something interesting on the web. An article of Peter Norvig explaining How to Write a Spelling Corrector. At this time I found it brilliant and did implement it in OCaml (but lost it). I tried to shorten the provided Python version, and also the Java version made by Rael Cunha. Eventually, I did come with a shortest version…

Vim XML Indent on Windows

Today I had some XML to check and I wanted to pretty format it inside gVim on my Windows 7 workstation. On Unix we ve got xmllint who s able to pretty format XML content, but I did not have it on Windows. I knew I could do something like :%!xmllint in Vim and bam it would work. All I was needing was that external program. Instead of searching on the web for a port from Cygwin or something else, I…

Unix Prompt

Arriving at my new working place, I wanted to install my own .bashrc and other dotfiles, like I had on my previous work station. But this time, I wanted a distinguishable prompt with nice colors and still easy for the eyes. So I decided to go on with the Solarized theme and installed it for PuTTY, Vim and other tools I use on a daily basis. The next little challenge for me was to clearly…

Hello

Hello More is coming

(untitled)

About

My name is Alexandre aka Alex, I m a 35 years old (and counting) Tech Lead, Software Craftsman, Jack of all trades Developer working in Luxembourg, and living in Metz, France. Up to now, I‘ve accumulated a few passions that you will be able to glimpse below. IT I‘ve made it my job, I like it a lot. Coding, Agile and other hype buzzwords that looks good on CV. I‘m into almost everything IT, but my…

Jtoml

TOML for Java This is a parser for Tom Preson-Werner s (@mojombo) [TOML][1] markup language, using Java. GitHub project You can browse the project on my GitHub repository [@agrison/jtoml][2]. Usage Parsing // parse from a String or from a File Toml toml = Toml.parse('pi = 3.14\nfoo = \'bar\''); toml = Toml.parse(new File('foo.toml')); Getting values // get different types toml.get('foo');…

Legacy4J

legacy flat files for Java Are you a Java Developer who needs to parse old times legacy flat files? You re bored to write each time a new parser for these files? In this case, you ve come to the right page. Legacy4j is a small Java library that helps you load fixed length files to POJOs and saves them the other way. You can get the legacy4j library from my GitHub at http://github.

OCamail

Simple SMTP Server written in OCaml OCamail is a simple SMTP Server acknowledging all requests it receives. It is written in Objective Caml for development and learning purposes. To say the truth, I just found the combination of OCaml & mail to be funny, so I decided to write something related 😀 Attachments (non-gziped only) are supported and can be saved in a directory in order to be checked if…

Photography

I&rsquo;m an amateur photographer. In another life I would have love to be a professional photographer, travelling around the planet to capture its beauty for the whole world to see. I enjoy shooting landscape, at night, animals & architecture. I&rsquo;m from France and work in Luxembourg. Gear Camera: Canon EOS 6D Lenses: Canon EF 50mm f/1.4 Tamron SP 24-70mm f/2.8 Canon 70-200 f/4 L USM Samyang…

Projects

Here are some projects I did work on: harpoon: GitHub WebHook server in Go go-tablig: format-agnostic tabular dataset library johm: Simple Java ORM for Redis jtoml: TOML for Java scalocco: port of Docco in Scala jssg: Java Static Site Generator catastrophic: a Monster Component in Java & Spring, see also my blog article sermonis: chat experiment with Spring & Websockets ocamail: pun intended…

Scalocco

Scalocco is a really quick-and-dirty, literate-programming-style documentation generator. It is a Scala port of Docco, which was written by Jeremy Ashkenas in Coffescript and runs on node.js. Scalocco produces HTML that displays your comments alongside your code. Comments are passed through Markdown, and code is highlighted using google-code-prettify syntax highlighting. Currently, to build…

Sermonis

Sermonis Sermonis is an experimentation around Spring-Data, MongoDB, AngularJS and Websockets. Its goal is to provide a platform where users can create chat rooms (password protected or not), share a unique URL where friends can join and chat using only their browser. To use Sermonis, build it using maven calling a init class that will prepare the secret tokens needed by the application, then…

go-tablib

go-tablib: format-agnostic tabular dataset library Go-Tablib is a format-agnostic tabular dataset library, written in Go. This is a port of the famous Python&rsquo;s tablib by Kenneth Reitz with some new features. Export formats supported: JSON (Sets + Books) YAML (Sets + Books) XLSX (Sets + Books) XML (Sets + Books) TSV (Sets) CSV (Sets) ASCII + Markdown (Sets) MySQL (Sets) Postgres (Sets)…