Skip to content

Instantly share code, notes, and snippets.

'''
The code takes the url of an image and converts it into a numpy array.
'''
import matplotlib.pylab as plt
import numpy as np
import cStringIO
import Image
import urllib
file = cStringIO.StringIO(urllib.urlopen(url_sim_data).read())
@insin
insin / boolean-attrs.tag
Last active August 29, 2015 14:14
Riot.js Boolean Attribute Test Case - http://bl.ocks.org/insin/raw/4ce0df7537a567f1eecb/
<boolean-attrs>
<p><code>riot.version: {opts.version}</code></p>
<p>Try using the toggle button before and after clicking on the checkboxes. Not working in v2.0.5.</p>
<p><code>bool: {String(this.bool)}</code></p>
<label><input type="checkbox" checked={this.bool}> <code>checked=\{this.bool\}</code></label>
<br>
<label><input type="checkbox" checked={!this.bool}> <code>checked=\{!this.bool\}</code></label>
<br>
<button type="button" onclick={toggleBool}>Toggle <code>bool</code></button>
@robclewley
robclewley / bombardier_intro.md
Last active August 29, 2015 14:17
Brief description of gamified exploratory modeling tool application, Bombardier

Bombardier's Guild is a fun steampunk-like mobile game app that I used to play a lot. Basically, you have to shoot a projectile from one planet to hit another, while navigating a static, 2D n-body problem inbetween. It's a simple setup but a highly nonlinear four-dimensional system with two free parameters. For certain configurations of the n body obstacles, trajectory designs are very hard to intuit and figure out because of chaotic parameter regions (exponentially high sensitivity of final outcome to small changes in parameters). Hence the interest in visual diagnostic tools to assist a player in deconstructing and eventually solving the game.

I was inspired to recreate some of Bombardier's core gameplay as part of a demonstration of innovative new model exploration and algorithm diagnosis tools (see screenshot demo_shot.png below)

Here, you see a trajectory that successfully hits a user-defined target, with heatmap color coding along the line segment traj

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tnearey
tnearey / Minimal R Ipython3 Notebook
Created July 13, 2015 17:17
Minimal IPython 3 notebook (Anaconda) runing R code
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# A minimal notebook for running %%R (rmagic) in IPython 3 notebook (Anaconda)\n",
"\n",
"Here's some environment info from Jupyter's Help:About pull down\n",
">About IPython Notebook\n",
@mrocklin
mrocklin / NYCTaxi.ipynb
Last active August 29, 2015 14:26
NYCTaxi and dask.dataframe
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mrocklin
mrocklin / dask-svd-profile.html
Created June 26, 2015 19:51
Bokeh plot showing dask svd performance
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bokeh Plot</title>
<style>
/* BEGIN /Users/jcrist/anaconda/envs/dask/lib/python2.7/site-packages/bokeh/server/static/css/bokeh.min.css */
.bk-bs-container,.bk-bs-container-fluid{margin-left:auto;padding-left:15px;padding-right:15px;margin-right:auto}.bk-bs-btn,.bk-toolbar-button{-ms-user-select:none;user-select:none;-webkit-user-select:none;-moz-user-select:none}.bk-bs-btn,.bk-bs-btn-danger.bk-bs-active,.bk-bs-btn-danger:active,.bk-bs-btn-default.bk-bs-active,.bk-bs-btn-default:active,.bk-bs-btn-info.bk-bs-active,.bk-bs-btn-info:active,.bk-bs-btn-success.bk-bs-active,.bk-bs-btn-success:active,.bk-bs-btn-warning.bk-bs-active,.bk-bs-btn-warning:active,.bk-bs-btn.bk-bs-active,.bk-bs-btn:active,.bk-bs-dropdown-menu>.bk-bs-disabled>a:focus,.bk-bs-dropdown-menu>.bk-bs-disabled>a:hover,.bk-bs-form-control,.bk-bs-open .bk-bs-dropdown-toggle.bk-bs-btn-danger,.bk-bs-open .bk-bs-dropdown
anonymous
anonymous / Beaker Share
Created July 12, 2015 21:01
Beaker Share
This file has been truncated, but you can view the full file.
{"beaker":"2","evaluators":[{"name":"Html","plugin":"Html","view":{"cm":{"mode":"htmlmixed"}},"shellID":null},{"name":"Latex","plugin":"Latex","view":{"cm":{"mode":"stex"}},"shellID":null},{"name":"JavaScript","plugin":"JavaScript","jsSetting2":"","jsSetting1":"","view":{"cm":{"mode":"javascript","background":"#FFE0F0"}},"shellID":null},{"name":"Python3","plugin":"Python3","imports":"","supplementalClassPath":"","setup":"%matplotlib inline\nimport numpy\nimport matplotlib\nfrom matplotlib import pylab, mlab, pyplot\nnp = numpy\nplt = pyplot\nfrom IPython.display import display\nfrom IPython.core.pylabtools import figsize, getfigs\nfrom pylab import *\nfrom numpy import *\n","view":{"cm":{"mode":"python"}},"shellID":"0C7DE263A92D4ABD85F9C1B4AD5717D9"}],"cells":[{"id":"sectionC6ReWS","type":"section","title":"Bokeh working with Beaker","level":1,"evaluatorReader":false,"collapsed":false},{"id":"markdownRxrBrK","type":"markdown","body":"[Bokeh](http://bokeh.pydata.org/en/latest/) is an interactive web visualizat
This file has been truncated, but you can view the full file.
{
"cells": [
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"collapsed": false
},
"outputs": [
{
anonymous
anonymous / Untitled (7).ipynb
Created November 3, 2015 16:14
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.