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
| # Simple pagerank implementation | |
| # M - transition matrix | |
| # r - initial rankings | |
| # \beta - the taxation cost, (1-\beta) is the teleport prob | |
| # iter - iterations to run for | |
| function pagerank(M::Matrix{Float64}, r::Vector{Float64}, β::Float64, iter::Int64) | |
| c = (1-β)/length(r) | |
| v_prime = β*M*r + c | |
| for i = 1:iter | |
| v_prime = β*M*v_prime + c |
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 match(s, pairs): | |
| stack = [] | |
| closers = set(pairs.values()) | |
| for c in s: | |
| if c in pairs: | |
| stack.append(pairs[c]) | |
| elif c in closers: | |
| # we can end early if either is true | |
| if not stack or c != stack.pop(): |
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 longest_common_substring(s1, s2): | |
| """ | |
| lcs[i,j] = if match lcs[i-1, j-1] + 1 | |
| lcs[i,j] = if not match 0 | |
| """ | |
| m = len(s1) | |
| n = len(s2) | |
| # Hash table not be more memory efficient. Here we have n*m | |
| # entries guaranteed. In a hash table all entries that are 0 |
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 spiral(M): | |
| """ | |
| Given a matrix M (mxn) print out the elements in spiral order | |
| Ex: | |
| 30 42 30 55 31 | |
| 21 30 60 24 38 | |
| 11 22 33 44 55 |
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 __future__ import print_function, absolute_import | |
| import cgt | |
| from cgt import nn | |
| from cgt.distributions import categorical | |
| import numpy as np | |
| from load import load_mnist | |
| import time | |
| epochs = 10 | |
| batch_size = 128 |
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 __future__ import print_function | |
| from scrapy.selector import Selector | |
| import requests | |
| def scrape_comments(url): | |
| comments = [] | |
| r = requests.get(url).text | |
| sel = Selector(text=r) | |
| rough_comments = sel.xpath("//span[@class='comment']/span") |
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
| " General | |
| set encoding=utf-8 | |
| set fileencoding=utf-8 | |
| " Match and Search | |
| set ignorecase | |
| set smartcase | |
| set hlsearch | |
| set incsearch | |
| " set autochdir | |
| set tabstop=4 |
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
| Some questions to ask during interviews: | |
| * What does success look like for this position? How will I know if I am accomplishing what is expected of me? | |
| * What is the last project you shipped? What was the goal, how long did it take, what were the stumbling blocks, what tools did you use, etc. | |
| * What will my first 90 days in this role look like? First 180 days? | |
| * Who will I report to and how many people report to that person? Do they have regular 1:1 with their team members? | |
| * Why did the last person who quit this team leave? The company? | |
| * If a startup, how long is your runway? How are financial decisions made? | |
| * What would be my first project here? Has someone already been working on this or is this in the aspirational stage? | |
| * What is the current state of the data infrastructure? How much work needs to be done on getting the infrastructure and pipeline into shape before we start analyzing that data? |
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
| { | |
| "parser": "babel-eslint", | |
| "env": { | |
| "node": true, | |
| "mocha": true | |
| }, | |
| "rules": { | |
| "brace-style": 2, | |
| "camelcase": 2, | |
| "comma-dangle": [2, "never"], |
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
| Implements the Cross-Entropy Method with decreasing noise added to the variance updates as described in [1]. | |
| Running cem.py with the default settings should reproduce results. | |
| [1] Szita, Lorincz 2006 | |
| http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.81.6579&rep=rep1&type=pdf |