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
| require 'rubygems' | |
| require 'nokogiri' | |
| require 'open-uri' | |
| require 'digest/md5' | |
| require 'fastercsv' | |
| require 'json' | |
| require 'curb' | |
| require 'pp' | |
| data = [] |
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
| (def dns-cache (new Cache)) | |
| (defn lookup-dns | |
| "Does a DNS lookup with no cache" | |
| [host] | |
| (let [dnsLookup (new Lookup host)] | |
| (. dns-cache clearCache) | |
| (. dnsLookup setCache dns-cache) | |
| (. dnsLookup run) | |
| (. dnsLookup getResult))) |
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 view-errors [] | |
| (let [table (data-table (get-data)) | |
| frame (view table) | |
| running (atom true)] | |
| (.addWindowListener frame (proxy [WindowAdapter] [] | |
| (windowClosing [event] | |
| (reset! running false)))) | |
| (loop [] | |
| (when @running | |
| (set-data table ($where {:down? {:$nin #{0}}} (get-data))) |
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
| (def data | |
| (try | |
| (read-dataset | |
| "./uptime2.csv" | |
| :header true) | |
| (catch FileNotFoundException e | |
| (dataset ["time" "up?"] | |
| [])))) |
NewerOlder