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 / 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:
@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
> 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 / 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
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 / 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
@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 / reader-monad.md
Last active October 23, 2020 14:27
Discovering the Reader Monad

The Reader Monad

The reader monad is one solution to "dependency injection". This document shows how we might discover the reader monad when we attempt to solve this problem.

Dependency Injection

Our working definition of the dependency injection problem will be this: we have a method or function that takes certain parameters that we don't want to specify every time we call it. For example, we might have a function that gets a user given an ID and also requires a database connection.

def getUser(db: DbConnection, id: Id): User =
@noelwelsh
noelwelsh / dataframe.scala
Last active May 16, 2017 17:30
DataFrame
import java.util.Date
sealed trait DataFrame[A] {
import DataFrame._
def size: Int =
this.foldLeft(0)( (s, _) => s + 1 )
def foldLeft[B](z: B)(f: (B, A) => B): B =
this match {
@noelwelsh
noelwelsh / Website.scala
Created May 12, 2017 16:19
Simple website login implemented using the free monad
object Website {
import cats.free.Free
import cats.Comonad
import scala.io._
final case class User(username: String)
sealed trait Page
final case object Welcome extends Page
final case object TryAgain extends Page