Skip to content

Instantly share code, notes, and snippets.

@dfeng
dfeng / results.R
Created November 17, 2015 16:49
Body of the Paper
setwd("/Users/dfeng/Documents/Work/Research/YINS/Negative Ties/Code")
source('init.R')
dat <- data.frame(
id=1:n.graphs,
standard=numeric(n.graphs),
se=numeric(n.graphs),
stratified=numeric(n.graphs)
)
for (i in 1:n.graphs) {
@dfeng
dfeng / scrape.ipynb
Last active March 21, 2020 12:37
Housing Data – an introduction to scraping in Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dfeng
dfeng / new.html
Created September 14, 2015 20:36
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
@dfeng
dfeng / tufterhandout.css
Created September 14, 2015 20:16
Tufter Handout Custom CSS
.caption {
font-size: smaller;
}
html {
min-width: 1040px;
}
h1 { font-style: italic;
font-weight: 400;
@dfeng
dfeng / nh.md
Last active August 29, 2015 14:26
nh

Restaurants

  • $$$ Tarry Lodge: Good Italian food. Supposedly there's actually a lot of Italian places, but I haven't been to all of them.
  • $$$ Zinc: Favorite restaurant in NH. It's just really, really good food. Their lunch menu is surprisingly decently priced and almost the same thing as dinner.
  • $ Prime 16: Burgers - get the Honey Truffle burgers.
  • $$ Rubamba: Mexican food - try their arepa dishes. They also have a food cart on the corner of York and Elm - simple but delicious!
  • $$$ Barcelona: Spanish tapas - everything is great. I especially like the Tuna Carpaccio.
  • $$ Da Legna: Italian food - haven't tried their pizza but everyone raves about them. Their other food is also really good, like the pasta.
  • $$ Taste of China: Chinese food, best in NH (but if you have a car, there are
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
@dfeng
dfeng / carbon.css
Created July 21, 2015 07:25
Reddit Carbon (for Chrome)
body{
background:#1a1a1a;
color:#ddd
}
.comment .usertext .md p>a:visited,.md a,.res.res-nightmode .tagline a,a,h2 a:visited{
color:#3498db;
-webkit-transition:color .15s ease-in-out;
-moz-transition:color .15s ease-in-out;
-o-transition:color .15s ease-in-out;
@dfeng
dfeng / pipes.R
Created July 20, 2015 14:19
Pipes
# Before
# directed case
graph.directed[[i]] <- graph.adjacency(x, mode="directed", weighted=TRUE, diag=FALSE)
E(graph.directed[[i]])$type <- ifelse(E(graph.directed[[i]])$weight == 1, "friend", "enemy")
graph.sib <- graph.adjacency(aj.sib, mode="directed", weighted=TRUE, diag=FALSE)
E(graph.sib)$type <- "sibling"
graph.directed[[i]] <- graph.directed[[i]] + graph.sib
E(graph.directed[[i]])$type <- ifelse(is.na(E(graph.directed[[i]])$type_1), "sibling", E(graph.directed[[i]])$type_1)