(setq debug-on-error t)
(setq inhibit-startup-message t) ; no splash screen
(defmacro delegate-protcols | |
"delegate protcol(s) to a member" | |
[from to & protocols] | |
`(extend | |
~from | |
~@(reduce #(concat %1 (cons (first %2) (rest %2))) | |
nil | |
(map (fn [p] | |
`(~p ~(into | |
{} |
mp_bin="mpost -TEX=latex"prolog = "verbatimtex\n\ | |
\\\documentclass{article}\n\ | |
\\\begin{document}\n\ | |
\etex\n\n\ | |
\input boxes\n\ | |
\input FuncMP\n\n" | |
epilog = "\n\n\\end" | |
defaultDX = 3 |
/** | |
* Code to illustrate garbage collector's handling of SoftReference objects. | |
* | |
* A number of soft references to byte arrays are added to a hash | |
* map. For some of those byte arrays, strong references are also | |
* retained. When garbage collector runs out of memory, it should | |
* clear all soft references except the ones to which we have strong | |
* references. | |
*/ |
/** | |
* Code to illustrate garbage collector's handling of WeakReference objects. | |
* | |
* A number of weak references to byte arrays are added to a hash | |
* map. For some of those byte arrays, strong references are also | |
* retained. When garbage collector runs out of memory, it should | |
* clear all soft references except the ones to which we have strong | |
* references. | |
*/ |
/* Illustration of phantom references handling */ | |
import java.io.FileNotFoundException; | |
import java.io.FileOutputStream; | |
import java.lang.ref.PhantomReference; | |
import java.lang.ref.ReferenceQueue; | |
/** | |
* An object which requires cleanup action when reclaimed | |
*/ | |
class MyObject { |
;; Copyright (C) 2014 by Praki Prakash | |
(ns monadict.throttle | |
(require | |
[clojure.core.async :as async])) | |
(defmacro defn-throttled | |
"Defines a function which will only be invoked after a specified | |
interval (ms). Syntax is the same as defn but precede the argument | |
vector with interval specified in milliseconds. |
\documentclass{standalone} | |
\usepackage{tikz} | |
\usetikzlibrary{shapes.misc, positioning, backgrounds, fit} | |
\begin{document} | |
\tikzset{ | |
sys/.style = {draw, rectangle, rounded corners=5, | |
node distance = 2cm, minimum height=2cm, minimum width=4cm}, | |
} |
\documentclass{standalone} | |
\usepackage{tikz} | |
\usetikzlibrary{shapes.misc, positioning, backgrounds, fit} | |
\begin{document} | |
\begin{tikzpicture} | |
\draw (0,0) -- (10, 10); | |
\end{tikzpicture} | |
\end{document} |
\documentclass{standalone} | |
\usepackage{tikz} | |
\usetikzlibrary{shapes.misc, positioning, backgrounds, fit} | |
\begin{document} | |
\begin{tikzpicture}[node distance=1 and 1] | |
\draw[help lines, very thin] (-1,-3) grid (5, 1); | |
% Drawing boxes left aligned | |
\node at (0,0) [rectangle,white,fill=red] (D) {D}; |