This file contains hidden or 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 foo.core) | |
| (use 'lamina.core 'lamina.connections 'aleph.http) | |
| (defn print-agent [fmt & rest] | |
| "prints a printf-style message, prefixed by the current agent" | |
| (let [args (if (nil? rest) '(*agent*) (cons *agent* rest))] | |
| (apply printf (str "%s " fmt "\n") args))) | |
| (defn make-get-requests [_ ntimes url] |
This file contains hidden or 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 cs.crawler) | |
| (defn- read-forms | |
| "Read all of the forms from a file, passed by name." | |
| [file] | |
| (let [reader-read-forms | |
| (fn [rdr] | |
| (let [inner-read (fn func [rslt] | |
| (try | |
| (func (conj rslt (read rdr))) |
This file contains hidden or 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
| $('.ajax_paginate').click(function() { | |
| setTimeout(engirdle, 500); | |
| }); |
This file contains hidden or 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 clojure-crawler.core | |
| (:require [cheshire.core :as cheshire] | |
| [clj-http.client :as client] | |
| [clojure.tools.cli :as cli])) | |
| (defn- read-forms | |
| "Read all of the forms from a file, passed by name." | |
| [file] | |
| (let [reader-read-forms | |
| (fn [rdr] |
This file contains hidden or 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
| commit 912767abf9ee5271061b35ec718f1d27482dbdbd | |
| Author: Evan Klitzke <evan@eklitzke.org> | |
| Date: Sun Jul 1 23:40:49 2012 -0700 | |
| add reader threads | |
| diff --git a/src/index_reader.cc b/src/index_reader.cc | |
| index adf7f27..f890b44 100644 | |
| --- a/src/index_reader.cc | |
| +++ b/src/index_reader.cc |
This file contains hidden or 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
| void NGramIndexReader::Find(const std::string &query, | |
| SearchResults *results) { | |
| if (query.size() < ngram_size_) { | |
| FindSmall(query, results); | |
| return; | |
| } | |
| // split the query into its constituent ngrams | |
| std::set<std::string> ngrams; | |
| for (std::string::size_type i = 0; |
This file contains hidden or 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
| deb http://ftp.us.debian.org/debian/ wheezy main | |
| deb-src http://ftp.us.debian.org/debian/ wheezy main | |
| deb http://security.debian.org/ wheezy/updates main | |
| deb-src http://security.debian.org/ wheezy/updates main |
This file contains hidden or 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 () { | |
| var x = 1; | |
| (function (x) { | |
| function () { | |
| // x is always 1 here, no matter what | |
| } | |
| })(x); | |
| x = 2; | |
| }) |
This file contains hidden or 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 | |
| # | |
| # Get "allocated" memory for a process (not including shmem!) | |
| pmap $1 | egrep ' anon|stack ' | awk '{s += $2} END {printf "%1.1fM\n", s / 1024.}' |
This file contains hidden or 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
| static void | |
| decide_maybe_mmap (_IO_FILE *fp) | |
| { | |
| /* We use the file in read-only mode. This could mean we can | |
| mmap the file and use it without any copying. But not all | |
| file descriptors are for mmap-able objects and on 32-bit | |
| machines we don't want to map files which are too large since | |
| this would require too much virtual memory. */ | |
| struct _G_stat64 st; |