- requires python 2.7 (maybe python 3.3+ will work too, didn't tested it)
Put git2neo.py somewhere in your $PATH
and chmod +x
it.
package example.statemachine | |
import scalaz.{State, Scalaz}, Scalaz._ | |
object FSM { | |
def apply[I, S](f: PartialFunction[(I, S), S]): FSM[I, S] = | |
new FSM((i, s) => f.applyOrElse((i, s), (_: (I, S)) => s)) | |
private def states[S, O](xs: List[State[S, O]]): State[S, List[O]] = | |
xs.sequence[({type λ[α]=State[S, α]})#λ, O] |
#!/usr/bin/env python | |
import csv | |
import collections | |
import re | |
import json | |
import requests |
/* | |
* Based on http://stackoverflow.com/a/31641779/2996265 | |
* | |
* Changed: | |
* - use https://github.com/knutwalker/validation to accumulate errors | |
* - support lists as well (polymorphic on higher kinds would be better, though) | |
* - use -Xexperimental for java8 style SAM support | |
*/ | |
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Control.Applicative ((<$>), (<*>)) | |
import Control.Monad (mzero) | |
import Data.Aeson | |
import Data.Aeson.Types (emptyObject) | |
import qualified Data.ByteString.Lazy.Char8 as BL |
package com.example; | |
import com.wordnik.swagger.annotations.ApiParam; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.PathParam; | |
import javax.ws.rs.Produces; | |
import javax.ws.rs.core.MediaType; | |
import javax.ws.rs.core.Response; |
(function(G,O,o,g,l,e){G.GoogleAnalyticsObject=O;G[O]=function(){G[O].q.push(arguments)},G[O].q=[],G[O].l=+new Date;e=o.createElement('script'),l=o.scripts[0];e.src=g;l.parentNode.insertBefore(e,l)}(this,'ga',document,'//www.google-analytics.com/analytics.js')); | |
// ===> | |
ga('create', 'UA-XXXXXXX-Y'); | |
ga('send', 'pageview'); |
λ> enumFromThenTo 3 9 50 | |
[3,9,15,21,27,33,39,45] | |
it :: (Enum a, Num a) => [a] | |
λ> enumFromThenTo 'A' 'C' 'I' | |
"ACEGI" | |
it :: [Char] | |
λ> data Foo = A | B | C | D | E | F | G | H | I deriving (Enum,Show) | |
λ> enumFromThenTo A C I |
sealed trait Thingy[+A] { | |
def bla(x: String): String | |
val bla2: String ⇒ String = bla | |
} | |
case class Good[A](x: A) extends Thingy[A] { def bla(x: String) = x } | |
case class Bad(t: String) extends Thingy[Nothing] { def bla(x: String) = t } | |
object Thingy { | |
def good1[A](x: A): Thingy[A] = Good(x) |
package stackoverflow; | |
import org.apache.lucene.analysis.Analyzer; | |
import org.apache.lucene.analysis.standard.StandardAnalyzer; | |
import org.apache.lucene.document.Document; | |
import org.apache.lucene.document.Field; | |
import org.apache.lucene.document.StringField; | |
import org.apache.lucene.document.TextField; | |
import org.apache.lucene.index.*; | |
import org.apache.lucene.search.*; |