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 React, { Component } from 'react'; | |
import { Grid, ScrollSync, AutoSizer } from 'react-virtualized'; | |
import 'react-virtualized/styles.css'; | |
class App extends Component { | |
render() { | |
return ( | |
<div className="App"> | |
<div className='Table' style={{width: 600, height: 400}}> | |
<AutoSizer> |
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
(walk-term [1 {1 1} [1 1 1] #{1 2 3} (l/llist 1 1 1)] | |
(fn [expr] | |
(if (number? expr) | |
(inc expr) | |
expr))) | |
;; => [3 {3 3} [3 3 3] #{1 2 3} (2 1 . 1)] |
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
user=> (use 'clojure.core.logic.unifier) | |
user=> (prep '([?x])) | |
([<lvar:?x>]) ;; ok. ?x turned into an lvar | |
user=> (prep '([?x] . ?xs)) | |
([?x] . <lvar:?xs>) ;; fail. ?x is not an lvar |
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
;; Given a class name, which methods have changed the most? | |
(->> (q '[:find ?name (count ?sha) | |
:in $ ?class-name | |
:where | |
[?codeq :java/class-name ?class-name] | |
[?mcodeq :codeq/parent ?codeq] | |
[?mcodeq :java/method ?codename] | |
[?codename :code/name ?name] | |
[?mcodeq :codeq/code ?code] | |
[?code :code/sha ?sha]] |
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
(require '[datomic.api :as d]) | |
(require '[clojure.pprint :refer [pprint]]) | |
(def uri "datomic:free://localhost:4334/git") | |
(def conn (d/connect uri)) | |
(def db (d/db conn)) | |
;; committers | |
(d/q '[:find ?email | |
:where | |
[_ :commit/committer ?u] |
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
(defmulti foo identity) | |
(defmethod foo 1 [n] | |
(recur (dec n))) | |
(defmethod foo 0 [n] | |
:ok) | |
(foo 1) ;; runs forever |
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 '[datomic.api :only [db q] :as d]) | |
(def schema | |
[{:db/doc "A persons name" | |
:db/id #db/id[:db.part/db] | |
:db/ident :name | |
:db/valueType :db.type/string | |
:db/cardinality :db.cardinality/one | |
:db.install/_attribute :db.part/db} | |
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 '[datomic.api :only [db q] :as d]) | |
(def schema | |
[{:db/id #db/id[:db.part/db] | |
:db/ident :num | |
:db/valueType :db.type/long | |
:db/cardinality :db.cardinality/one | |
:db.install/_attribute :db.part/db} | |
{:db/id #db/id[:db.part/db] |
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 '[datomic.api :only [db q] :as d]) | |
(def schema | |
[{:db/doc "A persons name" | |
:db/id #db/id[:db.part/db] | |
:db/ident :name | |
:db/valueType :db.type/string | |
:db/cardinality :db.cardinality/one | |
:db.install/_attribute :db.part/db} | |
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 '[datomic.api :only [db q] :as d]) | |
(def schema | |
[{:db/doc "A persons name" | |
:db/id #db/id[:db.part/db] | |
:db/ident :name | |
:db/valueType :db.type/string | |
:db/cardinality :db.cardinality/one | |
:db.install/_attribute :db.part/db} | |
NewerOlder