This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ru" > | |
<head> | |
<meta charset="UTF-8"> | |
<title>SVG-графика</title> | |
</head> | |
<body> | |
<svg> | |
<line x1="50" y1="30" x2="250" y2="0" stroke-width="3" stroke="red"/> | |
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
$a = 123; | |
$b = -7.496; | |
$c = 0xABC; # можно записывать переменные и в шестнадцатеричной форме | |
$d = ($a + $b) / $c; | |
$d *= $a; # тоже самое, что $d = $d * $a; | |
$str1 = "hello"; | |
$str2 = "$str1, world"; # в $str2 будет записано 'hello, world |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# выводим '1 2 3 4 5' четырьмя разными способами | |
$i = 0; | |
while($i < 5) { # пока $i меньше пяти | |
print ++$i." "; | |
} | |
print "\n"; # новая строка | |
$i = 0; | |
until($i == 5) { # пока $i не станет равно пяти |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Подключаем модуль для работы со временем | |
import time | |
# Подключаем потоки | |
from threading import Thread | |
# Делаем отдельную функцию с напоминанием | |
def remind(): | |
# Спрашиваем текст напоминания, который нужно потом показать пользователю | |
print("О чём вам напомнить?") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Делаем отдельную функцию с напоминанием | |
def remind(): | |
# Спрашиваем текст напоминания, который нужно потом показать пользователю | |
print("О чём вам напомнить?") | |
# Ждём ответа пользователя и результат помещаем в строковую переменную text | |
text = str(input()) | |
# Спрашиваем про время | |
print("Через сколько минут?") | |
# Тут будем хранить время, через которое нужно показать напоминание | |
local_time = float(input()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from threading import Thread | |
def sleepMe(i): | |
print("Поток %i засыпает на 5 секунд.\n" % i) | |
time.sleep(5) | |
print("Поток %i сейчас проснулся.\n" % i) | |
for i in range(10): | |
th = Thread(target=sleepMe, args=(i, )) | |
th.start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// настройки содержимого карточки | |
// задаём минимальную, обычную и максимальную ширину | |
.card { | |
width: clamp(200px, 50%, 700px); | |
// содержимое может растягиваться в пределах колонки | |
display: flex; | |
flex-direction: column; | |
background: lightpink; | |
padding: 1rem; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// настраиваем карточки | |
.card { | |
display: flex; | |
// делаем так, чтобы карточки растягивались ровно по колонкам | |
flex-direction: column; | |
// а вот главная команда — сделать так, чтобы всё содержимое карточки выровнялось одинаково с остальными карточками | |
justify-content: space-between; | |
background: lightpink; | |
padding: 1rem; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// общие настройки страницы | |
body { | |
font-family: system-ui, sans-serif; | |
// подключаем сетку | |
display: grid; | |
// высота — на весь экран | |
height: 100vh; | |
// задаём расстояние между блоками | |
grid-gap: 1rem; | |
// формируем колонки, минимальная ширина каждой — 200 пикселей |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.parent { | |
display: grid; | |
grid-template: auto 1fr auto / auto 1fr auto; | |
} | |
header { | |
padding: 2rem; | |
grid-column: 1 / 4; | |
} |