This file contains 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
(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 % #"\|")))) |
This file contains 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
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 |
This file contains 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
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: |
This file contains 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
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) |
This file contains 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
(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 %))) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.