- Install IntelliJ + Scala Plugin
- Don’t do the Coursera courses yet.
- Don’t do the “red book” Functional Programming in Scala yet.
- Do: http://underscore.io/books/
- Essential Scala
- Essential Play
- Essential Slick
- Do Scala for the Impatient: https://www.amazon.com/Scala-Impatient-Cay-S-Horstmann/dp/0321774094
- The Neophyte’s Guide to Scala http://danielwestheide.com/scala/neophytes.html
type ∀[F[_]] = scalaz.Forall[F] | |
/** | |
* An unpublished arbitrary type. May be viewed as a formulation of | |
* (∃ α . α). Thus, we encode a rank-1 universal by means of a rank-2 | |
* existential. This encoding is more convenient for our purposes. | |
*/ | |
sealed trait τ | |
object τ { |
import sbt._, Keys._ | |
import scala.xml.{Node => XmlNode, NodeSeq => XmlNodeSeq, _} | |
import scala.xml.transform.{RewriteRule, RuleTransformer} | |
import sbt.plugins.JvmPlugin | |
object PPrintPlugin extends AutoPlugin { | |
override def requires = JvmPlugin | |
override def trigger: PluginTrigger = AllRequirements | |
override def projectSettings: Seq[Def.Setting[_]] = List( | |
libraryDependencies ++= { |
// Build Scala source code | |
val tree = q""" | |
object Test { | |
val a = 2 + 5 | |
def f(b: String) = { b + a.toString } | |
} | |
""" | |
val src = List(TreeNode(tree)) | |
// Build Scala target code |
import play.api.libs.json.Json | |
object Main{ | |
def main(args: Array[String]): Unit = { | |
println( | |
Json.prettyPrint( | |
Json.toJson(Seq("Hello", "World", "Cow")) | |
) | |
) | |
} |
apiVersion: extensions/v1beta1 | |
kind: PodSecurityPolicy | |
metadata: | |
name: restricted | |
annotations: | |
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default' | |
apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default' | |
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default' | |
apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default' | |
spec: |
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
private rule Macho | |
{ | |
meta: | |
description = "private rule to match Mach-O binaries (copied from Apple's XProtect)" | |
condition: | |
uint32(0) == 0xfeedface or uint32(0) == 0xcefaedfe or uint32(0) == 0xfeedfacf or uint32(0) == 0xcffaedfe or uint32(0) == 0xcafebabe or uint32(0) == 0xbebafeca | |
} | |
rule ZoomDaemon | |
{ |