Skip to content

Instantly share code, notes, and snippets.

View lancegatlin's full-sized avatar

Lance Gatlin lancegatlin

View GitHub Profile
Lance is a professional Scala adventurer, open source loner, longevity nut and semi-regular awkward dancer. Lance has been exploring Scala for the last 6 years and recently renewed his Scala vows on his Scala-versary: "I'll never quit you... not like those others". Lance enjoys polishing his shiny sword of functional programming +2 but finds his patrons prefer just "getting things done" with their rusty daggers. Lance also used to do a lot of improv, has deep thoughts about one-handed typing and will win, eventually, by living longer than everyone else.
Typemax 2.0 1KC base layout preview
Note1: orientation below is with Twiddler back in palm keys facing out (right or left handed)
Note2: all scores below are in 1000th of a percentage of all bigrams e.g. 1041 = 1.041% of all bigrams occurences
Note3: SPACE frequency calculated as follows: average 4.79 letters per word => 1 space for every 4.79 letters => 1/5.79 characters = 17.3% spaces => 4.79/5.79 = 82.7% letters
Note4: percentage-scores are normalized against frequency of SPACE (17.3% of all letters) to compute total load since http://norvig.com/mayzner.html does not provide letter percentages including SPACE e.g. E => 12.49% * (1-0.173=0.827) = 10.33% including SPACE
.-------------------.
| Inner | Outer |
.-------------------.
/-----------------------------------------------------------\
| |
|-----------------------------------------------------------.
| Orientation = face-away |
| ••••• = hold key |
| ▒▒▒▒▒ = unassigned |
| ▒▒▒▒* = mouse button |
.-------------------. |
| ▒▒▒▒* ▒▒▒▒* ▒▒▒▒* | |
.-------------------. |
trait Exec[F[_]] extends Monad[F] {
/**
Execute a block of code in in the context of F
F may execute code block asynchronously, synchronously or may suspend execution.
Note: if F suspends execution, this typeclass does not define how to execute the suspended code
F may capture effects or may not capture effects
F may catch exceptions or may not catch exceptions
*/
import scala.languageFeature.higherKinds
trait Var[A] {
def isSet : Boolean
def :=(a: A) : Unit
def unset() : Unit
def toOption: Option[A]
def assumeSetAndGet : A
}
object test {
trait Nullable
type MaybeNullBase[A >: Null] = {
type inner = A
}
type MaybeNull[A >: Null] = MaybeNullBase[A] with Null
object NotNull {
@inline def apply[A >: Null](a: A): MaybeNull[A] = a.asInstanceOf[MaybeNull[A]]
package s_mach.codetools.bigcaseclass
import s_mach.string._
object BigCaseClassPrinter {
def print(name: String, fields: Vector[CaseClassField]) : String = {
val subCaseClasses = fields.grouped(CASECLASS_MAX_FIELDS).toVector
/*
_1 : Licensee.Licensee1,
package s_mach.string.impl
import s_mach.string._
object GridOps {
def grid_rowCount[T](self: Grid[T]) : Int =
self.size
def grid_columnCount[T](self: Grid[T]) : Int =
package org.lancegatlin
import scala.language.higherKinds
import scalaz._
import Id._
import std._
import scalaz.effect.IO
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits._
@lancegatlin
lancegatlin / submatrix
Last active August 29, 2015 14:06 — forked from ghidalgo3/submatrix
asdf
// note: more efficient way to store matrix is a class that uses internal Buffer[Double] of size row * columns
//submatrix determination for calculating determinants of matrices
def submatrix[A](i : Int, j : Int, matrix : Array[Array[A]]) = {
//returns a new array of size n-1 with the ith index removed
def remove[A](index : Int, arr: Seq[A]): Seq[A] = {
// Note: removing the ith index from a sequence is considered highly inefficient and to be avoided whenever possible
arr.take(index) ++ arr.drop(index+1)
}