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
var express = require('express') | |
var http = require('http') | |
var path = require('path') | |
var reload = require('reload'); | |
var app = express() | |
app.get('/', function (req, res) { | |
res.sendFile(path.join(__dirname, 'public', 'test.html')); | |
}) |
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
{ | |
"type": "array", | |
"items": [ | |
{ | |
"type": "map", | |
"values": "bytes" | |
}, | |
{ | |
"name": "veTBcQK", | |
"type": "record", |
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
hello yvonne |
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
{ | |
"maxPlanets": 2, | |
"planets": [ | |
[[0.77, 0.5], 50, false], | |
[[0.58, 0.5], 50, false], | |
[[0.05, 0.85], 35, false] | |
] | |
} |
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 tubes | |
import numpy as np | |
from matplotlib import pyplot | |
import glob | |
from os import path | |
FILES = glob.glob(path.expanduser("~/src/data/ngrams/1gram/googlebooks*")) | |
PYTHON_MATCH = '0' | |
PASCAL_MATCH = '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
# Find the matching rows (where the first column is True) | |
word_rows = one_grams[IS_WORD_COL] | |
# Create an empty array to hold the per-year % values | |
word_counts = np.zeros(last_year+1) | |
# Iterate over each matching row (for a matching word, there should just be 1,000s of rows) | |
for _, year, count in one_grams[word_rows]: | |
# Set the relevant word_counts row to the calculated value | |
word_counts[year] += (100*count) / year_totals[year] |
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
one_grams_tube = (tubes.Each(FILES) | |
.read_files() | |
.split() | |
.tsv(headers=False) | |
.skip_unless(lambda row: row.get(1).to(int).gt(1799)) | |
.multi(lambda row: ( | |
row.get(0).equals(word.encode('utf-8')), | |
row.get(1).to(int), | |
row.get(2).to(int) | |
)) |
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
last_year = 2008 | |
YEAR_COL = '1' | |
COUNT_COL = '2' | |
year_totals, bins = np.histogram( | |
one_grams[YEAR_COL], | |
density=False, | |
range=(0, last_year+1), | |
bins=last_year + 1, | |
weights=one_grams[COUNT_COL] |
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 tubes | |
FILES = glob.glob(path.expanduser("~/src/data/ngrams/1gram/googlebooks*")) | |
WORD = "Python" | |
# Set up the data load pipeline | |
one_grams_tube = (tubes.Each(FILES) | |
.read_files() | |
.split() | |
.tsv(headers=False) |
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
extern fn isr_rtc0(); | |
#[allow(non_upper_case_globals)] | |
#[link_section=".isr_vector_nvic"] | |
#[no_mangle] | |
pub static NVICVectors: [Option<unsafe extern fn()>; ISR_COUNT+1] = [ | |
None, | |
Some(isr_power_clock), | |
... | |
Some(isr_rtc0), |