This demo uses d3.layout.force()
to calculate the node positions and then passes those to webGL to render them on the GPU.
# Make NSF award badges for your github readme or Markdown-based website! | |
nsf_badges <- function(award_id) { | |
nsf_button_template="[](https://nsf.gov/awardsearch/showAward?AWD_ID={award_id})]" | |
badges<- stringr::str_glue(nsf_button_template) | |
return(paste(badges, collapse = ' ') ) | |
} |
# Goals: ARMA modeling - estimation, diagnostics, forecasting. | |
# 0. SETUP DATA | |
rawdata <- c(-0.21,-2.28,-2.71,2.26,-1.11,1.71,2.63,-0.45,-0.11,4.79,5.07,-2.24,6.46,3.82,4.29,-1.47,2.69,7.95,4.46,7.28,3.43,-3.19,-3.14,-1.25,-0.50,2.25,2.77,6.72,9.17,3.73,6.72,6.04,10.62,9.89,8.23,5.37,-0.10,1.40,1.60,3.40,3.80,3.60,4.90,9.60,18.20,20.60,15.20,27.00,15.42,13.31,11.22,12.77,12.43,15.83,11.44,12.32,12.10,12.02,14.41,13.54,11.36,12.97,10.00,7.20,8.74,3.92,8.73,2.19,3.85,1.48,2.28,2.98,4.21,3.85,6.52,8.16,5.36,8.58,7.00,10.57,7.12,7.95,7.05,3.84,4.93,4.30,5.44,3.77,4.71,3.18,0.00,5.25,4.27,5.14,3.53,4.54,4.70,7.40,4.80,6.20,7.29,7.30,8.38,3.83,8.07,4.88,8.17,8.25,6.46,5.96,5.88,5.03,4.99,5.87,6.78,7.43,3.61,4.29,2.97,2.35,2.49,1.56,2.65,2.49,2.85,1.89,3.05,2.27,2.91,3.94,2.34,3.14,4.11,4.12,4.53,7.11,6.17,6.25,7.03,4.13,6.15,6.73,6.99,5.86,4.19,6.38,6.68,6.58,5.75,7.51,6.22,8.22,7.45,8.00,8.29,8.05,8.91,6.83,7.33,8.52,8.62,9.80,10.63,7.70,8.91,7.50,5.88,9.82,8.44,10.92,11.67) | |
# Make a R timeseries out of the raw |
Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.
In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.
Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j
// viewport dimensions | |
const WIDTH = 300; | |
const HEIGHT = 400; | |
// initial values | |
var tx = 0, | |
ty = 0, | |
scale = 1; | |
/** |
{ | |
"graph": [], | |
"links": [ | |
{"source": 0, "target": 1}, | |
{"source": 0, "target": 2}, | |
{"source": 0, "target": 3}, | |
{"source": 0, "target": 4}, | |
{"source": 0, "target": 5}, | |
{"source": 0, "target": 6}, | |
{"source": 1, "target": 3}, |
#!/bin/sh | |
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
# CREATE block and create them in separate commands _after_ all the INSERTs. | |
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
# The mysqldump file is traversed only once. | |
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
#!/usr/bin/env python | |
import sys | |
import urllib2 | |
from xml.etree import ElementTree as ET | |
def getforecast(zipcode): | |
"""gets current forecast from wunderground""" | |
url='http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query={}' | |
forecastxml = urllib2.urlopen(url.format(zipcode)).read() |
# fix names | |
# toy program that looks for non-windows-friendly file names on an OS X system and emits "mv" commands to rename them. | |
# checks that files are uniquely named. Does not check for length of file path | |
# run the mv commands to make the changes | |
# TEST before using; no guarantees; in Public domain | |
import re | |
import os, sys | |
# | |
# illegal chars |