Skip to content

Instantly share code, notes, and snippets.

View hastebrot's full-sized avatar

Benjamin Gudehus hastebrot

  • Freiheit.com
  • Hamburg, Germany
  • 08:38 (UTC +01:00)
View GitHub Profile
dependencies {
// collection query engine.
compile "com.googlecode.cqengine:cqengine:2.5.0"
}
package io.requery.playground.modeljpa
import io.requery.Persistable
import io.requery.query.MutableResult
import java.io.Serializable
import java.net.URL
import java.util.Date
import java.util.Optional
import java.util.UUID
import javax.persistence.CascadeType
import java.util.function.Predicate
import javafx.beans.binding.Bindings
import javafx.beans.property.ObjectProperty
import javafx.beans.property.SimpleObjectProperty
import javafx.collections.FXCollections
import javafx.collections.ObservableList
import javafx.collections.transformation.FilteredList
import javafx.collections.transformation.SortedList
class TransformatedListContext<E> {
@hastebrot
hastebrot / bret_victor-reading_list.md
Created February 13, 2016 00:54 — forked from nickloewen/bret_victor-reading_list.md
Bret Victor’s Reading List

This is a plain-text version of Bret Victor’s reading list. It was requested by hf on Hacker News.


Highly recommended things!

This is my five-star list. These are my favorite things in all the world.

A few of these works have had an extraordinary effect on my life or way of thinking. They get a sixth star. ★

@hastebrot
hastebrot / ManageCtrl.java
Last active January 12, 2016 10:41
Usage of TestFX and DataFX
import javafx.fxml.FXML;
import javafx.scene.control.TextField;
import javafx.scene.layout.AnchorPane;
import io.datafx.controller.ViewController;
@ViewController("manage.fxml")
public class ManageCtrl extends AnchorPane {
@FXML
private TextField email;
@hastebrot
hastebrot / springer-free-maths-books.md
Created December 28, 2015 18:10 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links
@hastebrot
hastebrot / README.md
Last active March 6, 2022 06:31
Transducers in Kotlin

Transducers are composable algorithmic transformations. They are independent from the context of their input and output sources and specify only the essence of the transformation in terms of an individual element. Because transducers are decoupled from input or output sources, they can be used in many different processes - collections, streams, channels, observables, etc. Transducers compose directly, without awareness of input or creation of intermediate aggregates.

Original source code (from Oct 12, 2014):

Change notes:

  • Converted to Kotlin 1.0.0-beta-3595 and JUnit 4.12.
# -*- coding: utf-8 -*- #
module Rouge
module Lexers
class Kotlin < RegexLexer
title "Kotlin"
desc "Kotlin <http://kotlinlang.org>"
tag 'kotlin'
filenames '*.kt'
@hastebrot
hastebrot / Accent.py
Last active September 22, 2015 01:01 — forked from endolith/Accent.py
Documenting the matplotlib colormaps
# https://github.com/matplotlib/matplotlib/issues/881
# Several of the ColorBrewer maps are "qualitative", meaning
# they are just a group of colors that can be used together
# for categories of data. So I remapped Accent to segments
# instead of continuous:
# Actually, these should be used with ListedColormap, and
# the number of colors should depend on the number of
# categories in the data, with colors removed from the
# list in a certain order?
@hastebrot
hastebrot / mapcss_cartocss_cascadenik.md
Last active September 11, 2015 11:18 — forked from tmcw/mapcss_cartocss_cascadenik.md
MapCSS vs CartoCSS

In which I begrudglingly compare MapCSS and CartoCSS because people keep asking.

I hate this kind of writing - it's annoying to try to describe one bit of software versus another, and this can and will fall out of date every time that somebody makes a big change to their library. But people want it, or whatever, so here it is.

Since CartoCSS and Cascadenik are weird cousins, the big difference is between them and MapCSS.

Let's see, differences:

  • CartoCSS is designed for Mapnik. That is, it tries to expose every possible Mapnik style option and ability, and supports every Mapnik datasource.
  • MapCSS is designed for OSM. That is, it makes it easy to style based on OpenStreetMap data types, tags, and so on.