From eb4a233c9d9278f54c2f6fe4010cd286d7dc4458 Mon Sep 17 00:00:00 2001 From: mhjensen Date: Mon, 10 Jun 2019 22:48:38 -0400 Subject: [PATCH] updated intro --- .../Introduction/html/Introduction-bs.html | 125 +- .../html/Introduction-reveal.html | 126 +- .../html/Introduction-solarized.html | 125 +- doc/pub/Introduction/html/Introduction.html | 125 +- .../Introduction/html/reveal.js/.gitignore | 7 +- .../Introduction/html/reveal.js/.travis.yml | 6 +- doc/pub/Introduction/html/reveal.js/LICENSE | 2 +- doc/pub/Introduction/html/reveal.js/README.md | 592 +++---- .../Introduction/html/reveal.js/bower.json | 6 +- .../html/reveal.js/css/print/paper.css | 7 +- .../html/reveal.js/css/print/pdf.css | 97 +- .../html/reveal.js/css/reveal.scss | 588 ++----- .../html/reveal.js/css/theme/README.md | 6 +- .../reveal.js/css/theme/source/black.scss | 4 +- .../reveal.js/css/theme/source/white.scss | 4 +- .../Introduction/html/reveal.js/index.html | 390 ++++- .../Introduction/html/reveal.js/js/reveal.js | 1419 ++++------------- .../html/reveal.js/lib/css/zenburn.css | 119 +- .../html/reveal.js/lib/js/head.min.js | 17 +- .../Introduction/html/reveal.js/package.json | 42 +- .../reveal.js/plugin/highlight/highlight.js | 55 +- .../reveal.js/plugin/markdown/example.html | 7 - .../html/reveal.js/plugin/markdown/example.md | 5 - .../reveal.js/plugin/markdown/markdown.js | 57 +- .../html/reveal.js/plugin/markdown/marked.js | 2 +- .../html/reveal.js/plugin/math/math.js | 7 +- .../html/reveal.js/plugin/multiplex/client.js | 2 +- .../html/reveal.js/plugin/multiplex/index.js | 38 +- .../html/reveal.js/plugin/multiplex/master.js | 61 +- .../reveal.js/plugin/notes-server/client.js | 7 +- .../reveal.js/plugin/notes-server/index.js | 31 +- .../reveal.js/plugin/notes-server/notes.html | 241 +-- .../html/reveal.js/plugin/notes/notes.html | 417 +---- .../html/reveal.js/plugin/notes/notes.js | 45 +- .../reveal.js/plugin/print-pdf/print-pdf.js | 75 +- .../html/reveal.js/plugin/search/search.js | 72 +- .../html/reveal.js/plugin/zoom-js/zoom.js | 40 +- .../html/reveal.js/test/examples/math.html | 2 +- .../test/examples/slide-backgrounds.html | 2 +- .../html/reveal.js/test/test-markdown.html | 2 +- .../html/reveal.js/test/test.html | 3 +- .../Introduction/html/reveal.js/test/test.js | 10 +- doc/pub/Introduction/ipynb/Introduction.ipynb | 130 +- .../ipynb/ipynb-Introduction-src.tar.gz | Bin 211 -> 214 bytes .../Introduction/pdf/Introduction-minted.pdf | Bin 213987 -> 214484 bytes doc/src/Intro2Course/Intro2Course.do.txt | 4 +- doc/src/Introduction/Introduction.do.txt | 119 +- 47 files changed, 1830 insertions(+), 3411 deletions(-) diff --git a/doc/pub/Introduction/html/Introduction-bs.html b/doc/pub/Introduction/html/Introduction-bs.html index a052cad50..e726006af 100644 --- a/doc/pub/Introduction/html/Introduction-bs.html +++ b/doc/pub/Introduction/html/Introduction-bs.html @@ -6,6 +6,7 @@ Automatically generated HTML file from DocOnce source + Introduction to Applied Data Analysis and Machine Learning @@ -107,7 +108,7 @@ end of tocinfo -->
[2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University

-

May 28, 2018

+

Jun 10, 2019


@@ -115,14 +116,25 @@ end of tocinfo -->

Introduction

-Statistics, data science and machine learning form important fields of -research in modern science. They describe how to learn and make -predictions from data, as well as allowing us to extract important -correlations about physical process and the underlying laws of motion -in large data sets. The latter, big data sets, appear frequently in -essentially all disciplines, from the traditional Science, Technology, -Mathematics and Engineering fields to Life Science, Law, education -research, the Humanities and the Social Sciences. +During the last two decades there has been a swift and amazing +development of Machine Learning techniques and algorithms that impact +many areas in not only Science and Technology but also the Humanities, +Social Sciences, Medicine, Law, indeed, almost all possible +disciplines. The applications are incredibly many, from self-driving +cars to solving high-dimensional differential equations or complicated +quantum mechanical many-body problems. Machine Learning is perceived +by many as one of the main disruptive techniques nowadays. + +

+Statistics, Data science and Machine Learning form important +fields of research in modern science. They describe how to learn and +make predictions from data, as well as allowing us to extract +important correlations about physical process and the underlying laws +of motion in large data sets. The latter, big data sets, appear +frequently in essentially all disciplines, from the traditional +Science, Technology, Mathematics and Engineering fields to Life +Science, Law, education research, the Humanities and the Social +Sciences.

It has become more @@ -188,7 +200,7 @@ of algorithms and methods we will discuss.

Learning outcomes

-These setsof lectures aim at giving you an overview of central aspects of +These sets of lectures aim at giving you an overview of central aspects of statistical data analysis as well as some of the central algorithms used in machine learning. We will introduce a variety of central algorithms and methods essential for studies of data analysis and @@ -197,17 +209,17 @@ machine learning.

Hands-on projects and experimenting with data and algorithms plays a central role in these lectures, and our hope is, through the various -projects and exercies, to expose you to fundamental +projects and exercises, to expose you to fundamental research problems in these fields, with the aim to reproduce state of the art scientific results. You will learn to develop and -structure large codes for studying these systems, get acquainted with +structure codes for studying these systems, get acquainted with computing facilities and learn to handle large scientific projects. A good scientific and ethical conduct is emphasized throughout the course. More specifically, you will

    -
  1. learn about basic data analysis, Bayesian statistics, Monte Carlo methods, data optimization and machine learning;
  2. -
  3. be capable of extending the acquired knowledge to other systems and cases;
  4. +
  5. Learn about basic data analysis, Bayesian statistics, Monte Carlo methods, data optimization and machine learning;
  6. +
  7. Be capable of extending the acquired knowledge to other systems and cases;
  8. Have an understanding of central algorithms used in data analysis and machine learning;
  9. Gain knowledge of central aspects of Monte Carlo methods, Markov chains, Gibbs samplers and their possible applications, from numerical integration to simulation of stock markets;
  10. Understand methods for regression and classification;
  11. @@ -215,16 +227,16 @@ course. More specifically, you will
  12. Work on numerical projects to illustrate the theory. The projects play a central role and you are expected to know modern programming languages like Python or C++, in addition to a basic knowledge of linear algebra (typically taught during the first one or two years of undergraduate studies).
-There are several topics we will cover here, spanning from a -statistical data analysis and its basic concepts such expectation +There are several topics we will cover here, spanning from +statistical data analysis and its basic concepts such as expectation values, variance, covariance, correlation functions and errors, via -well-known probability distribution functions like uniform +well-known probability distribution functions like the uniform distribution, the binomial distribution, the Poisson distribution and simple and multivariate normal distributions to central elements of Bayesian statistics and modeling. We will also remind the reader about central elements from linear algebra and standard methods based on -linear algebra used to fit functions such Cubic splines and gradient -methods for data optimization and the Singular-value decomposition and +linear algebra used to optimize (minimize) functions (the family of gradient descent methods) +and the Singular-value decomposition and least square methods for parameterizing data.

@@ -232,8 +244,8 @@ We will also cover Monte Carlo methods, Markov chains, well-known algorithms for sampling stochastic events like the Metropolis-Hastings and Gibbs sampling methods. An important aspect of all our calculations is a proper estimation of errors. Here we will also -discuss famous resampling techniques like the blocking, bootstrapping -and jackknife methods. +discuss famous resampling techniques like the blocking, the bootstrapping +and the jackknife methods and the infamous bias-variance tradeoff.

The second part of the material covers several algorithms used in @@ -265,8 +277,12 @@ desired output of a system. Some of the most common tasks are: The methods we cover have three main topics in common, irrespective of whether we deal with supervised or unsupervised learning. The first ingredient is normally our data set (which can be subdivided into -training and test data), the second item is a model which is normally a -function of some parameters. The model reflects our knowledge of the system (or lack thereof). As an example, if we know that our data show a behavior similar to what would be predicted by a polynomial, fitting our data to a polynomial of some degree would then determin our model. +training and test data), the second item is a model which is normally +a function of some parameters. The model reflects our knowledge of +the system (or lack thereof). As an example, if we know that our data +show a behavior similar to what would be predicted by a polynomial, +fitting our data to a polynomial of some degree would then determin +our model.

The last ingredient is a so-called cost @@ -280,12 +296,11 @@ analysis, stochastic processes etc. We will discuss the following machine learning algorithms

    -
  1. Linear regression and its variants, in essence polynomial regression
  2. -
  3. Decision tree algorithms, from simpler to more complex ones
  4. -
  5. Nearest neighbors models
  6. +
  7. Linear regression and its variants
  8. +
  9. Decision tree algorithms, from single trees to random forests
  10. Bayesian statistics and regression
  11. Support vector machines and finally various variants of
  12. -
  13. Artifical neural networks and deep learning
  14. +
  15. Artifical neural networks and deep learning, including convolutional neural networks and Bayesian neural networks
  16. Networks for unsupervised learning using for example reduced Boltzmann machines.
@@ -294,21 +309,16 @@ machine learning algorithms

Python plays nowadays a central role in the development of machine learning techniques and tools for data analysis. In particular, seen -the wealth of machine learning and data analysis packages written in +the wealth of machine learning and data analysis libraries written in Python, easy to use libraries with immediate visualization(and not the -least impressive galleries of existing example), the popularity of the +least impressive galleries of existing examples), the popularity of the Jupyter notebook framework with the possibility to run R codes or compiled programs written in C++, and much more made our choice of -programming language for this series of lectures of easy. However, -since the focus here is not only on using existing Python tools such -as scikit-learn or tensorflow, but also on developing your own +programming language for this series of lectures easy. However, +since the focus here is not only on using existing Python libraries such +as Scikit-Learn or Tensorflow, but also on developing your own algorithms and codes, we will as far as possible present many of these -algorithms eithers a Python codes or C++ codes. Finally, we will, as -far as possible keep parallel versions of the data analysis and -machine larning programming aspects in R as -well. R is a language and environment -for statistical computing and graphics which is widely used in -statistics and mathematics applications. +algorithms either as a Python codes or C++ or Fortran (or other languages) codes.

The reason we also focus on compiled languages like C++ (or @@ -317,7 +327,7 @@ utilize highly streamlined computational libraries like Lapack or other numerical libraries written in compiled languages (many of these libraries are written in Fortran). Although a project like Numba -holds great promise for speeding up the unrolling of lengthy loops, C+ +holds great promise for speeding up the unrolling of lengthy loops, C++ and Fortran are presently still the performance winners. Numba gives you potentially the power to speed up your applications with high performance functions written directly in Python. In particular, @@ -340,7 +350,7 @@ existing data files or provide code examples which produce the data to be analyzed. Most of the applications we will discuss deal with small data sets (less than a terabyte of information) and can easily be analyzed and tested on standard off the shelf laptops you find in general -grocery stores. +stores.

Data handling, machine learning and ethical aspects

@@ -348,7 +358,7 @@ grocery stores. In most of the cases we will study, we will either generate the data to analyze ourselves (both for supervised learning and unsupervised learning) or we will recur again and again to data present in say -scikit-learn or tensorflow. Many of the examples we end up +Scikit-Learn or Tensorflow. Many of the examples we end up dealing with are from a privacy and data protection point of view, rather inoccuous and boring results of numerical calculations. However, this does not hinder us from developing a sound @@ -364,7 +374,7 @@ repositories like Github, and data sets we have used, freely and easily accessible to a wider community. This helps us almost automagically in making our science reproducible. The large open-source development communities involved -in say Scikit-learn, +in say Scikit-Learn, Tensorflow, PyTorch and Keras, are all excellent examples of this. The codes can be tested and improved @@ -373,13 +383,13 @@ developing data analysis and machine learning tools. It is much easier today to gain traction and acceptance for making your science reproducible. From a societal stand, this is an important element since many of the developers are employees of large public institutions like -universities and research labs. Our taxpayer do deserve to get +universities and research labs. Our fellow taxpayers do deserve to get something back for their bucks.

However, this more mechanical aspect of the ethics of science (in particular the reproducibility of scientific results) is something -which is obvious and everybody should do as part of the dialectics of +which is obvious and everybody should do so as part of the dialectics of science. The fact that many scientists are not willing to share their codes or data is detrimental to the scientific discourse. @@ -387,11 +397,11 @@ data is detrimental to the scientific discourse. Before we proceed, we should add a disclaimer. Even though we may dream of computers developing some kind of higher learning capabilities, at the end (even if the artificial intelligence -community keeps touting our ears full of fancy futuristic avenues), it is we +community keeps touting our ears full of fancy futuristic avenues), it is we, yes you reading these lines, who end up constructing and instructing, via various algorithms, the -computers. Self-driving cars for example, rely on sofisticated +machine learning approaches. Self-driving cars for example, rely on sofisticated programs which take into account all possible situations a car can -encounter. In addition, extensive usage of training datas from GPS +encounter. In addition, extensive usage of training data from GPS information, maps etc, are typically fed into the software for self-driving cars. Adding to this various sensors and cameras that feed information to the programs, there are zillions of ethical issues @@ -402,8 +412,8 @@ For self-driving cars, where basically many of the standard machine learning algorithms discussed here enter into the codes, at a certain stage we have to make choices. Yes, we , the lads and lasses who wrote a program for a specific brand of a self-driving car. As an example, -a most carmakers have as their utmost priority the security of the -driver and the accompanying passengers. A famous carmaker, which is +all carmakers have as their utmost priority the security of the +driver and the accompanying passengers. A famous European carmaker, which is one of the leaders in the market of self-driving cars, had if statements of the following type: suppose there are two obstacles in front of you and you cannot avoid to collide with one of them. One of @@ -414,9 +424,9 @@ the likelihood of surving a collision with our future citizens, is much higher.

-This brings us leads then to serious ethical aspects. Why should we +This leads to serious ethical aspects. Why should we opt for such an option? Who decides and who is entitled to make such -choices? Keep in mind that many of the algorithms you will about in +choices? Keep in mind that many of the algorithms you will encounter in this series of lectures or hear about later, are indeed based on simple programming instructions. And you are very likely to be one of the people who may end up writing such a code. Thus, developing a @@ -429,15 +439,16 @@ not weighting some data in a particular way, perhaps because you dearly want a specific conclusion which may support your political views?

-We do not have the answers here, but we want you think over these -topics in a more overarching way. A statistical data analysis with -its dry numbers and graphs meant to guide the eye, do not necessarily +We do not have the answers here, nor will we venture into a deeper +discussions of these aspects, but we want you think over these topics +in a more overarching way. A statistical data analysis with its dry +numbers and graphs meant to guide the eye, does not necessarily reflect the truth, whatever that is. As a scientist, and after a university education, you are supposedly a better citizen, with an improved critical view and understanding of the scientific method, and -perhaps some deeper understandings of the ethics of science at +perhaps some deeper understanding of the ethics of science at large. Use these insights. Be a critical citizen. You owe it to our -societies. +society.

To do: Add references and acknowledgements @@ -457,7 +468,7 @@ To do: Add references and acknowledgements

- © 1999-2018, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license + © 1999-2019, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license
diff --git a/doc/pub/Introduction/html/Introduction-reveal.html b/doc/pub/Introduction/html/Introduction-reveal.html index 8565b2273..dd1093f5d 100644 --- a/doc/pub/Introduction/html/Introduction-reveal.html +++ b/doc/pub/Introduction/html/Introduction-reveal.html @@ -1,8 +1,8 @@ -\ + Introduction to Applied Data Analysis and Machine Learning @@ -132,20 +132,31 @@ td.padding {
[2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University

 
-

May 28, 2018

+

Jun 10, 2019


Introduction

-Statistics, data science and machine learning form important fields of -research in modern science. They describe how to learn and make -predictions from data, as well as allowing us to extract important -correlations about physical process and the underlying laws of motion -in large data sets. The latter, big data sets, appear frequently in -essentially all disciplines, from the traditional Science, Technology, -Mathematics and Engineering fields to Life Science, Law, education -research, the Humanities and the Social Sciences. +During the last two decades there has been a swift and amazing +development of Machine Learning techniques and algorithms that impact +many areas in not only Science and Technology but also the Humanities, +Social Sciences, Medicine, Law, indeed, almost all possible +disciplines. The applications are incredibly many, from self-driving +cars to solving high-dimensional differential equations or complicated +quantum mechanical many-body problems. Machine Learning is perceived +by many as one of the main disruptive techniques nowadays. + +

+Statistics, Data science and Machine Learning form important +fields of research in modern science. They describe how to learn and +make predictions from data, as well as allowing us to extract +important correlations about physical process and the underlying laws +of motion in large data sets. The latter, big data sets, appear +frequently in essentially all disciplines, from the traditional +Science, Technology, Mathematics and Engineering fields to Life +Science, Law, education research, the Humanities and the Social +Sciences.

It has become more @@ -208,7 +219,7 @@ of algorithms and methods we will discuss.

- © 1999-2018, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license + © 1999-2019, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license
@@ -217,7 +228,7 @@ of algorithms and methods we will discuss.

Learning outcomes

-These setsof lectures aim at giving you an overview of central aspects of +These sets of lectures aim at giving you an overview of central aspects of statistical data analysis as well as some of the central algorithms used in machine learning. We will introduce a variety of central algorithms and methods essential for studies of data analysis and @@ -226,17 +237,17 @@ machine learning.

Hands-on projects and experimenting with data and algorithms plays a central role in these lectures, and our hope is, through the various -projects and exercies, to expose you to fundamental +projects and exercises, to expose you to fundamental research problems in these fields, with the aim to reproduce state of the art scientific results. You will learn to develop and -structure large codes for studying these systems, get acquainted with +structure codes for studying these systems, get acquainted with computing facilities and learn to handle large scientific projects. A good scientific and ethical conduct is emphasized throughout the course. More specifically, you will

    -

  1. learn about basic data analysis, Bayesian statistics, Monte Carlo methods, data optimization and machine learning;
  2. -

  3. be capable of extending the acquired knowledge to other systems and cases;
  4. +

  5. Learn about basic data analysis, Bayesian statistics, Monte Carlo methods, data optimization and machine learning;
  6. +

  7. Be capable of extending the acquired knowledge to other systems and cases;
  8. Have an understanding of central algorithms used in data analysis and machine learning;
  9. Gain knowledge of central aspects of Monte Carlo methods, Markov chains, Gibbs samplers and their possible applications, from numerical integration to simulation of stock markets;
  10. Understand methods for regression and classification;
  11. @@ -245,16 +256,16 @@ course. More specifically, you will

-There are several topics we will cover here, spanning from a -statistical data analysis and its basic concepts such expectation +There are several topics we will cover here, spanning from +statistical data analysis and its basic concepts such as expectation values, variance, covariance, correlation functions and errors, via -well-known probability distribution functions like uniform +well-known probability distribution functions like the uniform distribution, the binomial distribution, the Poisson distribution and simple and multivariate normal distributions to central elements of Bayesian statistics and modeling. We will also remind the reader about central elements from linear algebra and standard methods based on -linear algebra used to fit functions such Cubic splines and gradient -methods for data optimization and the Singular-value decomposition and +linear algebra used to optimize (minimize) functions (the family of gradient descent methods) +and the Singular-value decomposition and least square methods for parameterizing data.

@@ -262,8 +273,8 @@ We will also cover Monte Carlo methods, Markov chains, well-known algorithms for sampling stochastic events like the Metropolis-Hastings and Gibbs sampling methods. An important aspect of all our calculations is a proper estimation of errors. Here we will also -discuss famous resampling techniques like the blocking, bootstrapping -and jackknife methods. +discuss famous resampling techniques like the blocking, the bootstrapping +and the jackknife methods and the infamous bias-variance tradeoff.

The second part of the material covers several algorithms used in @@ -299,8 +310,12 @@ desired output of a system. Some of the most common tasks are: The methods we cover have three main topics in common, irrespective of whether we deal with supervised or unsupervised learning. The first ingredient is normally our data set (which can be subdivided into -training and test data), the second item is a model which is normally a -function of some parameters. The model reflects our knowledge of the system (or lack thereof). As an example, if we know that our data show a behavior similar to what would be predicted by a polynomial, fitting our data to a polynomial of some degree would then determin our model. +training and test data), the second item is a model which is normally +a function of some parameters. The model reflects our knowledge of +the system (or lack thereof). As an example, if we know that our data +show a behavior similar to what would be predicted by a polynomial, +fitting our data to a polynomial of some degree would then determin +our model.

The last ingredient is a so-called cost @@ -314,12 +329,11 @@ analysis, stochastic processes etc. We will discuss the following machine learning algorithms

    -

  1. Linear regression and its variants, in essence polynomial regression
  2. -

  3. Decision tree algorithms, from simpler to more complex ones
  4. -

  5. Nearest neighbors models
  6. +

  7. Linear regression and its variants
  8. +

  9. Decision tree algorithms, from single trees to random forests
  10. Bayesian statistics and regression
  11. Support vector machines and finally various variants of
  12. -

  13. Artifical neural networks and deep learning
  14. +

  15. Artifical neural networks and deep learning, including convolutional neural networks and Bayesian neural networks
  16. Networks for unsupervised learning using for example reduced Boltzmann machines.
@@ -328,21 +342,16 @@ machine learning algorithms

Python plays nowadays a central role in the development of machine learning techniques and tools for data analysis. In particular, seen -the wealth of machine learning and data analysis packages written in +the wealth of machine learning and data analysis libraries written in Python, easy to use libraries with immediate visualization(and not the -least impressive galleries of existing example), the popularity of the +least impressive galleries of existing examples), the popularity of the Jupyter notebook framework with the possibility to run R codes or compiled programs written in C++, and much more made our choice of -programming language for this series of lectures of easy. However, -since the focus here is not only on using existing Python tools such -as scikit-learn or tensorflow, but also on developing your own +programming language for this series of lectures easy. However, +since the focus here is not only on using existing Python libraries such +as Scikit-Learn or Tensorflow, but also on developing your own algorithms and codes, we will as far as possible present many of these -algorithms eithers a Python codes or C++ codes. Finally, we will, as -far as possible keep parallel versions of the data analysis and -machine larning programming aspects in R as -well. R is a language and environment -for statistical computing and graphics which is widely used in -statistics and mathematics applications. +algorithms either as a Python codes or C++ or Fortran (or other languages) codes.

The reason we also focus on compiled languages like C++ (or @@ -351,7 +360,7 @@ utilize highly streamlined computational libraries like Lapack or other numerical libraries written in compiled languages (many of these libraries are written in Fortran). Although a project like Numba -holds great promise for speeding up the unrolling of lengthy loops, C+ +holds great promise for speeding up the unrolling of lengthy loops, C++ and Fortran are presently still the performance winners. Numba gives you potentially the power to speed up your applications with high performance functions written directly in Python. In particular, @@ -374,7 +383,7 @@ existing data files or provide code examples which produce the data to be analyzed. Most of the applications we will discuss deal with small data sets (less than a terabyte of information) and can easily be analyzed and tested on standard off the shelf laptops you find in general -grocery stores. +stores.

Data handling, machine learning and ethical aspects

@@ -382,7 +391,7 @@ grocery stores. In most of the cases we will study, we will either generate the data to analyze ourselves (both for supervised learning and unsupervised learning) or we will recur again and again to data present in say -scikit-learn or tensorflow. Many of the examples we end up +Scikit-Learn or Tensorflow. Many of the examples we end up dealing with are from a privacy and data protection point of view, rather inoccuous and boring results of numerical calculations. However, this does not hinder us from developing a sound @@ -398,7 +407,7 @@ repositories like Github, and data sets we have used, freely and easily accessible to a wider community. This helps us almost automagically in making our science reproducible. The large open-source development communities involved -in say Scikit-learn, +in say Scikit-Learn, Tensorflow, PyTorch and Keras, are all excellent examples of this. The codes can be tested and improved @@ -407,13 +416,13 @@ developing data analysis and machine learning tools. It is much easier today to gain traction and acceptance for making your science reproducible. From a societal stand, this is an important element since many of the developers are employees of large public institutions like -universities and research labs. Our taxpayer do deserve to get +universities and research labs. Our fellow taxpayers do deserve to get something back for their bucks.

However, this more mechanical aspect of the ethics of science (in particular the reproducibility of scientific results) is something -which is obvious and everybody should do as part of the dialectics of +which is obvious and everybody should do so as part of the dialectics of science. The fact that many scientists are not willing to share their codes or data is detrimental to the scientific discourse. @@ -421,11 +430,11 @@ data is detrimental to the scientific discourse. Before we proceed, we should add a disclaimer. Even though we may dream of computers developing some kind of higher learning capabilities, at the end (even if the artificial intelligence -community keeps touting our ears full of fancy futuristic avenues), it is we +community keeps touting our ears full of fancy futuristic avenues), it is we, yes you reading these lines, who end up constructing and instructing, via various algorithms, the -computers. Self-driving cars for example, rely on sofisticated +machine learning approaches. Self-driving cars for example, rely on sofisticated programs which take into account all possible situations a car can -encounter. In addition, extensive usage of training datas from GPS +encounter. In addition, extensive usage of training data from GPS information, maps etc, are typically fed into the software for self-driving cars. Adding to this various sensors and cameras that feed information to the programs, there are zillions of ethical issues @@ -436,8 +445,8 @@ For self-driving cars, where basically many of the standard machine learning algorithms discussed here enter into the codes, at a certain stage we have to make choices. Yes, we , the lads and lasses who wrote a program for a specific brand of a self-driving car. As an example, -a most carmakers have as their utmost priority the security of the -driver and the accompanying passengers. A famous carmaker, which is +all carmakers have as their utmost priority the security of the +driver and the accompanying passengers. A famous European carmaker, which is one of the leaders in the market of self-driving cars, had if statements of the following type: suppose there are two obstacles in front of you and you cannot avoid to collide with one of them. One of @@ -448,9 +457,9 @@ the likelihood of surving a collision with our future citizens, is much higher.

-This brings us leads then to serious ethical aspects. Why should we +This leads to serious ethical aspects. Why should we opt for such an option? Who decides and who is entitled to make such -choices? Keep in mind that many of the algorithms you will about in +choices? Keep in mind that many of the algorithms you will encounter in this series of lectures or hear about later, are indeed based on simple programming instructions. And you are very likely to be one of the people who may end up writing such a code. Thus, developing a @@ -463,15 +472,16 @@ not weighting some data in a particular way, perhaps because you dearly want a specific conclusion which may support your political views?

-We do not have the answers here, but we want you think over these -topics in a more overarching way. A statistical data analysis with -its dry numbers and graphs meant to guide the eye, do not necessarily +We do not have the answers here, nor will we venture into a deeper +discussions of these aspects, but we want you think over these topics +in a more overarching way. A statistical data analysis with its dry +numbers and graphs meant to guide the eye, does not necessarily reflect the truth, whatever that is. As a scientist, and after a university education, you are supposedly a better citizen, with an improved critical view and understanding of the scientific method, and -perhaps some deeper understandings of the ethics of science at +perhaps some deeper understanding of the ethics of science at large. Use these insights. Be a critical citizen. You owe it to our -societies. +society.

To do: Add references and acknowledgements diff --git a/doc/pub/Introduction/html/Introduction-solarized.html b/doc/pub/Introduction/html/Introduction-solarized.html index 8953c7afc..8de69662c 100644 --- a/doc/pub/Introduction/html/Introduction-solarized.html +++ b/doc/pub/Introduction/html/Introduction-solarized.html @@ -6,6 +6,7 @@ Automatically generated HTML file from DocOnce source + Introduction to Applied Data Analysis and Machine Learning @@ -67,20 +68,31 @@ end of tocinfo -->

[2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University

-

May 28, 2018

+

Jun 10, 2019


Introduction

-Statistics, data science and machine learning form important fields of -research in modern science. They describe how to learn and make -predictions from data, as well as allowing us to extract important -correlations about physical process and the underlying laws of motion -in large data sets. The latter, big data sets, appear frequently in -essentially all disciplines, from the traditional Science, Technology, -Mathematics and Engineering fields to Life Science, Law, education -research, the Humanities and the Social Sciences. +During the last two decades there has been a swift and amazing +development of Machine Learning techniques and algorithms that impact +many areas in not only Science and Technology but also the Humanities, +Social Sciences, Medicine, Law, indeed, almost all possible +disciplines. The applications are incredibly many, from self-driving +cars to solving high-dimensional differential equations or complicated +quantum mechanical many-body problems. Machine Learning is perceived +by many as one of the main disruptive techniques nowadays. + +

+Statistics, Data science and Machine Learning form important +fields of research in modern science. They describe how to learn and +make predictions from data, as well as allowing us to extract +important correlations about physical process and the underlying laws +of motion in large data sets. The latter, big data sets, appear +frequently in essentially all disciplines, from the traditional +Science, Technology, Mathematics and Engineering fields to Life +Science, Law, education research, the Humanities and the Social +Sciences.

It has become more @@ -146,7 +158,7 @@ of algorithms and methods we will discuss.

Learning outcomes

-These setsof lectures aim at giving you an overview of central aspects of +These sets of lectures aim at giving you an overview of central aspects of statistical data analysis as well as some of the central algorithms used in machine learning. We will introduce a variety of central algorithms and methods essential for studies of data analysis and @@ -155,17 +167,17 @@ machine learning.

Hands-on projects and experimenting with data and algorithms plays a central role in these lectures, and our hope is, through the various -projects and exercies, to expose you to fundamental +projects and exercises, to expose you to fundamental research problems in these fields, with the aim to reproduce state of the art scientific results. You will learn to develop and -structure large codes for studying these systems, get acquainted with +structure codes for studying these systems, get acquainted with computing facilities and learn to handle large scientific projects. A good scientific and ethical conduct is emphasized throughout the course. More specifically, you will

    -
  1. learn about basic data analysis, Bayesian statistics, Monte Carlo methods, data optimization and machine learning;
  2. -
  3. be capable of extending the acquired knowledge to other systems and cases;
  4. +
  5. Learn about basic data analysis, Bayesian statistics, Monte Carlo methods, data optimization and machine learning;
  6. +
  7. Be capable of extending the acquired knowledge to other systems and cases;
  8. Have an understanding of central algorithms used in data analysis and machine learning;
  9. Gain knowledge of central aspects of Monte Carlo methods, Markov chains, Gibbs samplers and their possible applications, from numerical integration to simulation of stock markets;
  10. Understand methods for regression and classification;
  11. @@ -173,16 +185,16 @@ course. More specifically, you will
  12. Work on numerical projects to illustrate the theory. The projects play a central role and you are expected to know modern programming languages like Python or C++, in addition to a basic knowledge of linear algebra (typically taught during the first one or two years of undergraduate studies).
-There are several topics we will cover here, spanning from a -statistical data analysis and its basic concepts such expectation +There are several topics we will cover here, spanning from +statistical data analysis and its basic concepts such as expectation values, variance, covariance, correlation functions and errors, via -well-known probability distribution functions like uniform +well-known probability distribution functions like the uniform distribution, the binomial distribution, the Poisson distribution and simple and multivariate normal distributions to central elements of Bayesian statistics and modeling. We will also remind the reader about central elements from linear algebra and standard methods based on -linear algebra used to fit functions such Cubic splines and gradient -methods for data optimization and the Singular-value decomposition and +linear algebra used to optimize (minimize) functions (the family of gradient descent methods) +and the Singular-value decomposition and least square methods for parameterizing data.

@@ -190,8 +202,8 @@ We will also cover Monte Carlo methods, Markov chains, well-known algorithms for sampling stochastic events like the Metropolis-Hastings and Gibbs sampling methods. An important aspect of all our calculations is a proper estimation of errors. Here we will also -discuss famous resampling techniques like the blocking, bootstrapping -and jackknife methods. +discuss famous resampling techniques like the blocking, the bootstrapping +and the jackknife methods and the infamous bias-variance tradeoff.

The second part of the material covers several algorithms used in @@ -223,8 +235,12 @@ desired output of a system. Some of the most common tasks are: The methods we cover have three main topics in common, irrespective of whether we deal with supervised or unsupervised learning. The first ingredient is normally our data set (which can be subdivided into -training and test data), the second item is a model which is normally a -function of some parameters. The model reflects our knowledge of the system (or lack thereof). As an example, if we know that our data show a behavior similar to what would be predicted by a polynomial, fitting our data to a polynomial of some degree would then determin our model. +training and test data), the second item is a model which is normally +a function of some parameters. The model reflects our knowledge of +the system (or lack thereof). As an example, if we know that our data +show a behavior similar to what would be predicted by a polynomial, +fitting our data to a polynomial of some degree would then determin +our model.

The last ingredient is a so-called cost @@ -238,12 +254,11 @@ analysis, stochastic processes etc. We will discuss the following machine learning algorithms

    -
  1. Linear regression and its variants, in essence polynomial regression
  2. -
  3. Decision tree algorithms, from simpler to more complex ones
  4. -
  5. Nearest neighbors models
  6. +
  7. Linear regression and its variants
  8. +
  9. Decision tree algorithms, from single trees to random forests
  10. Bayesian statistics and regression
  11. Support vector machines and finally various variants of
  12. -
  13. Artifical neural networks and deep learning
  14. +
  15. Artifical neural networks and deep learning, including convolutional neural networks and Bayesian neural networks
  16. Networks for unsupervised learning using for example reduced Boltzmann machines.
@@ -252,21 +267,16 @@ machine learning algorithms

Python plays nowadays a central role in the development of machine learning techniques and tools for data analysis. In particular, seen -the wealth of machine learning and data analysis packages written in +the wealth of machine learning and data analysis libraries written in Python, easy to use libraries with immediate visualization(and not the -least impressive galleries of existing example), the popularity of the +least impressive galleries of existing examples), the popularity of the Jupyter notebook framework with the possibility to run R codes or compiled programs written in C++, and much more made our choice of -programming language for this series of lectures of easy. However, -since the focus here is not only on using existing Python tools such -as scikit-learn or tensorflow, but also on developing your own +programming language for this series of lectures easy. However, +since the focus here is not only on using existing Python libraries such +as Scikit-Learn or Tensorflow, but also on developing your own algorithms and codes, we will as far as possible present many of these -algorithms eithers a Python codes or C++ codes. Finally, we will, as -far as possible keep parallel versions of the data analysis and -machine larning programming aspects in R as -well. R is a language and environment -for statistical computing and graphics which is widely used in -statistics and mathematics applications. +algorithms either as a Python codes or C++ or Fortran (or other languages) codes.

The reason we also focus on compiled languages like C++ (or @@ -275,7 +285,7 @@ utilize highly streamlined computational libraries like Lapack or other numerical libraries written in compiled languages (many of these libraries are written in Fortran). Although a project like Numba -holds great promise for speeding up the unrolling of lengthy loops, C+ +holds great promise for speeding up the unrolling of lengthy loops, C++ and Fortran are presently still the performance winners. Numba gives you potentially the power to speed up your applications with high performance functions written directly in Python. In particular, @@ -298,7 +308,7 @@ existing data files or provide code examples which produce the data to be analyzed. Most of the applications we will discuss deal with small data sets (less than a terabyte of information) and can easily be analyzed and tested on standard off the shelf laptops you find in general -grocery stores. +stores.

Data handling, machine learning and ethical aspects

@@ -306,7 +316,7 @@ grocery stores. In most of the cases we will study, we will either generate the data to analyze ourselves (both for supervised learning and unsupervised learning) or we will recur again and again to data present in say -scikit-learn or tensorflow. Many of the examples we end up +Scikit-Learn or Tensorflow. Many of the examples we end up dealing with are from a privacy and data protection point of view, rather inoccuous and boring results of numerical calculations. However, this does not hinder us from developing a sound @@ -322,7 +332,7 @@ repositories like Github, and data sets we have used, freely and easily accessible to a wider community. This helps us almost automagically in making our science reproducible. The large open-source development communities involved -in say Scikit-learn, +in say Scikit-Learn, Tensorflow, PyTorch and Keras, are all excellent examples of this. The codes can be tested and improved @@ -331,13 +341,13 @@ developing data analysis and machine learning tools. It is much easier today to gain traction and acceptance for making your science reproducible. From a societal stand, this is an important element since many of the developers are employees of large public institutions like -universities and research labs. Our taxpayer do deserve to get +universities and research labs. Our fellow taxpayers do deserve to get something back for their bucks.

However, this more mechanical aspect of the ethics of science (in particular the reproducibility of scientific results) is something -which is obvious and everybody should do as part of the dialectics of +which is obvious and everybody should do so as part of the dialectics of science. The fact that many scientists are not willing to share their codes or data is detrimental to the scientific discourse. @@ -345,11 +355,11 @@ data is detrimental to the scientific discourse. Before we proceed, we should add a disclaimer. Even though we may dream of computers developing some kind of higher learning capabilities, at the end (even if the artificial intelligence -community keeps touting our ears full of fancy futuristic avenues), it is we +community keeps touting our ears full of fancy futuristic avenues), it is we, yes you reading these lines, who end up constructing and instructing, via various algorithms, the -computers. Self-driving cars for example, rely on sofisticated +machine learning approaches. Self-driving cars for example, rely on sofisticated programs which take into account all possible situations a car can -encounter. In addition, extensive usage of training datas from GPS +encounter. In addition, extensive usage of training data from GPS information, maps etc, are typically fed into the software for self-driving cars. Adding to this various sensors and cameras that feed information to the programs, there are zillions of ethical issues @@ -360,8 +370,8 @@ For self-driving cars, where basically many of the standard machine learning algorithms discussed here enter into the codes, at a certain stage we have to make choices. Yes, we , the lads and lasses who wrote a program for a specific brand of a self-driving car. As an example, -a most carmakers have as their utmost priority the security of the -driver and the accompanying passengers. A famous carmaker, which is +all carmakers have as their utmost priority the security of the +driver and the accompanying passengers. A famous European carmaker, which is one of the leaders in the market of self-driving cars, had if statements of the following type: suppose there are two obstacles in front of you and you cannot avoid to collide with one of them. One of @@ -372,9 +382,9 @@ the likelihood of surving a collision with our future citizens, is much higher.

-This brings us leads then to serious ethical aspects. Why should we +This leads to serious ethical aspects. Why should we opt for such an option? Who decides and who is entitled to make such -choices? Keep in mind that many of the algorithms you will about in +choices? Keep in mind that many of the algorithms you will encounter in this series of lectures or hear about later, are indeed based on simple programming instructions. And you are very likely to be one of the people who may end up writing such a code. Thus, developing a @@ -387,15 +397,16 @@ not weighting some data in a particular way, perhaps because you dearly want a specific conclusion which may support your political views?

-We do not have the answers here, but we want you think over these -topics in a more overarching way. A statistical data analysis with -its dry numbers and graphs meant to guide the eye, do not necessarily +We do not have the answers here, nor will we venture into a deeper +discussions of these aspects, but we want you think over these topics +in a more overarching way. A statistical data analysis with its dry +numbers and graphs meant to guide the eye, does not necessarily reflect the truth, whatever that is. As a scientist, and after a university education, you are supposedly a better citizen, with an improved critical view and understanding of the scientific method, and -perhaps some deeper understandings of the ethics of science at +perhaps some deeper understanding of the ethics of science at large. Use these insights. Be a critical citizen. You owe it to our -societies. +society.

To do: Add references and acknowledgements @@ -404,7 +415,7 @@ To do: Add references and acknowledgements

- © 1999-2018, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license + © 1999-2019, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license
diff --git a/doc/pub/Introduction/html/Introduction.html b/doc/pub/Introduction/html/Introduction.html index 478112798..089cf025b 100644 --- a/doc/pub/Introduction/html/Introduction.html +++ b/doc/pub/Introduction/html/Introduction.html @@ -6,6 +6,7 @@ Automatically generated HTML file from DocOnce source + Introduction to Applied Data Analysis and Machine Learning @@ -72,20 +73,31 @@ end of tocinfo -->
[2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University

-

May 28, 2018

+

Jun 10, 2019


Introduction

-Statistics, data science and machine learning form important fields of -research in modern science. They describe how to learn and make -predictions from data, as well as allowing us to extract important -correlations about physical process and the underlying laws of motion -in large data sets. The latter, big data sets, appear frequently in -essentially all disciplines, from the traditional Science, Technology, -Mathematics and Engineering fields to Life Science, Law, education -research, the Humanities and the Social Sciences. +During the last two decades there has been a swift and amazing +development of Machine Learning techniques and algorithms that impact +many areas in not only Science and Technology but also the Humanities, +Social Sciences, Medicine, Law, indeed, almost all possible +disciplines. The applications are incredibly many, from self-driving +cars to solving high-dimensional differential equations or complicated +quantum mechanical many-body problems. Machine Learning is perceived +by many as one of the main disruptive techniques nowadays. + +

+Statistics, Data science and Machine Learning form important +fields of research in modern science. They describe how to learn and +make predictions from data, as well as allowing us to extract +important correlations about physical process and the underlying laws +of motion in large data sets. The latter, big data sets, appear +frequently in essentially all disciplines, from the traditional +Science, Technology, Mathematics and Engineering fields to Life +Science, Law, education research, the Humanities and the Social +Sciences.

It has become more @@ -151,7 +163,7 @@ of algorithms and methods we will discuss.

Learning outcomes

-These setsof lectures aim at giving you an overview of central aspects of +These sets of lectures aim at giving you an overview of central aspects of statistical data analysis as well as some of the central algorithms used in machine learning. We will introduce a variety of central algorithms and methods essential for studies of data analysis and @@ -160,17 +172,17 @@ machine learning.

Hands-on projects and experimenting with data and algorithms plays a central role in these lectures, and our hope is, through the various -projects and exercies, to expose you to fundamental +projects and exercises, to expose you to fundamental research problems in these fields, with the aim to reproduce state of the art scientific results. You will learn to develop and -structure large codes for studying these systems, get acquainted with +structure codes for studying these systems, get acquainted with computing facilities and learn to handle large scientific projects. A good scientific and ethical conduct is emphasized throughout the course. More specifically, you will

    -
  1. learn about basic data analysis, Bayesian statistics, Monte Carlo methods, data optimization and machine learning;
  2. -
  3. be capable of extending the acquired knowledge to other systems and cases;
  4. +
  5. Learn about basic data analysis, Bayesian statistics, Monte Carlo methods, data optimization and machine learning;
  6. +
  7. Be capable of extending the acquired knowledge to other systems and cases;
  8. Have an understanding of central algorithms used in data analysis and machine learning;
  9. Gain knowledge of central aspects of Monte Carlo methods, Markov chains, Gibbs samplers and their possible applications, from numerical integration to simulation of stock markets;
  10. Understand methods for regression and classification;
  11. @@ -178,16 +190,16 @@ course. More specifically, you will
  12. Work on numerical projects to illustrate the theory. The projects play a central role and you are expected to know modern programming languages like Python or C++, in addition to a basic knowledge of linear algebra (typically taught during the first one or two years of undergraduate studies).
-There are several topics we will cover here, spanning from a -statistical data analysis and its basic concepts such expectation +There are several topics we will cover here, spanning from +statistical data analysis and its basic concepts such as expectation values, variance, covariance, correlation functions and errors, via -well-known probability distribution functions like uniform +well-known probability distribution functions like the uniform distribution, the binomial distribution, the Poisson distribution and simple and multivariate normal distributions to central elements of Bayesian statistics and modeling. We will also remind the reader about central elements from linear algebra and standard methods based on -linear algebra used to fit functions such Cubic splines and gradient -methods for data optimization and the Singular-value decomposition and +linear algebra used to optimize (minimize) functions (the family of gradient descent methods) +and the Singular-value decomposition and least square methods for parameterizing data.

@@ -195,8 +207,8 @@ We will also cover Monte Carlo methods, Markov chains, well-known algorithms for sampling stochastic events like the Metropolis-Hastings and Gibbs sampling methods. An important aspect of all our calculations is a proper estimation of errors. Here we will also -discuss famous resampling techniques like the blocking, bootstrapping -and jackknife methods. +discuss famous resampling techniques like the blocking, the bootstrapping +and the jackknife methods and the infamous bias-variance tradeoff.

The second part of the material covers several algorithms used in @@ -228,8 +240,12 @@ desired output of a system. Some of the most common tasks are: The methods we cover have three main topics in common, irrespective of whether we deal with supervised or unsupervised learning. The first ingredient is normally our data set (which can be subdivided into -training and test data), the second item is a model which is normally a -function of some parameters. The model reflects our knowledge of the system (or lack thereof). As an example, if we know that our data show a behavior similar to what would be predicted by a polynomial, fitting our data to a polynomial of some degree would then determin our model. +training and test data), the second item is a model which is normally +a function of some parameters. The model reflects our knowledge of +the system (or lack thereof). As an example, if we know that our data +show a behavior similar to what would be predicted by a polynomial, +fitting our data to a polynomial of some degree would then determin +our model.

The last ingredient is a so-called cost @@ -243,12 +259,11 @@ analysis, stochastic processes etc. We will discuss the following machine learning algorithms

    -
  1. Linear regression and its variants, in essence polynomial regression
  2. -
  3. Decision tree algorithms, from simpler to more complex ones
  4. -
  5. Nearest neighbors models
  6. +
  7. Linear regression and its variants
  8. +
  9. Decision tree algorithms, from single trees to random forests
  10. Bayesian statistics and regression
  11. Support vector machines and finally various variants of
  12. -
  13. Artifical neural networks and deep learning
  14. +
  15. Artifical neural networks and deep learning, including convolutional neural networks and Bayesian neural networks
  16. Networks for unsupervised learning using for example reduced Boltzmann machines.
@@ -257,21 +272,16 @@ machine learning algorithms

Python plays nowadays a central role in the development of machine learning techniques and tools for data analysis. In particular, seen -the wealth of machine learning and data analysis packages written in +the wealth of machine learning and data analysis libraries written in Python, easy to use libraries with immediate visualization(and not the -least impressive galleries of existing example), the popularity of the +least impressive galleries of existing examples), the popularity of the Jupyter notebook framework with the possibility to run R codes or compiled programs written in C++, and much more made our choice of -programming language for this series of lectures of easy. However, -since the focus here is not only on using existing Python tools such -as scikit-learn or tensorflow, but also on developing your own +programming language for this series of lectures easy. However, +since the focus here is not only on using existing Python libraries such +as Scikit-Learn or Tensorflow, but also on developing your own algorithms and codes, we will as far as possible present many of these -algorithms eithers a Python codes or C++ codes. Finally, we will, as -far as possible keep parallel versions of the data analysis and -machine larning programming aspects in R as -well. R is a language and environment -for statistical computing and graphics which is widely used in -statistics and mathematics applications. +algorithms either as a Python codes or C++ or Fortran (or other languages) codes.

The reason we also focus on compiled languages like C++ (or @@ -280,7 +290,7 @@ utilize highly streamlined computational libraries like Lapack or other numerical libraries written in compiled languages (many of these libraries are written in Fortran). Although a project like Numba -holds great promise for speeding up the unrolling of lengthy loops, C+ +holds great promise for speeding up the unrolling of lengthy loops, C++ and Fortran are presently still the performance winners. Numba gives you potentially the power to speed up your applications with high performance functions written directly in Python. In particular, @@ -303,7 +313,7 @@ existing data files or provide code examples which produce the data to be analyzed. Most of the applications we will discuss deal with small data sets (less than a terabyte of information) and can easily be analyzed and tested on standard off the shelf laptops you find in general -grocery stores. +stores.

Data handling, machine learning and ethical aspects

@@ -311,7 +321,7 @@ grocery stores. In most of the cases we will study, we will either generate the data to analyze ourselves (both for supervised learning and unsupervised learning) or we will recur again and again to data present in say -scikit-learn or tensorflow. Many of the examples we end up +Scikit-Learn or Tensorflow. Many of the examples we end up dealing with are from a privacy and data protection point of view, rather inoccuous and boring results of numerical calculations. However, this does not hinder us from developing a sound @@ -327,7 +337,7 @@ repositories like Github, and data sets we have used, freely and easily accessible to a wider community. This helps us almost automagically in making our science reproducible. The large open-source development communities involved -in say Scikit-learn, +in say Scikit-Learn, Tensorflow, PyTorch and Keras, are all excellent examples of this. The codes can be tested and improved @@ -336,13 +346,13 @@ developing data analysis and machine learning tools. It is much easier today to gain traction and acceptance for making your science reproducible. From a societal stand, this is an important element since many of the developers are employees of large public institutions like -universities and research labs. Our taxpayer do deserve to get +universities and research labs. Our fellow taxpayers do deserve to get something back for their bucks.

However, this more mechanical aspect of the ethics of science (in particular the reproducibility of scientific results) is something -which is obvious and everybody should do as part of the dialectics of +which is obvious and everybody should do so as part of the dialectics of science. The fact that many scientists are not willing to share their codes or data is detrimental to the scientific discourse. @@ -350,11 +360,11 @@ data is detrimental to the scientific discourse. Before we proceed, we should add a disclaimer. Even though we may dream of computers developing some kind of higher learning capabilities, at the end (even if the artificial intelligence -community keeps touting our ears full of fancy futuristic avenues), it is we +community keeps touting our ears full of fancy futuristic avenues), it is we, yes you reading these lines, who end up constructing and instructing, via various algorithms, the -computers. Self-driving cars for example, rely on sofisticated +machine learning approaches. Self-driving cars for example, rely on sofisticated programs which take into account all possible situations a car can -encounter. In addition, extensive usage of training datas from GPS +encounter. In addition, extensive usage of training data from GPS information, maps etc, are typically fed into the software for self-driving cars. Adding to this various sensors and cameras that feed information to the programs, there are zillions of ethical issues @@ -365,8 +375,8 @@ For self-driving cars, where basically many of the standard machine learning algorithms discussed here enter into the codes, at a certain stage we have to make choices. Yes, we , the lads and lasses who wrote a program for a specific brand of a self-driving car. As an example, -a most carmakers have as their utmost priority the security of the -driver and the accompanying passengers. A famous carmaker, which is +all carmakers have as their utmost priority the security of the +driver and the accompanying passengers. A famous European carmaker, which is one of the leaders in the market of self-driving cars, had if statements of the following type: suppose there are two obstacles in front of you and you cannot avoid to collide with one of them. One of @@ -377,9 +387,9 @@ the likelihood of surving a collision with our future citizens, is much higher.

-This brings us leads then to serious ethical aspects. Why should we +This leads to serious ethical aspects. Why should we opt for such an option? Who decides and who is entitled to make such -choices? Keep in mind that many of the algorithms you will about in +choices? Keep in mind that many of the algorithms you will encounter in this series of lectures or hear about later, are indeed based on simple programming instructions. And you are very likely to be one of the people who may end up writing such a code. Thus, developing a @@ -392,15 +402,16 @@ not weighting some data in a particular way, perhaps because you dearly want a specific conclusion which may support your political views?

-We do not have the answers here, but we want you think over these -topics in a more overarching way. A statistical data analysis with -its dry numbers and graphs meant to guide the eye, do not necessarily +We do not have the answers here, nor will we venture into a deeper +discussions of these aspects, but we want you think over these topics +in a more overarching way. A statistical data analysis with its dry +numbers and graphs meant to guide the eye, does not necessarily reflect the truth, whatever that is. As a scientist, and after a university education, you are supposedly a better citizen, with an improved critical view and understanding of the scientific method, and -perhaps some deeper understandings of the ethics of science at +perhaps some deeper understanding of the ethics of science at large. Use these insights. Be a critical citizen. You owe it to our -societies. +society.

To do: Add references and acknowledgements @@ -409,7 +420,7 @@ To do: Add references and acknowledgements

- © 1999-2018, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license + © 1999-2019, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license
diff --git a/doc/pub/Introduction/html/reveal.js/.gitignore b/doc/pub/Introduction/html/reveal.js/.gitignore index e7b4f216a..a5df3133d 100644 --- a/doc/pub/Introduction/html/reveal.js/.gitignore +++ b/doc/pub/Introduction/html/reveal.js/.gitignore @@ -1,8 +1,3 @@ -.idea/ -*.iml -*.iws -*.eml -out/ .DS_Store .svn log/*.log @@ -10,4 +5,4 @@ tmp/** node_modules/ .sass-cache css/reveal.min.css -js/reveal.min.js \ No newline at end of file +js/reveal.min.js diff --git a/doc/pub/Introduction/html/reveal.js/.travis.yml b/doc/pub/Introduction/html/reveal.js/.travis.yml index ec3b27d5d..165d9ae9f 100644 --- a/doc/pub/Introduction/html/reveal.js/.travis.yml +++ b/doc/pub/Introduction/html/reveal.js/.travis.yml @@ -1,7 +1,5 @@ language: node_js node_js: - - 4 + - 0.10 before_script: - - npm install -g grunt-cli -after_script: - - grunt retire + - npm install -g grunt-cli \ No newline at end of file diff --git a/doc/pub/Introduction/html/reveal.js/LICENSE b/doc/pub/Introduction/html/reveal.js/LICENSE index c3e6e5fd6..09623076f 100644 --- a/doc/pub/Introduction/html/reveal.js/LICENSE +++ b/doc/pub/Introduction/html/reveal.js/LICENSE @@ -1,4 +1,4 @@ -Copyright (C) 2017 Hakim El Hattab, http://hakim.se, and reveal.js contributors +Copyright (C) 2015 Hakim El Hattab, http://hakim.se Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/doc/pub/Introduction/html/reveal.js/README.md b/doc/pub/Introduction/html/reveal.js/README.md index f2ab6ca88..573b19597 100644 --- a/doc/pub/Introduction/html/reveal.js/README.md +++ b/doc/pub/Introduction/html/reveal.js/README.md @@ -1,58 +1,12 @@ -# reveal.js [![Build Status](https://travis-ci.org/hakimel/reveal.js.svg?branch=master)](https://travis-ci.org/hakimel/reveal.js) Slides +# reveal.js [![Build Status](https://travis-ci.org/hakimel/reveal.js.svg?branch=master)](https://travis-ci.org/hakimel/reveal.js) -A framework for easily creating beautiful presentations using HTML. [Check out the live demo](http://revealjs.com/). +A framework for easily creating beautiful presentations using HTML. [Check out the live demo](http://lab.hakim.se/reveal-js/). -reveal.js comes with a broad range of features including [nested slides](https://github.com/hakimel/reveal.js#markup), [Markdown contents](https://github.com/hakimel/reveal.js#markdown), [PDF export](https://github.com/hakimel/reveal.js#pdf-export), [speaker notes](https://github.com/hakimel/reveal.js#speaker-notes) and a [JavaScript API](https://github.com/hakimel/reveal.js#api). There's also a fully featured visual editor and platform for sharing reveal.js presentations at [slides.com](https://slides.com?ref=github). +reveal.js comes with a broad range of features including [nested slides](https://github.com/hakimel/reveal.js#markup), [Markdown contents](https://github.com/hakimel/reveal.js#markdown), [PDF export](https://github.com/hakimel/reveal.js#pdf-export), [speaker notes](https://github.com/hakimel/reveal.js#speaker-notes) and a [JavaScript API](https://github.com/hakimel/reveal.js#api). It's best viewed in a modern browser but [fallbacks](https://github.com/hakimel/reveal.js/wiki/Browser-Support) are available to make sure your presentation can still be viewed elsewhere. -## Table of contents -- [Online Editor](#online-editor) -- [Instructions](#instructions) - - [Markup](#markup) - - [Markdown](#markdown) - - [Element Attributes](#element-attributes) - - [Slide Attributes](#slide-attributes) -- [Configuration](#configuration) -- [Presentation Size](#presentation-size) -- [Dependencies](#dependencies) -- [Ready Event](#ready-event) -- [Auto-sliding](#auto-sliding) -- [Keyboard Bindings](#keyboard-bindings) -- [Touch Navigation](#touch-navigation) -- [Lazy Loading](#lazy-loading) -- [API](#api) - - [Slide Changed Event](#slide-changed-event) - - [Presentation State](#presentation-state) - - [Slide States](#slide-states) - - [Slide Backgrounds](#slide-backgrounds) - - [Parallax Background](#parallax-background) - - [Slide Transitions](#slide-transitions) - - [Internal links](#internal-links) - - [Fragments](#fragments) - - [Fragment events](#fragment-events) - - [Code syntax highlighting](#code-syntax-highlighting) - - [Slide number](#slide-number) - - [Overview mode](#overview-mode) - - [Fullscreen mode](#fullscreen-mode) - - [Embedded media](#embedded-media) - - [Stretching elements](#stretching-elements) - - [postMessage API](#postmessage-api) -- [PDF Export](#pdf-export) -- [Theming](#theming) -- [Speaker Notes](#speaker-notes) - - [Share and Print Speaker Notes](#share-and-print-speaker-notes) - - [Server Side Speaker Notes](#server-side-speaker-notes) -- [Multiplexing](#multiplexing) - - [Master presentation](#master-presentation) - - [Client presentation](#client-presentation) - - [Socket.io server](#socketio-server) -- [MathJax](#mathjax) -- [Installation](#installation) - - [Basic setup](#basic-setup) - - [Full setup](#full-setup) - - [Folder Structure](#folder-structure) -- [License](#license) -#### More reading +#### More reading: +- [Installation](#installation): Step-by-step instructions for getting reveal.js running on your computer. - [Changelog](https://github.com/hakimel/reveal.js/releases): Up-to-date version history. - [Examples](https://github.com/hakimel/reveal.js/wiki/Example-Presentations): Presentations created with reveal.js, add your own! - [Browser Support](https://github.com/hakimel/reveal.js/wiki/Browser-Support): Explanation of browser support and fallbacks. @@ -60,36 +14,14 @@ reveal.js comes with a broad range of features including [nested slides](https:/ ## Online Editor -Presentations are written using HTML or Markdown but there's also an online editor for those of you who prefer a graphical interface. Give it a try at [https://slides.com](https://slides.com?ref=github). +Presentations are written using HTML or Markdown but there's also an online editor for those of you who prefer a graphical interface. Give it a try at [http://slides.com](http://slides.com). ## Instructions ### Markup -Here's a barebones example of a fully working reveal.js presentation: -```html - - - - - - -
-
-
Slide 1
-
Slide 2
-
-
- - - - -``` - -The presentation markup hierarchy needs to be `.reveal > .slides > section` where the `section` represents one slide and can be repeated indefinitely. If you place multiple `section` elements inside of another `section` they will be shown as vertical slides. The first of the vertical slides is the "root" of the others (at the top), and will be included in the horizontal sequence. For example: +Markup hierarchy needs to be ``
`` where the ``
`` represents one slide and can be repeated indefinitely. If you place multiple ``
``'s inside of another ``
`` they will be shown as vertical slides. The first of the vertical slides is the "root" of the others (at the top), and it will be included in the horizontal sequence. For example: ```html
@@ -105,36 +37,32 @@ The presentation markup hierarchy needs to be `.reveal > .slides > section` wher ### Markdown -It's possible to write your slides using Markdown. To enable Markdown, add the `data-markdown` attribute to your `
` elements and wrap the contents in a ` +
``` #### External Markdown -You can write your content as a separate file and have reveal.js load it at runtime. Note the separator arguments which determine how slides are delimited in the external file: the `data-separator` attribute defines a regular expression for horizontal slides (defaults to `^\r?\n---\r?\n$`, a newline-bounded horizontal rule) and `data-separator-vertical` defines vertical slides (disabled by default). The `data-separator-notes` attribute is a regular expression for specifying the beginning of the current slide's speaker notes (defaults to `note:`). The `data-charset` attribute is optional and specifies which charset to use when loading the external file. +You can write your content as a separate file and have reveal.js load it at runtime. Note the separator arguments which determine how slides are delimited in the external file. The ```data-charset``` attribute is optional and specifies which charset to use when loading the external file. -When used locally, this feature requires that reveal.js [runs from a local web server](#full-setup). The following example customises all available options: +When used locally, this feature requires that reveal.js [runs from a local web server](#full-setup). ```html -
-
``` @@ -164,19 +92,6 @@ Special syntax (in html comment) is available for adding attributes to the slide
``` -#### Configuring *marked* - -We use [marked](https://github.com/chjj/marked) to parse Markdown. To customise marked's rendering, you can pass in options when [configuring Reveal](#configuration): - -```javascript -Reveal.initialize({ - // Options which are passed into marked - // See https://github.com/chjj/marked#options-1 - markdown: { - smartypants: true - } -}); -``` ### Configuration @@ -185,26 +100,12 @@ At the end of your page you need to initialize reveal by running the following c ```javascript Reveal.initialize({ - // Display presentation control arrows + // Display controls in the bottom right corner controls: true, - // Help the user learn the controls by providing hints, for example by - // bouncing the down arrow when they first encounter a vertical slide - controlsTutorial: true, - - // Determines where controls appear, "edges" or "bottom-right" - controlsLayout: 'bottom-right', - - // Visibility rule for backwards navigation arrows; "faded", "hidden" - // or "visible" - controlsBackArrows: 'faded', - // Display a presentation progress bar progress: true, - // Set default timing of 2 minutes per slide - defaultTiming: 120, - // Display the page number of the current slide slideNumber: false, @@ -229,9 +130,6 @@ Reveal.initialize({ // Change the presentation direction to be RTL rtl: false, - // Randomizes the order of slides each time the presentation loads - shuffle: false, - // Turns fragments on and off globally fragments: true, @@ -243,15 +141,6 @@ Reveal.initialize({ // key is pressed help: true, - // Flags if speaker notes should be visible to all viewers - showNotes: false, - - // Global override for autoplaying embedded media (video/audio/iframe) - // - null: Media will only autoplay if data-autoplay is present - // - true: All media will autoplay, regardless of individual setting - // - false: No media will autoplay, regardless of individual setting - autoPlayMedia: null, - // Number of milliseconds between automatically proceeding to the // next slide, disabled when set to 0, this value can be overwritten // by using a data-autoslide attribute on your slides @@ -260,9 +149,6 @@ Reveal.initialize({ // Stop auto-sliding after user input autoSlideStoppable: true, - // Use this method for navigation when auto-sliding - autoSlideMethod: Reveal.navigateNext, - // Enable slide navigation via mouse wheel mouseWheel: false, @@ -270,18 +156,16 @@ Reveal.initialize({ hideAddressBar: true, // Opens links in an iframe preview overlay - // Add `data-preview-link` and `data-preview-link="false"` to customise each link - // individually previewLinks: false, // Transition style - transition: 'slide', // none/fade/slide/convex/concave/zoom + transition: 'default', // none/fade/slide/convex/concave/zoom // Transition speed transitionSpeed: 'default', // default/fast/slow // Transition style for full page slide backgrounds - backgroundTransition: 'fade', // none/fade/slide/convex/concave/zoom + backgroundTransition: 'default', // none/fade/slide/convex/concave/zoom // Number of slides away from the current that are visible viewDistance: 3, @@ -292,14 +176,10 @@ Reveal.initialize({ // Parallax background size parallaxBackgroundSize: '', // CSS syntax, e.g. "2100px 900px" - // Number of pixels to move the parallax background per slide - // - Calculated automatically unless specified - // - Set to 0 to disable movement along an axis - parallaxBackgroundHorizontal: null, - parallaxBackgroundVertical: null, - - // The display mode that will be used to show slides - display: 'block' + // Amount to move parallax background (horizontal and vertical) on slide change + // Number, e.g. 100 + parallaxBackgroundHorizontal: '', + parallaxBackgroundVertical: '' }); ``` @@ -316,6 +196,56 @@ Reveal.configure({ autoSlide: 5000 }); ``` +### Dependencies + +Reveal.js doesn't _rely_ on any third party scripts to work but a few optional libraries are included by default. These libraries are loaded as dependencies in the order they appear, for example: + +```javascript +Reveal.initialize({ + dependencies: [ + // Cross-browser shim that fully implements classList - https://github.com/eligrey/classList.js/ + { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } }, + + // Interpret Markdown in
elements + { src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, + { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, + + // Syntax highlight for elements + { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }, + + // Zoom in and out with Alt+click + { src: 'plugin/zoom-js/zoom.js', async: true }, + + // Speaker notes + { src: 'plugin/notes/notes.js', async: true }, + + // Remote control your reveal.js presentation using a touch device + { src: 'plugin/remotes/remotes.js', async: true }, + + // MathJax + { src: 'plugin/math/math.js', async: true } + ] +}); +``` + +You can add your own extensions using the same syntax. The following properties are available for each dependency object: +- **src**: Path to the script to load +- **async**: [optional] Flags if the script should load after reveal.js has started, defaults to false +- **callback**: [optional] Function to execute when the script has loaded +- **condition**: [optional] Function which must return true for the script to be loaded + + +### Ready Event + +A 'ready' event is fired when reveal.js has loaded all non-async dependencies and is ready to start navigating. To check if reveal.js is already 'ready' you can call `Reveal.isReady()`. + +```javascript +Reveal.addEventListener( 'ready', function( event ) { + // event.currentSlide, event.indexh, event.indexv +} ); +``` + + ### Presentation Size All presentations have a normal size, that is the resolution at which they are authored. The framework will automatically scale presentations uniformly based on this size to ensure that everything fits on any given display or viewport. @@ -343,69 +273,6 @@ Reveal.initialize({ }); ``` -If you wish to disable this behavior and do your own scaling (e.g. using media queries), try these settings: - -```javascript -Reveal.initialize({ - - ... - - width: "100%", - height: "100%", - margin: 0, - minScale: 1, - maxScale: 1 -}); -``` - -### Dependencies - -Reveal.js doesn't _rely_ on any third party scripts to work but a few optional libraries are included by default. These libraries are loaded as dependencies in the order they appear, for example: - -```javascript -Reveal.initialize({ - dependencies: [ - // Cross-browser shim that fully implements classList - https://github.com/eligrey/classList.js/ - { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } }, - - // Interpret Markdown in
elements - { src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, - { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, - - // Syntax highlight for elements - { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }, - - // Zoom in and out with Alt+click - { src: 'plugin/zoom-js/zoom.js', async: true }, - - // Speaker notes - { src: 'plugin/notes/notes.js', async: true }, - - // MathJax - { src: 'plugin/math/math.js', async: true } - ] -}); -``` - -You can add your own extensions using the same syntax. The following properties are available for each dependency object: -- **src**: Path to the script to load -- **async**: [optional] Flags if the script should load after reveal.js has started, defaults to false -- **callback**: [optional] Function to execute when the script has loaded -- **condition**: [optional] Function which must return true for the script to be loaded - -To load these dependencies, reveal.js requires [head.js](http://headjs.com/) *(a script loading library)* to be loaded before reveal.js. - -### Ready Event - -A 'ready' event is fired when reveal.js has loaded all non-async dependencies and is ready to start navigating. To check if reveal.js is already 'ready' you can call `Reveal.isReady()`. - -```javascript -Reveal.addEventListener( 'ready', function( event ) { - // event.currentSlide, event.indexh, event.indexv -} ); -``` - -Note that we also add a `.ready` class to the `.reveal` element so that you can hook into this with CSS. ### Auto-sliding @@ -429,8 +296,6 @@ You can also override the slide duration for individual slides and fragments by
``` -To override the method used for navigation when auto-sliding, you can specify the ```autoSlideMethod``` setting. To only navigate along the top layer and ignore vertical slides, set this to ```Reveal.navigateRight```. - Whenever the auto-slide mode is resumed or paused the ```autoslideresumed``` and ```autoslidepaused``` events are fired. @@ -448,13 +313,6 @@ Reveal.configure({ }); ``` -### Touch Navigation - -You can swipe to navigate through a presentation on any touch-enabled device. Horizontal swipes change between horizontal slides, vertical swipes change between vertical slides. If you wish to disable this you can set the `touch` config option to false when initializing reveal.js. - -If there's some part of your content that needs to remain accessible to touch events you'll need to highlight this by adding a `data-prevent-swipe` attribute to the element. One common example where this is useful is elements that need to be scrolled. - - ### Lazy Loading When working on presentation with a lot of media or iframe content it's important to load lazily. Lazy loading means that reveal.js will only load content for the few slides nearest to the current slide. The number of slides that are preloaded is determined by the `viewDistance` configuration option. @@ -489,18 +347,11 @@ Reveal.next(); Reveal.prevFragment(); Reveal.nextFragment(); -// Randomize the order of slides -Reveal.shuffle(); - // Toggle presentation states, optionally pass true/false to force on/off Reveal.toggleOverview(); Reveal.togglePause(); Reveal.toggleAutoSlide(); -// Shows a help overlay with keyboard shortcuts, optionally pass true/false -// to force on/off -Reveal.toggleHelp(); - // Change a config value at runtime Reveal.configure({ controls: true }); @@ -514,14 +365,9 @@ Reveal.getScale(); Reveal.getPreviousSlide(); Reveal.getCurrentSlide(); -Reveal.getIndices(); // { h: 0, v: 0 } } -Reveal.getPastSlideCount(); -Reveal.getProgress(); // (0 == first slide, 1 == last slide) -Reveal.getSlides(); // Array of all slides -Reveal.getTotalSlides(); // total number of slides - -// Returns the speaker notes for the current slide -Reveal.getSlideNotes(); +Reveal.getIndices(); // { h: 0, v: 0 } } +Reveal.getProgress(); // 0-1 +Reveal.getTotalSlides(); // State checks Reveal.isFirstSlide(); @@ -574,59 +420,26 @@ Reveal.addEventListener( 'somestate', function() { ### Slide Backgrounds -Slides are contained within a limited portion of the screen by default to allow them to fit any display and scale uniformly. You can apply full page backgrounds outside of the slide area by adding a ```data-background``` attribute to your ```
``` elements. Four different types of backgrounds are supported: color, image, video and iframe. +Slides are contained within a limited portion of the screen by default to allow them to fit any display and scale uniformly. You can apply full page backgrounds outside of the slide area by adding a ```data-background``` attribute to your ```
``` elements. Four different types of backgrounds are supported: color, image, video and iframe. Below are a few examples. -#### Color Backgrounds -All CSS color formats are supported, like rgba() or hsl(). ```html -
-

Color

+
+

All CSS color formats are supported, like rgba() or hsl().

+
+
+

This slide will have a full-size background image.

+
+
+

This background image will be sized to 100px and repeated.

+
+
+

Video. Multiple sources can be defined using a comma separated list. Video will loop when the data-background-video-loop attribute is provided.

+
+
+

Embeds a web page as a background. Note that the page won't be interactive.

``` -#### Image Backgrounds -By default, background images are resized to cover the full page. Available options: - -| Attribute | Default | Description | -| :--------------------------- | :--------- | :---------- | -| data-background-image | | URL of the image to show. GIFs restart when the slide opens. | -| data-background-size | cover | See [background-size](https://developer.mozilla.org/docs/Web/CSS/background-size) on MDN. | -| data-background-position | center | See [background-position](https://developer.mozilla.org/docs/Web/CSS/background-position) on MDN. | -| data-background-repeat | no-repeat | See [background-repeat](https://developer.mozilla.org/docs/Web/CSS/background-repeat) on MDN. | -```html -
-

Image

-
-
-

This background image will be sized to 100px and repeated

-
-``` - -#### Video Backgrounds -Automatically plays a full size video behind the slide. - -| Attribute | Default | Description | -| :--------------------------- | :------ | :---------- | -| data-background-video | | A single video source, or a comma separated list of video sources. | -| data-background-video-loop | false | Flags if the video should play repeatedly. | -| data-background-video-muted | false | Flags if the audio should be muted. | -| data-background-size | cover | Use `cover` for full screen and some cropping or `contain` for letterboxing. | - -```html -
-

Video

-
-``` - -#### Iframe Backgrounds -Embeds a web page as a slide background that covers 100% of the reveal.js width and height. The iframe is in the background layer, behind your slides, and as such it's not possible to interact with it by default. To make your background interactive, you can add the `data-background-interactive` attribute. -```html -
-

Iframe

-
-``` - -#### Background Transitions Backgrounds transition using a fade animation by default. This can be changed to a linear sliding transition by passing ```backgroundTransition: 'slide'``` to the ```Reveal.initialize()``` call. Alternatively you can set ```data-background-transition``` on any section with a background to override that specific transition. @@ -643,16 +456,16 @@ Reveal.initialize({ // Parallax background size parallaxBackgroundSize: '', // CSS syntax, e.g. "2100px 900px" - currently only pixels are supported (don't use % or auto) - // Number of pixels to move the parallax background per slide - // - Calculated automatically unless specified - // - Set to 0 to disable movement along an axis + // Amount of pixels to move the parallax background per slide step, + // a value of 0 disables movement along the given axis + // These are optional, if they aren't specified they'll be calculated automatically parallaxBackgroundHorizontal: 200, parallaxBackgroundVertical: 50 }); ``` -Make sure that the background size is much bigger than screen size to allow for some scrolling. [View example](http://revealjs.com/?parallaxBackgroundImage=https%3A%2F%2Fs3.amazonaws.com%2Fhakim-static%2Freveal-js%2Freveal-parallax-1.jpg¶llaxBackgroundSize=2100px%20900px). +Make sure that the background size is much bigger than screen size to allow for some scrolling. [View example](http://lab.hakim.se/reveal-js/?parallaxBackgroundImage=https%3A%2F%2Fs3.amazonaws.com%2Fhakim-static%2Freveal-js%2Freveal-parallax-1.jpg¶llaxBackgroundSize=2100px%20900px). @@ -673,15 +486,15 @@ You can also use different in and out transitions for the same slide: ```html
- The train goes on … + The train goes on …
-
- and on … +
+ and on …
-
+
and stops.
-
+
(Passengers entering and leaving)
@@ -690,6 +503,9 @@ You can also use different in and out transitions for the same slide: ``` +Note that this does not work with the page and cube transitions. + + ### Internal links It's easy to link between slides. The first example below targets the index of another slide whereas the second targets a slide with an ID attribute (```
```): @@ -712,7 +528,7 @@ You can also add relative navigation links, similar to the built in reveal.js co ### Fragments -Fragments are used to highlight individual elements on a slide. Every element with the class ```fragment``` will be stepped through before moving on to the next slide. Here's an example: http://revealjs.com/#/fragments +Fragments are used to highlight individual elements on a slide. Every element with the class ```fragment``` will be stepped through before moving on to the next slide. Here's an example: http://lab.hakim.se/reveal-js/#/fragments The default fragment style is to start out invisible and fade in. This style can be changed by appending a different class to the fragment: @@ -721,7 +537,6 @@ The default fragment style is to start out invisible and fade in. This style can

grow

shrink

fade-out

-

fade-up (also down, left and right!)

visible only once

blue only once

highlight-red

@@ -767,41 +582,33 @@ Reveal.addEventListener( 'fragmenthidden', function( event ) { ### Code syntax highlighting -By default, Reveal is configured with [highlight.js](https://highlightjs.org/) for code syntax highlighting. To enable syntax highlighting, you'll have to load the highlight plugin ([plugin/highlight/highlight.js](plugin/highlight/highlight.js)) and a highlight.js CSS theme (Reveal comes packaged with the zenburn theme: [lib/css/zenburn.css](lib/css/zenburn.css)). - -Below is an example with clojure code that will be syntax highlighted. When the `data-trim` attribute is present, surrounding whitespace is automatically removed. HTML will be escaped by default. To avoid this, for example if you are using `` to call out a line of code, add the `data-noescape` attribute to the `` element. +By default, Reveal is configured with [highlight.js](http://softwaremaniacs.org/soft/highlight/en/) for code syntax highlighting. Below is an example with clojure code that will be syntax highlighted. When the `data-trim` attribute is present surrounding whitespace is automatically removed. ```html
-

+	

 (def lazy-fib
   (concat
    [0 1]
-   ((fn rfib [a b]
+   ((fn rfib [a b]
         (lazy-cons (+ a b) (rfib b (+ a b)))) 0 1)))
 	
``` ### Slide number -If you would like to display the page number of the current slide you can do so using the ```slideNumber``` and ```showSlideNumber``` configuration values. +If you would like to display the page number of the current slide you can do so using the ```slideNumber``` configuration value. ```javascript // Shows the slide number using default formatting Reveal.configure({ slideNumber: true }); // Slide number formatting can be configured using these variables: -// "h.v": horizontal . vertical slide number (default) -// "h/v": horizontal / vertical slide number -// "c": flattened slide number -// "c/t": flattened slide number / total slides -Reveal.configure({ slideNumber: 'c/t' }); - -// Control which views the slide number displays on using the "showSlideNumber" value: -// "all": show on all views (default) -// "speaker": only show slide numbers on speaker notes view -// "print": only show slide numbers when printing to PDF -Reveal.configure({ showSlideNumber: 'speaker' }); +// h: current slide's horizontal index +// v: current slide's vertical index +// c: current slide index (flattened) +// t: total number of slides (flattened) +Reveal.configure({ slideNumber: 'c / t' }); ``` @@ -819,26 +626,20 @@ Reveal.addEventListener( 'overviewhidden', function( event ) { /* ... */ } ); Reveal.toggleOverview(); ``` - ### Fullscreen mode Just press »F« on your keyboard to show your presentation in fullscreen mode. Press the »ESC« key to exit fullscreen mode. ### Embedded media +Embedded HTML5 `
diff --git a/doc/pub/Introduction/html/reveal.js/plugin/markdown/example.md b/doc/pub/Introduction/html/reveal.js/plugin/markdown/example.md index 89c75345e..6f6f577a1 100644 --- a/doc/pub/Introduction/html/reveal.js/plugin/markdown/example.md +++ b/doc/pub/Introduction/html/reveal.js/plugin/markdown/example.md @@ -29,8 +29,3 @@ Content 3.1 ## External 3.2 Content 3.2 - - -## External 3.3 - -![External Image](https://s3.amazonaws.com/static.slid.es/logo/v2/slides-symbol-512x512.png) diff --git a/doc/pub/Introduction/html/reveal.js/plugin/markdown/markdown.js b/doc/pub/Introduction/html/reveal.js/plugin/markdown/markdown.js index aa08ee5ed..15e3b40b3 100644 --- a/doc/pub/Introduction/html/reveal.js/plugin/markdown/markdown.js +++ b/doc/pub/Introduction/html/reveal.js/plugin/markdown/markdown.js @@ -4,26 +4,33 @@ * of external markdown documents. */ (function( root, factory ) { - if (typeof define === 'function' && define.amd) { - root.marked = require( './marked' ); - root.RevealMarkdown = factory( root.marked ); - root.RevealMarkdown.initialize(); - } else if( typeof exports === 'object' ) { + if( typeof exports === 'object' ) { module.exports = factory( require( './marked' ) ); - } else { + } + else { // Browser globals (root is window) root.RevealMarkdown = factory( root.marked ); root.RevealMarkdown.initialize(); } }( this, function( marked ) { + if( typeof marked === 'undefined' ) { + throw 'The reveal.js Markdown plugin requires marked to be loaded'; + } + + if( typeof hljs !== 'undefined' ) { + marked.setOptions({ + highlight: function( lang, code ) { + return hljs.highlightAuto( lang, code ).value; + } + }); + } + var DEFAULT_SLIDE_SEPARATOR = '^\r?\n---\r?\n$', - DEFAULT_NOTES_SEPARATOR = 'notes?:', + DEFAULT_NOTES_SEPARATOR = 'note:', DEFAULT_ELEMENT_ATTRIBUTES_SEPARATOR = '\\\.element\\\s*?(.+?)$', DEFAULT_SLIDE_ATTRIBUTES_SEPARATOR = '\\\.slide:\\\s*?(\\\S.+?)$'; - var SCRIPT_END_PLACEHOLDER = '__SCRIPT_END__'; - /** * Retrieves the markdown contents of a slide section @@ -31,15 +38,11 @@ */ function getMarkdownFromSlide( section ) { - // look for a ' ); - var leadingWs = text.match( /^\n?(\s*)/ )[1].length, leadingTabs = text.match( /^\n?(\t*)/ )[1].length; @@ -109,13 +112,9 @@ var notesMatch = content.split( new RegExp( options.notesSeparator, 'mgi' ) ); if( notesMatch.length === 2 ) { - content = notesMatch[0] + ''; + content = notesMatch[0] + ''; } - // prevent script end tags in the content from interfering - // with parsing - content = content.replace( /<\/script>/g, SCRIPT_END_PLACEHOLDER ); - return ''; } @@ -178,7 +177,7 @@ markdownSections += '
'; sectionStack[i].forEach( function( child ) { - markdownSections += '
' + createMarkdownSlide( child, options ) + '
'; + markdownSections += '
' + createMarkdownSlide( child, options ) + '
'; } ); markdownSections += '
'; @@ -380,24 +379,6 @@ return { initialize: function() { - if( typeof marked === 'undefined' ) { - throw 'The reveal.js Markdown plugin requires marked to be loaded'; - } - - if( typeof hljs !== 'undefined' ) { - marked.setOptions({ - highlight: function( code, lang ) { - return hljs.highlightAuto( code, [lang] ).value; - } - }); - } - - var options = Reveal.getConfig().markdown; - - if ( options ) { - marked.setOptions( options ); - } - processSlides(); convertSlides(); }, diff --git a/doc/pub/Introduction/html/reveal.js/plugin/markdown/marked.js b/doc/pub/Introduction/html/reveal.js/plugin/markdown/marked.js index 555c1dc1d..70af29bf9 100644 --- a/doc/pub/Introduction/html/reveal.js/plugin/markdown/marked.js +++ b/doc/pub/Introduction/html/reveal.js/plugin/markdown/marked.js @@ -3,4 +3,4 @@ * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) * https://github.com/chjj/marked */ -(function(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+block.def.source+")")();block.blockquote=replace(block.blockquote)("def",block.def)();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";block.html=replace(block.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,block._tag)();block.paragraph=replace(block.paragraph)("hr",block.hr)("heading",block.heading)("lheading",block.lheading)("blockquote",block.blockquote)("tag","<"+block._tag)("def",block.def)();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/});block.gfm.paragraph=replace(block.paragraph)("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|")();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top,bq){var src=src.replace(/^ +$/gm,""),next,loose,cap,bull,b,item,space,i,l;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]||""});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i ?/gm,"");this.token(cap,top,true);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];this.tokens.push({type:"list_start",ordered:bull.length>1});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose)loose=next}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false,bq);this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&(cap[1]==="pre"||cap[1]==="script"||cap[1]==="style"),text:cap[0]});continue}if(!bq&&top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);this.tokens.links[cap[1].toLowerCase()]={href:cap[2],title:cap[3]};continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=replace(inline.link)("inside",inline._inside)("href",inline._href)();inline.reflink=replace(inline.reflink)("inside",inline._inside)();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:replace(inline.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(inline.text)("]|","~]|")("|","|https?://|")()});inline.breaks=merge({},inline.gfm,{br:replace(inline.br)("{2,}","*")(),text:replace(inline.gfm.text)("{2,}","*")()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else if(this.options.pedantic){this.rules=inline.pedantic}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=cap[1].charAt(6)===":"?this.mangle(cap[1].substring(7)):this.mangle(cap[1]);href=this.mangle("mailto:")+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){src=src.substring(cap[0].length);text=escape(cap[1]);href=text;out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^/i.test(cap[0])){this.inLink=false}src=src.substring(cap[0].length);out+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(cap[0]):escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2],true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.text(escape(this.smartypants(cap[0])));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants)return text;return text.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")};InlineLexer.prototype.mangle=function(text){if(!this.options.mangle)return text;var out="",l=text.length,i=0,ch;for(;i.5){ch="x"+ch.toString(16)}out+="&#"+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return"
"+(escaped?code:escape(code,true))+"\n
"}return'
'+(escaped?code:escape(code,true))+"\n
\n"};Renderer.prototype.blockquote=function(quote){return"
\n"+quote+"
\n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"'+text+"\n"};Renderer.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"};Renderer.prototype.list=function(body,ordered){var type=ordered?"ol":"ul";return"<"+type+">\n"+body+"\n"};Renderer.prototype.listitem=function(text){return"
  • "+text+"
  • \n"};Renderer.prototype.paragraph=function(text){return"

    "+text+"

    \n"};Renderer.prototype.table=function(header,body){return"\n"+"\n"+header+"\n"+"\n"+body+"\n"+"
    \n"};Renderer.prototype.tablerow=function(content){return"\n"+content+"\n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+"\n"};Renderer.prototype.strong=function(text){return""+text+""};Renderer.prototype.em=function(text){return""+text+""};Renderer.prototype.codespan=function(text){return""+text+""};Renderer.prototype.br=function(){return this.options.xhtml?"
    ":"
    "};Renderer.prototype.del=function(text){return""+text+""};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(prot.indexOf("javascript:")===0||prot.indexOf("vbscript:")===0){return""}}var out='
    ";return out};Renderer.prototype.image=function(href,title,text){var out=''+text+'":">";return out};Renderer.prototype.text=function(text){return text};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":{return""}case"hr":{return this.renderer.hr()}case"heading":{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text)}case"code":{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped)}case"table":{var header="",body="",i,row,cell,flags,j;cell="";for(i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&([#\w]+);/g,function(_,n){n=n.toLowerCase();if(n==="colon")return":";if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})}function replace(regex,opt){regex=regex.source;opt=opt||"";return function self(name,val){if(!name)return new RegExp(regex,opt);val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return self}}function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;iAn error occured:

    "+escape(e.message+"",true)+"
    "}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); \ No newline at end of file +(function(){function e(e){this.tokens=[],this.tokens.links={},this.options=e||a.defaults,this.rules=p.normal,this.options.gfm&&(this.rules=this.options.tables?p.tables:p.gfm)}function t(e,t){if(this.options=t||a.defaults,this.links=e,this.rules=u.normal,this.renderer=this.options.renderer||new n,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.rules=this.options.breaks?u.breaks:u.gfm:this.options.pedantic&&(this.rules=u.pedantic)}function n(e){this.options=e||{}}function r(e){this.tokens=[],this.token=null,this.options=e||a.defaults,this.options.renderer=this.options.renderer||new n,this.renderer=this.options.renderer,this.renderer.options=this.options}function s(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function i(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?String.fromCharCode("x"===t.charAt(1)?parseInt(t.substring(2),16):+t.substring(1)):""})}function l(e,t){return e=e.source,t=t||"",function n(r,s){return r?(s=s.source||s,s=s.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,s),n):new RegExp(e,t)}}function o(){}function h(e){for(var t,n,r=1;rAn error occured:

    "+s(c.message+"",!0)+"
    ";throw c}}var p={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:o,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:o,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:o,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};p.bullet=/(?:[*+-]|\d+\.)/,p.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,p.item=l(p.item,"gm")(/bull/g,p.bullet)(),p.list=l(p.list)(/bull/g,p.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+p.def.source+")")(),p.blockquote=l(p.blockquote)("def",p.def)(),p._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",p.html=l(p.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,p._tag)(),p.paragraph=l(p.paragraph)("hr",p.hr)("heading",p.heading)("lheading",p.lheading)("blockquote",p.blockquote)("tag","<"+p._tag)("def",p.def)(),p.normal=h({},p),p.gfm=h({},p.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/}),p.gfm.paragraph=l(p.paragraph)("(?!","(?!"+p.gfm.fences.source.replace("\\1","\\2")+"|"+p.list.source.replace("\\1","\\3")+"|")(),p.tables=h({},p.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),e.rules=p,e.lex=function(t,n){var r=new e(n);return r.lex(t)},e.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},e.prototype.token=function(e,t,n){for(var r,s,i,l,o,h,a,u,c,e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},u=0;u ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),i=i[0].match(this.rules.item),r=!1,c=i.length,u=0;c>u;u++)h=i[u],a=h.length,h=h.replace(/^ *([*+-]|\d+\.) +/,""),~h.indexOf("\n ")&&(a-=h.length,h=this.options.pedantic?h.replace(/^ {1,4}/gm,""):h.replace(new RegExp("^ {1,"+a+"}","gm"),"")),this.options.smartLists&&u!==c-1&&(o=p.bullet.exec(i[u+1])[0],l===o||l.length>1&&o.length>1||(e=i.slice(u+1).join("\n")+e,u=c-1)),s=r||/\n\n(?!\s*$)/.test(h),u!==c-1&&(r="\n"===h.charAt(h.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(h,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:"pre"===i[1]||"script"===i[1]||"style"===i[1],text:i[0]});else if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:o,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:o,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,u.link=l(u.link)("inside",u._inside)("href",u._href)(),u.reflink=l(u.reflink)("inside",u._inside)(),u.normal=h({},u),u.pedantic=h({},u.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),u.gfm=h({},u.normal,{escape:l(u.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:l(u.text)("]|","~]|")("|","|https?://|")()}),u.breaks=h({},u.gfm,{br:l(u.br)("{2,}","*")(),text:l(u.gfm.text)("{2,}","*")()}),t.rules=u,t.output=function(e,n,r){var s=new t(n,r);return s.output(e)},t.prototype.output=function(e){for(var t,n,r,i,l="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),l+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=this.mangle(":"===i[1].charAt(6)?i[1].substring(7):i[1]),r=this.mangle("mailto:")+n):(n=s(i[1]),r=n),l+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^
    /i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),l+=this.options.sanitize?s(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,l+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){l+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,l+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),l+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),l+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),l+=this.renderer.codespan(s(i[2],!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),l+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),l+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),l+=s(this.smartypants(i[0]));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=s(i[1]),r=n,l+=this.renderer.link(r,null,n);return l},t.prototype.outputLink=function(e,t){var n=s(t.href),r=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,s(e[1]))},t.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/--/g,"—").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},t.prototype.mangle=function(e){for(var t,n="",r=e.length,s=0;r>s;s++)t=e.charCodeAt(s),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},n.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:s(e,!0))+"\n
    \n":"
    "+(n?e:s(e,!0))+"\n
    "},n.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},n.prototype.html=function(e){return e},n.prototype.heading=function(e,t,n){return"'+e+"\n"},n.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},n.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},n.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},n.prototype.paragraph=function(e){return"

    "+e+"

    \n"},n.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},n.prototype.tablerow=function(e){return"\n"+e+"\n"},n.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"\n"},n.prototype.strong=function(e){return""+e+""},n.prototype.em=function(e){return""+e+""},n.prototype.codespan=function(e){return""+e+""},n.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},n.prototype.del=function(e){return""+e+""},n.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(i(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var l='
    "},n.prototype.image=function(e,t,n){var r=''+n+'":">"},r.parse=function(e,t,n){var s=new r(t,n);return s.parse(e)},r.prototype.parse=function(e){this.inline=new t(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var n="";this.next();)n+=this.tok();return n},r.prototype.next=function(){return this.token=this.tokens.pop()},r.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},r.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},r.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s,i="",l="";for(n="",e=0;ebody{font-family: sans-serif;}

    reveal.js multiplex server.

    Generate token'); - res.end(); - }); - stream.on('readable', function() { - stream.pipe(res); - }); + fs.createReadStream(opts.baseDir + '/index.html').pipe(res); }); app.get("/token", function(req,res) { @@ -55,7 +47,7 @@ var createHash = function(secret) { }; // Actually listen -server.listen( opts.port || null ); +app.listen(opts.port || null); var brown = '\033[33m', green = '\033[32m', diff --git a/doc/pub/Introduction/html/reveal.js/plugin/multiplex/master.js b/doc/pub/Introduction/html/reveal.js/plugin/multiplex/master.js index 7f4bf4511..b6a7eb7dc 100644 --- a/doc/pub/Introduction/html/reveal.js/plugin/multiplex/master.js +++ b/doc/pub/Introduction/html/reveal.js/plugin/multiplex/master.js @@ -1,34 +1,51 @@ (function() { - // Don't emit events from inside of notes windows if ( window.location.search.match( /receiver/gi ) ) { return; } var multiplex = Reveal.getConfig().multiplex; - var socket = io.connect( multiplex.url ); + var socket = io.connect(multiplex.url); - function post() { + var notify = function( slideElement, indexh, indexv, origin ) { + if( typeof origin === 'undefined' && origin !== 'remote' ) { + var nextindexh; + var nextindexv; - var messageData = { - state: Reveal.getState(), - secret: multiplex.secret, - socketId: multiplex.id - }; + var fragmentindex = Reveal.getIndices().f; + if (typeof fragmentindex == 'undefined') { + fragmentindex = 0; + } - socket.emit( 'multiplex-statechanged', messageData ); + if (slideElement.nextElementSibling && slideElement.parentNode.nodeName == 'SECTION') { + nextindexh = indexh; + nextindexv = indexv + 1; + } else { + nextindexh = indexh + 1; + nextindexv = 0; + } + var slideData = { + indexh : indexh, + indexv : indexv, + indexf : fragmentindex, + nextindexh : nextindexh, + nextindexv : nextindexv, + secret: multiplex.secret, + socketId : multiplex.id + }; + + socket.emit('slidechanged', slideData); + } + } + + Reveal.addEventListener( 'slidechanged', function( event ) { + notify( event.currentSlide, event.indexh, event.indexv, event.origin ); + } ); + + var fragmentNotify = function( event ) { + notify( Reveal.getCurrentSlide(), Reveal.getIndices().h, Reveal.getIndices().v, event.origin ); }; - // post once the page is loaded, so the client follows also on "open URL". - window.addEventListener( 'load', post ); - - // Monitor events that trigger a change in state - Reveal.addEventListener( 'slidechanged', post ); - Reveal.addEventListener( 'fragmentshown', post ); - Reveal.addEventListener( 'fragmenthidden', post ); - Reveal.addEventListener( 'overviewhidden', post ); - Reveal.addEventListener( 'overviewshown', post ); - Reveal.addEventListener( 'paused', post ); - Reveal.addEventListener( 'resumed', post ); - -}()); + Reveal.addEventListener( 'fragmentshown', fragmentNotify ); + Reveal.addEventListener( 'fragmenthidden', fragmentNotify ); +}()); \ No newline at end of file diff --git a/doc/pub/Introduction/html/reveal.js/plugin/notes-server/client.js b/doc/pub/Introduction/html/reveal.js/plugin/notes-server/client.js index 00b277baf..628586ffb 100644 --- a/doc/pub/Introduction/html/reveal.js/plugin/notes-server/client.js +++ b/doc/pub/Introduction/html/reveal.js/plugin/notes-server/client.js @@ -41,15 +41,10 @@ } // When a new notes window connects, post our current state - socket.on( 'new-subscriber', function( data ) { + socket.on( 'connect', function( data ) { post(); } ); - // When the state changes from inside of the speaker view - socket.on( 'statechanged-speaker', function( data ) { - Reveal.setState( data.state ); - } ); - // Monitor events that trigger a change in state Reveal.addEventListener( 'slidechanged', post ); Reveal.addEventListener( 'fragmentshown', post ); diff --git a/doc/pub/Introduction/html/reveal.js/plugin/notes-server/index.js b/doc/pub/Introduction/html/reveal.js/plugin/notes-server/index.js index b95f07188..df917f112 100644 --- a/doc/pub/Introduction/html/reveal.js/plugin/notes-server/index.js +++ b/doc/pub/Introduction/html/reveal.js/plugin/notes-server/index.js @@ -1,40 +1,37 @@ -var http = require('http'); var express = require('express'); var fs = require('fs'); var io = require('socket.io'); +var _ = require('underscore'); var Mustache = require('mustache'); -var app = express(); +var app = express.createServer(); var staticDir = express.static; -var server = http.createServer(app); -io = io(server); +io = io.listen(app); var opts = { port : 1947, baseDir : __dirname + '/../../' }; -io.on( 'connection', function( socket ) { +io.sockets.on( 'connection', function( socket ) { - socket.on( 'new-subscriber', function( data ) { - socket.broadcast.emit( 'new-subscriber', data ); + socket.on( 'connect', function( data ) { + socket.broadcast.emit( 'connect', data ); }); socket.on( 'statechanged', function( data ) { - delete data.state.overview; socket.broadcast.emit( 'statechanged', data ); }); - socket.on( 'statechanged-speaker', function( data ) { - delete data.state.overview; - socket.broadcast.emit( 'statechanged-speaker', data ); - }); - }); -[ 'css', 'js', 'images', 'plugin', 'lib' ].forEach( function( dir ) { - app.use( '/' + dir, staticDir( opts.baseDir + dir ) ); +app.configure( function() { + + [ 'css', 'js', 'images', 'plugin', 'lib' ].forEach( function( dir ) { + app.use( '/' + dir, staticDir( opts.baseDir + dir ) ); + }); + }); app.get('/', function( req, res ) { @@ -55,7 +52,7 @@ app.get( '/notes/:socketId', function( req, res ) { }); // Actually listen -server.listen( opts.port || null ); +app.listen( opts.port || null ); var brown = '\033[33m', green = '\033[32m', @@ -65,5 +62,5 @@ var slidesLocation = 'http://localhost' + ( opts.port ? ( ':' + opts.port ) : '' console.log( brown + 'reveal.js - Speaker Notes' + reset ); console.log( '1. Open the slides at ' + green + slidesLocation + reset ); -console.log( '2. Click on the link in your JS console to go to the notes page' ); +console.log( '2. Click on the link your JS console to go to the notes page' ); console.log( '3. Advance through your slides and your notes will advance automatically' ); diff --git a/doc/pub/Introduction/html/reveal.js/plugin/notes-server/notes.html b/doc/pub/Introduction/html/reveal.js/plugin/notes-server/notes.html index ab8c5b17a..72d0317f1 100644 --- a/doc/pub/Introduction/html/reveal.js/plugin/notes-server/notes.html +++ b/doc/pub/Introduction/html/reveal.js/plugin/notes-server/notes.html @@ -8,7 +8,6 @@ @@ -247,7 +152,7 @@
    -
    Upcoming
    +
    UPCOMING:

    Time Click to Reset

    @@ -265,10 +170,6 @@
    -
    - - -
    @@ -281,20 +182,11 @@ currentState, currentSlide, upcomingSlide, - layoutLabel, - layoutDropdown, connected = false; var socket = io.connect( window.location.origin ), socketId = '{{socketId}}'; - var SPEAKER_LAYOUTS = { - 'default': 'Default', - 'wide': 'Wide', - 'tall': 'Tall', - 'notes-only': 'Notes only' - }; - socket.on( 'statechanged', function( data ) { // ignore data from sockets that aren't ours @@ -303,6 +195,7 @@ if( connected === false ) { connected = true; + setupIframes( data ); setupKeyboard(); setupNotes(); setupTimer(); @@ -313,28 +206,13 @@ } ); - setupLayout(); - - // Load our presentation iframes - setupIframes(); - - // Once the iframes have loaded, emit a signal saying there's - // a new subscriber which will trigger a 'statechanged' - // message to be sent back window.addEventListener( 'message', function( event ) { var data = JSON.parse( event.data ); if( data && data.namespace === 'reveal' ) { if( /ready/.test( data.eventName ) ) { - socket.emit( 'new-subscriber', { socketId: socketId } ); - } - } - - // Messages sent by reveal.js inside of the current slide preview - if( data && data.namespace === 'reveal' ) { - if( /slidechanged|fragmentshown|fragmenthidden|overviewshown|overviewhidden|paused|resumed/.test( data.eventName ) && currentState !== JSON.stringify( data.state ) ) { - socket.emit( 'statechanged-speaker', { state: data.state } ); + socket.emit( 'connect', { socketId: socketId } ); } } @@ -389,7 +267,7 @@ /** * Creates the preview iframes. */ - function setupIframes() { + function setupIframes( data ) { var params = [ 'receiver', @@ -399,8 +277,9 @@ 'backgroundTransition=none' ].join( '&' ); - var currentURL = '/?' + params + '&postMessageEvents=true'; - var upcomingURL = '/?' + params + '&controls=false'; + var hash = '#/' + data.state.indexh + '/' + data.state.indexv; + var currentURL = '/?' + params + '&postMessageEvents=true' + hash; + var upcomingURL = '/?' + params + '&controls=false' + hash; currentSlide = document.createElement( 'iframe' ); currentSlide.setAttribute( 'width', 1280 ); @@ -472,74 +351,6 @@ } - /** - * Sets up the speaker view layout and layout selector. - */ - function setupLayout() { - - layoutDropdown = document.querySelector( '.speaker-layout-dropdown' ); - layoutLabel = document.querySelector( '.speaker-layout-label' ); - - // Render the list of available layouts - for( var id in SPEAKER_LAYOUTS ) { - var option = document.createElement( 'option' ); - option.setAttribute( 'value', id ); - option.textContent = SPEAKER_LAYOUTS[ id ]; - layoutDropdown.appendChild( option ); - } - - // Monitor the dropdown for changes - layoutDropdown.addEventListener( 'change', function( event ) { - - setLayout( layoutDropdown.value ); - - }, false ); - - // Restore any currently persisted layout - setLayout( getLayout() ); - - } - - /** - * Sets a new speaker view layout. The layout is persisted - * in local storage. - */ - function setLayout( value ) { - - var title = SPEAKER_LAYOUTS[ value ]; - - layoutLabel.innerHTML = 'Layout' + ( title ? ( ': ' + title ) : '' ); - layoutDropdown.value = value; - - document.body.setAttribute( 'data-speaker-layout', value ); - - // Persist locally - if( window.localStorage ) { - window.localStorage.setItem( 'reveal-speaker-layout', value ); - } - - } - - /** - * Returns the ID of the most recently set speaker layout - * or our default layout if none has been set. - */ - function getLayout() { - - if( window.localStorage ) { - var layout = window.localStorage.getItem( 'reveal-speaker-layout' ); - if( layout ) { - return layout; - } - } - - // Default to the first record in the layouts hash - for( var id in SPEAKER_LAYOUTS ) { - return id; - } - - } - function zeroPadInteger( num ) { var str = '00' + parseInt( num ); diff --git a/doc/pub/Introduction/html/reveal.js/plugin/notes/notes.html b/doc/pub/Introduction/html/reveal.js/plugin/notes/notes.html index 4c5b799b5..0cc8cf612 100644 --- a/doc/pub/Introduction/html/reveal.js/plugin/notes/notes.html +++ b/doc/pub/Introduction/html/reveal.js/plugin/notes/notes.html @@ -8,7 +8,6 @@