Skip to content

Instantly share code, notes, and snippets.

View noelwelsh's full-sized avatar
💭
Hacking on Doodle when I get time

Noel Welsh noelwelsh

💭
Hacking on Doodle when I get time
View GitHub Profile
@noelwelsh
noelwelsh / Questionnaire.scala
Last active November 14, 2018 08:29
A simple questionnaire system
final case class Id(value: String) extends AnyVal
sealed trait Question[A] {
def id: Id
def prompt: String
}
object Question {
final case class IntQuestion(id: Id, prompt: String) extends Question[Int]
final case class StringQuestion(id: Id, prompt: String) extends Question[String]
final case class MultipleChoiceQuestion(id: Id, prompt: String, choices: List[String]) extends Question[String]
@noelwelsh
noelwelsh / curriculum.org
Created March 13, 2020 17:19
ScalaBridge Curriculum

Curriculum

Level One

Setup

  • VSCode or IntelliJ?

Expressions, Types, and Values

  • Literals
  • Expressions have types and produce values
  • Compound expressions
  • All values are objects
  • Method call syntax
import scala.compiletime._
import scala.compiletime.ops.any
final case class Col[Key, Value](data: Array[Value])
object Frame {
object Types {
type Get[F <: Tuple, Key] =
F match {
case Col[Key, v] *: cols => v
@noelwelsh
noelwelsh / HList.scala
Created April 14, 2020 13:47
An HList in Dotty (which doesn't compile)
import scala.compiletime._
import scala.compiletime.ops.any
// This is a standard HList plus data is keyed by a type K
sealed trait HList {
def :::[K <: AnyVal, V](data: V): HCons[K, V, this.type] = HCons(data, this)
inline def contains[K <: AnyVal]: Boolean =
inline this match {
case HNil => false
> java -version 1397ms  Thu 7 May 10:38:16 2020
openjdk version "14.0.1" 2020-04-14
OpenJDK Runtime Environment AdoptOpenJDK (build 14.0.1+7)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 14.0.1+7, mixed mode, sharing)
> java -jar ping-server.jar -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:+UseJVMCICompiler
[ioapp-compute-0] INFO o.h.b.c.n.NIO1SocketServerGroup - Service bound to address /[0:0:0:0:0:0:0:0]:8080
[ioapp-compute-0] INFO o.h.s.b.BlazeServerBuilder -
_ _ _ _ _
| |_| |_| |_ _ __| | | ___
| ' \ _| _| '_ \_ _(_-<
@noelwelsh
noelwelsh / thoughts.txt
Created July 7, 2020 09:19
The difficulty of defining a curriculum for creative coding
The original poster said they wanted to construct a curriculum to become a "web artist and/or use code or electronics to create art".
In well established fields there are reasonably well established expectations as to what a curriculum involves. E.g. for computing there is an accreditation body (https://dev.csab.org/info-for/programs/) and widely agreed upon curriculum guidelines (e.g. https://www.acm.org/education/curricula-recommendations). So there is reasonably widely shared understanding of what someone undertaking, say, a computer science degree should learn. Computing is interesting because there are so many new alternate routes such as bootcamps but even here I think they are informed by the above (e.g. https://github.com/Ada-Developers-Academy/textbook-curriculum has elements that would be found in almost all university curriculums)
I believe "creative computing", or whatever we want to call OP's goal, is different. It's defined by the output (e.g. "creative application of computing") more than by
@noelwelsh
noelwelsh / minikube-err.txt
Created February 2, 2021 13:12
minikube error log
minikube : I0202 12:40:59.542903 6584 out.go:229] Setting OutFile to fd 84 ...
At line:1 char:1
+ minikube start --alsologtostderr -v=5 2>minikube-err.txt
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (I0202 12:40:59....le to fd 84 ...:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
I0202 12:40:59.543906 6584 out.go:242] Setting ErrFile to fd 3752...
I0202 12:40:59.556903 6584 out.go:236] Setting JSON to false
I0202 12:40:59.565255 6584 start.go:106] hostinfo: