Repère historique internet et le WEB en moins de 128 mots

Les grandes étapes du développement d’Internet

< 1945 – 1970 : Les premiers réseaux, les premiers acteurs et les problématiques techniques émergent.
1970 – 1990 : ARPANET, INTERNET, TCP/IP
1990 – 2000 : Internet et le Web
2000 : Le WEB 2.0 et sémantique se développe.

Les 3 couches d’internet :

Contenu et application ==> Le navigateur
Standard technique ==> TCP / IP
Infrastructure ==> Moyen de télécommunication (radio, satellite, téléphone …)

Le WEB :
Hypertexte : Liens bi-directionnels entre document (Paul Otlet)

Sorting by selection in Python

tab[111, 34, 22, 55, 4, 2, 1, 77]

for i in range (0,len(tab)-1):
	min i
	for j in range (i-1,len(tab):c)
		if tab<tab[j]:></tab[min]:>
			min - J
	if (min!
		tmp - tab[i]
		ta[i]b-tab[min]
		tab[min] - tmp

print (tab)

If we consider the "if tab" comparison operation<tab" et n la taille du tableau. et="" n="[j]" la=""[min] taille="" du=""></tab" et n la taille du tableau.>

If i -0 -0 (n-1) comparisons

If i – 1 – (n-2) comparisons

… If i 'n-2' – 1 comparison

or n – (n-1) comparisons

So the loop for i in range (0,len(tab)-1): runs n-1 times

The for j in range loop (i-1,len(tab):runs (n-(i-1) – 1) times

The complexity in the number of comparisons is equal to the sum of the following n-1 terms (i – 1, … i – n-1)

C – (n-2) -1 – (n-3) -1…..-1-0 -1-0 -(n-1)–(n-2)-…-1 -n.(n-1)/2 (this is the sum of the entire first n-1).

The complexity in the number of comparisons is in the order of n2, one writes O(n2).

Clasificación por selección en Python

pestaña[111, 34, 22, 55, 4, 2, 1, 77]

para i en el rango (0,len(tab)-1):
	min i
	para j en el rango (i-1,len(tab):c)
		si la pestaña<[j]tab:></ta[min]b:>
			min - J
	si (min!
		tmp - pestaña[i]
		pes[i]taña-tab[min]
		pest[min]aña - tmp

imprimir (pestaña)

Si consideramos la operación de comparación "if tab"<tab" et n la taille du tableau. et="" n[j]="" la="[min]" taille="" du=""></tab" et n la taille du tableau.>

Si i -0 -0 (n-1) comparaciones

Si i – 1 – (n-2) comparaciones

… Si i 'n-2' – 1 comparación

o n – (n-1) comparaciones

Así que el bucle para i en el rango (0,len(tab)-1): se ejecuta n-1 veces

El bucle de rango for j (i-1,len(tab):runs (n-(i-1) – 1) veces

La complejidad en el número de comparaciones es igual a la suma de los siguientes términos n-1 (i – 1, … i – n-1)

C – (n-2) -1 – (n-3) -1…..-1-0 -1-0 -(n-1)–(n-2)-…-1 -n.(n-1)/2 (esta es la suma de todo el primer n-1).

La complejidad en el número de comparaciones está en el orden de n2, se escribe O(n2).

Tri par sélection Python – Implémentation de l’algorithme

Tri par sélection python : Implémentation de l’algorithme exemple complet avec code source.

tab = [111, 34, 22, 55, 4, 2, 1, 77]

for i in range(0,len(tab)-1):
	min = i
	for j in range(i+1,len(tab)):
		if tab[j]<tab[min]:
			min = j
	if (min != i):
		tmp = tab[i]
		tab[i] = tab[min]
		tab[min] = tmp

print(tab)

Introduction :

Si on considère l’opération de comparaison « if tab[j]<tab[min] » et n la taille du tableau.

Si i = 0 ==> (n-1) comparaisons

Si i = 1 ==> (n-2) comparaisons

… Si i = n-2 ==> 1 comparaison

soit n * (n-1) comparaisons

Donc la boucle for i in range(0,len(tab)-1): s’exécute n-1 fois

La boucle for j in range(i+1,len(tab)): s’exécute (n-(i+1) + 1) fois

La complexité en nombre de comparaison est égale à la somme des n-1 termes suivants (i = 1, …i = n-1)

C = (n-2)+1 + (n-3)+1 +…..+1+0 = (n-1)+(n-2)+…+1 = n.(n-1)/2 (c’est la somme des n-1 premiers entiers).

La complexité en nombre de comparaison est de de l’ordre de n², on écrit O(n²).

Tri par sélection python liens externes :

Website fr.wikipedia.org

Website www.python.org

Liens internes :

https://128mots.com/index.php/category/python/

The calculation of the TCP control amount explained in more than 128 words

The TCP (checksum) control sum, intended for package integrity control, uses a pseudo-header that consists of the source IP of origin, destination, reserved file name (identified by 0000,0000), protocol (x06) and the length of the header Tcp.

Pseudo header TCP (source wikipedia)
TCP header (source wikipedia)
Consider the TCP package:
IP source 192.168.0.1
IP destination 192.168.0.2
Reserved/TCP Control 0 / 6
Padding/Lenght 0 / 10
TCP source port 20
TCP port destination 10
Sequence number11
ACK Acknowledgement Number 0
Offset / Reserved / Flag 5/0/2 (Flag SYN)
Window (c) 8192
Checksum (c) 0
Urgent pointer 0
Data "Ah" (41 68 unicode converts to hexadecimal)
We convert to binary:
Source IP (32-bit) 11000000.10101000.
00000000.00000001
IP destination (32 bits) 11000000.10101000.
00000000.00000010
Reserved/TCP Control (16 bts) 00000000.00000110
Padding/Lenght – 0/10 (16 bts) 00000000.00001010
TCP source port – 20 (16 bit) 00000000.00010100
TCP port destination – $10 00000000.00001010
Sequence number – 11 (32 bits) 00000000.00000000
00000000.00001011
ACK Acknowledgement Number 00000000.00000000
Offset / Reserved / Flag
5 / 0 / 2 (Flag SYN) 01010000.00000010
Window – 8192 01010000.00000010
Checksum – 0 00100000.00000000
Urgent Pointer – 0 00000000.00000000
Data – "Ah"
(41 68 unicode
converts to hexadecimal) 01000001.01101000
SOMME DE CONTROLE
Step 1 (addition) 10.10000010.00001110

The binary addition is based on the rules:

  • Rule 1: 0 – 0 – 0;
  • Rule 2: 1 – 0 – 1;
  • Rule 3: 1 – 1 – 0 with carry of 1;
  • Rule 4: 1 – 1 – 1 – 1 with carry of 1.

To add up several binary numbers you have to proceed in pairs and carry out postponements.

Source Website fr.wikihow.com

CONTROLE SOMME (step 1) 00000000.00000010.10000010.00001110

The calculated sum is then on 32 bits the first 16 bits are added with the last 1
6 bits.

CONTROLE SOMME (step 2) 00000000.00000010
10000010.00001110
10000010.00010000

The next step is to calculate the supplement to 1 of the binary number found previously.
The complement to one of a binary number is the value obtained by reversing all the bits of that number (by swapping the 0 by 1 and vice versa).

CONTROLE SOMME – 01111101.1110111 1 I.e.
7D EF in hexadecimal

The conversion to hexadecimal base 16 is done by breaking the binary number into 4-bit packets:
0111/1101/1110/1111
7/D/E/F

El cálculo de la cantidad de control TCP explicado en más de 128 palabras

La suma de control TCP (suma de suma de comprobación), destinada al control de integridad del paquete, utiliza un pseudoencabezado que consta de la IP de origen de origen, el destino, el nombre de archivo reservado (identificado por 0000.0000), el protocolo (x06) y la longitud del encabezado Tcp.

Pseudo encabezado TCP (fuente wikipedia)
Encabezado TCP (fuente wikipedia)
Considere el paquete TCP:
Fuente de P.I. 192.168.0.1
Destino IP 192.168.0.2
Control reservado/TCP 0 / 6
Relleno/Lenght 0 / 10
Puerto de origen TCP 20
Destino del puerto TCP 10
Número de secuencia11
Número de acuse de recibo de ACK 0
Desplazamiento / Reservado / Bandera 5/0/2 (Flag SYN)
Ventana (c) 8192
Suma de comprobación (c) 0
Puntero urgente 0
Datos "Ah" (41 68 unicode se convierte en hexadecimal)
Convertimos a binario:
IP de origen (32 bits) 11000000.10101000.
00000000.00000001
Destino IP (32 bits) 11000000.10101000.
00000000.00000010
Control reservado/TCP (16 bts) 00000000.00000110
Relleno/Lenght – 0/10 (16 bts) 00000000.00001010
Puerto de origen TCP – 20 (16 bits) 00000000.00010100
Destino del puerto TCP – $10 00000000.00001010
Número de secuencia – 11 (32 bits) 00000000.00000000
00000000.00001011
Número de acuse de recibo de ACK 00000000.00000000
Desplazamiento / Reservado / Bandera
5 / 0 / 2 (Flag SYN) 01010000.00000010
Ventana – 8192 01010000.00000010
Suma de comprobación – 0 00100000.00000000
Puntero urgente – 0 00000000.00000000
Datos – "Ah"
(41 68 unicode
convierte a hexadecimal) 01000001.01101000
SOMME DE CONTROLE
Paso 1 (adición) 10.10000010.00001110

La adición binaria se basa en las reglas:

  • Regla 1: 0 – 0 – 0;
  • Regla 2: 1 – 0 – 1;
  • Regla 3: 1 – 1 – 0 con transporte de 1;
  • Regla 4: 1 – 1 – 1 – 1 con transporte de 1.

Para sumar varios números binarios tienes que proceder en pares y llevar a cabo aplazamientos.

Https://fr.wikihow.com/additionner-des-nombres-binaires de origen

CONTROLE SOMME (paso 1) 00000000.00000010.10000010.00001110

La suma calculada es entonces en 32 bits los primeros 16 bits se agregan con los últimos 1
6 bits.

CONTROLE SOMME (paso 2) 00000000.00000010
10000010.00001110
10000010.00010000

El siguiente paso es calcular el suplemento a 1 del número binario encontrado anteriormente.
El complemento a uno de un número binario es el valor obtenido invirtiendo todos los bits de ese número (intercambiando el 0 por 1 y viceversa).

CONTROLE SOMME – 01111101.1110111 1 Es decir
, 7D EF en hexadecimal

La conversión a la base hexadecimal 16 se realiza dividiendo el número binario en paquetes de 4 bits:
0111/1101/1110/1111
7/D/E/F

Le calcul de la somme de contrôle TCP expliqué en plus de 128 mots

La somme de contrôle TCP (checksum), destiné au contrôle d’intégrité du paquet, utilise un pseudo-en-tête qui se compose de l’IP source d’origine, de destination, du nom de fichier réservé (identifié par 0000 0000), du protocole (x06) et de la longueur de l’en-tête TCP.

Pseudo en-tête TCP (source wikipedia)
En-tête TCP (source wikipedia)
Considérons le paquet TCP :
IP source = 192.168.0.1
IP destination = 192.168.0.2
Reserved/TCP Control = 0 / 6
Padding/Lenght = 0 / 10
TCP port source = 20
TCP port destination = 10
Numéro de séquence =11
Numéro d’accusé de réception ACK = 0
Offset / Reserved / Flag = 5 / 0 / 2 (Flag SYN)
Window = 8192
Checksum = 0
Pointeur urgent = 0
Données = « Ah » (41 68 unicode convertit en hexadecimal)
On convertit en binaire :
IP source (32 bits) = 11000000.10101000.
00000000.00000001
IP destination (32 bits) = 11000000.10101000.
00000000.00000010
Reserved/TCP Control (16 bts) = 00000000.00000110
Padding/Lenght = 0 / 10 (16 bts) = 00000000.00001010
TCP port source = 20 (16 bit) = 00000000.00010100
TCP port destination = 10 = 00000000.00001010
Numéro de séquence = 11 (32 bits)= 00000000.00000000
00000000.00001011
Numéro d’accusé de réception ACK = 00000000.00000000
Offset / Reserved / Flag
= 5 / 0 / 2 (Flag SYN) = 01010000.00000010
Window = 8192 = 01010000.00000010
Checksum = 0 = 00100000.00000000
Pointeur urgent = 0 = 00000000.00000000
Données = « Ah »
(41 68 unicode
convertit en hexadecimal) = 01000001.01101000
SOMME DE CONTROLE
à l’étape 1 (addition) = 10.10000010.00001110

L’addition binaire est basée sur les règles :

  • Règle n° 1 : 0 + 0 = 0 ;
  • Règle n° 2 : 1 + 0 = 1 ;
  • Règle n° 3 : 1 + 1 = 0 avec report de 1 ;
  • Règle n° 4 : 1 + 1 + 1 = 1 avec report de 1.

Pour additionner plusieurs nombre binaire il faut procéder par paire et effectuer des reports.

Source Website fr.wikihow.com

SOMME DE CONTROLE (etape 1)= 00000000.00000010.10000010.00001110

La somme calculée est alors sur 32 bits on effectue l’addition des 16 premiers bits avec les 16 derniers
Soit :

SOMME DE CONTROLE (etape 2) 00000000.00000010
+ 10000010.00001110
= 10000010.00010000

L’étape suivante est de calculer le complément à 1 du nombre binaire trouvé précédemment.
Le complément à un d’un nombre binaire est la valeur obtenue en inversant tous les bits de ce nombre (en permutant les 0 par des 1 et inversement).

SOMME DE CONTROLE = 01111101.11101111
Soit 7D EF en hexadecimal

La conversion en hexadecimal base 16 s’effectue en decomposant le nombre binaire en paquets de 4 bits soit :
0111/1101/1110/1111
7/D/E/F

Python Strings in more than 128 words

In python the strings of characters (Strings) are surrounded by simple quotation marks or double quotation marks, both notations are equivalent. The print feature () allows you to display the number of characters on the screen.

print ("Hello") #notation double quotes and display
print ('Hello') #notation simple quotes
a - "Test" #assignation           

Python offers methods that can be used on String-type objects

a - "Hello, World!"
print(a.upper))) #retourne the chain of character in capital letters   
a - "Hello, World!"
print(a.lower))) #retourne the string of character in tiny
txt - "Hello the world"
x - txt.find ("world")
print(x) #retourne the position of the word you are looking for
a - "Hello, the world!"
(a.replace) #Remplace a chain of character
a - "Hello"
b - "World"
c - a -b
print(c) #Affiche the concatenation of the two character chains
Python gives belonging operators who are used to test whether a sequence is presented in an object:
x - 'Apple and banana'
print ("banana" in x) #Affiche True
print ("pear" not in x) #Affiche True
print ('cherry' in x) #Affiche False

Python Strings en más de 128 palabras.

Los strings en Python son una parte fundamental del lenguaje de programación Python. Estas secuencias de caracteres se utilizan para representar texto y datos de texto en Python. En este artículo, exploraremos en detalle cómo trabajar con strings en Python, desde las operaciones básicas hasta las funciones más avanzadas. Python Strings en más de 128 palabras.

Definición de Strings en Python

Un string en Python es una secuencia de caracteres, ya sean letras, números, espacios o cualquier otro carácter imprimible. Los strings se pueden definir utilizando comillas simples ( ») o comillas dobles («  »).

string1 = 'Hola, mundo!'
string2 = "Python es genial"

Operaciones Básicas con Strings

Python ofrece una amplia variedad de operaciones para trabajar con strings, como la concatenación, la indexación y la división de strings. Aquí hay algunos ejemplos:

# Concatenación de strings
saludo = "Hola"
nombre = "Juan"
mensaje = saludo + ", " + nombre + "!"
print(mensaje)

# Indexación de strings
texto = "Python"
primer_caracter = texto[0]
print(primer_caracter)

# División de strings
frase = "Este es un ejemplo"
palabras = frase.split()
print(palabras)

Funciones Avanzadas de Strings

Python también proporciona funciones avanzadas para trabajar con strings, como la búsqueda de subcadenas, el reemplazo y la manipulación de mayúsculas/minúsculas. Aquí hay algunos ejemplos:

# Búsqueda de subcadenas
texto = "Python es un lenguaje poderoso"
indice = texto.find("poderoso")
print(indice)

# Reemplazo de subcadenas
frase = "Python es divertido"
nueva_frase = frase.replace("divertido", "increíble")
print(nueva_frase)

# Manipulación de mayúsculas/minúsculas
texto = "Python"
mayusculas = texto.upper()
minusculas = texto.lower()
print(mayusculas, minusculas)

Video Tutorial sobre Strings en Python

Recursos Externos

Artículos Relacionados – Python Strings en más de 128 palabras

Python Strings en plus de 128 mots

En python les chaines de caractères (Strings) sont entourés de guillemets simples ou de guillemets doubles, les deux notations sont équivalentes. La fonction print() permet d’afficher à l’écran, len() affiche le nombre de caractères.

print("Bonjour")   #notation guillemets double et affichage
print('Bonjour')   #notation guillemets simple
a = "Test"         #assignation           

Python propose des méthodes que l’on peut utiliser sur des objets de type String

a = "Hello, World!"
print(a.upper())        #retourne la chaine de caractère en majuscule   
a = "Hello, World!"
print(a.lower())        #retourne la chaine de caractère en minuscule
txt = "Bonjour le monde"
x = txt.find("monde")
print(x)                #retourne la position du mot recherché
a = "Bonjour, le monde!"
print(a.replace("jour", "soir")) #Remplace une chaine de caractère
a = "Hello"
b = "World"
c = a + b
print(c)        #Affiche la concaténation des deux chaines de caractère
Python donne des opérateurs d’appartenance qui sont utilisés pour tester si une séquence est présentée dans un objet:
x = 'Pomme et banane'
print("banane" in x)    #Affiche True
print("poire" not in x) #Affiche True
print('cerise' in x)    #Affiche False