This file contains hidden or 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
def xkcdify(borders=True, code=True, html=True, prompts=True, output=True, | |
font_url='https://github.com/ipython/xkcd-font/raw/master/build/xkcd.otf'): | |
"""Turn on xkcd mode for the notebook. | |
Run this in your notebook and it will enable the xkcd regular font | |
from the xkcd website. This font is downloaded from the internet | |
so this only works if you are online. | |
This mode can be used with Matplotlib's new xkcd mode to great effect. However, | |
you will have to enable that separately by calling matplotlibs xkcd function. |
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 hidden or 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
By this year: | The majority of Americans will be too young to remember: | |
---|---|---|
2012 | The seventies | |
2013 | The Carter Presidency | |
2014 | The Reagan shooting | |
2015 | The Falkland Islands war | |
2016 | Return of the Jedi release | |
2017 | The first Apple Macintosh | |
2018 | New Coke | |
2019 | Challenger | |
2020 | Chernobyl |
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 hidden or 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
// Simple IPython Notebook test | |
// Requires PhantomJS and CasperJS. | |
// To run: | |
// 1) Start a notebook server in an empty directory. | |
// 2) casperjs test_basic.js | |
var casper = require('casper').create({ | |
// verbose: true, | |
// logLevel: "debug" | |
}); |
This file contains hidden or 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
OutputArea.prototype.append_svg = function (svg, element) { | |
var toinsert = $("<div/>").addClass("box-flex1 output_subarea output_svg"); | |
toinsert.append(svg); | |
element.append(toinsert); | |
// The <svg> tag cannot be made resizable so we wrap it in a resizable <div>. | |
// The problem with this is that we need to 1) set the initial size of the | |
// <div> based on the size of the <svg> and 2) we need to tie the size of the | |
// <div> and the <svg>. | |
var img = $('<div/>'); | |
img.html(svg); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 hidden or 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 networkx as nx | |
import matplotlib as mat | |
# Builds a graphene sheet with the given number of rows and columns. | |
# The sheet has a defected column running through the optionally passed | |
# arg. Otherwise it defaults to the center. | |
def build_defected_graph(rows, columns, defect = 0): | |
g = nx.Graph() | |
if( columns <= 2 ): |