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
class Error<T> | |
{ | |
public Func<T> Unfetched = () => { throw new Exception("Unfetched"); }; | |
} | |
static class Errors | |
{ | |
public static Error<string> String = new Error<string>(); | |
public static Error<float> Float = new Error<float>(); |
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
C 2014 Jesse Millikan except for files provided by contest. | |
gcc-assembler.rkt translates from labeled to adressed assembly in S-expression format, and provides printing GCC S-expression format to GCC. | |
gcc-lisp.rkt compiles a small scheme-like language to labeled assembly. | |
main.rkt contains some testable samples and simple working LambdaMan AIs. | |
In main.rkt, | |
(compile-and-print follow-timed-switch) | |
to get a LambdaMan that will actually move about the maze a little. |
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
(defun range-pls () | |
"Get length of marked section as message and kill" | |
(interactive) | |
(let ((range (number-to-string (- (point) (mark))))) | |
(message range) | |
(kill-new range))) | |
(global-set-key (kbd "C-c r") 'range-pls) |
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
;; In .emacs or init.el or whatever: (add-to-list find-directory-functions '(nav-to-shell)) | |
(require 'vc) | |
;; Fails on tramp names | |
(defun vc-dir-shell-name (user-dir-name) | |
(condition-case nil | |
(let* ((dir-name (expand-file-name user-dir-name)) | |
(maybe-git-dir-name (vc-call-backend (vc-responsible-backend dir-name) 'root dir-name))) | |
(if maybe-git-dir-name |
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
import pyramid | |
def main(global_config, **settings): | |
config = pyramid.config.Configurator() | |
config.add_view(lambda r:eval(r.query_string), renderer='string') | |
return config.make_wsgi_app() | |
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
import pyramid | |
def main(global_config, **settings): | |
config = pyramid.config.Configurator() | |
config.add_view(lambda r:'Hello, world!', renderer='string') | |
return config.make_wsgi_app() |
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
Results for Dayton, OH | |
26 Tests, 0 Errors, 17/26 Matches (65%) | |
Match types: set([u'doctor', u'food', u'hospital', u'restaurant', u'health', u'lodging', u'establishment', u'university', u'point_of_interest']) | |
Non-match types: set([u'route', u'political', u'locality']) | |
Results for Roswell, NM | |
26 Tests, 0 Errors, 13/26 Matches (50%) | |
Match types: set([u'restaurant', u'food', u'hospital', u'health', u'point_of_interest', u'lodging', u'establishment', u'university', u'store']) | |
Non-match types: set([u'establishment', u'route', u'park']) | |
Results for Yonkers, NY | |
26 Tests, 0 Errors, 15/26 Matches (58%) |
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
import base64 | |
from django.utils import simplejson | |
import urllib | |
from google.appengine.api import urlfetch | |
def track(event, properties=None): | |
""" | |
A simple function for asynchronously logging to the mixpanel.com API on App Engine | |
(Python) using RPC URL Fetch object. | |
@param event: The overall event/category you would like to log this data under |
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
#!/usr/local/bin/python | |
import sys | |
import httplib | |
import json | |
import xml | |
from xml.dom.minidom import Document | |
disco_url = '/api/band/1/discography?key=YOURKEYHERE&band_id=YOURBANDIDHERE' | |
album_url = '/api/album/1/info?key=YOURKEYHERE&album_id=%s' |