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
| from dateutil import parser | |
| permits = pandas.read_csv('../Data/Business_Licenses.csv', | |
| converters = { | |
| 'DATE ISSUED' : parser.parse | |
| } | |
| ) | |
| permits[permits['DATE ISSUED'] > datetime.datetime(2012, 5, 1)] |
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
| class TestHardPDAQCrash(TestLiveControlWithPDAQ): | |
| def test(self): | |
| assert 'OK' == livecmd("config set -i nice_default_config") | |
| assert 'OK' == livecmd("altconfigs add -i alt1") | |
| assert 'OK' == livecmd("start daq") | |
| # Simulate hard crash of pDAQ: | |
| self.toy.close() | |
| # Lexical closure to collect complete set of log messages: | |
| def message_updater(): |
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
| class TestHardPDAQCrash(TestLiveControlWithPDAQ): | |
| def test(self): | |
| assert 'OK' == livecmd("config set -i default") | |
| assert 'OK' == livecmd("altconfigs add -i alt1") | |
| assert 'OK' == livecmd("start daq") | |
| # Simulate hard crash of pDAQ: | |
| self.toy.close() | |
| # Lexical closure to collect complete set of log messages: | |
| def message_updater(): |
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
| its 10:19:27 eigenhombre-hits (master) > git remote add hits git://github.com/hits/hits.githits 10:19:51 eigenhombre-hits (master) > git remote | |
| hits | |
| origin | |
| hits 10:19:54 eigenhombre-hits (master) > git pull hits master | |
| remote: Counting objects: 15, done. | |
| remote: Compressing objects: 100% (7/7), done. | |
| remote: Total 9 (delta 4), reused 7 (delta 2) | |
| Unpacking objects: 100% (9/9), done. | |
| From git://github.com/hits/hits | |
| * branch master -> FETCH_HEAD |
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
| $ lein plugin install lein-newnew 0.3.4 | |
| [INFO] Unable to find resource 'lein-newnew:lein-newnew:jar:0.3.4' in repository central (http://repo1.maven.org/maven2) | |
| Copying 3 files to /var/folders/q9/q9rOdKa0FnyyCTa6KWtfoU+++TI/-Tmp-/lein-78f7ed8b-c510-402f-b67c-45611ff06b92/lib | |
| Including lein-newnew-0.3.4.jar | |
| Including bultitude-0.1.5.jar | |
| Including slingshot-0.8.0.jar | |
| Including stencil-0.2.0.jar | |
| Created lein-newnew-0.3.4.jar | |
| $ lein plugin install pallet/lein-template 0.2.3 | |
| [INFO] Unable to find resource 'pallet:lein-template:jar:0.2.3' in repository central (http://repo1.maven.org/maven2) |
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
| $ lein version | |
| Leiningen 1.7.1 on Java 1.6.0_33 Java HotSpot(TM) 64-Bit Server VM | |
| $ cat project.clj | |
| (defproject quickstart "0.1.0-SNAPSHOT" | |
| :description "FIXME Pallet project for quickstart" | |
| :dependencies [[org.clojure/clojure "1.3.0"] | |
| [org.cloudhoist/pallet "0.7.1"] | |
| [org.cloudhoist/pallet-jclouds "1.3.0-beta.1"] | |
| ;; To get started we include all jclouds compute providers. | |
| ;; You may wish to replace this with the specific jclouds |
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
| > lein deploy clojars | |
| Copying 1 file to /Users/jacobsen/Programming/Lisp/clojure/namejen/lib | |
| Copying 5 files to /Users/jacobsen/Programming/Lisp/clojure/namejen/lib/dev | |
| Compiling namejen.core | |
| Compilation succeeded. | |
| Created /Users/jacobsen/Programming/Lisp/clojure/namejen/namejen-0.1.0-SNAPSHOT.jar | |
| Wrote pom.xml | |
| Deploying to http://clojars.org/repo/ | |
| [INFO] Retrieving previous build number from clojars | |
| [INFO] repository metadata for: 'snapshot namejen:namejen:0.1.0-SNAPSHOT' could not be found on repository: clojars, so will be created |
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
| (defproject cannot-incant "0.1.0-SNAPSHOT" | |
| :description "FIXME: write description" | |
| :url "http://example.com/FIXME" | |
| :license {:name "Eclipse Public License" | |
| :url "http://www.eclipse.org/legal/epl-v10.html"} | |
| :dependencies [[org.clojure/clojure "1.4.0"] | |
| [incanter "1.3.0-SNAPSHOT"]]) | |
| ## Fails w/ lein deps |
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
| import binascii | |
| import hashlib | |
| import random | |
| import json | |
| import bz2 | |
| def mbid(pos): | |
| h = hashlib | |
| return h.sha224(str(pos)).hexdigest()[:10] |
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
| import itertools | |
| # live.util.misc: | |
| def collapse_seq(coll): | |
| """ | |
| Compress an interable of integers into a list of pair tuples | |
| (a, b) where a, a+1, ... b were in the original sequence; e.g., | |
| 1, 2, 3, 5, 7, 8, 9 -> (1, 3), (5, 5), (7, 9) | |
| """ | |
| ret = [] |