This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn get-attributes [html] | |
(map #(into {} %) | |
(map #(remove nil? %) | |
(map #(if (dom/attributes? %) [(:name (dom/attributes %)) (:value (dom/attributes %))]) | |
(map dom/node-seq | |
(xpath/lookup-nodeset "//form[@class=\"download\"]" html)))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$queries_array = {$query_1, $query_2, $query_n}; | |
$merged_array = array_reduce($queries_array, array_merge); | |
$uniques = array(); | |
$counter = array(); | |
foreach ( $merged_array as $current ) { | |
$counter[current->id] += $counter[current->id]; | |
$uniques[current->id] = $current; // pulls out unique only | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn magic [row] | |
(if (map? (first row)) (for [x row] (into [] (flatten (seq x)))) (into [] x))) | |
(defn collapser [incoming] | |
(reduce (fn [a b] (conj a (magic b))) [["header" "information"]] (remove nil? incoming))) | |
;for an input like | |
;([:a a :b b] nil nil [{:c c, :d d} {:e e, :f f}] nil [:a g :b h]) => | |
;[["test" "two"] [:a "a" :b "b"] ([:c "c" :d "d"] [:e "e" :f "f"]) [:a "g" :b "h"]] | |
;but what I want is |
NewerOlder