-
Notifications
You must be signed in to change notification settings - Fork 0
/
io.randomseed.utils.vec.html
13 lines (13 loc) · 10.6 KB
/
io.randomseed.utils.vec.html
1
2
3
4
5
6
7
8
9
10
11
12
13
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>io.randomseed.utils.vec documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script><link rel="stylesheet" type="text/css" href="css/randomseed.css" /></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Random:utils</span> <span class="project-version">1.2.34</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="10_introduction.html"><div class="inner"><span>Introduction</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>io</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>randomseed</span></div></div></li><li class="depth-3"><a href="io.randomseed.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.bot.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>bot</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.bus.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>bus</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.crypto.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>crypto</span></div></a></li><li class="depth-4"><a href="io.randomseed.utils.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-5"><a href="io.randomseed.utils.db.types.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>types</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.fs.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>fs</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.ip.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>ip</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.log.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>log</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.map.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>map</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.nop-cache.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>nop-cache</span></div></a></li><li class="depth-4"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>reitit</span></div></div></li><li class="depth-5"><a href="io.randomseed.utils.reitit.http.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>http</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.set.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>set</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.time.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>time</span></div></a></li><li class="depth-4"><a href="io.randomseed.utils.validators.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validators</span></div></a></li><li class="depth-5"><a href="io.randomseed.utils.validators.common.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>common</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.var.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>var</span></div></a></li><li class="depth-4 current"><a href="io.randomseed.utils.vec.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>vec</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="io.randomseed.utils.vec.html#var-get-rand-nth"><div class="inner"><span>get-rand-nth</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.vec.html#var-merge"><div class="inner"><span>merge</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.vec.html#var-of-strings"><div class="inner"><span>of-strings</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.vec.html#var-pairs"><div class="inner"><span>pairs</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.vec.html#var-rand-nths"><div class="inner"><span>rand-nths</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.vec.html#var-replace-by-last"><div class="inner"><span>replace-by-last</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.vec.html#var-shuffle"><div class="inner"><span>shuffle</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.vec.html#var-split-at"><div class="inner"><span>split-at</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.vec.html#var-swap"><div class="inner"><span>swap</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">io.randomseed.utils.vec</h1><h4 class="added">added in 1.0.0</h4><div class="doc"><div class="markdown"><p>Random utils, vector utilities.</p>
</div></div><div class="public anchor" id="var-get-rand-nth"><h3>get-rand-nth</h3><h4 class="added">added in 1.0.0</h4><div class="usage"><code>(get-rand-nth v)</code><code>(get-rand-nth v rng)</code></div><div class="doc"><div class="markdown"><p>Returns a random element of the given vector. When the second argument is present it should be an instance of random number generator used to get the random position.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/vec.clj#L54">view source</a></div></div><div class="public anchor" id="var-merge"><h3>merge</h3><div class="usage"><code>(merge v1 v2)</code></div><div class="doc"><div class="markdown"><p>Merges two vectors.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/vec.clj#L32">view source</a></div></div><div class="public anchor" id="var-of-strings"><h3>of-strings</h3><div class="usage"><code>(of-strings coll)</code><code>(of-strings coll skip-if)</code></div><div class="doc"><div class="markdown"><p>Ensures that the given collection or a single value is a non-empty vector of strings. Optional function can be given to skip matching input argument and leave it as is.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/vec.clj#L115">view source</a></div></div><div class="public anchor" id="var-pairs"><h3>pairs</h3><div class="usage"><code>(pairs coll)</code></div><div class="doc"><div class="markdown"><p>Partitions a vector into pairs.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/vec.clj#L20">view source</a></div></div><div class="public anchor" id="var-rand-nths"><h3>rand-nths</h3><div class="usage"><code>(rand-nths coll)</code><code>(rand-nths coll num)</code><code>(rand-nths coll num rng)</code></div><div class="doc"><div class="markdown"><p>Returns a vector with the given number of randomly selected elements of the given vector. No element will be selected more than once.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/vec.clj#L78">view source</a></div></div><div class="public anchor" id="var-replace-by-last"><h3>replace-by-last</h3><div class="usage"><code>(replace-by-last v index)</code></div><div class="doc"><div class="markdown"><p>Removes an element under the given index from a vector by replacing it with the last one. For the last element index it simply removes it.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/vec.clj#L46">view source</a></div></div><div class="public anchor" id="var-shuffle"><h3>shuffle</h3><div class="usage"><code>(shuffle coll)</code><code>(shuffle coll rng)</code></div><div class="doc"><div class="markdown"><p>Like clojure.core/shuffle but makes use of custom random number generator.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/vec.clj#L67">view source</a></div></div><div class="public anchor" id="var-split-at"><h3>split-at</h3><div class="usage"><code>(split-at idx v)</code></div><div class="doc"><div class="markdown"><p>Splits vector at the given index.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/vec.clj#L15">view source</a></div></div><div class="public anchor" id="var-swap"><h3>swap</h3><div class="usage"><code>(swap v index-1 index-2)</code></div><div class="doc"><div class="markdown"><p>Swaps two elements of a vector.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/vec.clj#L39">view source</a></div></div></div></body></html>