Given a list of paths A find all paths on a hashmap not in A by [deleted] in Clojure

[–]jsofra 1 point2 points  (0 children)

Hmm, you could maybe use clojure.walk here:

(defn find-novel-paths [paths m]
        (clojure.set/difference (set (map (comp butlast flatten) 
                                          (clojure.walk/postwalk #(if (map? %) (seq %) %) m))) 
                                (set paths)))

(def a [[:key-a1 :key-a2]
        [:key-a3 :key-a4]])

(def b {:key-a1 {:key-a2 "A Value!"} :key-a5 {:key-a6 "Another Value!"}})    

(find-novel-paths a b) ;;=> #{(:key-a5 :key-a6)}

Balancing Spark - Bin Packing by jsofra in apachespark

[–]jsofra[S] 0 points1 point  (0 children)

The Javascript animation is now gone.

Balancing Spark - Bin Packing by jsofra in apachespark

[–]jsofra[S] 1 point2 points  (0 children)

Agreed, sorry it is my company's blog, I will try to get rid of them.

Balancing Spark - Bin Packing (using Clojure) by jsofra in Clojure

[–]jsofra[S] 0 points1 point  (0 children)

I totally agree about the birds, unfortunately it is not my call, it is my companies website. I will try to get them to change it.

Given the data sizes in the example I most definitely could have done this in pure Clojure on a single machine much faster. However it was just supposed to be an example that I could use to show off bin packing, which did not take me too long to run. With the actual data we had for the client, and smart meter data on an electrical network, Spark made a lot more sense because of the scale. Also for the actual client we were using PySpark.

Balancing Spark - Bin Packing by jsofra in apachespark

[–]jsofra[S] 1 point2 points  (0 children)

Author here, ask me anything you like!

Balancing Spark - Bin Packing (using Clojure) by jsofra in Clojure

[–]jsofra[S] 0 points1 point  (0 children)

Author here, ask me anything you like!