Skip to content

Instantly share code, notes, and snippets.

Konstantin Läufer klaeufer

Block or report user

Report or block klaeufer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View DiningPhilosophers.scala
import scala.util.Random
import java.util.concurrent.locks.ReentrantLock
def dinner(number: Int, delayInMs: Int) = {
val forks = Array.fill(number)(new ReentrantLock)
// warning: running each philosopher in their own explicit Java thread
def phil(i: Int) = new Thread {
override def run(): Unit = {
@klaeufer
klaeufer / README.md
Last active Dec 4, 2018
cs2-lab10-bintrees-java
View README.md

Loyola COMP 271 Lab 10 (FALL 2018)

Individual project

Collaborate with your classmates on a conceptual level but do not share code. Submit individually.

Objectives

An understanding of the following concepts and techniques:

View quine.scala
object Q extends App { val s = "object Q extends App { val s = %c%s%c ; printf(s, 0x22, s, 0x22) }" ; printf(s, 0x22, s, 0x22) }
@klaeufer
klaeufer / README.md
Last active Sep 6, 2018
cs2-lab1-fizzbuzz-java
View README.md

Loyola COMP 271 Lab 1

Individual project

Collaborate with your classmates on a conceptual level but do not share code. Submit individually.

Objectives

An understanding of the following concepts and techniques:

@klaeufer
klaeufer / README.md
Last active Nov 29, 2018
cs2-lab10-graphs-java
View README.md

Loyola COMP 271 Lab 10 (FALL 2017)

Individual project

Collaborate with your classmates on a conceptual level but do not share code. Submit individually.

Objectives

An understanding of the following concepts and techniques:

@klaeufer
klaeufer / TODO.md
Last active Nov 6, 2018
cs2-lab7-linkedstack-recursive-java
View TODO.md

Loyola COMP 271 Lab 7

Individual project

Collaborate with your classmates on a conceptual level but do not share code. Submit individually.

Objectives

An understanding of the following concepts and techniques:

@klaeufer
klaeufer / README.md
Last active Oct 11, 2018
cs2-lab4-listnodes-java
View README.md

Loyola COMP 271 Lab 4

Individual project

Collaborate with your classmates on a conceptual level but do not share code. Submit individually.

Objectives

An understanding of the following concepts and techniques:

View Advanced-FP-with-Scala.md

Advanced Functional Programming with Scala - Notes

Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@klaeufer
klaeufer / README.md
Last active Feb 2, 2017
sbt-scalariform local configuration files
View README.md

Instructions

  • local.sbt goes in the project root
  • project-local.sbt goes in project/local.sbt
  • also add local.sbt to .gitignore

Purpose

Install sbt-scalariform in such a way that formatting taking place only on demand. This does not seem to work with a global plugin installation.

View NatMatryoshka.scala
// simple example illustrating how to replace
// https://github.com/LoyolaChicagoCode/scalamu
// with https://github.com/slamdata/matryoshka
//
// libraryDependencies ++= Seq(
// "org.scalaz" %% "scalaz-core" % "7.2.8",
// "com.slamdata" %% "matryoshka-core" % "0.16.4",
// "com.slamdata" %% "matryoshka-scalacheck" % "0.16.4" % Test
// )
You can’t perform that action at this time.