но в edge ширина картинки расползается по всему родителю.
как происходит разработка в реале
Может сначала следует освоить основы библиотек?
next() {
this.currentIndex++;
if (this.currentIndex >= this.slides.length) {
this.currentIndex = 0; // После последнего переходим на первый
}
// … дальше манипуляции со слайдами
}
previous() {
this.currentIndex--;
if (this.currentIndex < 0) {
// После первого переходим на последний (в обратном направлении)
this.currentIndex = this.slides.length - 1;
}
// … дальше манипуляции со слайдами
}
git init
.git clone git@github.com:username/reponame.git .
Самый простой вариант, конечно, удалить тестовую директорию и просто сделать git clone , но тогда придётся по новой связь с тестовой БД устанавливать и FTP настраивать и т.д.
.filter
должен возвращать булево значение. TRUE - оставить элемент, FALSE - удалитьfunction Validation(arr) {
return arr.filter((el) => {
return typeof el.age === "number"
&& el.full_name !== undefined
&& el.full_name.charAt(0) === el.full_name.charAt(0).toUpperCase()
&& el.gender !== undefined
&& el.gender.charAt(0) === el.gender.charAt(0).toUpperCase()
&& el.note !== undefined
&& el.note.charAt(0) === el.note.charAt(0).toUpperCase()
&& el.state !== undefined
&& el.state.charAt(0) === el.state.charAt(0).toUpperCase()
&& el.city !== undefined
&& el.city.charAt(0) === el.city.charAt(0).toUpperCase()
&& el.country !== undefined
&& el.country.charAt(0) === el.country.charAt(0).toUpperCase()
}
function firstLetterIsUpper(str) {
return typeof(str) === 'string'
&& str.length
&& str.charAt(0) === str.charAt(0).toUpperCase()
}
function Validation(arr) {
return arr.filter((el) => {
return typeof el.age === "number"
&& firstLetterIsUpper(el?.full_name)
&& firstLetterIsUpper(el?.gender)
&& firstLetterIsUpper(el?.note)
&& firstLetterIsUpper(el?.state)
&& firstLetterIsUpper(el?.city)
&& firstLetterIsUpper(el?.country)
}
CREATE TABLE `rainbow_table` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`pass` VARCHAR(255) NOT NULL COLLATE 'utf8mb4_unicode_ci',
`hash` CHAR(32) NOT NULL COLLATE 'utf8mb4_unicode_ci',
PRIMARY KEY (`id`) USING BTREE,
INDEX `hash_index` (`hash`) USING BTREE
)
COLLATE='utf8mb4_unicode_ci'
ENGINE=InnoDB;
$config = [
'db_name' => 'md5hashes',
'db_host' => '127.0.0.1',
'db_user' => 'mysql',
'db_pass' => 'mysql',
];
$hash = $_POST['hash'];
$dsn = 'mysql:dbname='.$config['db_name'].';host='.$config['db_host'];
$pdo = new PDO($dsn, $config['db_user'], $config['db_pass']);
$stmt = $pdo->prepare('SELECT * FROM `rainbow_table` WHERE `hash` = :hash')
$stmt->execute(['hash' => $hash]);
if ($stmt->rowCount() > 0) {
$row = $stmt->fetch(PDO::FETCH_ASSOC);
echo 'Хэш найден: '.$row['pass'];
} else {
echo 'Хэш не найден';
}
$dsn = 'mysql:dbname='.$config['db_name'].';host='.$config['db_host'];
$pdo = new PDO($dsn, $config['db_user'], $config['db_pass']);
$stmt = $pdo->prepare('INSERT INTO `rainbow_table` (`pass`, `hash`) VALUES (:pass, :hash)');
$fp = fopen('words.txt', 'r');
if ($fp) {
while (($buffer = fgets($fp)) !== false) {
$stmt->execute(['pass' => $buffer, 'hash' => md5($buffer)]);
}
if (!feof($fp)) {
echo "Ошибка: fgets() неожиданно потерпел неудачу\n";
}
fclose($fp);
}