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
(ns topologies.core | |
(:import [backtype.storm StormSubmitter LocalCluster]) | |
(:require [clojure.test :as test]) | |
(:use [backtype.storm clojure config]) | |
(:gen-class)) | |
(def id-count (atom 0)) ;; tuple counter for debugging -- something to make ids out of | |
(defspout sentence-spout ["sentence"] |
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/sh | |
# check if file-based sessions are enabled | |
file_storage=$(/usr/lib/php5/sessionstorage | grep '^files$' -c) | |
if [ "$file_storage" = "0" ]; then | |
exit 0 | |
fi | |
# first find all used files and touch them (hope it's not massive amount of files) |
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
defmodule Chat.Client do | |
# In all of the following functions 'server' stands for the server's pid | |
def join(server) do | |
send server, :join | |
end | |
def say(server, message) do | |
send server, { :say, message } | |
end |
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 thunder.streaming | |
import org.apache.spark.{SparkConf, Logging} | |
import org.apache.spark.rdd.RDD | |
import org.apache.spark.SparkContext._ | |
import org.apache.spark.streaming._ | |
import org.apache.spark.streaming.dstream.DStream | |
import org.apache.spark.mllib.clustering.KMeansModel | |
import scala.util.Random.nextDouble |
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 'optparse' | |
require 'net/http' | |
CATEGORIES = [:anime, :book, :music, :game, :real] | |
STATES = [:wish, :collect, :do, :on_hold, :dropped] | |
progress = true | |
options = { |
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/zsh -i | |
# if you're using ZSH, change the shebang above to "#!/bin/zsh -i" | |
eval "$(rbenv init -)" | |
if [ ${#} -ne 2 ]; then | |
echo >&2 Usage: $(basename ${0}) old-version new-version | |
exit 1 | |
fi |
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
# yum list \*openssl\* | |
yum install -y openssl098e | |
yum install -y zlib | |
ln -s /usr/lib64/libssl.so.0.9.8e /usr/lib64/libssl.so.0.9.8 | |
ln -s /usr/lib64/libcrypto.so.0.9.8e /usr/lib64/libcrypto.so.0.9.8 | |
ln -s /lib64/libbz2.so.1 /lib64/libbz2.so.1.0 | |
wget https://bitbucket.org/pypy/pypy/downloads/pypy-1.8-linux64.tar.bz2 | |
tar -xf pypy-1.8-linux64.tar.bz2 | |
cp -r pypy-1.8 /opt | |
ln -s /opt/pypy-1.8/bin/pypy /usr/local/bin |
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
openssl version -a | |
sudo add-apt-repository ppa:0k53d-karl-f830m/openssl | |
sudo apt-get update | |
sudo apt-get install openssl | |
openssl version -a |
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 net.abhinavsarkar.util; | |
/** | |
* A (infinite) Fibonacci number generator. | |
* | |
* @author Abhinav Sarkar | |
*/ | |
public class Fibonacci extends Generator<Integer> { | |
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 asyncio | |
missing = object() | |
class Value: | |
''' | |
Simple class that enables `await value.wait_for(foo)` to wait until the | |
variable is set to the expected value, without blocking the event loop. | |
Loosely modeled after asyncio.Event and asyncio.Condition |
OlderNewer