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 start = new Date(); | |
var data = eval('(' + | |
"[[\"1.\",\"2107773\",\"\\\"http:\\/\\/www.crunchgear.com\\/2011\\/01\\/15\\/a-brief-explanation-of-why-minecraft-matters\\/\\\"\",\"Why Minecraft Matters\",\" (crunchgear.com) \",\"50\",\"solipsist\",\" 2 hours ago | \",\"17 comments\"],[\"2.\",\"2108021\",\"\\\"http:\\/\\/antimatter15.com\\/wp\\/2011\\/01\\/the-ambiguity-of-open-and-vp8-vs-h-264\\/\\\"\",\"The Ambiguity of Open and H.264 vs. VP8\",\" (antimatter15.com) \",\"17\",\"antimatter15\",\" 1 hour ago | \",\"discuss\"],[\"3.\",\"2107618\",\"\\\"http:\\/\\/www.jamesmolloy.co.uk\\/tutorial_html\\/index.html\\\"\",\"Roll your own toy UNIX-clone OS\",\" (jamesmolloy.co.uk) \",\"57\",\"Rusky\",\" 4 hours ago | \",\"1 comment\"],[\"4.\",\"2108034\",\"\\\"http:\\/\\/nealpoole.com\\/blog\\/2011\\/01\\/http-response-splitting-on-reddit-com\\/\\\"\",\"HTTP Response Splitting Vulnerability on reddit.com\",\" (nealpoole.com) \",\"7\",\"there\",\" 1 hour ago | \",\"3 comments\"],[\"5.\",\"2107755\",\"\\\"http:\\/\ |
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 a) | |
(use '[clojure.contrib.io :only (make-parents spit delete-file)]) | |
(use '[clojure.contrib.shell :only (sh)]) | |
(use '[clojure.contrib.str-utils :only (re-split str-join)]) | |
(defn- convert-fn-meta-into-javadoc | |
[impl-ns prefix mname pclasses rclass is-static?] | |
(let [m (meta (resolve (symbol (str (str impl-ns) "/" prefix (str mname))))) | |
{:keys [file line doc]} m |
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
#include <iostream> | |
#include <string> | |
#include <unordered_map> | |
using namespace std; | |
static const unordered_map<int, int> mapA{}; | |
int funcA(int key) { | |
auto f = mapA.find(key); |
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
// A ZeroCopyOutputStream which appends bytes to a string. | |
// It has much a more favorable performance profile than StringOutputStream | |
// outside of Google since STLStringResizeUninitialized() is un-optimized. | |
class LIBPROTOBUF_EXPORT StringOutputStream2 : public ZeroCopyOutputStream { | |
public: | |
explicit StringOutputStream2(); | |
~StringOutputStream2(); | |
// implements ZeroCopyOutputStream --------------------------------- | |
bool Next(void** data, int* size); |
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
use strict; | |
use warnings 'all'; | |
use Tie::File; | |
use Fcntl 'O_RDWR'; | |
my $file = "to-sort.txt"; | |
tie my @nums, 'Tie::File', $file | |
, mode => O_RDWR | |
, recsep => ', ' | |
, memory => 20_000_000 # max 20 MB read buffer |
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 iiit | |
(:import | |
[java.io Writer File OutputStream FileOutputStream BufferedReader BufferedWriter FileReader FileWriter] | |
[java.util Collections]) | |
(:use | |
[clojure stacktrace] | |
[clojure.set :only (union intersection difference)] | |
[clojure.contrib repl-utils trace pprint str-utils (io :only (spit append-spit make-parents delete-file))] | |
[clojure.contrib.shell :only (sh)])) |
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
; MPI kind macros | |
(defmacro BLOCK_LOW [i p n] `(int (/ (* ~i ~n) ~p))) | |
(defmacro BLOCK_HIGH [i p n] `(- (BLOCK_LOW (+ 1 ~i) ~p ~n) 1)) | |
(defmacro BLOCK_SIZE [i p n] `(- (BLOCK_LOW (+ 1 ~i) ~p ~n) (BLOCK_LOW ~i ~p ~n))) | |
(defmacro BLOCK_ONWER [j p n] `(int (/ (- (* (inc ~j) ~p) 1) ~n))) | |
(defn partition-work | |
[p coll] | |
(let [s (seq coll) | |
n (count 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
/* | |
@lombok.Memoize | |
final Number test(int a, Double b) { | |
return null; | |
} | |
*/ | |
class Test{ | |
@java.lang.SuppressWarnings("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
import java.util.Random; | |
import java.util.concurrent.*; | |
import lombok.Memoize; | |
public class MemoizeTest { | |
@Memoize | |
public static int test(final int k){ | |
System.out.println("test " + k); | |
return k+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
package com.mxgraph.examples.swing; | |
import javax.swing.JFrame; | |
import com.mxgraph.layout.mxGraphLayout; | |
import com.mxgraph.layout.mxOrganicLayout; | |
import com.mxgraph.swing.mxGraphComponent; | |
import com.mxgraph.view.mxGraph; | |
@SuppressWarnings("serial") |
NewerOlder