Skip to content

Instantly share code, notes, and snippets.

View codahale's full-sized avatar
🦆
Look at all these chickens

Coda Hale codahale

🦆
Look at all these chickens
View GitHub Profile
@codahale
codahale / pom.xml
Last active April 20, 2024 01:38
Take this and save it as pom.xml in your project directory.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>my-project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<!-- none yet -->
pub fn estimate(&self, e: &E) -> u64 {
indexes(e, self.width)
.take(self.depth)
.enumerate()
.map(|(i, idx)| self.counters[i][idx])
.min()
.unwrap()
}
@codahale
codahale / SetBenchmark.java
Created April 3, 2013 18:49
An example of how to use Caliper: http://code.google.com/p/caliper/.
import com.google.caliper.Runner;
import com.google.caliper.SimpleBenchmark;
import java.util.HashSet;
import java.util.TreeSet;
public class SetBenchmark extends SimpleBenchmark {
// If you add a main function, you can run it from your IDE.
public static void main(String[] args) throws Exception {
new Runner().run(
@codahale
codahale / Regular.java
Created September 21, 2011 22:47
An example of the utility of private[this]
//decompiled with JD-GUI
import scala.ScalaObject;
import scala.reflect.ScalaSignature;
@ScalaSignature(bytes="\006\00192A!\001\002\001\013\t9!+Z4vY\006\024(\"A\002\002\017q*W\016\035;z}\r\0011c\001\001\007\035A\021q\001D\007\002\021)\021\021BC\001\005Y\006twMC\001\f\003\021Q\027M^1\n\0055A!AB(cU\026\034G\017\005\002\020%5\t\001CC\001\022\003\025\0318-\0317b\023\t\031\002CA\006TG\006d\027m\0242kK\016$\b\"B\013\001\t\0031\022A\002\037j]&$h\bF\001\030!\tA\002!D\001\003\021\035Q\002\0011A\005\nm\t\021![\013\0029A\021q\"H\005\003=A\0211!\0238u\021\035\001\003\0011A\005\n\005\nQ![0%KF$\"AI\023\021\005=\031\023B\001\023\021\005\021)f.\033;\t\017\031z\022\021!a\0019\005\031\001\020J\031\t\r!\002\001\025)\003\035\003\tI\007\005C\003+\001\021\0051&A\002j]\016$\022A\t\005\006[\001!\taG\001\004O\026$\b")
public class Regular
implements ScalaObject
{
private int i = 0;
fn main() {
let (port, chan): (Port<int>, Chan<int>) = stream();
let mut i = 0;
while i < 30 {
do spawn {
chan.send(1);
}
i += 1;
}
[INFO] +- com.sun.jersey.jersey-test-framework:jersey-test-framework-inmemory:jar:1.12:compile
[INFO] | \- com.sun.jersey.jersey-test-framework:jersey-test-framework-core:jar:1.12:compile
[INFO] | +- javax.servlet:javax.servlet-api:jar:3.0.1:compile
[INFO] | \- com.sun.jersey:jersey-client:jar:1.12:compile
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.4</version>
<configuration>
<createDependencyReducedPom>
true
</createDependencyReducedPom>
</configuration>
<executions>
public class ClassWithLazyVal
implements ScalaObject
{
private String name;
public volatile int bitmap$0;
public String name()
{
if (
(this.bitmap$0 & 0x1) == 0);
SPEAKER RELEASE FORM
This Release is provided to you as a speaker in a seminar, lecture, or other presentation at or sponsored by Pivotal Labs (hereafter “Pivotal”). Pivotal would like to capture your presentation in audio and/or video format for use on its website and in other materials. Please understand that there is nothing in this Release requiring you to give your ideas to Pivotal. If you plan to give the same talk somewhere else, there is nothing in this release that would keep you from that engagement.
I, ____________________________ (PRINTED NAME), hereby authorize Pivotal Labs, its designees, licenses and assignees, to audio, and/or video record, and/or video stream my speech or presentation given at __________________________________________ (LOCATION) on the date of ____________, as well as use my name, voice, likeness, biographic information and ancillary material in connection the recordings. I understand that the recording of my seminar, lecture, or other presentation may be made available a

“This is done through the mechanism of futures, which are roughly Algol-60 ‘thunks’ which have their own evaluator process (‘thinks’?). (Friedman and Wise call futures ‘promises’, while Hibbard calls them ‘eventuals’.) When an expression is given to the evaluator by the user, a future for that expression is returned which is a promise to deliver the value of that expression at some later time, if the expression has a value. A process is created for each new future which immediately starts to work evaluating the given expression. When the value of a future is needed explicitly, e.g., by the primitive function +, the evaluation process may or may not have finished. If it has finished, the value is immediately made available; if not, the requesting process is forced to wait until it finishes.”

Baker et al. The incremental garbage collection of processes. Proceedings of the 1977 symposium on Artificial intelligence and programming languages (1977)