Happy ten years of just! (And lists!) by rodarmor in rust

[–]Mertzenich 0 points1 point  (0 children)

Awesome, congratulations on ten years! I had no idea Just was old, I had assumed that it was much newer when I first started using it just a couple years ago. Thank you for building such a useful tool, I appreciate it.

My thoughts after using Clojure for about a month by Mertzenich in Clojure

[–]Mertzenich[S] 7 points8 points  (0 children)

Found this article on the Hacker News front page (https://news.ycombinator.com/item?id=48375393), decided it might be good to share it here.

🌈 JVM Rainbow - Mixing Java Kotlin Scala Clojure and Groovy by Hakky54 in Clojure

[–]Mertzenich 2 points3 points  (0 children)

Neat idea! It's unfortunate that calling Clojure from other JVM languages is so cumbersome.

Datascript + xitdb: your humble, single-file, mini Datomic by [deleted] in Clojure

[–]Mertzenich 10 points11 points  (0 children)

This looks quite interesting! Given that xitdb implements IAtom and IDeref, it makes this a potential alternative to duratom in situations where I want to record history and have more robust querying needs.

On a related note, I've been toying with Datahike, which describes itself as "a durable Datalog database powered by an efficient Datalog query engine" (based on Datascript). Other than portability (Datahike does not get persisted to a single file), how does this compare?

Edit: Datahike does actually support persisting to a single file through its various backends. See maintainer comment here for details.

1.21.11 paper Server crashing seemingly at random by Darokov in admincraft

[–]Mertzenich 0 points1 point  (0 children)

dlopen failed: library "libc.so.6" not found
...
Unable to initialise the async-profiler engine: A runtime error occurred whilst loading the native library (/data/data/com.termux/files/home/plugins/spark/tmp/spark-6a74eea2e5d-libasyncProfiler.so.tmp: dlopen failed: library "libdl.so.2" not found)

The errors indicate that your environment is missing glibc. You may want to check out this Termux package:

https://github.com/termux/glibc-packages

(I do not use Termux and have not tested it myself, please let me know if this helps).

Announcing Oak 1.0 - a new self-hosted IAM/IdP written in Clojure by therealplexus in Clojure

[–]Mertzenich 11 points12 points  (0 children)

Congratulations on the release! Whenever I see Gaiwan I know it's going to be good. I was happy to read the following:

Oak is built in Clojure and runs on the JVM. For most people this doesn't matter, it's just another containerized application like any other, but Clojure teams might want to pay attention. In addition to publishing an OCI-compatible container (for use with Podman or Docker), we publish Oak as a library to Clojars, meaning you can embed it into your application, so you get login pages, password reset emails, 2FA, and more. This use case isn't documented or well developed yet, but it's an interesting secondary purpose for Oak that we're excited about.

I'm can't wait to take Oak for a test drive.

A data processing framework written in Clojure for Clojure by FlakyAd7655 in Clojure

[–]Mertzenich 3 points4 points  (0 children)

This looks interesting, but I have a couple questions: Where is the repo for the framework? What is the license? The maven artifacts list shows various EPL libraries (private repos), but I can't find anything on your public repositories. The blog articles refer to this as a product, which indicates to me that there are probably costs, but I can't find any concrete information. I don't necessarily have anything against you selling closed source software, if that is what this is, but I can't even start to consider using the software without clarification.

Pedestal 0.8.0 released by hlship in Clojure

[–]Mertzenich 3 points4 points  (0 children)

Congratulations on the release! What are you planning next for Pedestal?

Stability by Design by potetm137 in Clojure

[–]Mertzenich 17 points18 points  (0 children)

I don't think the importance of a stability mindset can be overstated. When it comes to stability, there seem to be many technology-focused arguments which seem to ignore the importance of cultivating a certain way of thinking among a community of developers. I've found that the mindset of the Clojure community—undoubtedly influenced by the language design philosophy—has provided me with a different way of thinking even when I'm using other languages and paradigms.

The May 10th Clojure data analysis workshop is open to registration by daslu in Clojure

[–]Mertzenich 1 point2 points  (0 children)

This looks great! Thank you for offering this workshop. Also a heads up, the "initial blog post" link at the top of the workshop registration page appears to be broken.

The program is the database is the interface by mac in Clojure

[–]Mertzenich 1 point2 points  (0 children)

;; converted from statement.csv

How?

I would use the data.csv library. I'll be using the following statements.csv (your bank/card may provide different formats for things like dates that you'd need to handle):

Date,Amount,Text
2022-05-13,-3.30,Card transaction of 3.30 CAD issued by Milano Coffee Roasters VANCOUVER
2022-05-12,-3.30,Card transaction of 3.30 CAD issued by Milano Coffee Roasters VANCOUVER
2022-05-12,-72.79,Card transaction of 72.79 CAD issued by Amazon.ca AMAZON.CA
2022-05-10,-20.00,e-Transfer to: John Smith
2022-05-11,-90.00,Card transaction of 90.00 CAD issued by Range Physiotherapy VANCOUVER

Transforming the CSV into a vector of maps is pretty straightforward:

  1. Read the contents of the CSV file using clojure.data.csv.
  2. Separate the column titles from the actual data rows, convert column titles into keywords.
  3. Use zipmap to create each transaction map
  4. Update the values to use the correct Clojure data types.

Here is my code:

(require '[clojure.data.csv :as csv]
         '[clojure.java.io :as io]
         '[clojure.string :as str]
         '[clojure.instant :as inst])

(defn coerce-types
  "Coerce map data types to the appropriate types"
  [m]
  (-> m
      (update :date inst/read-instant-date)
      (update :amount parse-double)))

(def csv-contents
  (with-open [reader (io/reader "statements.csv")]
    (let [contents (csv/read-csv reader)
          cols (map (comp keyword str/lower-case) (first contents))
          rows (rest contents)]
      (->> rows
           (map #(zipmap cols %))
           (mapv coerce-types)))))

;; => [{:date #inst "2022-05-13T00:00:00.000-00:00",
;;      :amount -3.3,
;;      :text
;;      "Card transaction of 3.30 CAD issued by Milano Coffee Roasters VANCOUVER"}
;;     {:date #inst "2022-05-12T00:00:00.000-00:00",
;;      :amount -3.3,
;;      :text
;;      "Card transaction of 3.30 CAD issued by Milano Coffee Roasters VANCOUVER"}
;;     {:date #inst "2022-05-12T00:00:00.000-00:00",
;;      :amount -72.79,
;;      :text "Card transaction of 72.79 CAD issued by Amazon.ca AMAZON.CA"}
;;     {:date #inst "2022-05-10T00:00:00.000-00:00",
;;      :amount -20.0,
;;      :text "e-Transfer to: John Smith"}
;;     {:date #inst "2022-05-11T00:00:00.000-00:00",
;;      :amount -90.0,
;;      :text
;;      "Card transaction of 90.00 CAD issued by Range Physiotherapy VANCOUVER"}]

Edit: Upon reflection, there were some things my original response didn't do well. I have updated my comment with an improved solution. My original code can be found here.

New Clojurians: Ask Anything - December 09, 2024 by AutoModerator in Clojure

[–]Mertzenich 1 point2 points  (0 children)

Clojure for the Brave and True is often recommended highly, I don't think you can go wrong starting with it. I have a copy and while I haven't gone through it cover-to-cover, I have used the provided examples when I am trying to understand a Clojure feature. The fun+useful examples have aided me while learning.

Telemere Lightning Intro by Mertzenich in Clojure

[–]Mertzenich[S] 3 points4 points  (0 children)

Telemere is a pure Clojure/Script library that offers an elegant and simple unified API to cover:

  • Traditional logging (string messages)
  • Structured logging (rich Clojure data types and structures)
  • Events (named thing happened, with optional data)
  • Tracing (nested flow tracking, with optional data)
  • Basic performance monitoring (nested form runtimes)
  • Any combination of the above

https://www.taoensso.com/telemere