/
http-.tex
executable file
·1671 lines (1437 loc) · 57.5 KB
/
http-.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
\PassOptionsToPackage{dvipsnames,svgnames*,x11names*}{xcolor}
%
\documentclass[
11pt,
]{article}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
\usepackage{unicode-math}
\defaultfontfeatures{Scale=MatchLowercase}
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
\KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{
\usepackage{hyperref}
}
\hypersetup{
pdftitle={HTTP le protocole du Web},
pdfauthor={Première NSI Lycée du Parc},
colorlinks=true,
linkcolor=Maroon,
filecolor=Maroon,
citecolor=Blue,
urlcolor=Blue,
pdfcreator={LaTeX via pandoc}}
\urlstyle{same} % disable monospaced font for URLs
\usepackage[top=20mm,left=20mm,right=20mm,heightrounded]{geometry}
\usepackage{listings}
\newcommand{\passthrough}[1]{#1}
\lstset{defaultdialect=[5.3]Lua}
\lstset{defaultdialect=[x86masm]Assembler}
\usepackage{longtable,booktabs}
% Correct order of tables after \paragraph or \subparagraph
\usepackage{etoolbox}
\makeatletter
\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
\makeatother
% Allow footnotes in longtable head/foot
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
\makesavenoteenv{longtable}
\usepackage{graphicx}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
% Set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{5}
\title{HTTP le protocole du Web}
\author{Première NSI Lycée du Parc}
\date{}
%%%jolis boites
\usepackage{fancybox, graphicx}
%%%%%%%%%%%%%%%%Packages et Macros Frederic%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%Insertion de liens hypertextes %%%%
%%%%%%%%%%PSTricks%%%%%%%%%%%%
\usepackage{pstricks,pst-plot,pst-text,pst-tree,pst-eps,pst-fill,pst-node,pst-math,pstricks-add,pst-xkey,pst-eucl}
%%%%%%%Tikz%%%%%%%%%%%%%%%
\usepackage{pgf,tikz,tkz-tab}
% Pour les tableaux de signes ou de variations avec tkz-tab voir https://zestedesavoir.com/tutoriels/439/des-tableaux-de-variations-et-de-signes-avec-latex/#1-13389_tikz-un-package-qui-en-a-dans-le-ventre
\usetikzlibrary{arrows}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{petri}
\usetikzlibrary{decorations}
\usetikzlibrary{arrows}
\usetikzlibrary{math}
%Variables must be declared in a tikzmath environment but
% can be used outside
% \tikzmath{int \n; \n = 508; \x1 = 1; \y1 =1;
% %computations are also possible
% \x2 = \x1 + 1; \y2 =\y1 +3; }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%Commandes Tikz Perso%%%%%%%%%%%%%%%
% Définition des nouvelles options xmin, xmax, ymin, ymax
% Valeurs par défaut : -3, 3, -3, 3
\tikzset{
xmin/.store in=\xmin, xmin/.default=-3, xmin=-3,
xmax/.store in=\xmax, xmax/.default=3, xmax=3,
ymin/.store in=\ymin, ymin/.default=-3, ymin=-3,
ymax/.store in=\ymax, ymax/.default=3, ymax=3,
}
% Commande qui trace la grille entre (xmin,ymin) et (xmax,ymax)
\newcommand {\grille}[2]
{\draw[help lines,black, thick] (\xmin,\ymin) grid[xstep=#1, ystep=#2] (\xmax,\ymax);}
% Commande \axes
\newcommand {\axes} {
\draw[->,very thick] (\xmin,0) -- (\xmax,0);
\draw[->,very thick] (0,\ymin) -- (0,\ymax);
\draw (0.95*\xmax, 0) node[above] {};
\draw (0, 0.95*\ymax) node[left] {};
}
% Commande qui limite l?affichage à (xmin,ymin) et (xmax,ymax)
\newcommand {\fenetre}
{\clip (\xmin,\ymin) rectangle (\xmax,\ymax);}
%Exemple d'utilisation
%\begin{center}
%\begin{tikzpicture} [xmin=-2,xmax=2,ymin=0,ymax=5]
%\grille{1} \axes \fenetre
%\draw plot[smooth] (\x,\x^2);
%\end{tikzpicture}
%\end{center}
%style pour la perspective cavalière française
%voir Tikz pour l'impatient page 68
\tikzset{math3d/.style=
{x= {(-0.353cm,-0.353cm)}, z={(0cm,1cm)},y={(1cm,0cm)}}}
%%%%%%%Symbole pour code calculatrice%%%%%%
%Flèche remplie pour défilement de menu
\newcommand{\flechefillright}{
\begin{tikzpicture}[scale=0.15] \fill (0,0)--(2,1)--(0,2)--cycle;
\end{tikzpicture}}
%%%%%%%%%%%%%Symboles pour calculatrice Casio%%%%
\newcommand{\execasio}{\Pisymbol{psy}{191}} %Retour chariot
\newcommand{\dispcasio}{\begin{pspicture}(.1,.1)\pspolygon*(.1,0)(.1,.1)\end{pspicture}} %Triangle « Disp »
\newcommand{\dispcasiotikz}{\begin{tikzpicture}[scale=0.2]
\fill (0,0) -- (1,0) -- (1,1) -- cycle;
\end{tikzpicture}} %Triangle « Disp »
%
%Fleche entre deux lignes, d'apres 'un bon petit' : http://forum.mathematex.net/latex-f6/fleches-entre-deux-lignes-pour-resolution-d-equation-t10283.html#p99817
\newcommand\addnode[1]{\Rnode{#1}{}}
\newcommand\linknode[3]{\ncbar[angleA=0,angleB=0,nodesep=1ex,arm=10ex,offset=-2pt]{->}{#1}{#2}\Aput{\vphantom{x}#3}}
%%Commande pour touche de calculatrice
\newcommand\tc[1]{%
{
\begin{tikzpicture}
\node[draw,rectangle,rounded corners=3pt] (P) at (0,0){#1};
\end{tikzpicture}
}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%Fin Commandes Tikz%%%%%%%%%%%%%%%
%%%%%%%%%%%%Specifiques%%%%%%%%%%%
\usepackage{wrapfig}
%pour insérer une figure à droite ou à gauche d'un texte
%\begin{wrapfigure}[nb lignes]{placement l,r,c,i(inside),o(outside)}[overhang]{width}
%ce package fonctionne mal à proximité des listes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%Environnements et symboles spéciaux pour faire joli%%%%%%
%%%Bclogo, pour des environnements + jolis avec insertion de logo%%%%
%Dépendances de bclogo
\usepackage{xkeyval}
\usepackage{etoolbox}
\usepackage{ifpdf}
\usepackage[framemethod=tikz]{mdframed}
\usepackage[tikz]{bclogo}
%\newcommand\bcpython{\includegraphics[width=17pt]{/home/fjunier/Maths/python-logo.eps}}
\newcommand\bcpython{\includegraphics[width=17pt]{/home/fjunier/Maths/python-logo.png}}
%\newcommand\bcpython{\includegraphics[width=17pt]{/home/frederic/Maths/python-logo.png}}
%% Framed
\usepackage{framed} %Le package « framed» Crée 3 nouveaux environnements, qui se comportent comme des minipage de largeur \linewidth, mais permettant en plus de se casser entre plusieurs pages. * framed : avec un cadre autour; * shaded : avec un fonc coloré (il faut définir la couleur shadecolor); * leftbar : avec une barre le long du côté gauche.
%%%%%%%%%%%%%%%%%%%Présentation de codes sources%%%%%%%%%%%%%%%%%
\usepackage{listings}
%On utilise l?environnement lstlisting pour insérer
%un code source.
%En plus de l?environnement lstlisting, on peut également utiliser la
%commande \lstinline qui fonctionne comme la commande \verb, en ce
%sens qu?on peut utiliser n?importe quel caractère comme délimiteur. Enfin,
%la commande \lstinputlisting permet de charger un code source depuis
%un fichier externe.
%Il y a deux manières de préciser des options : soit via l?option de l?envi-
%ronnement ou de la commande, soit en utilisant la commande \lstset
%qui permet de définir des options de manière globale.
\lstset{ %
language=Python, % the language of the code
basicstyle=\ttfamily, % the size of the fonts that are used for the code
%numbers=left, % where to put the line-numbers
numberstyle=\tiny, % the style that is used for the line-numbers
%stepnumber=2, % the step between two line-numbers. If it's 1, each line
% will be numbered
%numbersep=5pt, % how far the line-numbers are from the code
backgroundcolor=\color{white}, % choose the background color. You must add \usepackage{color}
showspaces=false, % show spaces adding particular underscores
showstringspaces=false, % underline spaces within strings
showtabs=false, % show tabs within strings adding particular underscores
frame=single, % adds a frame around the code
rulecolor=\color{black}, % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))
tabsize=4, % sets default tabsize to 2 spaces
captionpos=b, % sets the caption-position to bottom
breaklines=true, % sets automatic line breaking
breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
%title=\lstname, % show the filename of files included with \lstinputlisting;
% also try caption instead of title
breakindent=1cm,
keywordstyle=\color{blue}, % keyword style
commentstyle=\color{red}, % comment style
%stringstyle=\ttfamily\color{green}, % string literal style
escapeinside={\%*}{*)}, % if you want to add LaTeX within your code
morekeywords={*,...}, % if you want to add more keywords to the set
deletekeywords={...} % if you want to delete keywords from the given language
upquote=true,columns=flexible,
xleftmargin=1cm,xrightmargin=1cm,
inputencoding=utf8, %Les lignes qui suivent sont pour le codage utf8
extendedchars=true,
literate=%
{é}{{\'{e}}}1
{è}{{\`{e}}}1
{ê}{{\^{e}}}1
{ë}{{\¨{e}}}1
{û}{{\^{u}}}1
{ù}{{\`{u}}}1
{â}{{\^{a}}}1
{à}{{\`{a} }}1
{î}{{\^{i}}}1
{ô}{{\^{o}}}1
{ç}{{\c{c}}}1
{Ç}{{\c{C}}}1
{É}{{\'{E}}}1
{Ê}{{\^{E}}}1
{À}{{\`{A}}}1
{Â}{{\^{A}}}1
{Î}{{\^{I}}}1
}
\lstdefinestyle{rond}{
numbers=none,
backgroundcolor=\color{gristclair},
frameround =tttt
}
\lstdefinestyle{compil}{
numbers=none,
backgroundcolor=\color{gristclair}
}
%\lstset{language=Python,basicstyle=\small , frame=single,tabsize=4,showspaces=false,showtabs=false,showstringspaces=false,numbers=left,numberstyle=\tiny , extendedchars=true}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%Environnements persos%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Syntaxe :
%\newenvironment{nom}[nombre d'args][defaut]{definitions initiales}{definitions finales}
%definitions intiales sont les commandes appelées par \begin{nom}
%Definitions finales sont les commandes appelées par \end{nom}
%%%%%%%%%%%%%%%%Définitions des environnemts persostheoreme, exemple ..%%%%
%%%% Exercice avec encadré %%%%
\newcounter{exo}
\newenvironment{exercice}[1]
{\par \medskip \addtocounter{exo}{1} \noindent
\begin{bclogo}[arrondi =0.1, noborder = true, logo=\bccrayon, marge=4]{~\textbf{Exercice} \textbf{\theexo} {\itshape #1} } \par}
{
\end{bclogo}
\par \bigskip }
%%Axiomes, Theoremes, Propriété, Définition, Methode, Preuve
\newenvironment{axiome}[1]
{\par \medskip \begin{leftbar} \noindent \underline{\textbf{Axiome}}\hspace{0.5cm}{\itshape #1} \vspace*{10pt} \par }
{\end{leftbar} \par \medskip }
\newcounter{thme}
\newenvironment{theoreme}[1]
{\par \medskip \addtocounter{thme}{1} \noindent
\begin{bclogo}[arrondi =0.1, ombre = true, barre=none, logo=\bcbook, marge=4]{~\textbf{Théorème} \textbf{\thethme} {\itshape #1} } \par}
{
\end{bclogo}
\par \bigskip}
\newenvironment{theoremedef}[1]
{\par \medskip \addtocounter{thme}{1} \noindent
\begin{bclogo}[arrondi =0.1, ombre = true, barre=none, logo=\bcbook, marge=4]{~\textbf{Théorème-Définition} \textbf{\thethme} {\itshape #1} } \par}
{
\end{bclogo}
\par \bigskip }
\newcounter{prop}
\newenvironment{propriete}[1]
{\par \medskip \addtocounter{prop}{1} \noindent
\begin{bclogo}[arrondi =0.1, ombre = true, barre=none, logo=\bcbook, marge=4]{~\textbf{Propriété} \textbf{\theprop} {\itshape #1} } \par}
{
\end{bclogo}
\par \bigskip }
\newenvironment{corollaire}[1]
{\par \medskip \noindent
\begin{bclogo}[arrondi =0.1, ombre = true, barre=none, logo=\bcbook, marge=4]{~\textbf{Corollaire} {\itshape #1} } \par }
{
\end{bclogo}
\par \bigskip }
\newenvironment{demo}[1]
{\par \medskip \noindent
\begin{bclogo}[arrondi =0.1, ombre = true, barre=zigzag, noborder = true, logo=\bcloupe, marge=0]{~\textbf{Démonstration} {\itshape #1} } \par \vspace{10pt}}
{
\end{bclogo}
\par \bigskip }
\newcounter{activite}
\newenvironment{activite}[1]
{\par \medskip \noindent \addtocounter{activite}{1}
\begin{bclogo}[arrondi =0.1, noborder = true, logo=\bcvelo, marge=4]{~\textbf{Activité} \textbf{\theactivite} {\itshape #1} } \par}
{
\end{bclogo}
\par \bigskip }
\newenvironment{synthese}
{\par \medskip \noindent
\begin{bclogo}[arrondi =0.1, noborder = true, logo=\bccle, marge=4]{~\textbf{Synthèse} } \par}
{
\end{bclogo}
\par \bigskip }
\newcounter{rque}
\newenvironment{remarque}
{\par \medskip \addtocounter{rque}{1} \noindent
\begin{bclogo}[arrondi =0.1, ombre = true, barre=snake, noborder = true, logo=\bcinfo, marge=0]{~\textbf{Remarque} \textbf{\therque}} \par }
{
\end{bclogo}
\par \bigskip }
\newcounter{def}
\newenvironment{definition}[1]
{\par \medskip \addtocounter{def}{1} \noindent
\begin{bclogo}[arrondi =0.1, ombre = true, barre=none, logo=\bcbook, marge=4]{~\textbf{Définition} \textbf{\thedef} {\itshape #1} } \par}
{
\end{bclogo}
\par \bigskip }
\newcounter{cours}
\newenvironment{cours}[1]
{\par \medskip \addtocounter{cours}{1} \noindent
\begin{bclogo}[arrondi =0.1, ombre = true, barre=none, logo=\bcbook, marge=4]{~\textbf{Point de cours} \textbf{\thecours} {\itshape #1} } \par}
{
\end{bclogo}
\par \bigskip }
\newenvironment{introduction}
{\par \medskip \noindent
\begin {bclogo}[couleur = blue!5 , arrondi =0.1,logo=\bcrosevents, marge=4] {~\textbf{Introduction} }
\par }
{
\end{bclogo}
\par \bigskip }
\newenvironment{memo}[1]
{\par \medskip \noindent
\begin{bclogo}[arrondi =0.1, ombre = true, barre=none, logo=\bccle, marge=4]{~\textbf{À retenir} {\itshape #1} } \par}
{
\end{bclogo}
\par \bigskip }
\newcounter{exple}
\newenvironment{exemple}[1]
{\par \medskip \addtocounter{exple}{1} \noindent
\begin{bclogo}[arrondi =0.1, noborder = true, logo=\bclampe, marge=4]{~\textbf{Exemple} \textbf{\theexple} {\itshape #1} } \par}
{
\end{bclogo}
\par \bigskip }
\newcounter{alg}
\newenvironment{algorithme}[1]
{\par \medskip \addtocounter{alg}{1} \noindent
\begin {bclogo}[noborder = true, barre=zigzag,logo=\bcpython, marge=4] {~\textbf{Algorithmique} \textbf{\thealg} {\itshape #1} } \par}
{
\end{bclogo}
\par \bigskip }
\newcounter{prog}
\newenvironment{programme}[1]
{\par \medskip \addtocounter{prog}{1} \noindent
\begin {bclogo}[noborder = true, barre=zigzag,logo=\bcpython, marge=4] {~\textbf{Programme} \textbf{\theprog} {\itshape #1} } \par \bigskip}
{
\end{bclogo}
\par \bigskip }
\newcounter{logi}
\newenvironment{logique}[1]
{\par \medskip \addtocounter{logi}{1} \noindent
\begin {bclogo}[noborder = true, barre=zigzag,logo=\bclampe, marge=4] {~\textbf{Logique} \textbf{\thelogi} {\itshape #1} } \par}
{
\end{bclogo}
\par \bigskip }
\newenvironment{methode}[1]
{\par \medskip \noindent
\begin {bclogo}[arrondi =0.1,logo=\bcoutil, marge=4,noborder = true] {~\textbf{Méthode} {\itshape #1} } \par}
{
\end{bclogo}
\par \bigskip }
\newcounter{histo}
\newenvironment{histoire}[1]
{\par \medskip \addtocounter{histo}{1} \noindent
\begin {bclogo}[couleur = blue!10 , arrondi =0.1,logo=\bchorloge, marge=4] {~\textbf{Histoire} \textbf{\thehisto} {\itshape #1} } \par}
{
\end{bclogo}
\par \bigskip }
%Environnement contenu pour un document présentant une progression annuelle
\newenvironment{contenu}
{\par \medskip \begin {bclogo}[ noborder = true,logo=\bccrayon] \noindent {\large \textbf{Contenu de la séance}} \vspace*{10pt} \par }
{\end{bclogo} \par \medskip }
%Environnement programme pour un document présentant une progression annuelle
%\newenvironment{programme}
%{\par \medskip \begin {bclogo}[ noborder = true, barre=zigzag,logo=\bcinfo] \noindent {\large \textbf{Programme officiel}} \vspace*{10pt} \par }
%{\end{bclogo} \par \medskip }
%Environnement programme pour un document présentant une progression annuelle
\newenvironment{ressource}
{\par \medskip \begin {bclogo}[ noborder = true,logo=\bcbook] \noindent {\large \textbf{Ressources}}\\vspace*{10pt} \par }
{\end{bclogo} \par \medskip }
%%%%%%%%%%%%%%%%%%Maths divers%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%Nombres%%%%%%%%%%%%%%%%
%Ensemble prive de...
%\newcommand{\prive}{\boi}%{\backslash}
%Ensembles de nombres%%%%%%%%%%%%%%%%%
\newcommand{\R}{\mathbb{R}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\D}{\mathbb{D}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Q}{\mathbb{Q}}
%\newcommand{\C}{\mathbb{C}}
\newcommand{\df}{~\ensuremath{]0;+\infty[}~}
\newcommand{\K}{\mathbb{K}}
%%%%%%%%Arithmetique%%%%%%%%%%
%PGCD, PPCM
\newcommand{\PGCD}{\mathop{\rm PGCD}\nolimits}
\newcommand{\PPCM}{\mathop{\rm PPCM}\nolimits}
%Intervalles
\newcommand{\interoo}[2]{]#1\, ;\, #2[}
\newcommand{\Interoo}[2]{\left]#1\, ;\, #2\right[}
\newcommand{\interof}[2]{]#1\, ;\, #2]}
\newcommand{\Interof}[2]{\left]#1\, ;\, #2\right]}
\newcommand{\interfo}[2]{[#1\, ;\, #2[}
\newcommand{\Interfo}[2]{\left[#1\, ;\, #2\right[}
\newcommand{\interff}[2]{[#1\, ;\, #2]}
\newcommand{\Interff}[2]{\left[#1\, ;\, #2\right]}
%\newcommand\interentiers #1#2{[\! [#1\, ;\, #2]\! ]}
\newcommand{\interentiers}[2]{\llbracket #1\, ;\, #2\rrbracket}
%
%%%%%%%%%%%%%%Nombres complexes%%%%%
\newcommand{\ic}{\text{i}}
%\newcommand{\I}{\text{i}}
\newcommand{\im}[1]{\text{Im}\left(#1\right)}
\newcommand{\re}[1]{\text{Re}\left(#1\right)}
\newcommand{\Arg}[1]{\text{arg}\left(#1\right)}
\newcommand{\Mod}[1]{\left[#1\right]}
%Parties entière, réelle, imaginaire, nombre i
\newcommand{\ent}[1]{\text{E}\left(#1\right)}
\renewcommand{\Re}{\mathop{\rm Re}\nolimits}
\renewcommand{\Im}{\mathop{\rm Im}\nolimits}
\renewcommand{\i}{\textrm{i}}
%%%%%%%%%%%Probabilites et statistiques%%%%%
\newcommand{\loibinom}[2]{\mathcal{B}\left(#1\ ; \ #2 \right)}
\newcommand{\loinorm}[2]{\mathcal{N}\left(#1\ ; \ #2 \right)}
\newcommand{\loiexp}[1]{\mathcal{E}\left(#1\right)}
\newcommand{\proba}[1]{\mathbb{P}\big(#1\big)}
\newcommand{\probacond}[2]{\mathbb{P}_{#2}\big(#1\big)}
\newcommand{\esperance}[1]{\mathbb{E}\left(#1\right)}
\newcommand{\variance}[1]{\mathbb{V}\left(#1\right)}
\newcommand{\ecart}[1]{\sigma\left(#1\right)}
\newcommand{\dnormx}{\frac{1}{\sqrt{2\pi}} \text{e}^{-\frac{x^2}{2}}}
\newcommand{\dnormt}{\frac{1}{\sqrt{2\pi}} \text{e}^{-\frac{t^2}{2}}}
%Covariance
\newcommand{\cov}{\mathop{\rm cov}\nolimits}
%
%%%%%%%%%%Analyse%%%%%%%%%%%
%%%%%%%%%%%Courbe%%%%%%%%%%%%
\newcommand{\courbe}[1]{\ensuremath{\mathcal{C}_{#1}}}
%%%%%%%Fonction exponentielle%%%%%
\newcommand{\fe}{~fonction exponentielle~}
\newcommand{\e}{\text{e}}
%Fonction cotangente
\newcommand{\cotan}{\mathop{\rm cotan}\nolimits}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%Fonctions hyperboliques
\newcommand{\ch}{\mathop{\rm ch}\nolimits}
\newcommand{\sh}{\mathop{\rm sh}\nolimits}
%%%%%%%%%%%%%%Limites%%%%%%
\newcommand{\limite}[2]{\lim\limits
_{x \to #1} #2}
\newcommand{\limitesuite}[1]{\lim\limits
_{n \to +\infty} #1}
\newcommand{\limiteg}[2]{\lim\limits
_{\substack{x \to #1 \\ x < #1 }} #2}
\newcommand{\limited}[2]{\lim\limits
_{\substack{x \to #1 \\ x > #1 }} #2}
%%%%%%%%%%Continuité%%%%%%%%%%%
\newcommand{\TVI}{théorème des valeurs intermédiaires}
%%%%%%%%%%%Suites%%%%%%%%%%%%
\newcommand{\suite}[1]{\ensuremath{\left(#1_{n}\right)}}
\newcommand{\Suite}[2]{\ensuremath{\left(#1\right)_{#2}}}
%
%%%%%%%%%%%%%%%Calcul intégral%%%%%%
\newcommand{\dx}{\ensuremath{\text{d}x}} % dx
\newcommand{\dt}{\ensuremath{\text{d}t}} % dt
\newcommand{\dtheta}{\ensuremath{\text{d}\theta}} % dtheta
\newcommand{\dy}{\ensuremath{\text{d}y}} % dy
\newcommand{\dq}{\ensuremath{\text{d}q}} % dq
%%%Intégrale%%%
\newcommand{\integralex}[3]{\int_{#1}^{#2} #3 \ \dx}
\newcommand{\integralet}[3]{\int_{#1}^{#2} #3 \ \dt}
\newcommand{\integraletheta}[3]{\int_{#1}^{#2} #3 \ \dtheta}
%%%%%Equivalent%%
\newcommand{\equivalent}[1]{\build\sim_{#1}^{}}
%o et O%%%%
\renewcommand{\o}[2]{\build o_{#1\to #2}^{}}
\renewcommand{\O}[2]{\build O_{#1\to #2}^{}}
%%%%%%%%%%%%%%%Geometrie%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%Reperes%%%%%%%%%%%%%%
\def\Oij{\ensuremath{\left(\text{O},~\vect{\imath},~\vect{\jmath}\right)}}
\def\Oijk{\ensuremath{\left(\text{O},~\vect{\imath},~ \vect{\jmath},~ \vect{k}\right)}}
\def\Ouv{\ensuremath{\left(\text{O},~\vect{u},~\vect{v}\right)}}
\renewcommand{\ij}{(\vec\imath\, ;\vec\jmath\,)}
\newcommand{\ijk}{(\vec\imath\, ;\vec\jmath\, ;\vec k\,)}
\newcommand{\OIJ}{(O\,;\, I\,;\, J\,)}
\newcommand{\repere}[3]{\big(#1\, ;\,\vect{#2} ;\vect{#3}\big)}
\newcommand{\reperesp}[4]{\big(#1\, ;\,\vect{#2} ;\vect{#3} ;\vect{#4}\big)}
%%%%%%%%%Coordonnees%%%%%%%%%%%%%%
\newcommand{\coord}[2]{(#1\, ;\, #2)}
\newcommand{\bigcoord}[2]{\big(#1\, ;\, #2\big)}
\newcommand{\Coord}[2]{\left(#1\, ;\, #2\right)}
\newcommand{\coordesp}[3]{(#1\, ;\, #2\, ;\, #3)}
\newcommand{\bigcoordesp}[3]{\big(#1\, ;\, #2\, ;\, #3\big)}
\newcommand{\Coordesp}[3]{\left(#1\, ;\, #2\, ;\, #3\right)}
\newcommand{\Vcoord}[3]{\begin{pmatrix} #1 \\ #2 \\ #3 \end{pmatrix}}
%Symboles entre droites
%\newcommand{\paral}{\sslash}
\newcommand{\paral}{\mathop{/\!\! /}}
%
%%%%%%%%%Produit scalaire, Angles%%%%%%%%%%
\newcommand{\scal}[2]{\vect{#1} \, \cdot \, \vect{#2}}
\newcommand{\Angle}[2]{\left(\vect{#1} \, , \, \vect{#2}\right)}
\newcommand{\Anglegeo}[2]{\left(\widehat{\vect{#1} \, ; \, \vect{#2}}\right)}
\renewcommand{\angle}[1]{\widehat{#1}}
\newcommand{\anglevec}[2]{\left(\vect {#1}\, ,\,\vect {#2} \right)}
\newcommand{\anglevecteur}[2]{(#1\, , \, #2)}
\newcommand{\Anglevec}[2]{(\vecteur{#1}\, ,\,\vecteur{#2})}
\newcommand{\prodscal}[2]{#1 \, \cdot \, #2}
%
%Arc
%\newcommand{\arc}[1]{\wideparen{#1}}
\newcommand{\arcoriente}[1]{\overset{\curvearrowright}{#1}}
%
%
%%%%%%%%%%%%%%%Normes%%%%%%%%%%%%%%%%
\newcommand{\norme}[1]{\left\| #1\right\|}
\newcommand{\normebis}[1]{\delim{2pt}{\|}{9pt}\! #1\delim{2pt}{\|}{9pt}}
\newcommand{\normetriple}[1]{\left |\kern -.07em\left\| #1\right |\kern -.07em\right\|}
\newcommand{\valabs}[1]{\big| \, #1 \, \big|}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%Degré%%%%%%
%\newcommand{\Degre}{\ensuremath{^\circ}}
%La commande \degre est déjà définie dans le package babel
%%%%%%%%%%Vecteurs%%%%%%%%%%%
\newcommand{\vect}[1]{\mathchoice%
{\overrightarrow{\displaystyle\mathstrut#1\,\,}}%
{\overrightarrow{\textstyle\mathstrut#1\,\,}}%
{\overrightarrow{\scriptstyle\mathstrut#1\,\,}}%
{\overrightarrow{\scriptscriptstyle\mathstrut#1\,\,}}}
%%%%%%%%%%%%%Algebre%%%%%%%%%%%%%%%
%%%%%%%%%%Systemes%%%%%%%%%%%
%Systemes
\newcommand{\sys}[2]{
\left\lbrace
\begin{array}{l}
\negthickspace\negthickspace #1\\
\negthickspace\negthickspace #2\\
\end{array}
\right.\negthickspace\negthickspace}
\newcommand{\Sys}[3]{
\left\lbrace
\begin{array}{l}
#1\\
#2\\
#3\\
\end{array}
\right.}
\newcommand{\Sysq}[4]{
\left\lbrace
\begin{array}{l}
#1\\
#2\\
#3\\
#4\\
\end{array}
\right.}
%
%
%%%%%%%%%%%%%%%%Matrices%%%%%%%%%%%%%%%%%%
%Comatrice
\newcommand{\com}{\mathop{\rm com}\nolimits}
%
%
%Trace
\newcommand{\tr}{\mathop{\rm tr}\nolimits}
%
%
%Transposee
\newcommand{\transposee}[1]{{\vphantom{#1}}^t\negmedspace #1}
%
%
%Noyau
\newcommand{\Ker}{\mathop{\rm Ker}\nolimits}
%
%
%
%Matrices
\newcommand{\Mn}{\mathcal M_n}
\newcommand{\matrice}[4]{
\left(
\begin{array}{cc}
#1 & #2 \\
#3 & #4
\end{array}
\right)}
\newcommand{\Matrice}[9]{
\left(
\begin{array}{ccc}
#1 & #2 & #3\\
#4 & #5 & #6\\
#7 & #8 & #9
\end{array}
\right)}
\newcommand{\Vect}[3]{
\left(\negmedspace
\begin{array}{c}
#1\\
#2\\
#3
\end{array}\negmedspace
\right)}
\newcommand{\Ideux}{\matrice{1}{0}{0}{1}}
\newcommand{\Itrois}{\Matrice{1}{0}{0}{0}{1}{0}{0}{0}{1}}
%
%
%Determinants
\newcommand{\determinant}[4]{
\left|
\begin{array}{cc}
#1 & #2 \\
#3 & #4
\end{array}
\right|}
\newcommand{\Determinant}[9]{
\left|
\begin{array}{ccc}
#1 & #2 & #3\\
#4 & #5 & #6\\
#7 & #8 & #9
\end{array}
\right|}
\begin{document}
\maketitle
\renewcommand*\contentsname{Table des matières}
{
\hypersetup{linkcolor=}
\setcounter{tocdepth}{3}
\tableofcontents
}
\hypertarget{cruxe9dits}{%
\section*{Crédits}\label{cruxe9dits}}
\addcontentsline{toc}{section}{Crédits}
\emph{Ce cours est largement inspiré du chapitre 28 du manuel NSI de la
collection Tortue chez Ellipsen auteurs : Ballabonski, Conchon,
Filliatre, N'Guyen.}
\hypertarget{le-web}{%
\section{Le Web}\label{le-web}}
\hypertarget{les-trois-piliers-du-web-http-url-et-html}{%
\subsection{Les trois piliers du Web : HTTP, URL et
HTML}\label{les-trois-piliers-du-web-http-url-et-html}}
Le Web est une application du réseau Internet qui désigne un réseau de
sources d'information reliées par des liens hypertextes. Le Web
fonctionne selon \textbf{l'architecture client/serveur} : la machine
\emph{client} demande à la machine \emph{serveur} une ressource
identifiée par son adresse
\href{https://developer.mozilla.org/fr/docs/Glossaire/URL}{URL}. Aux
débuts du Web le client était commandé par un humain mais ce peut être
un programme.
\begin{center}{}
\begin{figure}
\centering
\includegraphics[width=0.6\textwidth,height=\textheight]{images/client-serveur.png}
\caption{Architecture client serveur}
\end{figure}
\end{center}
Les inventeurs du Web,
\href{https://interstices.info/les-debuts-du-web-sous-loeil-du-w3c/}{Tim
Berners-Lee} et
\href{https://fr.wikipedia.org/wiki/Robert_Cailliau}{Robert Caillau} ont
défini au
\href{https://fr.wikipedia.org/wiki/Organisation_europ\%C3\%A9enne_pour_la_recherche_nucl\%C3\%A9aire}{CERN}
entre 1989 et 1991 ses trois piliers
\href{https://developer.mozilla.org/fr/docs/Glossaire/HTTP}{HTTP},
\url{URL} et \url{HTML}.
\begin{cours}{}
\begin{itemize}
\tightlist
\item
Dans un échange sur le Web, le \textbf{client} envoie une demande ou
\textbf{requête} à l'aide d'un logiciel appelé \textbf{navigateur}
\footnote{Note : Ne pas confondre navigateurs comme Firefox, Edge,
Chrome et moteurs de recherche comme Qwant, Google search, Bing} :
le \textbf{serveur} est un logiciel installé sur une machine reliée en
réseau à la machine du client.
\item
Le protocole
\href{https://developer.mozilla.org/fr/docs/Glossaire/HTTP}{HTTP},
acronyme d'\passthrough{\lstinline!Hypertext Transfer Protocol!}, est
un protocole de la couche application qui décrit le format des
échanges de données entre un client et un serveur sur le Web. Un
échange HTTP s'établit selon le schéma suivant :
\begin{itemize}
\tightlist
\item
Le client saisit une
\href{https://developer.mozilla.org/fr/docs/Glossaire/URL}{URL} dans
la barre d'adresse du navigateur, elle est résolue en adresse
\href{https://developer.mozilla.org/fr/docs/Glossaire/IP_Address}{IP}
par le service
\href{https://developer.mozilla.org/fr/docs/Glossaire/DNS}{DNS}.
\item
Mise en place d'une connexion \url{TCP} entre le client et le
serveur.
\item
Le client envoie une requête
\href{https://developer.mozilla.org/fr/docs/Glossaire/HTTP}{HTTP}
(format texte lisible par un humain).
\item
Le serveur retourne une réponse
\href{https://developer.mozilla.org/fr/docs/Glossaire/HTTP}{HTTP},
lue par le client. S'il y a un contenu, il est affiché par le
navigateur du client.
\item
Fermeture ou réutilisation (paramètre
\passthrough{\lstinline!Keep-alive!}) de la connexion pour les
requêtes suivantes.
\end{itemize}
\end{itemize}
Le protocole
\href{https://developer.mozilla.org/fr/docs/Glossaire/HTTP}{HTTP} n'est
pas sécurisé par défaut, il peut l'être par l'ajout du protocole SSL ou
TLS et on désigne par
\href{https://developer.mozilla.org/fr/docs/Glossaire/https}{HTTPS} sa
version sécurisée.
\href{https://developer.mozilla.org/fr/docs/Glossaire/HTTP}{HTTP} est un
standard normalisé par
l'\href{https://developer.mozilla.org/fr/docs/Glossaire/IETF}{IETF}
comme les protocoles d'internet
\href{https://developer.mozilla.org/fr/docs/Glossaire/TCP}{TCP} et
\href{https://developer.mozilla.org/fr/docs/Glossaire/IP_Address}{IP}.
\includegraphics[width=0.5\textwidth,height=\textheight]{images/HTTP_layers.png}\\
\emph{Source :
\url{https://developer.mozilla.org/fr/docs/Web/HTTP/Aper\%C3\%A7u}}
\begin{itemize}
\tightlist
\item
Une adresse
\href{https://developer.mozilla.org/fr/docs/Glossaire/URL}{URL} pour
\passthrough{\lstinline!Uniform Ressource Locator!} identifie une
ressource sur le Web. La syntaxe des
\href{https://developer.mozilla.org/fr/docs/Glossaire/URL}{URL} est
standardisée, par exemple décomposons :\\
\url{https://www.gnu.org/gnu/linux-and-gnu.fr.html} :
\begin{itemize}
\tightlist
\item
le protocole est \passthrough{\lstinline!https!} ;
\item
le nom de domaine sur Internet du serveur Web est
\passthrough{\lstinline!gnu.org!}.\\
\passthrough{\lstinline!www.gnu.org!} est un sous-domaine servant
d'alias pour le dossier public du serveur ;
\item
\passthrough{\lstinline!gnu/linux-and-gnu.fr.html!} est le chemin
vers la ressource sur le serveur : le fichier
\passthrough{\lstinline!linux-and-gnu.fr.html!} qui se trouve dans
le dossier public \passthrough{\lstinline!gnu!}.
\end{itemize}
\item
\href{https://developer.mozilla.org/fr/docs/Glossaire/HTML}{HTML} pour
\passthrough{\lstinline!Hypertext Markup Language!} est le langage de
description des documents textes disponibles sur le Web qui sont
reliées entre eux par des liens hypertextes. Il s'agit d'un langage à
balises. En pratique, d'autres types de ressources sont accessibles
sur le Web par une
\href{https://developer.mozilla.org/fr/docs/Glossaire/URL}{URL} : des
images, des fichiers de données (aux formats CSV, JSON \ldots), des
videos \ldots{} Par ailleurs les pages sont désormais réalisées en
combinant
\href{https://developer.mozilla.org/fr/docs/Glossaire/HTML}{HTML} avec
\href{https://developer.mozilla.org/fr/docs/Glossaire/CSS}{CSS} pour
la mise en forme, le positionnement, certains effets visuels et
\href{https://developer.mozilla.org/fr/docs/Glossaire/JavaScript}{Javascript}
pour la programmation événementielle nécessaire à l'interactivité côté
client.
\end{itemize}
\includegraphics[width=1\textwidth,height=\textheight]{images/anatomie-element-html.png}\\
\emph{Source :} https://developer.mozilla.org/fr/docs/Glossaire/HTML
\end{cours}
\begin{exercice}{}
\emph{QCM} de type E3C2.
Pour répondre à la première question, relisez la
\href{https://parc-nsi.github.io/premiere-nsi/chapitre2/memo/MemoHTML-CSS-2020.pdf}{synthèse
de cours sur HTML/CSS}.
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
Quelle est le code HTML permettant de créer un lien hypertexte dans un
document écrit en
\href{https://developer.mozilla.org/fr/docs/Glossaire/HTML}{HTML} ?
\begin{itemize}
\tightlist
\item
Réponse A : \passthrough{\lstinline!<a\\>http://tip-top.fr </a>!}
\item
Réponse B :
\passthrough{\lstinline!<a href="http://tip-top.fr">Site du TIP-TOP</a>!}
\item
Réponse C : \passthrough{\lstinline!<a name="http://tip.top.fr</a>!}
\end{itemize}
\item
Comment s'appelle le service qui permet de faire le lien entre une IP
et un nom de domaine ?
\begin{itemize}
\tightlist
\item
Réponse A : DNS
\item
Réponse B : ARP
\item
Réponse C : HTTP
\item
Réponse D : Internet
\end{itemize}
\end{enumerate}
\end{exercice}
\begin{exercice}{}
\includegraphics[width=0.5\textwidth,height=\textheight]{images/HTTP_Request.png}\\
\emph{Source :
\url{https://developer.mozilla.org/fr/docs/Web/HTTP/Aper\%C3\%A7u}}
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\item
Avec un navigateur Web, demander la page d'adresse\\