Skip to content

Instantly share code, notes, and snippets.

@asmaier
asmaier / wir-sind-bild.ipynb
Last active August 29, 2015 14:25
Unsmoothed Maximum Likelihood Character Level Language Model to create headlines for the german Bild-Zeitung
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@asmaier
asmaier / ShowSystemProperties.java
Created April 8, 2014 13:33
Small java program showing a sorted list of all java system properties. Useful for debugging, e.g. encoding issues. Compile and run with "javac ShowSystemProperties.java; java ShowSystemProperties".
import java.util.Map;
import java.util.Properties;
import java.util.TreeMap;
/**
* Shows a sorted list of all system properties
*/
public class ShowSystemProperties {
public static void main(String[] argv) {
@asmaier
asmaier / KafkaProducerIT.java
Last active March 23, 2022 11:16
Simple java junit test of an apache kafka producer (works with Kafka 0.11.0.2) (see also https://github.com/asmaier/mini-kafka)
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.Arrays;
import java.util.Iterator;
import java.util.Properties;
import org.I0Itec.zkclient.ZkClient;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;