Skip to content

Instantly share code, notes, and snippets.


Stuart Mashaal stumash

View GitHub Profile
stumash / co_and_contra_variance.scala
Last active Apr 8, 2020
scala covariance and contravariance
View co_and_contra_variance.scala
import scala.collection.mutable.ArrayDeque
object Co_and_Contra_Variance {
def main(args: Array[String]): Unit = {
theBasicIdea() // - What covariance and contravariance let you do, without discussing why or how
theCoreConceptIsBasedOnFunctions() // - How do we decide if function f1 can be substituted by f2? (aka f2 is subtype of f1)
bringItAllTogether() // - Now that we know why and how, let's see how it applies
def theBasicIdea(): Unit = {
stumash /
Last active Sep 21, 2018
python virtualenv as fast as possible

Create a virtualenv

make a virtualenv in a directory called vdir with:

$ virtualenv vdir [-p pythonX.X]

Activate a virtualenv

start using the virtualenv in vdir with:

$ source vdir/bin/activate

You can’t perform that action at this time.