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.
| #!/usr/bin/env python | |
| # Reflects the requests from HTTP methods GET, POST, PUT, and DELETE | |
| # Written by Nathan Hamiel (2010) | |
| from http.server import HTTPServer, BaseHTTPRequestHandler | |
| from optparse import OptionParser | |
| class RequestHandler(BaseHTTPRequestHandler): | |
| def do_GET(self): |
| #!/bin/bash | |
| # file: ttfb.sh | |
| # curl command to check the time to first byte | |
| # ** usage ** | |
| # 1. ./ttfb.sh "https://google.com" | |
| # 2. seq 10 | xargs -Iz ./ttfb.sh "https://google.com" | |
| curl -o /dev/null \ | |
| -H 'Cache-Control: no-cache' \ | |
| -s \ |
| #!/bin/sh | |
| #/ Usage: ports [<options>] | |
| #/ Show processes listening on ports. | |
| #/ Any <options> are passed to lsof | |
| set -e | |
| test "$1" = "--help" && { | |
| grep ^#/ <"$0"| cut -c4- | |
| exit 2 | |
| } |
| _.mixin({ | |
| sum : function(data){ | |
| return _.reduce(data, function(memo, num){ return memo + num; }, 0); | |
| }, | |
| mean : function(data){ | |
| return this.sum(data)/data.length | |
| }, | |
| median : function(data){ | |
| return this.percentile(data,50); | |
| }, |
| if [ $EUID != 0 ]; then | |
| echo "It's a weird tree." | |
| else | |
| echo ' _ __' | |
| echo ' / `\ (~._ ./ )' | |
| echo ' \__/ __`-_\__/ ./' | |
| echo ' _ \ \/ \ \ |_ __' | |
| echo ' ( ) \__/ -^ \ / \' | |
| echo ' \_/ " \ | o o |.. / __' | |
| echo " \\. --' ==== / || / \\ " |
| require 'rubygems' | |
| require 'mechanize' | |
| FIRST_NAME = 'FIRST_NAME' | |
| LAST_NAME = 'LAST_NAME' | |
| PHONE = 'PHONE' | |
| EMAIL = '[email protected]' | |
| PARTY_SIZE = 2 | |
| SCHEDULE_RANGE = { :start_time => '19:00', :end_time => '20:30' } |
| package util | |
| object Slug { | |
| def apply(input:String) = slugify(input) | |
| def slugify(input: String): String = { | |
| import java.text.Normalizer | |
| Normalizer.normalize(input, Normalizer.Form.NFD) | |
| .replaceAll("[^\\w\\s-]", "") // Remove all non-word, non-space or non-dash characters | |
| .replace('-', ' ') // Replace dashes with spaces |
| i386 : iPhone Simulator | |
| x86_64 : iPhone Simulator | |
| arm64 : iPhone Simulator | |
| iPhone1,1 : iPhone | |
| iPhone1,2 : iPhone 3G | |
| iPhone2,1 : iPhone 3GS | |
| iPhone3,1 : iPhone 4 | |
| iPhone3,2 : iPhone 4 GSM Rev A | |
| iPhone3,3 : iPhone 4 CDMA | |
| iPhone4,1 : iPhone 4S |