-
brew install macvim
or atom
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 square(number): | |
number = int(number) | |
return number**2 |
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 findall(haystack, needle): | |
i = 0 | |
while True: | |
j = haystack.find(needle, i) | |
if j is -1: | |
break | |
yield j | |
i = j + 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
brown_tagged_sents = [] | |
simplified_tagged_sents = [] | |
for sent in brown_tagged_sents: | |
sent_to_append = [] | |
for (word, tag) in sent: | |
sent_to_append.append((word, tag[0])) | |
simplified_tagged_sents.append(sent_to_append) | |
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 math | |
def dist(xs, ys): | |
return math.sqrt(sum((x-y)**2 for (x, y) in zip(xs, ys))) |
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
#!/bin/bash | |
set -e | |
KEY=barth | |
INPUT=paragraphs/ | |
mallet import-dir --input $INPUT --output $KEY.mallet --keep-sequence --remove-stopwords | |
mallet train-topics --input $KEY.mallet --num-topics 20 \ | |
--output-model $KEY.model --output-state $KEY.state.gz --output-doc-topics $KEY.doc.topics \ |
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 nltk | |
from nltk.corpus import brown | |
fd = nltk.FreqDist(brown.words(categories='news')) | |
cfd = nltk.ConditionalFreqDist(brown.tagged_words(categories='news')) | |
avgs = [] |
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
2015-07-16T15:19:35.320312+00:00 app[web.1]: ** [Airbrake] Failure: Net::HTTPNotFound | |
2015-07-16T15:19:35.405395+00:00 app[web.1]: | |
2015-07-16T15:19:35.405400+00:00 app[web.1]: ActionView::Template::Error (undefined method `name' for nil:NilClass): | |
2015-07-16T15:19:35.405402+00:00 app[web.1]: 2: <h1>myPrisms (<%= @user.email %>)</h1> | |
2015-07-16T15:19:35.405404+00:00 app[web.1]: 3: <%= image_tag(avatar_url(current_user), :class => "avatar") %> | |
2015-07-16T15:19:35.405405+00:00 app[web.1]: 4: | |
2015-07-16T15:19:35.405407+00:00 app[web.1]: 5: <% if @prisms.size > 0 %> | |
2015-07-16T15:19:35.405408+00:00 app[web.1]: 6: <h2>Owned Prisms</h2> | |
2015-07-16T15:19:35.405410+00:00 app[web.1]: 7: <table cellpadding="0" cellspacing="0"> | |
2015-07-16T15:19:35.405411+00:00 app[web.1]: 8: |
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
<?php | |
$db = get_db(); | |
$id = get_current_record('item')->id; | |
$sql = "SELECT id, title, exhibit_id FROM {$db->prefix}neatline_records " . | |
"WHERE {$db->prefix}neatline_records.item_id=?;"; | |
$result = $db->query($sql, array($id)); | |
$rows = $result->fetchAll(); | |
$exhibits = $db->getTable("NeatlineExhibit"); | |
if (! empty($rows)) { | |
?> |
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
ack | |
android-sdk | |
ansible | |
ant | |
apple-gcc42 | |
at-spi2-atk | |
at-spi2-core | |
atk | |
atkmm | |
autoconf |