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
/* | |
* expression_evaluator.cpp | |
* | |
* Created on: Mar 13, 2011 | |
* Author: ka | |
*/ | |
#define BOOST_SPIRIT_QI_DEBUG | |
#include <boost/config/warning_disable.hpp> |
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
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 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 a) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
(defn clj-mk-ref | |
[data] | |
(ref {:version 0 | |
:data data})) | |
(defn clj-sync-write |
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
(defn with-login-check | |
[handler] | |
(fn [request] | |
(if (logged-in? request) | |
(handler request) | |
{:status 403 | |
:headers {"Content-Type" "text/xml"} | |
:body "<forbidden/>"}))) | |
(defn create-routes [] |
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
(dotimes [_ 10] | |
(let [a (ref -100) | |
f1 (future (dosync (println "Trying T1") | |
(if (= @a 10) | |
(ref-set a @a) | |
(do (Thread/sleep 4000) | |
(println "Done T1"))))) | |
_ (Thread/sleep 1000) | |
f2 (future (dosync (println "Trying T2") | |
(ref-set a 15)))] |
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 tt) | |
(defn deduct-money-from-accnt | |
[a1-ref a2-ref {:keys [ensure1 ensure2]}] | |
(dosync | |
(when ensure1 (ensure a1-ref)) | |
(when ensure2 (ensure a2-ref)) | |
(let [sum (- (+ @a1-ref @a2-ref) 200)] | |
(when (>= sum 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
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.PreparedStatement; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.sql.Statement; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.Future; |
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 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 |
NewerOlder