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
$template TestFormat,"Message: %msg%\n" | |
$template TestFile,"/tmp/test_%$year%%$month%%$day%%$hour%.log" | |
# Writes matching messages to path defined by TestFile template in TestFormat format | |
:syslogtag, contains, "test" -?TestFile;TestFormat | |
# Drops messages matching this syslog tag | |
:syslogtag, contains, "test" ~ |
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
# get the largest 10 under current directory | |
du -hsx * | sort -rh | head -10 |
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 python | |
import redis | |
import random | |
import pylibmc | |
import sys | |
r = redis.Redis(host = 'localhost', port = 6389) | |
mc = pylibmc.Client(['localhost:11222']) |
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 messagepassing.core) | |
(import [java.util.concurrent LinkedTransferQueue]) | |
(def m 10000000) | |
(defn queue-test [] | |
(defn bounce [in out m] | |
(let [value (.take in)] | |
(if (< value m) | |
(do |
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
<!doctype html> | |
<html> | |
<head> | |
<title>Episodes Example 1</title> | |
<meta charset="UTF-8"> | |
<script> | |
var EPISODES = EPISODES || {}; | |
EPISODES.q = []; // command queue | |
EPISODES.mark = function(mn, mt) { EPISODES.q.push( ["mark", mn, mt || new Date().getTime()] ); }; |
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 python | |
import redis | |
import random | |
import pylibmc | |
import sys | |
r = redis.Redis(host = 'localhost', port = 6389) | |
mc = pylibmc.Client(['localhost:11222']) |
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
(defn chunked-string-seq | |
([^java.io.Reader rdr] | |
(chunked-string-seq rdr :chunk-size 16)) | |
([^java.io.Reader rdr &{chunk-size :chunk-size}] | |
{:pre [(some-> chunk-size pos?)]} | |
(let [buf (char-array chunk-size)] | |
(letfn [(f [] | |
(when (pos? (.read rdr buf)) | |
(cons (String. buf) (lazy-seq (f)))))] | |
(f))))) |
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
(defn fib2 [n] | |
(if (<= n 1) | |
1 | |
(+ (fib2 (dec n)) (fib2 (- n 2))))) | |
(defn ^:static fib ^long [^long n] | |
(if (<= n 1) | |
1 | |
(+ (fib (dec n)) (fib (- n 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
<div class="entry-content"> | |
<p>“<em><strong>Big-data</strong></em>” is one of the most inflated buzzword of the last years. Technologies born to handle huge datasets and overcome limits of previous products are gaining popularity outside the research environment. The following list would be a reference of this world. It’s still incomplete and always will be.</p> | |
<p><strong>Framework</strong></p> | |
<ul> | |
<li><a href="http://hadoop.apache.org/" onclick="javascript:_gaq.push(['_trackEvent','outbound-article','http://hadoop.apache.org']);"><strong>Apache Hadoop</strong></a>: framework for distributed processing. Integrates MapReduce (parallel processing), YARN (job scheduling) and HDFS (distributed file system)</li> | |
</ul> | |
<p><strong>Distributed Programming</strong></p> | |
<ul> | |
<li><a href="http://databricks.github.io/simr/" onclick="javascript:_gaq.push(['_trackEvent','outbound-article','http://databricks.github.io']);"><strong>AMPLab SIMR</strong></a>: run Spark on Hadoop MapReduce v1</li> | |
<li><a href="http://inc |
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 wikiparse.core | |
(:require [clojure.java.io :as io] | |
[clojure.data.xml :as xml] | |
[clojure.zip :refer [xml-zip]] | |
[clojure.data.zip.xml :refer [xml-> xml1-> text]]) | |
(:import [ org.apache.commons.compress.compressors.bzip2 BZip2CompressorInputStream]) | |
(:gen-class :main true)) | |
(defn bz2-reader | |
"Returns a streaming Reader for the given compressed BZip2 |
OlderNewer