Instantly share code, notes, and snippets.

# Frank Versnelfversnel

Block or report user

### Report or block fversnel

Hide content and notifications from this user.

• Sort options
Last active Apr 2, 2019
Baba is you spec
View baba.clj
 (ns babaisyou.spec (:require [clojure.spec.alpha :as s])) (s/def ::subject #{:word/baba :word/wall :word/flag :word/grass}) (s/def ::verb #{:word/is}) (s/def ::object #{:word/you :word/push :word/stop :word/win}) (s/def ::sentence
Last active May 10, 2018
Extra database assignments
View extra-database-assignments.md

# Extra assignments

Here are some extra assignments for everyone who has finished the database homework and couldn't get enough ;).

## Indices

Indices are a very important feature to make queries faster.

1. What is a database index? Explain in your own words.
Last active Nov 9, 2017
Following along in Scala with the Coursera Machine Learning course
View MachineLearning1.scala
 import spire.implicits._ import spire.math._ class MachineLearning1[Number](implicit fractional: Fractional[Number]) { import fractional.pow private def number(integer: Int): Number = fractional.fromInt(integer) type Hypothesis = Number => Number
Last active Feb 17, 2017
My first attempt at implementing lateral (i.e. imaginary) numbers. Currently implemented +, - and *
View ComplexNumber.cs
 namespace Lateralus { public struct ComplexNumber { public readonly double Direct; // Real part public readonly Lateral Lateral; // Imaginary part public ComplexNumber(double direct, Lateral lateral) { Direct = direct; Lateral = lateral;
Last active Aug 11, 2016
Bullet physics in a separate thread on Unity
 using System.Diagnostics; using System.Threading; using BulletSharp; using BulletSharp.Math; using BulletUnity; using UnityEngine; using Vector3 = BulletSharp.Math.Vector3; public class MultithreadingTest : MonoBehaviour { private MotionState _bodyView;
Last active Feb 11, 2016
Creates an Observable from a cron expression using the Quartz scheduler
View QuartzObservable.scala
 package org.frankversnel.rxquartz import java.time.Instant import java.util.UUID import scala.concurrent.{ExecutionContext, Promise, Future} import com.typesafe.scalalogging.Logger import org.quartz._ import rx.lang.scala.{Observer, Subscription, Observable}
Last active Dec 4, 2015
Get available port for UNET socket
View UnetAvailablePort.md
```using System.Net;
using System.Net.Sockets;
using UnityEngine.Networking;

int port;
using (var tempSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)) {