How to crash javac (jdk8) for free

This simple snippet can cause javac (from the JDK 8) to crash : public class TestExtendConsumer { @FunctionalInterface public interface NumberConsumer< E extends Number> extends java.util.function.Consumer< E>{void accept(E number);} private static < E extends Number> void extend(E number) { System.out.println(number); } public static void main(String[] args) { NumberConsumer numberConsumer = TestExtendConsumer::extend; numberConsumer.accept(1); } } Impressive.… Read More »

Tableau de visualisation SNCF (sorry, post in french only)

Je dois dire que je suis un habitué de l'app fusion de la sncf sobrement appelé "SNCF" https://play.google.com/store/apps/details?id=com.sncf.fusion. Et rien à dire, elle est plutôt complète puisqu'elle offre la possibilité de visualiser les horaires par gare ou par ligne, où que l'on se trouve. Elle permet aussi d'avoir toutes les infos "publiées" (donc pas toutes… Read More »

How to colorize an xml by code

The following class will help you to do that. You can easily transform this : <?xml version="1.0" encoding="UTF-8"?> <kcfg xmlns="http://www.kde.org/standards/kcfg/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd"> <kcfgfile name=""/> <group name="com.librehat.yahooweather"> <entry name="woeid" type="String"> <default></default> </entry> <entry name="interval" type="Int"> <default>60</default> </entry> <entry name="celsius" type="Bool"> <default>true</default> </entry> <entry name="fahrenheit" type="Bool"> <default>false</default> </entry> <entry name="ms" type="Bool"> <default>false</default> </entry> <entry name="kmh" type="Bool">… Read More »

Hubot : how to pipeline your commands ?

If you got used to creating new commands in your Hubot server, you will probably remember of this syntax : robot.hear(/say hello/i, function(res) {/*...*/} robot.respond(/how are you/i, function(res) {/*...*/} When you want to combine then into one, the easy way out is to create a spare command like this one : robot.respond(/hello, how are you/i,… Read More »