Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrections to Chapter 12 #176

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
315 changes: 181 additions & 134 deletions 12_ultima_continued.Rmd

Large diffs are not rendered by default.

2,896 changes: 2,010 additions & 886 deletions 12_ultima_continued/Manifest.toml

Large diffs are not rendered by default.

15 changes: 6 additions & 9 deletions 12_ultima_continued/Project.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
name = "VolterraExp"
uuid = "0faabb05-91c8-4f15-b0c7-da5206200d23"
authors = ["jmartensen <[email protected]>"]
version = "0.1.0"

[deps]
DataDrivenDiffEq = "2445eb08-9709-466a-b3fc-47e12bd697a2"
DataDrivenSparse = "5b588203-7d8b-4fab-a537-c31a7f73f46b"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DiffEqFlux = "aae7a2af-3d4f-5e19-a356-7da93b79d9d0"
DiffEqSensitivity = "41bf760c-e81c-5289-8e54-58b1f1f8abe2"
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
Juno = "e5e0dc1b-0480-54bc-9374-aad01c23163d"
Lasso = "b4fcebef-c861-5a0f-a7e2-ba9dc32b180a"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
RCall = "6f49c342-dc21-5d91-9882-a32aef131414"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd"
178 changes: 140 additions & 38 deletions docs/404.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/libs/anchor-sections-1.1.0/anchor-sections-hash.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* Styles for section anchors */
a.anchor-section::before {content: '#';font-size: 80%;}
4 changes: 4 additions & 0 deletions docs/libs/anchor-sections-1.1.0/anchor-sections.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* Styles for section anchors */
a.anchor-section {margin-left: 10px; visibility: hidden; color: inherit;}
.hasAnchor:hover a.anchor-section {visibility: visible;}
ul > li > .anchor-section {display: none;}
11 changes: 11 additions & 0 deletions docs/libs/anchor-sections-1.1.0/anchor-sections.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
document.addEventListener('DOMContentLoaded', function () {
// If section divs is used, we need to put the anchor in the child header
const headers = document.querySelectorAll("div.hasAnchor.section[class*='level'] > :first-child")

headers.forEach(function (x) {
// Add to the header node
if (!x.classList.contains('hasAnchor')) x.classList.add('hasAnchor')
// Remove from the section or div created by Pandoc
x.parentElement.classList.remove('hasAnchor')
})
})
6 changes: 6 additions & 0 deletions docs/libs/gitbook-2.6.7/css/plugin-bookdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,9 @@ div.proof>*:last-child:after {
.header-section-number {
padding-right: .5em;
}
#header .multi-author {
margin: 0.5em 0 -0.5em 0;
}
#header .date {
margin-top: 1.5em;
}
11 changes: 11 additions & 0 deletions docs/libs/gitbook-2.6.7/css/plugin-fontsettings.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,24 @@
line-height: 30px;
font-size: 1em;
}

/* sidebar transition background */
div.book.color-theme-1 {
background: #f3eacb;
}
.book.color-theme-1 .book-body {
color: #704214;
background: #f3eacb;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section {
background: #f3eacb;
}

/* sidebar transition background */
div.book.color-theme-2 {
background: #1c1f2b;
}

.book.color-theme-2 .book-body {
color: #bdcadb;
background: #1c1f2b;
Expand Down
11 changes: 7 additions & 4 deletions docs/libs/gitbook-2.6.7/css/style.css

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion docs/libs/gitbook-2.6.7/js/plugin-clipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ gitbook.require(["gitbook", "jQuery"], function(gitbook, $) {

// the page.change event is thrown twice: before and after the page changes
if (clipboard) {
// clipboard is already defined
// clipboard is already defined but we are on the same page
if (clipboard._prevPage === window.location.pathname) return;
// clipboard is already defined and url path change
// we can deduct that we are before page changes
clipboard.destroy(); // destroy the previous events listeners
clipboard = undefined; // reset the clipboard object
Expand All @@ -24,6 +26,8 @@ gitbook.require(["gitbook", "jQuery"], function(gitbook, $) {
}
});

clipboard._prevPage = window.location.pathname

});

});
93 changes: 70 additions & 23 deletions docs/libs/gitbook-2.6.7/js/plugin-search.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) {
var index = null;
var fuse = null;
var _search = {engine: 'lunr', opts: {}};
var $searchInput, $searchLabel, $searchForm;
var $highlighted = [], hi, hiOpts = { className: 'search-highlight' };
var collapse = false, toc_visible = [];

function init(config) {
// Instantiate search settings
_search = gitbook.storage.get("search", {
engine: config.search.engine || 'lunr',
opts: config.search.options || {},
});
};

// Save current search settings
function saveSearchSettings() {
gitbook.storage.set("search", _search);
}

// Use a specific index
function loadIndex(data) {
// [Yihui] In bookdown, I use a character matrix to store the chapter
Expand All @@ -14,18 +29,36 @@ gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) {
// lunr cannot handle non-English text very well, e.g. the default
// tokenizer cannot deal with Chinese text, so we may want to replace
// lunr with a dumb simple text matching approach.
index = lunr(function () {
this.ref('url');
this.field('title', { boost: 10 });
this.field('body');
});
data.map(function(item) {
index.add({
url: item[0],
title: item[1],
body: item[2]
if (_search.engine === 'lunr') {
index = lunr(function () {
this.ref('url');
this.field('title', { boost: 10 });
this.field('body');
});
});
data.map(function(item) {
index.add({
url: item[0],
title: item[1],
body: item[2]
});
});
return;
}
fuse = new Fuse(data.map((_data => {
return {
url: _data[0],
title: _data[1],
body: _data[2]
};
})), Object.assign(
{
includeScore: true,
threshold: 0.1,
ignoreLocation: true,
keys: ["title", "body"]
},
_search.opts
));
}

// Fetch the search index
Expand All @@ -36,20 +69,33 @@ gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) {

// Search for a term and return results
function search(q) {
if (!index) return;

var results = _.chain(index.search(q))
.map(function(result) {
var parts = result.ref.split("#");
return {
path: parts[0],
hash: parts[1]
};
})
.value();
let results = [];
switch (_search.engine) {
case 'fuse':
if (!fuse) return;
results = fuse.search(q).map(function(result) {
var parts = result.item.url.split('#');
return {
path: parts[0],
hash: parts[1]
};
});
break;
case 'lunr':
default:
if (!index) return;
results = _.chain(index.search(q)).map(function(result) {
var parts = result.ref.split("#");
return {
path: parts[0],
hash: parts[1]
};
})
.value();
}

// [Yihui] Highlight the search keyword on current page
$highlighted = results.length === 0 ? [] : $('.page-inner')
$highlighted = $('.page-inner')
.unhighlight(hiOpts).highlight(q, hiOpts).find('span.search-highlight');
scrollToHighlighted(0);

Expand Down Expand Up @@ -172,6 +218,7 @@ gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) {
gitbook.events.bind("start", function(e, config) {
// [Yihui] disable search
if (config.search === false) return;
init(config);
collapse = !config.toc || config.toc.collapse === 'section' ||
config.toc.collapse === 'subsection';

Expand Down
15 changes: 13 additions & 2 deletions docs/libs/gitbook-2.6.7/js/plugin-sharing.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,21 @@ gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) {
e.preventDefault();
window.open("http://vkontakte.ru/share.php?url="+encodeURIComponent(location.href));
}
}
},
'whatsapp': {
'label': 'Whatsapp',
'icon': 'fa fa-whatsapp',
'onClick': function(e) {
e.preventDefault();
var url = encodeURIComponent(location.href);
window.open((isMobile() ? "whatsapp://send" : "https://web.whatsapp.com/send") + "?text=" + url);
}
},
};


function isMobile() {
return !!navigator.maxTouchPoints;
}

gitbook.events.bind("start", function(e, config) {
var opts = config.sharing;
Expand Down
2 changes: 1 addition & 1 deletion docs/search_index.json

Large diffs are not rendered by default.

Loading