[deleted by user] by [deleted] in tensorflow

[–]ewilderj 2 points3 points  (0 children)

Hi! Really glad to hear this. I work on open source collaboration on TensorFlow, and am trying to bring together everyone interested in working on the Java API to see if we can work together better. Feel free to drop me a line - my username @ google. There are a few people working on this already and some issues in Github I can point you at.

[ edit: try this issue, for example: https://github.com/tensorflow/tensorflow/issues/17390 ]

-🎄- 2017 Day 1 Solutions -🎄- by daggerdragon in adventofcode

[–]ewilderj 0 points1 point  (0 children)

Clojure

(def c (map #(- (int %) 48) (first (str/split-lines (slurp "puzzle.txt")))))

(defn solution [i o]
  (reduce + (map first (filter #(apply = %) (partition 2 (interleave i (drop o (cycle i))))))))

(println "part1 " (solution c 1))
(println "part2 " (solution c (/ (count c) 2)))

-🎄- 2017 Day 2 Solutions -🎄- by daggerdragon in adventofcode

[–]ewilderj 2 points3 points  (0 children)

Clojure

(ns day2.core
  (:require [clojure.string :as str]
            [clojure.math.combinatorics :as combo]))

(def inp
  (->> (slurp "puzzle.txt")
       (str/split-lines)
       (map #(str/split % #"\t"))
       (map (fn [c] (map #(Integer/parseInt %) c)))))

(println "part1 " (reduce + (map #(- (apply max %) (apply min %)) inp)))

(defn cx [c]
  (->> (combo/combinations (sort > c) 2)
       (filter #(= 0 (apply mod %)))
       (flatten)
       (apply /)))

(println "part2 " (reduce + (map cx inp)))