iniziale
This commit is contained in:
commit
c4e189e370
BIN
fonts/Ubuntu-B.ttf
Normal file
BIN
fonts/Ubuntu-B.ttf
Normal file
Binary file not shown.
BIN
fonts/Ubuntu-BI.ttf
Normal file
BIN
fonts/Ubuntu-BI.ttf
Normal file
Binary file not shown.
BIN
fonts/Ubuntu-C.ttf
Normal file
BIN
fonts/Ubuntu-C.ttf
Normal file
Binary file not shown.
BIN
fonts/Ubuntu-L.ttf
Normal file
BIN
fonts/Ubuntu-L.ttf
Normal file
Binary file not shown.
BIN
fonts/Ubuntu-LI.ttf
Normal file
BIN
fonts/Ubuntu-LI.ttf
Normal file
Binary file not shown.
BIN
fonts/Ubuntu-M.ttf
Normal file
BIN
fonts/Ubuntu-M.ttf
Normal file
Binary file not shown.
BIN
fonts/Ubuntu-MI.ttf
Normal file
BIN
fonts/Ubuntu-MI.ttf
Normal file
Binary file not shown.
BIN
fonts/Ubuntu-R.ttf
Normal file
BIN
fonts/Ubuntu-R.ttf
Normal file
Binary file not shown.
BIN
fonts/Ubuntu-RI.ttf
Normal file
BIN
fonts/Ubuntu-RI.ttf
Normal file
Binary file not shown.
BIN
fonts/Ubuntu-Th.ttf
Normal file
BIN
fonts/Ubuntu-Th.ttf
Normal file
Binary file not shown.
BIN
fonts/UbuntuMono-B.ttf
Normal file
BIN
fonts/UbuntuMono-B.ttf
Normal file
Binary file not shown.
BIN
fonts/UbuntuMono-BI.ttf
Normal file
BIN
fonts/UbuntuMono-BI.ttf
Normal file
Binary file not shown.
BIN
fonts/UbuntuMono-R.ttf
Normal file
BIN
fonts/UbuntuMono-R.ttf
Normal file
Binary file not shown.
BIN
fonts/UbuntuMono-RI.ttf
Normal file
BIN
fonts/UbuntuMono-RI.ttf
Normal file
Binary file not shown.
11
index.html
Normal file
11
index.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="it">
|
||||
<head>
|
||||
<title>I monitor</title>
|
||||
<link rel="stylesheet" href="./style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="container"></div>
|
||||
<script src="./script.js"></script>
|
||||
</body>
|
||||
</html>
|
37
script.js
Normal file
37
script.js
Normal file
@ -0,0 +1,37 @@
|
||||
var counter = 0;
|
||||
|
||||
async function reloadSlide() {
|
||||
const req = await fetch(`./slide/${counter}.html`)
|
||||
if(req.status != 200) return false;
|
||||
container.innerHTML = await req.text();
|
||||
return true;
|
||||
}
|
||||
|
||||
async function nextSlide() {
|
||||
counter++;
|
||||
if(!await reloadSlide()) counter--;
|
||||
}
|
||||
|
||||
async function previousSlide() {
|
||||
counter--;
|
||||
if(!await reloadSlide()) counter++;
|
||||
}
|
||||
|
||||
document.body.addEventListener('click', nextSlide);
|
||||
|
||||
document.addEventListener(
|
||||
"keydown",
|
||||
(event) => {
|
||||
if(event.key === "ArrowRight") {
|
||||
nextSlide();
|
||||
return;
|
||||
}
|
||||
if(event.key === "ArrowLeft") {
|
||||
previousSlide();
|
||||
return;
|
||||
}
|
||||
},
|
||||
false,
|
||||
);
|
||||
|
||||
nextSlide();
|
9
slide/1.html
Normal file
9
slide/1.html
Normal file
@ -0,0 +1,9 @@
|
||||
<corpo>
|
||||
<h1>I monitor</h1>
|
||||
<small>
|
||||
<p>Pietro Tessarolo</p>
|
||||
<p>Enrico Vrabie</p>
|
||||
<p>Manuel Nichele</p>
|
||||
<p>Lorenzo Viola</p>
|
||||
</small>
|
||||
</corpo>
|
12
slide/2.html
Normal file
12
slide/2.html
Normal file
@ -0,0 +1,12 @@
|
||||
<titolo>Cos'è un monitor?</titolo>
|
||||
<corpo>
|
||||
<p>È un insieme di dati e procedure usate per la gestione di una risorsa o di un dato.</p>
|
||||
<br />
|
||||
<p>Esempi:</p>
|
||||
<ul>
|
||||
<li>Scheduler del disco</li>
|
||||
<li>Buffer</li>
|
||||
<li>Una variabile condivisa (lettori/scrittori)</li>
|
||||
</ul>
|
||||
</corpo>
|
||||
<autore>Pietro Tessarolo</autore>
|
10
slide/3.html
Normal file
10
slide/3.html
Normal file
@ -0,0 +1,10 @@
|
||||
<titolo>Diverse proposte</titolo>
|
||||
<corpo>
|
||||
<p>I monitor sono stati proposti in diverse occasioni:</p>
|
||||
<ul>
|
||||
<li>Per Brinch Hansen: 1973</li>
|
||||
<li>C.A.R. Hoare: 1974</li>
|
||||
</ul>
|
||||
<p>Utilizzeremo il modello di Hoare in questa presentazione.</p>
|
||||
</corpo>
|
||||
<autore>Pietro Tessarolo</autore>
|
15
slide/4.html
Normal file
15
slide/4.html
Normal file
@ -0,0 +1,15 @@
|
||||
<titolo>La "sintassi"</titolo>
|
||||
<corpo>
|
||||
<p>I monitor sono un concetto teorico. Non hanno <i>una</i> sintassi.</p>
|
||||
<p>Una sintassi appropriata è stata proposta da Hoare:</p>
|
||||
<codeblock>
|
||||
<name>monitorname</name>: <kw>monitor</kw>;<br />
|
||||
<idt></idt><kw>begin</kw> <comment>... dichiarazione dei dati locali al monitor</comment>;<br />
|
||||
<idt></idt><idt></idt><kw>procedure</kw> <name>procname</name> (<comment>... parametri formali ...</comment>);<br />
|
||||
<idt></idt><idt></idt><idt></idt><kw>begin</kw> <comment>... corpo della procedura ...</comment> <kw>end</kw>;<br />
|
||||
<idt></idt><idt></idt><comment>... dichiarazione di altre procedure locali al monitor</comment>;<br />
|
||||
<idt></idt><idt></idt><comment>... inizializzazione dei dati locali al monitor ...</comment><br />
|
||||
<idt></idt><kw>end;</kw><br />
|
||||
</codeblock>
|
||||
</corpo>
|
||||
<autore>Pietro Tessarolo</autore>
|
15
slide/5.html
Normal file
15
slide/5.html
Normal file
@ -0,0 +1,15 @@
|
||||
<titolo>La "sintassi"</titolo>
|
||||
<corpo>
|
||||
<p>Basata sulla sintassi del <b>Simula 67</b></p>
|
||||
<p>Si tratta comunque di <b>pseudocodice</b></p>
|
||||
<codeblock>
|
||||
<name>monitorname</name>: <kw>monitor</kw>;<br />
|
||||
<idt></idt><kw>begin</kw> <comment>... dichiarazione dei dati locali al monitor</comment>;<br />
|
||||
<idt></idt><idt></idt><kw>procedure</kw> <name>procname</name> (<comment>... parametri formali ...</comment>);<br />
|
||||
<idt></idt><idt></idt><idt></idt><kw>begin</kw> <comment>... corpo della procedura ...</comment> <kw>end</kw>;<br />
|
||||
<idt></idt><idt></idt><comment>... dichiarazione di altre procedure locali al monitor</comment>;<br />
|
||||
<idt></idt><idt></idt><comment>... inizializzazione dei dati locali al monitor ...</comment><br />
|
||||
<idt></idt><kw>end;</kw><br />
|
||||
</codeblock>
|
||||
</corpo>
|
||||
<autore>Pietro Tessarolo</autore>
|
16
slide/6.html
Normal file
16
slide/6.html
Normal file
@ -0,0 +1,16 @@
|
||||
<titolo>La struttura del libro</titolo>
|
||||
<corpo>
|
||||
<p>Il libro di testo propone una struttura diversa:</p>
|
||||
<codeblock>
|
||||
<kw>monitor</kw> <name>nome_monitor</name> {<br />
|
||||
<idt></idt><comment>... dichiarazione delle variabili locali private</comment><br />
|
||||
<idt></idt><comment>... inizializzazione delle variabili locali</comment><br />
|
||||
<br />
|
||||
<idt></idt><kw>procedura</kw> <name>entry1</name>()<br />
|
||||
<idt></idt><idt></idt>{ <comment>...</comment> }<br />
|
||||
<idt></idt><comment>... dichiarazione di altre procedure entry</comment><br />
|
||||
}
|
||||
</codeblock>
|
||||
<p>Trattandosi di pseudocodice, anche questa è valida.</p>
|
||||
</corpo>
|
||||
<autore>Pietro Tessarolo</autore>
|
22
slide/7.html
Normal file
22
slide/7.html
Normal file
@ -0,0 +1,22 @@
|
||||
<titolo>Un esempio di monitor</titolo>
|
||||
<corpo>
|
||||
<codeblock>
|
||||
<name>single resource</name>: <kw>monitor</kw><br />
|
||||
<kw>begin</kw><br />
|
||||
<idt></idt><name>busy</name>: <type>Boolean</type>;<br />
|
||||
<idt></idt><name>nonbusy</name>: <type>condition</type>;<br />
|
||||
<idt></idt><kw>procedure</kw> <name>acquire</name>;<br />
|
||||
<idt></idt><idt></idt><kw>begin</kw><br />
|
||||
<idt></idt><idt></idt><idt></idt><kw>if</kw> <name>busy</name> <kw>then</kw> <name>nonbusy</name>.<call>wait</call>;<br />
|
||||
<idt></idt><idt></idt><idt></idt><name>busy</name> := <value>true</value><br />
|
||||
<idt></idt><idt></idt><kw>end</kw>;<br />
|
||||
<idt></idt><kw>procedure</kw> <name>release</name>;<br />
|
||||
<idt></idt><idt></idt><kw>begin</kw><br />
|
||||
<idt></idt><idt></idt><idt></idt><name>busy</name> := <value>false</value>;<br />
|
||||
<idt></idt><idt></idt><idt></idt><name>nonbusy</name>.<call>signal</call><br />
|
||||
<idt></idt><idt></idt><kw>end;</kw><br />
|
||||
<idt></idt><name>busy</name> := <value>false</value>;<br />
|
||||
<kw>end</kw> <name>single resource</name>
|
||||
</codeblock>
|
||||
</corpo>
|
||||
<autore>Pietro Tessarolo</autore>
|
113
style.css
Normal file
113
style.css
Normal file
@ -0,0 +1,113 @@
|
||||
@font-face{
|
||||
font-family: ubuntu;
|
||||
src: url('./fonts/Ubuntu-R.ttf') format('truetype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face{
|
||||
font-family: ubuntu-mono;
|
||||
src: url('./fonts/UbuntuMono-R.ttf') format('truetype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
:root {
|
||||
--dimensone-titolo: 5vw;
|
||||
--dimensione-corpo: 2vw;
|
||||
--dimensione-autore: 2vw;
|
||||
|
||||
--indentazione: 4;
|
||||
}
|
||||
|
||||
|
||||
body {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
background: #FAFAFA;
|
||||
|
||||
text-align: center;
|
||||
font-family: 'ubuntu';
|
||||
|
||||
}
|
||||
|
||||
titolo {
|
||||
position: absolute;
|
||||
top: 2vw;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
font-size: var(--dimensone-titolo);
|
||||
}
|
||||
|
||||
corpo {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translateY(-50%) translateX(-50%);
|
||||
width: 70%;
|
||||
font-size: var(--dimensione-corpo);
|
||||
}
|
||||
|
||||
autore {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
font-size: var(--dimensione-autore);
|
||||
margin: 1vw;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
autore::before {
|
||||
content: "- ";
|
||||
}
|
||||
|
||||
ul, ol, codeblock {
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
text-align: left;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
li {
|
||||
margin-left: 5vw;
|
||||
}
|
||||
|
||||
|
||||
small {
|
||||
font-size: 2vw;
|
||||
}
|
||||
|
||||
small p {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
codeblock {
|
||||
font-family: 'ubuntu-mono';
|
||||
background: #EAEAEA;
|
||||
padding: 2vw 2vw 2vw 2vw;
|
||||
border-radius: 1vw;
|
||||
}
|
||||
|
||||
idt {
|
||||
width: calc(var(--dimensione-corpo) / 2 * var(--indentazione));
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
name {
|
||||
color: #111199;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
kw {
|
||||
color: #AA5500;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
comment {
|
||||
color: #494949;
|
||||
}
|
Loading…
Reference in New Issue
Block a user