Thread pools on the JVM should usually be divided into the following three categories:
- CPU-bound
- Blocking IO
- Non-blocking IO polling
Each of these categories has a different optimal configuration and usage pattern.
This is a full set of key bindings (as of Vimium v1.45); covering all Vimium functionality. I have tried to map all Vimium functionality to comparable Emacs functionality (whenever possible). In cases where there is no equivalent, those commands are prefixed by <c-g>
(indicating <c-g>
oogle Chrome; and because <c-g>
does not conflict with other Emacs shortcuts at all).
Commented Shortcuts: There are a few Emacs-style shortcuts that are simply not possible in Vimium. All of my shortcuts (including those which were not possible; i.e. where I used a decent alternative) have been commented below. This should help to clarify my rationale.
_Compatibility: All of these shortcuts were tested on Mac OS X (Mavericks). Please note that all of my shortcuts operate under the assumption that your Emacs Meta key is the ⌥
Alt/Option key. This really was my only choice, because the ⌘
key is already used in Chrome for shortcuts that c
Count empty values in csv file, grouped by column with pandas
Reference: Data Cleaning with Python and Pandas: Detecting Missing Values
import scala.collection._ | |
import com.twitter.util._ | |
scala> val buffer = mutable.ArrayBuffer.empty[Int] | |
scala> println(Time.measure { (0 to 50000000).foreach { buffer += _ } }.inMillis) | |
17610 | |
scala> var vector = immutable.Vector.empty[Int] | |
scala> println(Time.measure { (0 to 50000000).foreach { vector :+= _ } }.inMillis) | |
7865 |
Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * x
#!/usr/bin/env bash | |
# lists all unused AWS security groups. | |
# a group is considered unused if it's not attached to any network interface. | |
# requires aws-cli and jq. | |
# all groups | |
aws ec2 describe-security-groups \ | |
| jq --raw-output '.SecurityGroups[] | [.GroupName, .GroupId] | @tsv' \ | |
| sort > /tmp/sg.all |
public class Constants { | |
/** | |
* Contains the path to your Lambda function code. | |
*/ | |
public static final String LAMBDA_TASK_ROOT = System.getenv("LAMBDA_TASK_ROOT"); | |
/** | |
* The environment variable is set to one of the following options, depending on the runtime of the Lambda function: | |
* AWS_Lambda_nodejs, AWS_Lambda_nodejs4.3, AWS_Lambda_nodejs6.10 |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
import scala.slick.lifted.CanBeQueryCondition | |
// optionally filter on a column with a supplied predicate | |
case class MaybeFilter[X, Y](val query: scala.slick.lifted.Query[X, Y]) { | |
def filter[T,R:CanBeQueryCondition](data: Option[T])(f: T => X => R) = { | |
data.map(v => MaybeFilter(query.filter(f(v)))).getOrElse(this) | |
} | |
} | |
// example use case | |
import java.sql.Date |