Fork me on GitHub

Morning. So who’s paying the bill for Pro Slack Access? πŸ’΅πŸ’΅πŸ’΅πŸ’΅πŸ’΅πŸ’΅πŸ’΅πŸ’΅πŸ’΅πŸ’΅πŸ’΅πŸ’΅πŸ’΅πŸ’΅πŸ’΅πŸ’΅


@paulspencerwilliams Per #announcements Slack have given us a complimentary Pro subscription for a year and we can apply for an extension each year.

πŸŽ‰ 2

@robert-stuttaford (one of the admin team) reached out to the head of Slack on Twitter and asked about it since we were in a free trial period of Pro, and this morning he and I were on an email thread with Slack's Chief of Staff for Customer Experience (what a great title) sorting out the details. We have reminders in place to reach out to Slack again in November '22 to ask for an extension.


Has your sanity survived working with CSS?


That’s great news - it’s nice to have history in Slack for our community. Haha, I’m just about clinging on. My woes yesterday were really more about build pipelines etc than the css per se.


My sanity takes a hit every time I have to dive into CSS 😞 Same with JS. What little hair I have left just starts falling out every time I have to debug anything beyond the most basic JS.


The language, the context, the ever changing landscape. I find front end stuff so tiring.

πŸ’― 1

i've just re-implemented the non-view part of re-frame for the backend - i'm sure you'd love it 😬


it's actually really nice - i did it for the evented logic in a data-oriented game, but after programming with it for a while i'm thinking of rolling it out for our APIs too


Good Morning!


Don't forget re:Clojure 2021 starting shortly!


Here's the youtube link for the first day, starting at 09:45 UTC


heh, can't find any emails with the zoom links, and I can't join discord... everything is broken >.<


Morning all πŸ™‚


Does anyone know an idiomatic way to treat a list of vectors like a matrix, i.e. carry out operations on the columns represented by the positions in the vectors?



([\a \b \a \a]
 [\b \a \a \a]
 [\a \b \a \b])

how could I count \a in the columns?


Or, am I better off creating new data-structures from each position in the listed vectors, i.e. transforming the above to this:

([\a \b \a]
 [\b \a \b]
 [\a \a \a]
 [\a \a \b])


I don't know whether what you have is an actual matrix or you just want to treat it like one. If it's the former, maybe have a look at Neanderthal, that is the only thing that comes to mind for matrix operations in Clojure


You might be able to use some of their code in any case


Thanks @conor.p.farrell I will take a look


If it's just a list of things that you want to do a column sum on, it's no different than working with any sequence of data, I think - the Kotlin equivalent would be myData.chunked(rowSize).map { it[column] }.sum()


@conor.p.farrell - Basically I have a list of vectors (all the same length). I need to count the number of instances of a specific value in each of the columns represented by the positions in the vectors, and I have no idea how to do that.


So, in my first snippet above, I need to know how many \a there are in the notional column that is represented by (get % 0) if mapping over the list


but also for (get % 1), (get % 2), and (get % 3)


Which is why I asked if I am simply better off turning the list through 90-degrees (so to speak) and simply making a new list of vectors that has a row for each "column"


(not that I have the first clue how to do that in an idiomatic fashion either, fwiw)


In Python (or similar) I could just create a dataframe and then act on the columns


Sorry, my brain is in Kotlin mode so I'm going to have to give code snippets that way.

val l = listOf(
            listOf(1, 1, 2, 2),
            listOf(2, 2, 1, 2),
            listOf(1, 2, 1, 2),

        val rowSize = l.first().size
        val numColumnsMatching = (0 until rowSize).map { col -> { it[col] }.count { it == 2 } }
Is that the kind of thing you're trying to do (replacing 'seeing if the value is 2' with your predicate?


Clojure feels like a language that should be able to do these things easily, but I have never had to do them before and I now realise that I haven't the first clue about how to do them.


(defn col [n m] (map #(get % n) m))
(defn count-col [n val m] (->> m (col n) (filter #(= val %)) count)
(->> (range 0 3) (map #(count-col % \a m)))


(ps: ^ probably won't work or even compile - i just typed it straight into slack 😬)


Thanks @mccraigmccraig - I will give it a try / tweak


@mccraigmccraig - This ^^ is EXACTLY what I needed, thank you !


(it works btw)


(you were just missing a paren at the end of the second line you pasted)

Rachel Westmacott15:12:24

also if you have a collection of rows you can (apply map vector rows) to transpose it into columns

πŸ‘ 1