Skip to content

Instantly share code, notes, and snippets.

View dpastoor's full-sized avatar

Devin Pastoor dpastoor

  • A2-Ai
  • Rockville, MD
View GitHub Profile
@arunsrinivasan
arunsrinivasan / group_effect.md
Last active September 17, 2015 14:03
Illustrating the impact of number of groups on joins

Update: The timings are now updated with runs from R v3.2.2 along with the new 'on=' syntax

A small note on this tweet from @KevinUshey and this tweet from @ChengHLee:

The number of rows, while is important, is only one of the factors that influence the time taken to perform the join. From my benchmarking experience, the two features that I found to influence join speed, especially on hash table based approaches (ex: dplyr), much more are:

  • The number of unique groups.
  • The number of columns to perform the join based on - note that this is also related to the previous point as in most cases, more the columns, more the number of unique groups.

That is, these features influence join speed in spite of having the same number of rows.

@jimhester
jimhester / .gitignore
Last active December 21, 2015 19:39 — forked from hadley/.gitignore
.Rproj.user
.Rhistory
.RData
*.Rproj
*.html
@kevinushey
kevinushey / .gitignore
Last active December 21, 2015 21:39 — forked from hadley/.gitignore
.Rproj.user
.Rhistory
.RData
*.Rproj
*.html
@larrydahooster
larrydahooster / Sidebar1.js
Last active January 19, 2016 00:43
bindActionCreators
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { toggleSidebar } from '../actions/sidebarActionCreators';
import { bindActionCreators } from 'redux';
import MainNav from '../components/MainNav';
class Sidebar extends Component {
render() {
const { dispatch, sidebar, subNav } = this.props;
@idibidiart
idibidiart / GraphQL-Relay-HN.md
Last active February 16, 2016 02:21
GraphQL/Relay
function createDisabledUntilClientRendersComponent(component, displayName='ClientComponent') {
return React.createClass({
displayName,
propTypes: {
disabled: React.PropTypes.bool
},
getInitialState() {
@debergalis
debergalis / gist:bf76084cdb1434d8733d
Last active May 5, 2016 21:42
Notes on Meteor for CS 294-101

Brief notes on Meteor for CS 294-101. Many of the key architectural ideas in Meteor are described at https://www.meteor.com/projects.

  1. BSD as example of great system design. Application primitives: processes run by a scheduler, sockets, sys calls, virtual memory, mbufs. What makes something a platform. Unix vs Multics.

  2. History of application architectures. Mainframes (e.g. IBM 360 / 3270), client-server (e.g. Win32), web (e.g. LAMP), cloud-client. Oscillation of where the software runs. Thin vs thick clients, data vs presentation on the wire. Changes driven by massive forces (cheap CPUs, ubiquitous internet, mobile). New architecture for each era.

  3. What it takes to make modern UI/UX. Mobile. Live updating. Collaboration. No refresh button. All drive the need for “realtime” or “reactive” system. Very different from HTTP era.

  4. Four questions: 1 — how do we move data around; 2 — where does it come from; 3 — where do we put it; 4 — how do we use it?

# devtools::install_github('jalapic/engsoccerdata')
library(engsoccerdata)
library(dplyr)
library(plotly)
library(htmlwidgets)
england$Date <- as.Date(england$Date, format = "%Y-%m-%d")
#Get Data into Format Needed
df<-rbind(
// this wrapper component was never a Route! Just another way
// the old version "recreated react rendering"
<Route component={Wrapper}>
<Route path="/foo" component={Foo}/>
<Route path="/bar" component={Bar}/>
<Route path="/baz" component={Baz}/>
</Route>
// whenever one of those paths matched, you'd get something like
// <Wrapper><Foo/></Wrapper>
@oganm
oganm / explicit.R
Last active January 7, 2017 16:14
library(dplyr)
library(magrittr)
baseR = c('base','compiler','datasets','graphics','grDevices','grid','methods','parallel','splines','stats','stats4','tcltk','utils')
explicit = function(fileIn,fileOut,
ignore = baseR){
file = readLines(fileIn)