Skip to content

Instantly share code, notes, and snippets.

View dgtized's full-sized avatar

Charles Comstock dgtized

View GitHub Profile
(ns binary_diagnostics_2
(:require [clojure.string :as str]))
(def example (str/split-lines (slurp "example")))
(def input (str/split-lines (slurp "input")))
(defn most-common [input pos]
(let [freqs (frequencies (mapv #(nth % pos) input))
on (get freqs \1)
off (get freqs \0)]
;; make the backup gods obey ME! no more ~ sprinkles all over the place
(setq version-control nil)
(let ((backup-dir (expand-file-name "backups" user-emacs-directory)))
(setq backup-directory-alist
`(("." . ,backup-dir)))
(setq auto-save-file-name-transforms
`((".*" ,backup-dir t))))
(projectile-global-mode)
(setq projectile-enable-caching t
projectile-switch-project-action 'projectile-dired
projectile-use-git-grep t)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(ediff-split-window-function (quote split-window-horizontally))
'(ediff-window-setup-function (quote ediff-setup-windows-plain))
'(erc-nick "dgtized")
'(global-magit-wip-save-mode nil)
'(js2-auto-indent-p t)
(defun ruby-eval-buffer () (interactive)
"Evaluate the buffer with ruby."
(shell-command-on-region (point-min) (point-max) "ruby -w "))
(defun my-ruby-mode-hook ()
;; Keep ac-mode from trying to complete on an end
(make-local-variable 'ac-ignores)
(add-to-list 'ac-ignores "end")
(require 'rinari)
(setq rinari-tags-file-name "TAGS")
Started GET "/api/participants/to_test_at_site/1?page=1&order_by=last_name&order_direction=asc&properties=name,protocols&active=true" for 127.0.0.1 at 2013-11-13 15:26:33 -0600
Processing by ParticipantsController#to_test as HTML
Parameters: {"page"=>"1", "order_by"=>"last_name", "order_direction"=>"asc", "properties"=>"name,protocols", "active"=>"true", "site_id"=>"1"}
User Load (0.7ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1
AuthenticationPolicy Load (0.4ms) SELECT "authentication_policies".* FROM "authentication_policies" WHERE "authentication_policies"."id" = 1 LIMIT 1
Organization Load (0.4ms) SELECT "organizations".* FROM "organizations" WHERE "organizations"."name" = 'Intoximeters' LIMIT 1
Role Load (0.6ms) SELECT "roles".* FROM "roles" INNER JOIN "users_roles" ON "roles"."id" = "users_roles"."role_id" WHERE "users_roles"."user_id" = 2
Site Load (0.4ms) SELECT "sites".* FROM "sites" WHERE "sites"."id" = 1 LIMIT 1
CACHE (0.0ms) SELECT "organizations".* FROM "orga
(defun github-browse ()
(interactive)
(let ((url (magit-get "remote" (magit-get-current-remote) "url")))
(save-match-data
(if (string-match "github.com:\\([^/]+\\)/\\([^\.]+\\).git" url)
(let ((owner (match-string 1 url))
(repo (match-string 2 url)))
(browse-url (format "https://github.com/%s/%s/blob/%s/%s#L%d"
owner repo
(magit-get-current-branch)
[13 clgc@nocturnal ~/andy]$ ./to-csv.rb test.in
{"Name"=>"Richard Ruland", "Employee"=>nil, "Part-Time Status"=>nil, "Employee ID Number"=>"040807", "Home Address"=>"505 Westgate", "City"=>"U City", "State"=>"MO", "Zip Code"=>"63130", "Home/Mobile Phone Number"=>"727-2137", "License Plate#"=>"PB9 A8S", "State of license plate"=>"MO", "Make of vehicle"=>"Nissan", "Color of vehicle"=>"slate blue", "Primary Mode of Transportation to Campus"=>"walk Secondary Mode of", "Transportation (if applicable)"=>nil, "(Walk, Bike, Carpool/Vanpool, Metro Bus/Shuttle, MetroLink,"=>nil, "Motorcycle/Scooter, Off-Site Parking Permit, or specify other)"=>nil, "Employees and Campus Residents Only"=>nil, "Campus Box Number"=>"1122", "Campus Phone Extension"=>"4408"}
{"Name"=>"Jane Doe", "Student or Employee"=>"Employee", "Full-Time or Part-Time Status"=>"full time", "Employee/Student ID Number"=>"012365", "Home Address"=>"710 westgate", "City"=>"St Louis", "State"=>"MO", "Zip Code"=>"63130", "Home/Mobile Phone Number"=>"314-123-456
19:33:51.797 [main] DEBUG pallet.compute.vmfest - loaded model :micro = {:cpu-count 1, :storage [{:devices [nil nil nil nil], :name "IDE Controller", :bus :ide}], :boot-mount-point ["IDE Controller" 0], :m
emory-size 512}
19:33:51.797 [main] DEBUG pallet.compute.vmfest - loaded model :small = {:cpu-count 1, :storage [{:devices [nil nil nil nil], :name "IDE Controller", :bus :ide}], :boot-mount-point ["IDE Controller" 0], :m
emory-size 1024}
19:33:51.797 [main] DEBUG pallet.compute.vmfest - loaded model :medium = {:cpu-count 2, :storage [{:devices [nil nil nil nil], :name "IDE Controller", :bus :ide}], :boot-mount-point ["IDE Controller" 0], :
memory-size 2048}
19:33:51.797 [main] DEBUG pallet.compute.vmfest - loaded model :large = {:cpu-count 4, :storage [{:devices [nil nil nil nil], :name "IDE Controller", :bus :ide}], :boot-mount-point ["IDE Controller" 0], :m
emory-size 4096}
Exception in thread "main" clojure.lang.ExceptionInfo: Error loading project.clj {:project-file "pallet.clj"}
at clojure.cor
@dgtized
dgtized / gist:1646142
Created January 20, 2012 08:31
error thrown if running test-app :integration :functional but not if only :functional
Storing lucene index in: /home/clgc/.grails/projects/adjudica/searchable-index/null-default
Configuring Spring Security Core ...
... finished configuring Spring Security Core
2012-01-20 02:18:30,568 [Thread-12] ERROR [localhost].[/] - Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is java.lang.IllegalStateException: The org.hibernate.cache.StandardQueryCache Cache is not alive.
at org.codehaus.groovy.grails.web.context.GrailsContextLoader.initWebApplicationContext(GrailsContextLoader.java:118)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)