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
<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)

~/Downloads/node-v0.4.1> less pop-stack.js
function doAThing(i) {
console.log("Iter " + i);
doAThing(i + 1);
}
doAThing(1); // this should be good
~/Downloads/node-v0.4.1> ./node pop-stack.js
Iter 1
protected def ![A <: ColumnContainer](implicit consistency : ReadConsistency) : Seq[(String, Seq[A])] = {
ks.pool.withConnection { conn =>
val results = conn.client.get_range_slices(ks.name,
cp,
predicate,
range,
consistency.thrift)
results.map { ks =>
(ks.key, ks.columns.map{ container => new A(container)})
# ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.2.0], MBARI 0x6770, Ruby Enterprise Edition 2009.10
# user system total real
# hash lookup: 21.470000 0.120000 21.590000 ( 23.683924)
# method dispatch: 26.980000 0.150000 27.130000 ( 29.014672)
# jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2010-01-12 6586) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_17) [x86_64-java]
# user system total real
# hash lookup: 6.548000 0.000000 6.548000 ( 6.548000)
# method dispatch: 10.841000 0.000000 10.841000 ( 10.841000)
def time(f: => Unit) = {
val t1 = System.currentTimeMillis
f
((System.currentTimeMillis - t1)/1000.0)
}
def write(values: Array[(String, Int)], file: String) {
val writer = new PrintWriter(new FileWriter(file))
try {
for ((x, y) <- values) {
// Scala 2.7.7, immutable map, uses foldLeft to loop over files/words
import java.io._
import scala.io._
def time(f: => Unit) = {
val t1 = System.currentTimeMillis
f
((System.currentTimeMillis - t1)/1000.0)
}
scala> object Thing1 {
| var things = 0
| }
defined module Thing1
scala> class Thing1 {
| Thing1.things +=1
| }
defined class Thing1