Fork me on GitHub
#beginners
<
2016-09-08
>
Jon02:09:53

GitHub does not show Clojar's pictures correctly, weird

seancorfield02:09:14

@jiyinyiyong looks like it’s working fine now… I just visited that repo...

seancorfield02:09:56

I got "error fetching resource" on that image the first time, then it refreshed just fine… maybe caching (clojars was down for maintenance the other day so maybe GH cached that bad response?).

Jon02:09:28

me too, after force refreshing, it showed.

mordocai03:09:13

I could use some help with clojurescript here. This is my first "real" clojurescript project, and i'm getting an error about duplicate externs https://gitlab.com/mordocai/my-screeps/tree/clojurescript. Error: http://paste.lisp.org/display/325470. Link to the checkouts/screeps-beans is in http://README.org but its https://github.com/archlisp/screeps-beans. I'm not married to any of the existing structure, just need something that works. Goal is a discrete javascript file to be loaded/used by https://screeps.com

fingertoe03:09:36

Can somebody point me to some relatively simple cljs AWS lambda functions on Github to study? I am trying to write my own..

shaun-mahood04:09:55

@fingertoe: no clue if this is simple or current, but it's all I know of - https://github.com/aerostat/serverless - hope it at least gives you a starting point.

fingertoe04:09:10

Thanks — I’ve been looking at https://github.com/nervous-systems/cljs-lambda — It looks terrific, but their examples require core.async, promesa and a bunch of overkill I suspect I don’t need — but it would be nice to see some simple examples..

mordocai04:09:46

I'm headed to bed, if anyone has time to look at my issue above, just ping me here and i'll take a look in the morning.

credulous13:09:55

Hi! I have a sequence of maps (from a mongodb) and I’d like to store it mapped by id. group-by puts each value in a vector - that’s not what I want since I know there’s only one.

credulous13:09:14

I can do with a reduce, but it seems like something that there might be a more succinct way.

credulous13:09:05

Input:

( {:id “123", :data1: “abc”}  {:id: “456", :data1: “def”})
Output:
{:123  {:id: 123, :data1: “abc”}, :456 {:id “456”, :data1: “def”}}

credulous13:09:46

Figured it out. Thanks, rubber ducky slack channel. 🙂

(zipmap (map :_id msgs) msgs) 

akiva13:09:04

You’re welcome!

krchia14:09:23

how can i split a string “abc123” to return “a1” “b2” “c3”?

akiva15:09:52

(def input (partition 3 (seq “abc123")))

(map clojure.string/join (zipmap (first input) (second input)))

=> ("a1" "b2" "c3")

akiva15:09:49

There’s probably a more succinct way to do it. If you want to handle longer strings (e.g., “abcdef123456”) then you’d split it with a regex on the first digit rather than use partition. This just covers the case you gave.

jkrasnay19:09:16

A more succinct way:

(apply map str input)

abarylko22:09:48

I’m using plumatic/schema, what would be the way to have a schema extend other schema

abarylko22:09:59

like BigHouse extend House …. (meaning be a House with more fields)

alexisvincent23:09:09

What is scala interop with clojure like?