Skip to content

Instantly share code, notes, and snippets.

@nossidge
nossidge / Snowball
Last active December 15, 2015 14:09
C++ Generate valid snowball poems, using input file of example text and Markov chains to help make it grammatically correct.
/*
~~ Snowball Poem ~~
Snowball (also called a Chaterism): A poem in which each line is a single word,
and each successive word is one letter longer. One of the constrained writing
techniques invented by the Oulipo (Workshop of Potential Literature).
~~ Program Description ~~
This program takes input from the file "input-raw.txt". It examines the file for
@dragisak
dragisak / DateTimeMapper.scala
Created February 11, 2013 18:17
Joda DateTime mapper in Slick
import slick.lifted.MappedTypeMapper
import java.sql.Date
import org.joda.time.DateTime
import slick.lifted.TypeMapper.DateTypeMapper
object DateTimeMapper {
implicit def date2dateTime = MappedTypeMapper.base[DateTime, Date] (
dateTime => new Date(dateTime.getMillis),
date => new DateTime(date)