├── Dockerfile ├── README.md └── index.ipynb /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM andrewosh/binder-base 2 | 3 | MAINTAINER Andrew Osheroff 4 | 5 | USER root 6 | 7 | # Add Julia dependencies 8 | RUN apt-get update 9 | RUN apt-get install -y julia libnettle4 && apt-get clean 10 | 11 | USER main 12 | 13 | # Install Julia kernel 14 | RUN julia -e 'Pkg.add("IJulia")' 15 | RUN julia -e 'Pkg.add("Gadfly")' && julia -e 'Pkg.add("RDatasets")' 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## :dash: :dash: **The Binder Project is moving to a [new repo](https://github.com/jupyterhub/binderhub).** :dash: :dash: 2 | 3 | :books: Same functionality. Better performance for you. :books: 4 | 5 | Over the past few months, we've been improving Binder's architecture and infrastructure. We're retiring this repo as it will no longer be actively developed. Future development will occur under the [JupyterHub](https://github.com/jupyterhub/) organization. 6 | 7 | * All development of the Binder technology will occur in the [binderhub repo](https://github.com/jupyterhub/binderhub) 8 | * Documentation for *users* will occur in the [jupyterhub binder repo](https://github.com/jupyterhub/binder) 9 | * All conversations and chat for users will occur in the [jupyterhub binder gitter channel](https://gitter.im/jupyterhub/binder) 10 | 11 | Thanks for updating your bookmarked links. 12 | 13 | ## :dash: :dash: **The Binder Project is moving to a [new repo](https://github.com/jupyterhub/binderhub).** :dash: :dash: 14 | 15 | --- 16 | 17 | # Example Binder with a Dockerfile 18 | 19 | [![Binder](http://mybinder.org/badge.svg)](http://mybinder.org/repo/binder-project/example-dockerfile) 20 | 21 | A Binder-compatibible repository that contains its own `Dockerfile`. 22 | 23 | Your `Dockerfile` just needs to extend from the [`base`](https://github.com/binder-project/binder-build-core/blob/master/images/base/Dockerfile) image for Binder. 24 | 25 | In this example our Dockerfile installs the Julia language and packages for use with with the Jupyter notebook. Just by adding these steps, we get a Binder that includes Julia as a kernel. 26 | -------------------------------------------------------------------------------- /index.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Welcome to an example Binder" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "This notebook uses `julia`, which we have available as a kernel because we included a `Dockerfile` that installs Julia" 15 | ] 16 | }, 17 | { 18 | "cell_type": "markdown", 19 | "metadata": {}, 20 | "source": [ 21 | "## Do some math" 22 | ] 23 | }, 24 | { 25 | "cell_type": "markdown", 26 | "metadata": {}, 27 | "source": [ 28 | "Adding" 29 | ] 30 | }, 31 | { 32 | "cell_type": "code", 33 | "execution_count": 1, 34 | "metadata": { 35 | "collapsed": false 36 | }, 37 | "outputs": [ 38 | { 39 | "data": { 40 | "text/plain": [ 41 | "6" 42 | ] 43 | }, 44 | "execution_count": 1, 45 | "metadata": {}, 46 | "output_type": "execute_result" 47 | } 48 | ], 49 | "source": [ 50 | "1 + 2 + 3" 51 | ] 52 | }, 53 | { 54 | "cell_type": "markdown", 55 | "metadata": {}, 56 | "source": [ 57 | "Subtracting" 58 | ] 59 | }, 60 | { 61 | "cell_type": "code", 62 | "execution_count": 2, 63 | "metadata": { 64 | "collapsed": false 65 | }, 66 | "outputs": [ 67 | { 68 | "data": { 69 | "text/plain": [ 70 | "-1" 71 | ] 72 | }, 73 | "execution_count": 2, 74 | "metadata": {}, 75 | "output_type": "execute_result" 76 | } 77 | ], 78 | "source": [ 79 | "1 - 2" 80 | ] 81 | }, 82 | { 83 | "cell_type": "markdown", 84 | "metadata": {}, 85 | "source": [ 86 | "Dividing" 87 | ] 88 | }, 89 | { 90 | "cell_type": "code", 91 | "execution_count": 3, 92 | "metadata": { 93 | "collapsed": false 94 | }, 95 | "outputs": [ 96 | { 97 | "data": { 98 | "text/plain": [ 99 | "0.5" 100 | ] 101 | }, 102 | "execution_count": 3, 103 | "metadata": {}, 104 | "output_type": "execute_result" 105 | } 106 | ], 107 | "source": [ 108 | "3*2/12" 109 | ] 110 | }, 111 | { 112 | "cell_type": "markdown", 113 | "metadata": {}, 114 | "source": [ 115 | "## Do some linear algebra" 116 | ] 117 | }, 118 | { 119 | "cell_type": "markdown", 120 | "metadata": {}, 121 | "source": [ 122 | "Make a matrix" 123 | ] 124 | }, 125 | { 126 | "cell_type": "code", 127 | "execution_count": 8, 128 | "metadata": { 129 | "collapsed": false 130 | }, 131 | "outputs": [ 132 | { 133 | "data": { 134 | "text/plain": [ 135 | "5x5 Array{Float64,2}:\n", 136 | " 0.190155 0.0398036 0.717042 0.530508 0.0510607\n", 137 | " 0.475699 0.710277 0.0594697 0.723128 0.61855 \n", 138 | " 0.809481 0.349552 0.980045 0.8411 0.396291 \n", 139 | " 0.21775 0.849673 0.398905 0.294157 0.857497 \n", 140 | " 0.801216 0.260106 0.747052 0.482291 0.952977 " 141 | ] 142 | }, 143 | "execution_count": 8, 144 | "metadata": {}, 145 | "output_type": "execute_result" 146 | } 147 | ], 148 | "source": [ 149 | "M = rand(5,5)" 150 | ] 151 | }, 152 | { 153 | "cell_type": "markdown", 154 | "metadata": {}, 155 | "source": [ 156 | "Compute an SVD" 157 | ] 158 | }, 159 | { 160 | "cell_type": "code", 161 | "execution_count": 12, 162 | "metadata": { 163 | "collapsed": false 164 | }, 165 | "outputs": [ 166 | { 167 | "data": { 168 | "text/plain": [ 169 | "(\n", 170 | "5x5 Array{Float64,2}:\n", 171 | " -0.256741 0.496101 0.247033 -0.468919 0.638011\n", 172 | " -0.40771 -0.448952 0.607769 0.435805 0.270008\n", 173 | " -0.553348 0.471782 0.230678 0.0461864 -0.644889\n", 174 | " -0.413866 -0.571335 -0.143649 -0.674708 -0.162559\n", 175 | " -0.538867 0.0576566 -0.704091 0.36445 0.278802,\n", 176 | "\n", 177 | "[2.76453,1.02762,0.564152,0.443011,0.154289],\n", 178 | "5x5 Array{Float64,2}:\n", 179 | " -0.438613 0.179498 -0.128669 0.678577 -0.546238 \n", 180 | " -0.356315 -0.58842 0.384574 -0.387041 -0.478648 \n", 181 | " -0.476862 0.590254 -0.255149 -0.59126 -0.0975365\n", 182 | " -0.462314 0.189853 0.678432 0.186285 0.505222 \n", 183 | " -0.489414 -0.486928 -0.556935 0.0737671 0.455804 )" 184 | ] 185 | }, 186 | "execution_count": 12, 187 | "metadata": {}, 188 | "output_type": "execute_result" 189 | } 190 | ], 191 | "source": [ 192 | "(U,S,V)=svd(full(M))" 193 | ] 194 | }, 195 | { 196 | "cell_type": "markdown", 197 | "metadata": {}, 198 | "source": [ 199 | "## Do some calculus!" 200 | ] 201 | }, 202 | { 203 | "cell_type": "markdown", 204 | "metadata": {}, 205 | "source": [ 206 | "Get the library" 207 | ] 208 | }, 209 | { 210 | "cell_type": "code", 211 | "execution_count": 20, 212 | "metadata": { 213 | "collapsed": true 214 | }, 215 | "outputs": [], 216 | "source": [ 217 | "using Calculus" 218 | ] 219 | }, 220 | { 221 | "cell_type": "markdown", 222 | "metadata": {}, 223 | "source": [ 224 | "Differentiate `sin`" 225 | ] 226 | }, 227 | { 228 | "cell_type": "code", 229 | "execution_count": 25, 230 | "metadata": { 231 | "collapsed": false 232 | }, 233 | "outputs": [ 234 | { 235 | "data": { 236 | "text/plain": [ 237 | "0.87758256188362" 238 | ] 239 | }, 240 | "execution_count": 25, 241 | "metadata": {}, 242 | "output_type": "execute_result" 243 | } 244 | ], 245 | "source": [ 246 | "derivative(sin, 0.5)" 247 | ] 248 | }, 249 | { 250 | "cell_type": "markdown", 251 | "metadata": {}, 252 | "source": [ 253 | "And check against `cos`" 254 | ] 255 | }, 256 | { 257 | "cell_type": "code", 258 | "execution_count": 26, 259 | "metadata": { 260 | "collapsed": false 261 | }, 262 | "outputs": [ 263 | { 264 | "data": { 265 | "text/plain": [ 266 | "0.8775825618903728" 267 | ] 268 | }, 269 | "execution_count": 26, 270 | "metadata": {}, 271 | "output_type": "execute_result" 272 | } 273 | ], 274 | "source": [ 275 | "cos(0.5)" 276 | ] 277 | } 278 | ], 279 | "metadata": { 280 | "kernelspec": { 281 | "display_name": "Julia 0.3.2", 282 | "language": "julia", 283 | "name": "julia-0.3" 284 | }, 285 | "language_info": { 286 | "name": "julia", 287 | "version": "0.3.2" 288 | } 289 | }, 290 | "nbformat": 4, 291 | "nbformat_minor": 0 292 | } 293 | --------------------------------------------------------------------------------