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
import scala.concurrent.forkjoin.ForkJoinPool | |
import scala.concurrent.forkjoin.RecursiveTask | |
object Main { | |
def main(args: Array[String]) { | |
val pool = new ForkJoinPool() | |
println(s"${Thread.currentThread.getId}: unsorted=" + args.mkString(", ")) | |
val sorted = pool.invoke(new QuickSortingTask(args)) | |
println(s"${Thread.currentThread.getId}: sorted=" + sorted.mkString(", ")) | |
} |
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" | |
"os" | |
"path/filepath" | |
) | |
func main() { | |
if len(os.Args) < 2 { |
This file has been truncated, but you can view the full file.
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/folders/rc/_9kglbjs651431bbh2736s300000gn/T/python-build.20141227152802.9648 ~ | |
Downloading Python-3.4.1.tgz... | |
HTTP/1.1 200 OK | |
Date: Sat, 27 Dec 2014 06:28:03 GMT | |
Server: GitHub.com | |
Content-Type: application/octet-stream | |
Last-Modified: Tue, 04 Nov 2014 09:32:24 GMT | |
Expires: Sat, 27 Dec 2014 04:57:53 GMT | |
Cache-Control: max-age=600 | |
Content-Length: 19113124 |
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
#!/usr/bin/env ruby | |
require "json" | |
require "msgpack" | |
require "tempfile" | |
require "zlib" | |
io = Tempfile.new(File.basename($0)) | |
gzip = Zlib::GzipWriter.new(io) | |
packer = MessagePack::Packer.new(gzip) | |
ARGF.each do |s| | |
record = JSON.parse(s) |
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
hello, gist |
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 atoix(a) { | |
if(a~/Pi?B/) return int(a)*1024^5; | |
if(a~/Ti?B/) return int(a)*1024^4; | |
if(a~/Gi?B/) return int(a)*1024^3; | |
if(a~/Mi?B/) return int(a)*1024^2; | |
if(a~/Ki?B/) return int(a)*1024^1; | |
return int(a); | |
} | |
function itoax(i) { |
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
SRCDIR = /var/lib/cassandra/data | |
DSTDIR = . | |
SOURCES = $(wildcard $(SRCDIR)/*/*-Data.db) | |
ALL = $(foreach S,$(SOURCES),$(basename $(subst $(SRCDIR)/,,$(S))).json.lzo) | |
.SUFFIXES: .json.lzo | |
all: $(ALL) |
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
# upstart script for resolvconf | |
start on ( virtual-filesystems and starting udev ) | |
stop on runlevel [06] | |
pre-start script | |
invoke-rc.d resolvconf start | |
end script |
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
#!/usr/bin/env ruby | |
require 'logger' | |
require 'net/irc' | |
require 'optparse' | |
require 'thread' | |
class IRCNotifier < Net::IRC::Client | |
def initialize(host, port, opts={}) | |
super |
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 int2(str, card, rec) { | |
if(!card) card=10; | |
i = index("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", toupper(substr(str, 1, 1)))-1; | |
if(length(str) < 2) { | |
return rec*card+i; | |
} else { | |
return int2(substr(str, 2), card, rec*card+i); | |
} | |
} |
OlderNewer