This file contains 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
ids <- sample(c(9999,1021,4000),10, replace = TRUE) | |
lookup <- list(ix = c(9999,1021,4000), val = c('apple','pear','orange')) | |
print(lookup$val[match(ids,lookup$ix)]) |
This file contains 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 numpy as np | |
import pandas as pd | |
a = pd.DataFrame({'user_id': [8993,8994,8994,9009,9009],\ | |
'amount' : [50.00, 72.00, 72.00, 21.99, 21.99]}) | |
a.set_index('user_id').amount.min() | |
real_ids = [8993,8994,8994,9009,9009] | |
fake_ids = [999999,999998] | |
ids = real_ids+fake_ids |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
.title { | |
margin-left: 25%; | |
margin-right: 25%; | |
font-family: georgia; | |
margin-top: 40px; |
This file contains 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
Verifying that +wrgoldstein is my openname (Bitcoin username). https://onename.io/wrgoldstein |
This file contains 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 urllib2 | |
import re | |
import sys | |
def open_url(url): | |
opener = urllib2.build_opener() | |
opener.addheaders = [('User-agent', 'Mozilla/5.0')] | |
raw_html = opener.open(url).read() | |
return raw_html |
This file contains 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
require 'active_support/concern' | |
module A | |
extend ActiveSupport::Concern | |
module ClassMethods | |
@@a = 2 | |
def a | |
@@a | |
end | |
end |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
# Say we want to tell a story like the following: | |
"the bunny Foofoo went to the forest and ate a mouse" | |
# we build up the pieces to tell the story: | |
def the_bunny(name) | |
"The bunny #{name}" | |
end |
This file contains 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
# Say we want to tell a story like the following: | |
"the bunny Foofoo went to the forest and ate a mouse" | |
# we build up the pieces to tell the story: | |
def the_bunny(name) | |
"The bunny #{name}" | |
end |
This file contains 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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
</style> | |
<body> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script> | |
<script> | |
var width = 960, | |
height = 500, |
OlderNewer