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
package main | |
import ( | |
"bufio" | |
"encoding/binary" | |
"flag" | |
"io" | |
"os" | |
) |
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
// Two binary trees may be of different shapes, | |
// but have the same contents. For example: | |
// | |
// 4 6 | |
// 2 6 4 7 | |
// 1 3 5 7 2 5 | |
// 1 3 | |
// | |
// Go's concurrency primitives allow us to neatly | |
// traverse and compare the contents of two trees. |
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
package main | |
import "fmt" | |
var singleton = NewSingleton() | |
type Singleton struct { | |
S string | |
} |
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
PROGRAM MacPaint; | |
{ BitMap Painting Program by Bill Atkinson } | |
{$D- } | |
{$R- } | |
{$X- } | |
USES {$U obj:HeapZone } HeapZone, |
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
package main | |
import ( | |
"fmt" | |
"sort" | |
"container/heap" | |
"rand" | |
) | |
type record struct { |
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
fs = require 'fs' | |
class File | |
constructor: (@name) -> | |
read: (cb) -> | |
fs.readFile @name, (err, code) -> | |
throw err if err | |
cb code.toString() | |
file = new File "file.txt" |
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
{ | |
"KeyName": "icecloud-key", | |
"Server": [ | |
{ | |
"Kind": "master", | |
"Location": "Tokyo", | |
"Username": "ubuntu", | |
"ImageID": "ami-40b40041", | |
"Size": "m1.small", | |
"NumClients": 100, "NumSources": 5 |
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
13:23 <@adg> :) | |
13:28 < skelterjohn> always good to see a smiling face in here | |
13:35 < AndrewBC> Always? What if it's JUST a smiling face? | |
13:36 < skelterjohn> you mean as in this case? | |
13:37 < skelterjohn> it'll do | |
13:38 < AndrewBC> D'oh. I meant more like horror movie gore, but you win this | |
round | |
13:39 < skelterjohn> lol | |
13:39 <@adg> :) | |
13:39 < skelterjohn> OH GOD |
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
<html> | |
<head> | |
<title>Where's adg?</title> | |
<style> | |
th { | |
text-align: left; | |
} | |
td, th { | |
padding-right: 10px; | |
} |
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 cluster = require('cluster'); | |
var http = require('http'); | |
var numCPUs = require('os').cpus().length; | |
if (cluster.isMaster) { | |
// Fork workers. | |
for (var i = 0; i < numCPUs; i++) { | |
cluster.fork(); | |
} | |
cluster.on('exit', function(worker, code, signal) { |
OlderNewer