This is the resource repositry for my memory managment lecture / workshop series at Breda University of applied sciences - Games. It is mainly targeted for game developers
This file contains hidden or 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
| interp.configureCompiler(_.settings.Ydelambdafy.tryToSetColon(List("inline"))) | |
| import $plugin.$ivy.`org.typelevel::kind-projector:0.10.3` | |
| import $plugin.$ivy.`com.olegpy::better-monadic-for:0.3.1` | |
| import $ivy.`io.circe::circe-generic:0.13.0-RC1` | |
| import $ivy.`org.http4s::http4s-circe:0.21.0-RC2` | |
| import $ivy.`org.http4s::http4s-dsl:0.21.0-RC2` | |
| import $ivy.`org.http4s::http4s-ember-client:0.21.0-RC2` | |
| import cats._, cats.data._, cats.effect._, cats.implicits._, cats.effect.concurrent._, cats.effect.implicits._, fs2._, org.http4s._, org.http4s.implicits._, scala.concurrent.duration._ |
This file contains hidden or 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
| scala> import cats.implicits._ | |
| import cats.implicits._ | |
| scala> (1 -> 2) === (1 -> 3) | |
| res0: Boolean = true | |
| scala> import scala.reflect.runtime.universe._ | |
| import scala.reflect.runtime.universe._ | |
| scala> showCode(reify { (1 -> 2) === (1 -> 3) }.tree) |
This file contains hidden or 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
| /** This is in reference to @tploecat's blog http://tpolecat.github.io/2015/04/29/f-bounds.html | |
| * where he compares F-bounded polymorphism and type classes for implementing "MyType". | |
| * | |
| * Curiously, the in my mind obvious solution is missing: Use abstract types. | |
| * | |
| * A lot of this material, including an argument against F-bounded for the use-case | |
| * is discussed in: | |
| * | |
| * Kim B. Bruce, Martin Odersky, Philip Wadler: | |
| * A Statically Safe Alternative to Virtual Types. ECOOP 1998: 523-549 |
This file contains hidden or 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
| # Compiled source # | |
| ################### | |
| *.com | |
| *.class | |
| *.dll | |
| *.exe | |
| *.o | |
| *.so | |
| # Packages # |
This file contains hidden or 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
| def dotProduct(vector: Array[Int], matrix: Array[Array[Int]]): Array[Int] = { | |
| // ignore dimensionality checks for simplicity of example | |
| (0 to (matrix(0).size - 1)).toArray.map( colIdx => { | |
| val colVec: Array[Int] = matrix.map( rowVec => rowVec(colIdx) ) | |
| val elemWiseProd: Array[Int] = (vector zip colVec).map( entryTuple => entryTuple._1 * entryTuple._2 ) | |
| elemWiseProd.sum | |
| } ) | |
| } | |
This file contains hidden or 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'm not a fan of G/W/T because: | |
| - in its original form it forces you to use the words "given/when/then" and I prefer to have more freedom when I write specifications (even if the G/W/T pattern is actually followed) | |
| - the implementation makes it hard not to use variables, leading to difficulties in reusing steps and composing behaviors | |
| - I tend to think of a more simple functional, "input-output" way of seeing things when I write specifications |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| ############ | |
| # QuickSBT # | |
| ############ | |
| # Launch SBT with support for generating /tmp/sbt.quickfix file for Vim | |
| # http://github.com/aloiscochard / https://gist.github.com/4698501 | |
| # Error format for SBT, and shortcut to open SBT quickfix file : |