Back
>= (clj)
(source)function
(>= x)
(>= x y)
(>= x y & more)
Returns non-nil if nums are in monotonically non-increasing order,
otherwise false.
Examples
clojure
(ns clojure.test-clojure.server
(:import java.util.Random)
(:require [clojure.test :refer :all])
(:require [clojure.core.server :as s]))
(deftest test-parse-props
(let [thread (create-random-thread)]
(.start thread)
(Thread/sleep 1000)
(try
(is (>= (count
(#'s/parse-props (System/getProperties))) 0))
(finally (.interrupt thread)))))
originrose/cortex
(ns cortex.nn.impl
"Implementation helpers to aid implementing neural network cortex protocols
or specific neural network layers"
(:require [cortex.nn.layers :as layers]
[clojure.core.matrix.macros :refer [c-for]]))
(defmacro in-bounds?
"is value within the range of [min-val, max-val)"
[value min-val max-val]
`(and (>= ~value ~min-val)
(< ~value ~max-val)))
typedclojure/typedclojure
(ns ^:no-doc typed.ann.clojure
"Type annotations for the base Clojure distribution."
#?(:cljs (:require-macros [typed.ann-macros.clojure :as macros]))
(:require [clojure.core :as cc]
[typed.clojure :as t]
#?(:clj [typed.ann-macros.clojure :as macros])
#?(:clj typed.ann.clojure.jvm) ;; jvm annotations
#?(:clj clojure.core.typed))
#?(:clj
(:import (clojure.lang PersistentHashSet PersistentList
APersistentMap #_IPersistentCollection
#_ITransientSet
IRef)
(java.util Comparator Collection))))
#_(comment
cc/reduce
(t/All [a c d]
(t/IFn
;Without accumulator
; empty coll, f takes no args
; (reduce + []) => 0, (reduce + nil) => 0
[[:-> c] (t/U nil (t/I (ExactCount 0) (t/Seqable c))) :-> c]
; coll count = 1, f is not called
; (reduce + [1]) => 1
[t/Any (t/I (ExactCount 1) (t/Seqable c)) :-> c]
; coll count >= 2
; (reduce + [1 2]) => 3
[[c c :-> c] (t/I (t/CountRange 2) (t/Seqable c)) :-> c]
; default
; (reduce + my-coll)
[(t/IFn [c c :-> c] [:-> c]) (t/Seqable c) :-> c]
;With accumulator
; empty coll, f not called, returns accumulator
; (reduce + 3 []) => 3
[t/Any a (t/U nil (t/I (ExactCount 0) t/AnySeqable)) :-> a]
; default
; (reduce + 3 my-coll)
[[a c :-> a] a (t/Seqable c) :-> a]))
)
cc/< [(t/+ t/Num) :-> t/Bool]
cc/<= [(t/+ t/Num) :-> t/Bool]
cc/> [(t/+ t/Num) :-> t/Bool]
cc/>= [(t/+ t/Num) :-> t/Bool]
cc/== [(t/+ t/Num) :-> t/Bool]
Quantisan/docker-clojure
(ns docker-clojure.config
(:require [clojure.spec.alpha :as s]
[clojure.string :as str]
[docker-clojure.core :as-alias core]))
; no more focal builds for JDK 20+
; TODO: Add ability to specify version >= 20 for these
{:jdk-version 21
:distro :ubuntu/focal}
{:build-tool "boot"
:distro :alpine/alpine} ; boot is breaking on Alpine
; we're no longer building boot variants for JDK 20+
; TODO: Add ability to specify version >= 20 for these
{:jdk-version 21
:build-tool "boot"}
;; commented out example
#_{:jdk-version 8
:distro :alpine/alpine}})
djhaskin987/degasolv
(ns degasolv.resolver.search-strat-test
(:require [clojure.test :refer :all]
[degasolv.resolver :refer :all]
[clojure.core.match :refer [match]]
[serovers.core :refer [maven-vercmp]
:rename {maven-vercmp cmp}])
(:import [degasolv.resolver
PackageInfo
Requirement]))
(deftest ^:unit-tests basic-dfs
(testing "Make sure ``the puzzle`` still works"
(let [package-a
(->PackageInfo
"a"
1
"a_loc1"
[
[(present "b")]
[(present "c")]
]
)
package-b
(->PackageInfo
"b"
1
"b_loc1"
[
[(present "d" #(>= (:version %) 1))]
]
)
package-c
(->PackageInfo
"c"
1
"c_loc1"
[
[(present "d" #(< (:version %) 4))]
]
)
package-d1
(->PackageInfo
"d"
1
"d_loc1"
[
[(present "e" #(.equals (:version %) 4))]
]
)
package-d2
(->PackageInfo
"d"
2
"d_loc2"
[
[(present "e" #(.equals (:version %) 3))]
]
)
package-e4
(->PackageInfo
"e"
4
"e_loc4"
nil)
package-e3
(->PackageInfo
"3"
3
"e_loc3"
nil)
repo-info
{"a" [package-a]
"b" [package-b]
"c" [package-c]
"d" [package-d2 package-d1]
"e" [package-e4 package-e3]}
query
(map-query repo-info)]
(is (.equals [:successful #{package-a
package-b
package-c
package-d2
package-e3}]
(resolve-dependencies
[
[(present "a")]
]
query
:search-strat :depth-first)))))
(let [d
{
:id "d"
:version "4.0.0"
:location "http://example.com/repo/d-4.0.0.zip"
}
c
{
:id "c"
:version "2.7.0"
:location "http://example.com/repo/c-2.7.0.zip"
}
b
{
:id "b"
:version "1.0.0"
:location "http://example.com/repo/b-1.0.0.zip"
:requirements
[
[
{:status :present
:id "d"
}
{:status :present
:id "c"
}
]
]
}
a
{
:id "a"
:version "1.0.0"
:location "http://example.com/repo/a-1.0.0.zip"
:requirements
[
[
{:status :present
:id "b"
}
]
[
{:status :present
:id "c"
}
{:status :present
:id "d"
}
]
]
}
repo-info
{
"a"
[
a
]
"b"
[
b
]
"c"
[
c
]
"d"
[
d
]
}
query (map-query repo-info)]
(testing "order of resolution depending on search-strat - breadth first"
(is (= [:successful
#{c
b
a}]
(resolve-dependencies
[[{:status :present :id "a"}]]
query
:search-strat :breadth-first
:compare cmp))))
(testing "order of resolution depending on search-strat - depth first"
(is (= [:successful
#{d
b
a}]
(resolve-dependencies
[[{:status :present :id "a"}]]
query
:search-strat :depth-first
:compare cmp)))))
(let [e
{
:id "e"
:version "7.0.0"
:location "http://example.com/repo/e-7.0.0.zip"
}
d
{
:id "d"
:version "4.0.0"
:location "http://example.com/repo/d-4.0.0.zip"
}
c
{
:id "c"
:version "2.7.0"
:location "http://example.com/repo/c-2.7.0.zip"
}
b
{
:id "b"
:version "1.0.0"
:location "http://example.com/repo/b-1.0.0.zip"
:requirements
[
[
{:status :absent
:id "d"
}
{:status :present
:id "e"
}
]
]
}
a
{
:id "a"
:version "1.0.0"
:location "http://example.com/repo/a-1.0.0.zip"
:requirements
[
[
{:status :present
:id "b"
}
]
[
{:status :present
:id "d"
}
{:status :present
:id "c"
}
]
]
}
repo-info
{
"a"
[
a
]
"b"
[
b
]
"c"
[
c
]
"d"
[
d
]
"e"
[
e
]
}
query (map-query repo-info)]
(testing "search strat: order of resolution: breadth first: absent"
(is (= [:successful
#{a
b
d
e}]
(resolve-dependencies
[[{:status :present :id "a"}]]
query
:search-strat :breadth-first
:compare cmp))))
(testing "search strat: order of resolution: depth first: absent"
(is (= [:successful
#{a
b
c}]
(resolve-dependencies
[[{:status :present :id "a"}]]
query
:search-strat :depth-first
:compare cmp)))))
(let [c40
{
:id "c"
:version "4.0.0"
:location "http://example.com/repo/c-4.0.0.zip"
}
c27
{
:id "c"
:version "2.7.0"
:location "http://example.com/repo/c-2.7.0.zip"
}
b
{
:id "b"
:version "1.0.0"
:location "http://example.com/repo/b-1.0.0.zip"
:requirements
[
[
{:status :present
:id "c"
:spec [[{:relation :equal-to :version "2.7.0"}]]
}
]
]
}
a
{
:id "a"
:version "1.0.0"
:location "http://example.com/repo/a-1.0.0.zip"
:requirements
[
[
{:status :present
:id "b"
}
]
[
{:status :present
:id "c"
:spec [[{:version "4.0.0" :relation :equal-to}]]
}
]
]
}
repo-info
{
"a"
[
a
]
"b"
[
b
]
"c"
[
c40
c27
]
}
query (map-query repo-info)]
(testing "breadth-first conflict-strat as prioritized"
(is (= [:successful #{a b c40}]
(resolve-dependencies
[[{:status :present :id "a"}]]
query
:conflict-strat :prioritized
:search-strat :breadth-first
:compare cmp))))
(testing "depth-first conflict-strat as prioritized"
(is (= [:successful #{a b c27}]
(resolve-dependencies
[[{:status :present :id "a"}]]
query
:conflict-strat :prioritized
:search-strat :depth-first
:compare cmp))))))
gerritjvv/fmap-clojure
(ns fmap-clojure.applicative-tests
(:require [fmap-clojure.core :refer [<*> >>=*]])
(:use midje.sweet))
(facts "Test <*>"
(fact "Test <*> over single argument"
(<*> [inc] [1]) => [2])
(fact "Test <*> over 4 arguments"
(<*> [inc] [1 2 3 4]) => [2 3 4 5])
(fact "Test <*> over 1 int and a nested list of 4 arguments"
(<*> [inc] [1 [1 2 3 4]]) => [2 [2 3 4 5]])
(fact "Test fmap for maps"
(prn
(>>=* [{:topic "a" :partition 1 :val "hi"}
{:topic "b" :partition 2 :val "hi2"}]
(partial group-by :topic))
))
)