### ReadOnlyForm: Order detail
- Order number: 2020-02/202
- Status: Accepted
- Customer: Planet express
- Order date: 2 days ago (Feb 20, 2020)
- Delivery address: 57th Street, Manhattan, New New York
- [warning: Reserve]()
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 sample.solve-maze) | |
(defn visited | |
[maze] | |
(concat (vals (:transitions maze)) | |
(keys (:transitions maze)))) | |
(def escape | |
{ | |
:clear "\033[2J" |
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 sample.sample-core | |
(:require [clojure.repl :refer :all] | |
[clojure.test :refer :all])) | |
; List comprehension | |
; Works for negative numbers | |
(defn find-sum-1 | |
"Find the first continuous sub-sequence of elements having the sum. | |
Return the start-index and length of the sub-sequence. | |
Return [-1 -1] if no such sub-sequence exists." |
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- setup-java-melody | |
[] | |
(System/setProperty "javamelody.locale" "en_US") | |
(System/setProperty "javamelody.displayed-counters" "http,sql,error,log,ejb")) |
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 backend.support.aspects | |
(:require ... | |
[backend.support.java-melody :as melody])) | |
(defn- monitoring-hook | |
[f & args] | |
(let [ns-name (->ns-name f) | |
fn-name (->fn-name f) | |
melody-request-name (str ns-name "/" fn-name)] | |
(.bindContextIncludingCpu melody/ejb-counter melody-request-name) |
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 backend.support.java-melody | |
(:import (net.bull.javamelody MonitoringProxy) | |
(net.bull.javamelody.internal.model Counter))) | |
(defn- call-method | |
[klass method-name params obj & args] | |
(-> klass | |
(.getDeclaredMethod (name method-name) | |
(into-array Class params)) | |
(doto (.setAccessible true)) |
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 backend.system.datasource | |
(:require ...) | |
(:import (net.bull.javamelody JdbcWrapper) | |
(java.io Closeable))) | |
(defn- create-instance | |
[] | |
(let [hikari-ds (ds/make-datasource (:db config)) | |
java-melody-wrapped-ds (.createDataSourceProxy JdbcWrapper/SINGLETON hikari-ds)] | |
java-melody-wrapped-ds)) |
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 backend.system.datasource | |
(:require [clojure.tools.logging :as log] | |
[mount.core :refer [defstate]] | |
[hikari-cp.core :as ds] | |
[backend.system.config :refer [config]] | |
[backend.system.database])) | |
(defstate datasource | |
:start (ds/make-datasource (:db config)) | |
:stop (try |
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 setup-java-melody | |
[] | |
(System/setProperty "javamelody.locale" "en_US")) |
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
:dependencies [ ... | |
[net.bull.javamelody/javamelody-core "1.82.0"]] |
NewerOlder