小编Sat*_*Roy的帖子

如何使用 shift+alt+arrow-down 将所选行复制到 Visual Studio Code 中所选行的正下方

之前我使用的是Windows 10操作系统。我是初学者,正在学习 HTML、CSS。我在 Windows 10 上使用了 Visual Studio Code。在那里,我使用shift + alt + arrow-down键在所选行的正下方复制了一些所选行。我最近转向 Ubuntu,但shift + alt + arrow-down密钥不能像 Windows 那样工作。它不会复制选定的行。

我怎样才能让这些按键像 Windows 一样工作,或者是否有其他按键可以完成相同的工作?

请帮帮我。

html css ubuntu visual-studio-code

11
推荐指数
1
解决办法
2万
查看次数

页面加载时自动按下按钮

我是初学者,正在学习 JavaScript。我正在尝试制作一个密码生成器。我在 HTML 第 29 行和第 33 行有两个按钮。当我加载页面时,这两个按钮会自动按下,以后无法按下。我不明白为什么会发生这种事!

下面是我的代码:

const minusEl = document.getElementById('minus');
const plusEl = document.getElementById('plus');
const passwordLengthEl = document.getElementById('password-length');


// Password Length
function passwordLengthChose(value) {
    const passwordLength = parseInt(passwordLengthEl.innerText) + value;
    passwordLengthEl.innerText = passwordLength;
    console.log(passwordLength);
    console.log("clickd");
}

minusEl.addEventListener('click', passwordLengthChose(-1));
plusEl.addEventListener('click', passwordLengthChose(1));
Run Code Online (Sandbox Code Playgroud)
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Random Password Generator - Avast Clone by Dabananda Mitra</title>
    <!-- FontAwesome Icon CDN -->
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css" integrity="sha384-DyZ88mC6Up2uqS4h/KRgHuoeGwBcD4Ng9SiP4dIRy0EXTlnuz47vAwmeGwVChigm" crossorigin="anonymous">
    <!-- Custom CSS --> …
Run Code Online (Sandbox Code Playgroud)

html javascript css

-1
推荐指数
1
解决办法
109
查看次数

为什么字符串使用的字符串比 C 中的大小更大

我已将字符串的大小设置word为 5。我正在使用 进行输入scanf(),格式说明符为%s。虽然字符串的大小为 5,但如果我输入的字符串大于长度 5,它也会占用整个输入。为什么会发生这种情况?

这是我的 C 程序:

#include <stdio.h>
#include <string.h>

int main() {
  char word[5];
  printf("Enter word: ");
  scanf("%s", word);
  printf("Word: %s\n", word);
  strlwr(word);
  printf("To Lower: %s\n", word);
  return 0;
}
Run Code Online (Sandbox Code Playgroud)

如果我输入的AbcDEfghij长度是 10,但它会接受它并正确打印完整的字符串。我怎样才能防止这种情况发生?我不想接受大于尺寸的输入。

c string

-1
推荐指数
1
解决办法
451
查看次数

标签 统计

css ×2

html ×2

c ×1

javascript ×1

string ×1

ubuntu ×1

visual-studio-code ×1