ScalaCheck 1.14.0 was just released with support for deterministic testing using seeds. Some folks have asked for examples, so I wanted to produce a Gist to help people use this feature.
These examples will assume the following imports:
case class Foo( bar: Bar ) | |
case class Bar( bar: Baz ) | |
case class Baz( bar: Booyah ) | |
case class Booyah( i: Int, s: String ) | |
object V1Serializers{ | |
implicit def FormatFoo[Foo] = ... | |
implicit def FormatBar[Bar] = ... | |
implicit def FormatBaz[Baz] = ... | |
implicit def FormatBooyah[Booyah] = ... |
Verify the microcode version prior to updating:
dmesg | grep microcode
Update your package list and install the following packages:
apt update
apt install microcode.ctl intel-microcode
Reboot and run the following command again to verify the new microcode is in effect:
I was talking to a coworker recently about general techniques that almost always form the core of any effort to write very fast, down-to-the-metal hot path code on the JVM, and they pointed out that there really isn't a particularly good place to go for this information. It occurred to me that, really, I had more or less picked up all of it by word of mouth and experience, and there just aren't any good reference sources on the topic. So… here's my word of mouth.
This is by no means a comprehensive gist. It's also important to understand that the techniques that I outline in here are not 100% absolute either. Performance on the JVM is an incredibly complicated subject, and while there are rules that almost always hold true, the "almost" remains very salient. Also, for many or even most applications, there will be other techniques that I'm not mentioning which will have a greater impact. JMH, Java Flight Recorder, and a good profiler are your very best friend! Mea
See https://github.com/sbt/sbt/wiki/sbt-1.x-plugin-migration for the list with sbt 1.x migration status.
plugin | star |
---|---|
playframework/playframework | 9597 |
scala-js/scala-js | 3053 |
sbt/sbt-assembly | 1092 |
mpeltonen/sbt-idea | 1085 |
Tageless Final interpreters are an alternative to the traditional Algebraic Data Type (and generalized ADT) based implementation of the interpreter pattern. This document presents the Tageless Final approach with Scala, and shows how Dotty with it's recently added implicits functions makes the approach even more appealing. All examples are direct translations of their Haskell version presented in the Typed Tagless Final Interpreters: Lecture Notes (section 2).
The interpreter pattern has recently received a lot of attention in the Scala community. A lot of efforts have been invested in trying to address the biggest shortcomings of ADT/GADT based solutions: extensibility. One can first look at cats' Inject
typeclass for an implementation of [Data Type à la Carte](http://www.cs.ru.nl/~W.Swierstra/Publications/DataTypesA
import javax.sound.midi.MidiDevice; | |
import javax.sound.midi.MidiUnavailableException; | |
import javax.sound.midi.spi.MidiDeviceProvider; | |
public class HighResolutionTimer { | |
private static final MidiDevice midiDevice = getMidiOutDevice(); | |
private static MidiDevice getMidiOutDevice() { | |
MidiDeviceProvider provider = new com.sun.media.sound.MidiOutDeviceProvider(); | |
MidiDevice.Info[] info = provider.getDeviceInfo(); |
### | |
### | |
### UPDATE: For Win 11, I recommend using this tool in place of this script: | |
### https://christitus.com/windows-tool/ | |
### https://github.com/ChrisTitusTech/winutil | |
### https://www.youtube.com/watch?v=6UQZ5oQg8XA | |
### iwr -useb https://christitus.com/win | iex | |
### | |
### OR take a look at | |
### https://github.com/HotCakeX/Harden-Windows-Security |
Minecraft mods, especially mods which change the client, are by and large written with Forge. If you visit their website, you'll be greeted abruptly by a mysterious message at the top of an SMF forum, with no clear path towards actually... making a mod. I'm documenting here the steps I went through to get started, in the hopes of helping the next person have an easier time of it.
I'll be using Scala for this guide, but it should be fairly easy to adapt these instructions to any JVM language (e.g. clojure or if you're feeling masochistic, Java). I'm also developing on OS X, so some of the commands will be a little different if you're on Linux or Windows. I'm assuming you have some proficiency with your operating system, so I won't go into details about how to adapt those commands to your system.
Minecraft doesn't have an official mod API (despite early [promises](http://notch.t
package psp | |
package jtos | |
import java.{ util => ju }, ju.{ stream => jus, function => juf }, jus._ | |
import scala.annotation.unchecked.{ uncheckedVariance => uV } | |
object generated { | |
implicit final class BiConsumer[-T1, -T2](f: (T1, T2) => Unit) extends juf.BiConsumer[T1 @uV, T2 @uV] { def accept(x1: T1, x2: T2): Unit = f(x1, x2) } | |
implicit final class BiFunction[-T1, -T2, +R](f: (T1, T2) => R) extends juf.BiFunction[T1 @uV, T2 @uV, R @uV] { def apply(x1: T1, x2: T2): R = f(x1, x2) } | |
implicit final class BinaryOperator[T](f: (T, T) => T) extends juf.BinaryOperator[T] { def apply(x1: T, x2: T): T = f(x1, x2) } |