Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wp-file-.../lib/codemirr.../mode/clojure
File: index.html
<!doctype html>
[0] Fix | Delete
[1] Fix | Delete
<title>CodeMirror: Clojure mode</title>
[2] Fix | Delete
<meta charset="utf-8"/>
[3] Fix | Delete
<link rel=stylesheet href="../../doc/docs.css">
[4] Fix | Delete
[5] Fix | Delete
<link rel="stylesheet" href="../../lib/codemirror.css">
[6] Fix | Delete
<script src="../../lib/codemirror.js"></script>
[7] Fix | Delete
<script src="clojure.js"></script>
[8] Fix | Delete
<style>.CodeMirror {background: #f8f8f8;}</style>
[9] Fix | Delete
<div id=nav>
[10] Fix | Delete
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
[11] Fix | Delete
[12] Fix | Delete
<ul>
[13] Fix | Delete
<li><a href="../../index.html">Home</a>
[14] Fix | Delete
<li><a href="../../doc/manual.html">Manual</a>
[15] Fix | Delete
<li><a href="https://github.com/codemirror/codemirror">Code</a>
[16] Fix | Delete
</ul>
[17] Fix | Delete
<ul>
[18] Fix | Delete
<li><a href="../index.html">Language modes</a>
[19] Fix | Delete
<li><a class=active href="#">Clojure</a>
[20] Fix | Delete
</ul>
[21] Fix | Delete
</div>
[22] Fix | Delete
[23] Fix | Delete
<article>
[24] Fix | Delete
<h2>Clojure mode</h2>
[25] Fix | Delete
<form><textarea id="code" name="code">
[26] Fix | Delete
; Conway's Game of Life, based on the work of:
[27] Fix | Delete
;; Laurent Petit https://gist.github.com/1200343
[28] Fix | Delete
;; Christophe Grand http://clj-me.cgrand.net/2011/08/19/conways-game-of-life
[29] Fix | Delete
[30] Fix | Delete
(ns ^{:doc "Conway's Game of Life."}
[31] Fix | Delete
game-of-life)
[32] Fix | Delete
[33] Fix | Delete
;; Core game of life's algorithm functions
[34] Fix | Delete
[35] Fix | Delete
(defn neighbours
[36] Fix | Delete
"Given a cell's coordinates, returns the coordinates of its neighbours."
[37] Fix | Delete
[[x y]]
[38] Fix | Delete
(for [dx [-1 0 1] dy (if (zero? dx) [-1 1] [-1 0 1])]
[39] Fix | Delete
[(+ dx x) (+ dy y)]))
[40] Fix | Delete
[41] Fix | Delete
(defn step
[42] Fix | Delete
"Given a set of living cells, computes the new set of living cells."
[43] Fix | Delete
[cells]
[44] Fix | Delete
(set (for [[cell n] (frequencies (mapcat neighbours cells))
[45] Fix | Delete
:when (or (= n 3) (and (= n 2) (cells cell)))]
[46] Fix | Delete
cell)))
[47] Fix | Delete
[48] Fix | Delete
;; Utility methods for displaying game on a text terminal
[49] Fix | Delete
[50] Fix | Delete
(defn print-board
[51] Fix | Delete
"Prints a board on *out*, representing a step in the game."
[52] Fix | Delete
[board w h]
[53] Fix | Delete
(doseq [x (range (inc w)) y (range (inc h))]
[54] Fix | Delete
(if (= y 0) (print "\n"))
[55] Fix | Delete
(print (if (board [x y]) "[X]" " . "))))
[56] Fix | Delete
[57] Fix | Delete
(defn display-grids
[58] Fix | Delete
"Prints a squence of boards on *out*, representing several steps."
[59] Fix | Delete
[grids w h]
[60] Fix | Delete
(doseq [board grids]
[61] Fix | Delete
(print-board board w h)
[62] Fix | Delete
(print "\n")))
[63] Fix | Delete
[64] Fix | Delete
;; Launches an example board
[65] Fix | Delete
[66] Fix | Delete
(def
[67] Fix | Delete
^{:doc "board represents the initial set of living cells"}
[68] Fix | Delete
board #{[2 1] [2 2] [2 3]})
[69] Fix | Delete
[70] Fix | Delete
(display-grids (take 3 (iterate step board)) 5 5)
[71] Fix | Delete
[72] Fix | Delete
;; Let's play with characters
[73] Fix | Delete
(println \1 \a \# \\
[74] Fix | Delete
\" \( \newline
[75] Fix | Delete
\} \" \space
[76] Fix | Delete
\tab \return \backspace
[77] Fix | Delete
\u1000 \uAaAa \u9F9F)
[78] Fix | Delete
[79] Fix | Delete
;; Let's play with numbers
[80] Fix | Delete
(+ 1 -1 1/2 -1/2 -0.5 0.5)
[81] Fix | Delete
[82] Fix | Delete
</textarea></form>
[83] Fix | Delete
<script>
[84] Fix | Delete
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
[85] Fix | Delete
</script>
[86] Fix | Delete
[87] Fix | Delete
<p><strong>MIME types defined:</strong> <code>text/x-clojure</code>.</p>
[88] Fix | Delete
[89] Fix | Delete
</article>
[90] Fix | Delete
[91] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function