Skip to content

Instantly share code, notes, and snippets.

case class Hoge(x: Int) {
lazy val i = x + 1
lazy val foo = (1 to 10).par.map(_*i)
}
Hoge(1).foo
/**
* In a static language like scala, how could we repeatedly flatten a datastructure without reflection?
* This is an interesting example of using implicit parameters to do the work for you.
*/
object DeepFlatten {
// what should this really be called? ;)
trait Flattenable[F[_]] {
def flatten[A](f: F[F[A]]): F[A]
}
@komiya-atsushi
komiya-atsushi / MinHash.java
Created September 2, 2013 16:13
b-bit Minwise hashing の Java 実装です。#DSIRNLP http://partake.in/events/76854228-ba38-4f6e-87b9-f79e30add75c での発表用に実装してみました。
/**
* b-bit Minwise hashing の Java 実装です。
* <p>
* 参考文献 : <a href="http://research.microsoft.com/pubs/120078/wfc0398-lips.pdf">b-Bit Minwise Hashing</a>
* </p>
*
* @author KOMIYA Atsushi
*/
public class MinHash {
private final int numBits;
@kevinwright
kevinwright / scaladays2014.md
Last active March 8, 2018 20:25
Scaladays 2014 slides

As compiled by Kevin Wright a.k.a @thecoda

(executive producer of the movie, and I didn't even know it... clever huh?)

please, please, please - If you know of any slides/code/whatever not on here, then ping me on twitter or comment this Gist!

This gist will be updated as and when I find new information. So it's probably best not to fork it, or you'll miss the updates!

Monday June 16th

@freeman-lab
freeman-lab / StreamingKMeans.scala
Last active February 26, 2019 07:13
Spark Streaming + MLLib integration examples
package thunder.streaming
import org.apache.spark.{SparkConf, Logging}
import org.apache.spark.rdd.RDD
import org.apache.spark.SparkContext._
import org.apache.spark.streaming._
import org.apache.spark.streaming.dstream.DStream
import org.apache.spark.mllib.clustering.KMeansModel
import scala.util.Random.nextDouble
@oxbowlakes
oxbowlakes / 3nightclubs.scala
Created May 13, 2011 15:14
A Tale of 3 Nightclubs
/**
* Part Zero : 10:15 Saturday Night
*
* (In which we will see how to let the type system help you handle failure)...
*
* First let's define a domain. (All the following requires scala 2.9.x and scalaz 6.0)
*/
import scalaz._
import Scalaz._
@jto
jto / qs.scala
Last active December 9, 2019 07:14
Type level quicksort
object jto {
type _1 = Succ[_0]
type _2 = Succ[_1]
type _3 = Succ[_2]
type _4 = Succ[_3]
type _5 = Succ[_4]
// Natural numbers (extracted from shapeless)
@wu-sheng
wu-sheng / opentracing-zipkin.md
Created December 21, 2016 06:30 — forked from codefromthecrypt/opentracing-zipkin.md
My ramble on OpenTracing (with a side of Zipkin)

I've had many people ask me questions about OpenTracing, often in relation to OpenZipkin. I've seen assertions about how it is vendor neutral and is the lock-in cure. This post is not a sanctioned, polished or otherwise muted view, rather what I personally think about what it is and is not, and what it helps and does not help with. Scroll to the very end if this is too long. Feel free to add a comment if I made any factual mistakes or you just want to add a comment.

So, what is OpenTracing?

OpenTracing is documentation and library interfaces for distributed tracing instrumentation. To be "OpenTracing" requires bundling its interfaces in your work, so that others can use it to time distributed operations with the same library.

So, who is it for?

OpenTracing interfaces are targeted to authors of instrumentation libraries, and those who want to collaborate with traces created by them. Ex something started a trace somewhere and I add a notable event to that trace. Structure logging was recently added to O

go 1.1 scheduler

where

src/pkg/runtime proc.c asm_*.s

design