Giter Site home page Giter Site logo

everyelixirpatternmatchingexampleever's Introduction

Every example of pattern matching (almost) from the docs

Really, it's a lot of examples from the docs.

Plus some weird excursions, like Peano arithmetic (see Notebook 2), to illustrate pattern matching in recursion.

NOTE: This requires Python, Jupyter Notebooks, and IElixir for Jupyter.

Docker

From scratch (takes hours)

  • docker build -t ielixir_notebook .
  • Use the commands below to run a container.

From an image (large download)

  • This assumes you have Docker installed.
  • Pull the image docker pull mudphone/ielixir_notebook
  • Clone this repo, then cd into it
  • Run a container
    • docker run --name my_iex_notebook -it -p 8888:8888 --user jovyan -v "$PWD":/home/jovyan/jupyter-env/patterns mudphone/ielixir_notebook bash
  • Note:
    • the name of the container: my_iex_notebook (make it what you wish)
    • the port: 8888 (you'll use this to connect to Jupyter notebooks)
    • the user: jovyan (that's the default Jupyter image user name)
    • the shared volume: -v host_source:container_target
  • Start the container
    • docker start my_iex_notebook
  • From the container, launch Jupyter notebook
  • cd ~/jupyter-env
    • pipenv shell
    • jupyter notebook patterns
    • Note the URL, you'll use it to connect from the host
  • From the host, connect to the notebook
    • Open a browser to http://127.0.0.1:8888/?token=xxxx
    • Note: token=xxxx must be replaced with whatever you saw from the container when you started the Jupyter notebook

Also

  • Stop the container
    • docker stop my_iex_notebook
  • Connect to a running container
    • docker exec -it --user jovyan my_iex_notebook bash
  • Use --rm to rum a container and delete it after you exit

everyelixirpatternmatchingexampleever's People

Contributors

mudphone avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.