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 java.util.concurrent.{BlockingQueue, ArrayBlockingQueue, CountDownLatch, Executors, TimeUnit} | |
/* | |
Abstracts away the common pattern of producing items into a queue that are | |
consumed concurrently by a pool of workers. | |
*/ | |
class ConcurrentBlockingQueueConsumer[T](queue: BlockingQueue[T], producer: Iterator[T], concurrencyLevel: Int) { | |
lazy val stopLatch = new CountDownLatch(1) | |
lazy val pool = Executors.newFixedThreadPool(concurrencyLevel) |
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
# Ever get tired of people messing with your ruby classes? | |
# now you can put the hammer down and stop them. Just | |
# include this module and no one will be able to modify the | |
# class implementation or any instance implementations. | |
module Stop | |
module CantTouchThis | |
def self.included(mod) |
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 isVisible = false; | |
function onVisible() { | |
isVisible = true; | |
jQuery.getScript("http://www.google-analytics.com/ga.js"); | |
} | |
if ( document.webkitVisibilityState === undefined || document.webkitVisibilityState === "visible" ) { | |
onVisible(); | |
} else { | |
jQuery.bind( "webkitvisibilitychange", function() { |
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
require 'rubygems' | |
require 'oauth' | |
require 'awesome_print' | |
require 'uri' | |
# Usage: | |
# 1) Get consumer key/secret from https://dev.twitter.com/apps | |
# 2) Run ruby oauth_util.rb https://api.twitter.com/statuses/home_timeline.json | |
# 3) Authorize as instructed | |
# 4) $$$ |
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/bash | |
LAYOUT=sfdp | |
SIZE=300 | |
echo `date`: Producing graph | |
cat mutual_uoi_follows | perl -ne 's/(\w+)\t(\w+)/"\1"\t->\t"\2"/ and print' | samp 1 | graphify > graph.gv | |
echo `date`: Splitting out largest connected component | |
cat graph.gv | ccomps -zX#0 > graph-cc0.gv |
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
Ping me if you know of an awesome conference that isn't on this list. | |
Most of these cover the cost of conference, travel and lodging. | |
Dates are currently almost all for 2015. | |
JSConf US CFP: Jan 30 Conf: May 27-29 FL http://jsconf.us | |
Clojure/West CFP: Feb 11 Conf: Apr 20-22 PDX http://clojurewest.org | |
LambdaConf CFP: Feb 27 Conf: May 22 BLDR http://www.degoesconsulting.com/lambdaconf-2015/ | |
SIGBOVIK CFP: Mar 15 Conf: Apr 1 CMU http://sigbovik.org | |
PolyConf CFP: Mar 28 Conf: Jul 2-4 Poland http://polyconf.com | |
Curry-On CFP: Apr 3 Conf: Jul 6-7 Prague http://www.curry-on.org |
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
-- Load foreign functions interface | |
local ffi = require("ffi") | |
-- Load Ruby library & define function headers | |
local ruby = ffi.load("msvcrt-ruby210") | |
ffi.cdef([[ | |
typedef uintptr_t RUBY_VALUE; | |
enum{ | |
RUBY_Qfalse = 0, | |
RUBY_Qtrue = 2, |
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
(require '[clojure.walk :as w]) | |
(defmacro both [a b pred] `(and (~pred ~a) (~pred ~b))) | |
(defn union-structure [a b] | |
(cond (= a b) a | |
(both a b vector?) [(reduce union-structure (concat a b))] | |
(both a b map?) (merge-with union-structure a b) | |
; Dunno, said the ghoul |
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
# Ever get tired of people messing with your ruby classes? | |
# now you can put the hammer down and stop them. Just | |
# include this module and no one will be able to modify the | |
# class implementation or any instance implementations. | |
module Stop | |
module CantTouchThis | |
def self.included(mod) |
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
Candidates for next platforms after PCs, phones, and tablets: | |
Virtual reality | |
Internet of things | |
Wearable computers | |
Cryptocurrencies / blockchain | |
Self-driving cars | |
Drones | |
Brain-computer interfaces | |
3d printing | |
Augmented reality |
OlderNewer