Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import matplotlib
matplotlib.use('agg') # avoid use of tkinter (not preinstalled on Linux)
# GIF support requires ImageMagick which is installed by default on many Linux installations
import holoviews as hv
hv.extension('matplotlib')
# create a series of 5 x 5 heatmaps
@smillies
smillies / MapInverter.java
Created September 29, 2016 22:38
Map Inversion
package java8.util;
import static java.util.stream.Collectors.groupingBy;
import static java.util.stream.Collectors.mapping;
import static java.util.stream.Collectors.toCollection;
import static java.util.stream.Collectors.toMap;
import java.util.AbstractMap.SimpleEntry;
import java.util.Collection;
import java.util.HashMap;
@smillies
smillies / FibCached.java
Last active January 21, 2019 16:55
Caching recursive functions
package java8.concurrent;
import java.math.BigInteger;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.Executor;
import java.util.function.Function;
/**
/*******************************************************************************
* Copyright (c) 2013,2014 Rüdiger Herrmann, Sebastian Millies
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Rüdiger Herrmann - initial API and implementation
* Sebastian Millies - increase type safety & simplify reflection by using enums