| (ns grook.preprocess | |
| (:refer-clojure :exclude [==]) | |
| (:use clojure.core.logic | |
| [clojure.pprint :only [pprint]]) | |
| (:require [clojure.walk :as walk] | |
| [clojure.java.io :as io])) | |
| ;; Running this cleans any previously defined rules from the namespace. | |
| (dorun (for [[sym var] (ns-interns *ns*) | |
| :when (::rule (meta var))] |
| import json | |
| import urlparse | |
| from itertools import chain | |
| flatten = chain.from_iterable | |
| from nltk import word_tokenize | |
| from gensim.corpora import Dictionary | |
| from gensim.models.ldamodel import LdaModel | |
| from gensim.models.tfidfmodel import TfidfModel |
| from datetime import datetime | |
| import string | |
| from nltk.stem.lancaster import LancasterStemmer | |
| from nltk.corpus import stopwords | |
| #Gets the tweet time. | |
| def get_time(tweet): | |
| return datetime.strptime(tweet['created_at'], "%a %b %d %H:%M:%S +0000 %Y") |
Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets
“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”
You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?
| """ | |
| Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
| BSD License | |
| """ | |
| import numpy as np | |
| # data I/O | |
| data = open('input.txt', 'r').read() # should be simple plain text file | |
| chars = list(set(data)) | |
| data_size, vocab_size = len(data), len(chars) |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft,elem.offsetTop,elem.offsetWidth,elem.offsetHeight,elem.offsetParent