This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Plat[P <: Plat[P]] { | |
type Keyed[_, _] | |
} | |
class MPlat extends Plat[MPlat] { | |
type Keyed[K, V] = (K, TraversableOnce[V]) | |
} | |
trait Prod[P <: Plat[P], T, This <: Prod[P, T, This]] { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://www.infoq.com/presentations/scala-idris | |
http://www.cs.nott.ac.uk/~txa/publ/ydtm.pdf | |
http://coq.inria.fr/stdlib/Coq.Sorting.Mergesort.html | |
http://mazzo.li/posts/AgdaSort.html#fnref7 | |
http://eb.host.cs.st-andrews.ac.uk/writings/idris-tutorial.pdf | |
https://gist.github.com/timjb/9043255 | |
http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.InductiveFamilies | |
http://www.cse.chalmers.se/~ulfn/darcs/AFP08/LectureNotes/AgdaIntro.pdf | |
http://eb.host.cs.st-andrews.ac.uk/drafts/pe-edsl.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in bijection branch jco/macro_case_class_plus | |
// ./sbt "bijection-macros/console" | |
// paste the following | |
import com.twitter.bijection._ | |
import com.twitter.bijection.macros.common.TypesNotEqual | |
import com.twitter.bijection.macros.common.MacroImplicits._ | |
trait Semigroup[T] { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The following are just some useful category theoretic type classes | |
// Note that this IS an endofunctor -- it has to be. Our category is all possible types, | |
// so the type A and T[A] are both in our Category, so it's an endofunctor | |
trait Functor[T[_]] { | |
def map[A, B](fn: A => B): T[A] => T[B] | |
} | |
trait Monad[T[_]] extends Functor[T] { | |
// we go with the less common join approach because THIS is where the "monoid"-ness of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = """{ | |
"fields": [ | |
{ | |
"type": "int", | |
"name": "first" | |
}, | |
{ | |
"type": "string", | |
"name": "second" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.FileOutputStream; | |
import org.apache.avro.Schema; | |
import org.apache.avro.file.CodecFactory; | |
import org.apache.avro.file.DataFileWriter; | |
import org.apache.avro.generic.GenericDatumReader; | |
import org.apache.avro.generic.GenericDatumWriter; | |
import org.apache.avro.io.DecoderFactory; | |
public class Hrm { | |
public static void main(String[] args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import avro.schema | |
from avro.datafile import DataFileReader, DataFileWriter | |
from avro.io import DatumReader, DatumWriter | |
import simplejson as json | |
a = avro.schema.parse(json.dumps({"name": "hey", "type": "record", "fields": [{"name":"n", "type":"double"}]})) | |
b = avro.schema.parse(json.dumps({"name": "hey", "type": "record", "fields": [{"name":"n", "type":"int"}]})) | |
c = avro.schema.parse(json.dumps({"name": "hey", "type": "record", "fields": [{"name":"n", "type":["int","double"]}]})) | |
writer = DataFileWriter(open("a.avro", "w"), DatumWriter(), a) | |
writer.append({"n": 1.0}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.OutputStream; | |
import org.apache.avro.Schema; | |
import org.apache.avro.file.DataFileReader; | |
import org.apache.avro.file.DataFileWriter; | |
import org.apache.avro.file.FileReader; | |
import org.apache.avro.generic.GenericDatumReader; | |
import org.apache.avro.generic.GenericDatumWriter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bruce, | |
I do not know you, but I am told by people who care about you that you're a really nice guy. I was also told that a picture I tweeted recently was offensive[1]. I'm not going to try and justify this tweet: it was offensive, and it was wrong. Being a person who has been very fortunately untouched by sexual violence against children, I inconsiderately saw it as a funny subversion of a common sign, and not what it is: graffiti which trivializes the the issue of sexualizing children and sexual harassment or violence. I see that I was wrong, and in the future I will try to be much more sensitive to images which make light of a serious issue: when those who have power over children abuse that power in the worst possible way. | |
[1] The tweet in question: https://twitter.com/jco/status/360755209632362497 | |
PS I made this apology public because the tweet was public, and others saw it. I'd like for them to know that it is offensive, and that I apologize. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have a file at: scrooge_sbt/src/main/thrift/com/example/thrift/AStruct.thrift | |
namespace java com.example.thrift | |
include "thrift2/BStruct.thrift" | |
struct AStruct { | |
1: BStruct a_field | |
} |