beginners

Getting started with Clojure/ClojureScript? Welcome! Also try: https://ask.clojure.org. Check out resources at https://gist.github.com/yogthos/be323be0361c589570a6da4ccc85f58f.
cschep 2021-01-01T01:26:32.251Z

I am hacking on a learning project where I’m doing some data processing on fantasy baseball data 🙂 I’m currently thinking I can kind emulate a database by using some sort of ref to a map and just writing it to disk on updates - is this a total disaster? this will be used potentially as a web app by like 1-4 people, never real traffic. I’m trying to avoid the rdbms dance because it just doesn’t seem important at this point. thanks for any insight! does this approach work for anyone?

2021-01-01T20:01:03.286400Z

I’ve done this before on smaller apps too! Just reading/writing JSON or CSV data to the disk is totally fine for something like that.

cschep 2021-01-01T21:05:51.286800Z

awesome, thanks all!

cschep 2021-01-01T21:05:57.287200Z

will check these projects out..

FHE 2021-01-01T01:36:17.252200Z

@seancorfield Oof. Just heard I should have at least Win 10 v2004 (I have Win 10 Pro v1909) in order to use WSL2. Guess it'll have to wait until next year!

seancorfield 2021-01-01T01:43:02.252700Z

@factorhengineering You should have had the free update by this point...

seancorfield 2021-01-01T01:43:56.253200Z

2004	Semi-Annual Channel	2020-05-27
-- v2004 has been available for seven months.

seancorfield 2021-01-01T01:44:54.253700Z

(that's build 19041.685 -- I'm on 20279.1 via Insider builds... and 21277.1000 just became available!)

seancorfield 2021-01-01T01:48:18.255Z

(ah, that's a prerelease of the next main Windows update -- 20279.1 must be close to the upcoming release version)

2021-01-01T01:57:42.255500Z

For 4 people it sounds totally fine

2021-01-01T01:58:05.255700Z

You can even use something like this to make your life easier: https://github.com/jimpil/duratom

Harley Waagmeester 2021-01-01T02:07:08.256400Z

is datomic only useful as a cloud service ?

seancorfield 2021-01-01T02:12:21.257600Z

@codeperfect You can run it on-prem as well, I believe. And for development, there's a fully local free version.

seancorfield 2021-01-01T02:13:08.258400Z

https://www.cognitect.com/dev-tools/ is where you can request a link for dev-local Datomic (and REBL).

seancorfield 2021-01-01T02:13:45.259500Z

(there's a #datomic channel if you want detailed info)

2021-01-01T02:14:45.260300Z

Other shout outs would be https://github.com/replikativ/datahike and https://github.com/jackrusher/spicerack

zackteo 2021-01-01T08:27:02.264500Z

Hi guys, I just managed to make a simple quote fetcher from bible-gateway by scrapping the site using enlive I did a fair bit of refactoring and ended up with this https://github.com/zackteo/bible-gateway-clj/blob/master/src/bible_gateway/core.clj#L24-L32 Any suggestions on how might I want to refactor bible-quote? Or any other comments ?

euccastro 2021-01-01T09:31:06.268100Z

@zackteo I normally see the lower-arity versions expressed in terms of the higher-arity ones, not the other way around. you may try this

(defn search-string [book chapter verse]
  (str book "+" chapter
       (when verse (str "%3A" verse)))))
,,,

(defn bible-quote
  ([book chapter version]
   (bible-quote book chapter nil version)
  ([book chapter verse version]
   (-> (search-string book chapter verse)
       (bible-gateway-url version)
       url->quote)))
which is not a huge win, but it does remove some duplication

euccastro 2021-01-01T09:31:34.268600Z

str will output nothing for nil , btw

roelof 2021-01-01T11:22:00.269500Z

anyone know if the exercism clojure is active so when I submit a challenge I do not have to wait too long for a mentor

zackteo 2021-01-01T11:24:01.269600Z

You can start working on the side challenges too! But realistically exercism will require some waiting. But yes it is active - not sure if the holiday session has made it more or less active

roelof 2021-01-01T11:24:40.269800Z

oke, maybe I try that too to get some more xp in clojure. Just begin with the brave book

zackteo 2021-01-01T11:24:42.270Z

Thanks!

zackteo 2021-01-01T11:26:24.270200Z

You can honestly target an exercism question a day - you will also get a lot of feedback and the mentors usually guide you on how to improve your solutions step by step. So sitting down and understanding that might be equally if not more important than getting the solution

zackteo 2021-01-01T11:27:04.270400Z

If you want quick things to test out your knowledge, clojure (/script) koans would be better

zackteo 2021-01-01T11:27:51.270600Z

And 4clojure will be where don't get feedback but you can follow a few who have completed it and compare your solutions with theirs after

zackteo 2021-01-01T11:28:16.270800Z

If you haven't seen this, you might want to take a look! https://gist.github.com/yogthos/be323be0361c589570a6da4ccc85f58f

roelof 2021-01-01T11:28:43.271Z

thanks

roelof 2021-01-01T15:07:50.272100Z

maybe someone who knows how to solve this :

clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} cider/cider-nrepl {:mvn/version "0.25.5"} clj-kondo/clj-kondo {:mvn/version "2020.04.05"}}}'  -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
/bin/sh: 1: clojure: not found
Jack-in process exited. Status: 127

roelof 2021-01-01T15:08:16.272700Z

I have lein installed and it seems that this project uses clojure clj

roelof 2021-01-01T15:09:07.273Z

I use vscode with calva

borkdude 2021-01-01T15:14:23.273700Z

@roelof which OS are you on?

roelof 2021-01-01T15:14:44.274100Z

WSL2 , so ubuntu

borkdude 2021-01-01T15:15:43.274400Z

should be good then with the linux installer script

roelof 2021-01-01T15:16:25.274700Z

im trying it right now

roelof 2021-01-01T15:18:17.275100Z

oke, it seems to work, thanks

seancorfield 2021-01-01T17:54:50.276300Z

Just FYI: even on Linux, I use brew (linuxbrew) to install the Clojure CLI because it's easier to remember to keep it up-to-date and it also means it's easy to test against older versions that you've installed as well.

seancorfield 2021-01-01T17:55:13.276500Z

(! 502)-> ls /usr/local/Cellar/clojure
clojure/            clojure@1.10.1.672/ clojure@1.10.1.735/
clojure@1.10.1.561/ clojure@1.10.1.681/ clojure@1.10.1.739/
clojure@1.10.1.590/ clojure@1.10.1.693/ clojure@1.10.1.745/
clojure@1.10.1.596/ clojure@1.10.1.697/ clojure@1.10.1.749/
clojure@1.10.1.619/ clojure@1.10.1.708/ clojure@1.10.1.754/
clojure@1.10.1.636/ clojure@1.10.1.716/ clojure@1.10.1.763/
clojure@1.10.1.641/ clojure@1.10.1.723/ 
clojure@1.10.1.645/ clojure@1.10.1.727/ 

roelof 2021-01-01T17:56:18.276900Z

oke, so leiningen is not the tool anymore ?

2021-01-01T17:58:11.278900Z

New stuff seems to be deps now; although this is just installing clojure right? A project can still use leiningen

seancorfield 2021-01-01T18:31:45.280Z

This is the Clojure CLI that I'm talking about -- separate from Clojure-as-a-library.

seancorfield 2021-01-01T18:32:40.281Z

The CLI is the official stuff, and relatively new. Folks can still use Leiningen (or Boot). But I've been using just the Clojure CLI since some time in 2018 I think was when I switched.

FHE 2021-01-01T18:53:18.283400Z

@seancorfield My Windows Update reads 'up to date' but it also refers to ' 'feature update' I could manually trigger to go to Version 20H2. 'winver' tells me my current version is 1909. What is Windows Update doing?

FHE 2021-01-01T18:56:51.285600Z

I'm saving all kinds of open work and then going to trigger the update. (Restarting my computer is such a pain. It will take me ages to re-open all the things I have open now.)

seancorfield 2021-01-01T19:00:02.286100Z

Windows has an option to reopen everything automatically after a restart -- that's what I rely on.

Mno 2021-01-01T21:32:56.287900Z

TIL about linuxbrew… #beginners is always a treasure trove of knowledge 🙂

❤️ 1
FHE 2021-01-01T22:26:07.289500Z

@seancorfield I have seen it re-open my file explorer windows under certain conditions, like a forced restart maybe, but how can you be sure it will do it?

FHE 2021-01-01T22:26:55.290400Z

Also, can it reopen other things, like text files (I am not an Emacs wizard yet) and command prompt windows (with history??)?