summary refs log tree commit diff stats
path: root/lib/pure/bitops.nim
Commit message (Expand)AuthorAgeFilesLines
* styleCheck: make the compiler and large parts of the stdlib compatible with -...Araq2019-07-101-48/+48
* Bit operator names 2 (#11413)Arne Döring2019-06-061-0/+11
* Enable range checking for unsigned integers (#11313)Oscar Nihlgård2019-05-251-0/+18
* code cleanup (#10874)Arne Döring2019-03-281-18/+6
* bitops: add reverseBits and test (#10835)Tomohiro2019-03-131-0/+45
* Remove varsilent-observer2019-03-051-1/+1
* Vm bitops fixes (#10520)Arne Döring2019-02-051-10/+17
* Added basic bit manipulation procs to bitops (#10338)Ico Doornekamp2019-01-231-1/+59
* bitops: add 'hamming weight' to the doc indexAraq2017-12-031-1/+1
* add bitops module for optimized bit manipulation. (#5201)Parashurama2017-03-141-0/+383
ht .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
# a utility script used to explore my fediverse followers
(use spork)

(defn read-from-file [file-path]
  "read data from a file, not super safe or fault tolerant."
  (let [f (file/open file-path :r)
        content (file/read f :all)]
    (file/close f)
    content))

(def json-data
  (read-from-file "followers.json")) # this is just a small sample export, will have to use curl to get the full list beyond the first 80

(def all-followers
  (json/decode json-data))

# this seems horribly inefficient
# TODO: is there a clever way to deal with this?
# maybe a filter?
# (filter (fn [x] (> x 2)) [1 2 3 4 5])  # @[3 4 5]
# or maybe keep?
# https://janetdocs.com/keep
(defn select-by-key [key arr]
  "select a value by matched key."
  (def a @[])
  (each follower arr
    (loop [[k v] :pairs follower]
      (if (= k key)
        (array/push a v))))
  a)

(def follower-accounts
  (select-by-key "acct" all-followers))

(def follower-usernames
  (select-by-key "username" all-followers))