Skip to content

Instantly share code, notes, and snippets.

@ConnorDoyle
ConnorDoyle / ReflectionHelpersSnippet.scala
Last active January 26, 2022 20:00
Generic reflective case class instantiation with Scala 2.10.x
package test
import scala.reflect.runtime.universe._
object ReflectionHelpers extends ReflectionHelpers
trait ReflectionHelpers {
protected val classLoaderMirror = runtimeMirror(getClass.getClassLoader)
@roquin
roquin / spark_matrix.py
Created February 23, 2012 12:49
A helper function for cs373 from udacity
# usage: spark_matrix([[0.1, 0.5, 0.3],
# [0.0, 1.0, 0.8],
# [0.1, 0.2, 0.1]])
# ▁▅▃
# ▁█▇
# ▁▂▁
#
# If you get encoding errors, uncomment and add next 5 lines to the start of file.
# #!/usr/bin/env python
# # -*- coding: utf-8 -*-