Skip to content

Instantly share code, notes, and snippets.

View themistoklik's full-sized avatar
👀
wat

Themis themistoklik

👀
wat
View GitHub Profile
(require ['clojure.string :as 'str]
['clojure.set :as 'set])
(use 'clojure.data)
(def input
(->>
"/Users/themis/IdeaProjects/aoclj/src/src/input.txt"
slurp
str/split-lines
(mapv #(str/split % #"\|"))))
curl -s -w \\ntime_connect::%{time_connect}\\ntime_redirect:%{time_redirect}\\ntime_pretransfer:%{time_pretransfer}\\ntime_starttransfer:%{time_starttransfer}\\ntime_namelookup:%{time_namelookup}\\ntime_total:%{time_total} www.google.gr
with open('input') as f:
ss = f.read().splitlines()
sorted_input=sorted(ss,key=lambda d:d[1:17])
bucket=[]
res=[]
#partition by begin shift message
for entry in sorted_input:
@themistoklik
themistoklik / aoc18_5.py
Last active December 21, 2018 17:00
aoc18 day 5 both parts, naive
def react(s):
stack = [s[0]]
def push(letter,stack):
if stack and abs(ord(stack[-1])-ord(letter)) == 32:
stack.pop()
else:
stack.append(letter)
for letter in s[1:]:
push(letter,stack)
@themistoklik
themistoklik / fsm.clj
Created March 12, 2017 14:11
dereftroubles
(ns freq-seq-enum)
(def fs (atom #{}))
(defn locally-frequents
[sdb min-sup]
(let [uniq-sdb (map (comp frequencies set) sdb)
freqs (apply merge-with + uniq-sdb)]
(->> freqs
(filter #(<= min-sup (second %)))
@themistoklik
themistoklik / demo.ipynb
Created November 27, 2016 12:32
demo processing in networkx
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@themistoklik
themistoklik / sequencer.ipynb
Created April 1, 2016 19:39
work so far for the sequencer.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.