Skip to content

Instantly share code, notes, and snippets.

@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@retronym
retronym / type-bounds.scala
Created December 16, 2009 11:17
Tour of Scala Type Bounds
class A
class A2 extends A
class B
trait M[X]
//
// Upper Type Bound
//
def upperTypeBound[AA <: A](x: AA): A = x
@buzzdecafe
buzzdecafe / ct_notes.txt
Last active January 24, 2022 12:17
Category Theory for Programmers: Notes
CATEGORY THEORY FOR PROGRAMMERS
Category Theory 1.1: Motivation and Philosophy
https://www.youtube.com/watch?v=I8LbkfSSR58&index=1&list=PLbgaMIhjbmEnaH_LTkxLI7FMa2HsnawM_
Composability, Abstraction, Reusability
Category Theory is a higher-level language.
Not a practical, executable language.
@dcsobral
dcsobral / README.md
Created April 15, 2020 23:40
Scala Configurable Warnings

Pull request #8373 implementing issue 333 (but please note differences).

Pull request description follows:

This PR adds a -Wconf compiler flag that allows filtering and configuring compiler warnings (silence them, or turn them into errors).

It also integrates the fantastic silencer compiler plugin by @ghik into the compiler, which allows suppressing warnings locally using the @nowarn annotation.

<!-- ADMIN ITEMS -->
<item id="3500" name="Admin_nailgun">
<property name="IsDeveloper" value="true"/>
<property name="Meshfile" value="Items/Tools/nailgunPrefab"/>
<property name="CustomIcon" value="nailgun"/>
<property name="CustomIconTint" value="FF0000"/>
<property name="Material" value="metal"/>
<property name="HoldType" value="37"/>
<property name="Stacknumber" value="1"/>
<property name="RepairTools" value="repairKit"/>
@aloiscochard
aloiscochard / qsbt.sh
Last active March 5, 2018 21:34
QuickSBT - Launch SBT with support for generating /tmp/sbt.quickfix file for Vim
#!/usr/bin/env bash
############
# QuickSBT #
############
# Launch SBT with support for generating /tmp/sbt.quickfix file for Vim
# http://github.com/aloiscochard / https://gist.github.com/4698501
# Error format for SBT, and shortcut to open SBT quickfix file :
@jboner
jboner / SBT.sublime-build
Created May 6, 2011 09:47
Sublime Editor SBT build setup
{
"cmd": ["sbt-no-color compile"],
"file_regex": "^\\[error\\] ([.a-zA-Z0-9/-]+[.]scala):([0-9]+):",
"selector": "source.scala",
"working_dir": "${project_path:${folder}}",
"shell": "true"
}
@ymasory
ymasory / scala-irc
Last active August 30, 2017 21:16
List of all Scala-related IRC channels.
Please help compile a list of all Scala-related IRC rooms.
All of these channels are on Freenode.
#akka | concurrency & distribution framework
#argonaut | json library
#fp-in-scala | the book Functional Programming in Scala
#geotrellis | geoprocessing library
#indyscala | regional scala group
#json4s | json library
@poetix
poetix / builder.scala
Created January 15, 2013 12:26
Dynamic / Monadic object builder round 2
package com.youdevise.lofty
import org.specs2.mutable._
import scala.language.dynamics
import scala.language.reflectiveCalls
import scalaz._
import Scalaz._
import scala.reflect.runtime.universe._
trait Builder[T] {
/** Constructing "singleton types" from compile-time literals
*
* val x = Example.foo(42)
* val y: x.T = 42 // compiles
* val z: x.T = 43 // doesn't
*
*/
package s
import scala.language.experimental.macros