- hprof a builtin java agent which dumps profiling info at runtime
- class sharing class file cache used for faster startup times
- pack200 unpack200 uber packed jars
- mission control a Profiling, Monitoring, and Diagnostics Tools Suite
- jstat performance stats tool
- jhat heap dump browser
- jmap memory maps
- jstack prints stack trace of running process
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
var el = $("#slide-9") // last slide | |
, stream = new WebSocket("ws://stream.meetup.com/2/photos") | |
, target_event = 156380082 // http://www.meetup.com/Application-Developers-Alliance-NYC-Meetup/events/156380082/ | |
, target_member = 8157820; // me (doug) | |
stream.onmessage = function (msg) { | |
var item = msg.data ? JSON.parse(msg.data) : null; | |
if (item) { | |
var event_id = item.photo_album.event ? item.photo_album.event.id : null | |
, member_id = item.member.member_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** a shortener for things that may have `long tails` */ | |
case class Tailed[A, B: Numeric]( | |
population: Iterable[A], index: A => B, update: (A, B) => A) { | |
private val num = implicitly[Numeric[B]] | |
private lazy val indexed = population.groupBy(index) | |
def shorten(threshold: Double = .03) = { | |
val total = num.toDouble(indexed.keys.reduce(num.plus)) | |
def accept(index: B) = (num.toDouble(index) / total) > threshold | |
val accepted = indexed.filterKeys(accept).values.flatten |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var qparam = function(name) { | |
var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search); | |
return match && decodeURIComponent(match[1].replace(/\+/g, ' ')); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# read a java java's manifest file | |
unzip -p "$@" META-INF/MANIFEST.MF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createWebSocket () { | |
var connection = new WebSocket(); | |
var attempts = 1; | |
connection.onopen = function () { | |
// reset the tries back to 1 since we have a new connection opened. | |
attempts = 1; | |
// ...Your app's logic... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class Url( | |
_host: String, | |
_path: Seq[String] = Seq.empty[String], | |
_query: Map[String, List[String]] = Map.empty[String, List[String]].withDefaultValue(Nil), | |
_fragment: Option[String] = None, | |
_scheme: Option[String] = None, | |
_port: Option[Int] = None) { | |
def host(host: String) = copy(_host = host) | |
def param(k: String, v: String) = copy(_query = _query + (k -> (v :: _query(k)))) | |
def path(p: String) = copy(_path = p.split("/").filter(_.nonEmpty).toList) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( a = all ) | |
+------------+------------+------------+ | |
| u | g | o | | |
+------------+------------+------------+ | |
| user | group | others | | |
+------------+------------+------------+ | |
| r | w | x | r | w | x | r | w | x | | |
+------------+------------+------------+ | |
| 4 | 2 | 1 | 4 | 2 | 1 | 4 | 2 | 1 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Welcome to Scala version 2.10.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_51). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> def curryme(beep: Int)(boop: String*) = beep * boop.size | |
curryme: (beep: Int)(boop: String*)Int | |
scala> val c = curryme(1)_ | |
c: Seq[String] => Int = <function1> |
OlderNewer