RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / user-642180

Лена's questions

Martin Hope
Лена
Asked: 2025-01-09 15:56:42 +0000 UTC

适用于所有网站的一项规则

  • 5

我有 2 个站点,每个站点都有自己的配置文件。

可以这样做,以便如果 URL 是通过 http:// 或通过 www,则无论是哪个站点,都可以执行重定向。但仅此而已,如果请求是个体企业家提出的,请忽略此块

server {
    if ($host = www.site.ru) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    if ($host = site.ru) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    server_name site.ru www.site.ru;
    listen 80;
    return 404; # managed by Certbot
}


server {
    server_name site.ru www.site.ru;
    listen 80 default_server;
    listen [::]:80 default_server;
    return 301 https://site.ru$request_uri;
}

也就是说,将2个块合并为1个,使其通用。仅当请求是通过个体企业家提出时,才忽略该阻止。我希望将 phpmyadmin 控制面板托管在个人企业家上。

server {
        server_name _;
        listen 80 default_server;
        listen [::]:80 default_server;

        if($host = "site.ru" || $host = "www.site.ru") {
            return 301 https://site.ru$request_uri;
        }

        if($host = "site1.ru" || $host = "www.site1.ru") {
            return 301 https://site1.ru$request_uri;
        }

    }
    
    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;

不包括,从块所在的配置文件中删除它们。

阅读时,他对我理解的语法发誓

if($host

我试着不带跑步

server_name _;

一切都一样,他在同一条线上发誓,对着主持人

nginx
  • 1 个回答
  • 46 Views
Martin Hope
Лена
Asked: 2025-01-07 00:04:33 +0000 UTC

禁止下载文件,只执行

  • 5
try_files $uri @php;
location @php {
    fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;;
    fastcgi_param SCRIPT_FILENAME /var/www/site.ru/index.php;
    include fastcgi_params;
    fastcgi_buffers 16 16k;
    fastcgi_buffer_size 32k;
}

当直接访问index.php文件或robots.txt等时,浏览器只需下载文件和代码即可。什么参数负责执行,禁止下载文件...

nginx
  • 1 个回答
  • 36 Views
Martin Hope
Лена
Asked: 2025-01-05 12:32:05 +0000 UTC

块的排列,父级的属性为 flex

  • 7

* {
  position: relative;
  padding: 0;
  margin: 0;
  outline: none;
  letter-spacing: 1px;
  box-sizing: border-box;
  scrollbar-width: none;
  -webkit-tap-highlight-color: transparent
}

main {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  padding: 25px;
  height: 1000px;
  width: 500px;
  margin: 0 auto;
}

.blok1 {
  background: green;
  height: 100px;
  flex: 1;
  padding: 50px;
}

.blok2 {
  background: #ff0000;
  padding: 50px;
}
<main>
  <div class='blok1'></div>
  <div class='blok1'></div>
  <div class='blok2'></div>
</main>

如何放置 2 个绿色块,一个在另一个下面。须符合以下条件

  1. 父级必须具有 display:flex
  2. 嵌套结构应保持不变。也就是说,无需将其包裹在额外的层中。有一个父块和 3 个子块。
  3. 绿色块的高度可能会有所不同。即内容的高度与红色相同。绿色边可能是 100 像素高,红色边是 1000 像素高

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
main {
  --gap: 25px;
  --height: 100vh;  
  display: flex;
  gap: var(--gap);
  flex-wrap: wrap;
  flex-direction: column;
  height: var(--height);
  padding: var(--gap);
  align-content: center;
}
.block1,
.block2 {
    width: 70%;
    max-width: min(calc(50vh*(16 / 9)), 70%);
    background: #cfc;
}
.block3 {
  flex: 0 0 100%;
  width: calc(30% - var(--gap));
  background: #fcc
}
.block3, .block1, .block2 {padding: 0.5em;}
<main>
  <div class="block1">
    <h2>block1</h2>
     Text Text Text Text Text Text 
  </div>
  <div class="block2">
    <h2>block2</h2>
    Text Text Text Text Text Text Textext Text Text Text Text Text Textext Text Text Text Text  
  </div>
  <div class="block3">
     Text Text Text Text Text Text Text 
  </div>
</main>

部分实现。仅当总高度超过红色时。他们跳过去,站成一排……

网格示例

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
main {
    display: grid;
    gap: 10px;
    grid-template:
        "a c" auto
        "b c" auto / min(calc(50vh*(16 / 9)), 70%) 30%;
    padding: 10px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    justify-content: center;
}
.block1 {grid-area: a}
.block2 {grid-area: b}
.block1, .block2 {background: #cfc}
.block3 {
  grid-area: c;
  grid-row: 1 / 3;
  background: #fcc
}
main > div {padding: 0.5em;}
<main>
  <div class="block1">
    Text Text Text Text Text Text 
  </div>
  <div class="block2">
    Text Text Text Text Text Text Text 
  </div>
  <div class="block3">
   Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text 
   Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text 
   Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text 
   Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text 
  </div>
</main>

这似乎有效,但是...怎么做呢。使绿色的高度与内容一致,而不是拉伸...如果你尝试按下它,间隙就会被打破。

它似乎保留了网格,位置是正确的,但它没有按下绿色块......

html
  • 4 个回答
  • 66 Views
Martin Hope
Лена
Asked: 2025-01-03 16:47:44 +0000 UTC

确定页面滚动的方向

  • 6
document.onscroll = e => {

    console.log(e);

};

如何找出用户将向哪个方向滚动页面?

相关问题:

任务是当用户滚动到底部时隐藏页面上的水平菜单,反之亦然。一旦用户开始向上滚动。开始逐步显示菜单,用户向下滚动 20px。因此,将水平菜单降低同样的 20 个像素...

它表明这样的问题只能通过样式来解决。也许从事过此工作的人知道这是什么。

html
  • 1 个回答
  • 25 Views
Martin Hope
Лена
Asked: 2024-12-31 06:41:13 +0000 UTC

FFmpeg 中的总帧数

  • 6

如何使用 FFmpeg 获取视频中的总帧数?

ffmpeg
  • 1 个回答
  • 19 Views
Martin Hope
Лена
Asked: 2024-12-30 15:33:34 +0000 UTC

四舍五入到整数

  • 6

例如,变量包含数字,而不是整数

321.23453

如何将给定数字舍入为整数,以便进一步除以整数。

echo "TEXT $((($time/2))) TEXT"

我试过了,没用。我对四舍五入一无所知,也许可以除以整数而不对数字进行四舍五入?

linux
  • 3 个回答
  • 49 Views
Martin Hope
Лена
Asked: 2024-12-28 06:55:44 +0000 UTC

转换字符串,删除空格

  • 6

有一行:

const txt = '    #text # textx   saad #asadsas   '

执行 3 项操作的最佳方法是什么

  1. 删除行首的空格
  2. 删除 # 符号后面的所有空格
  3. 将所有等于或大于 2 的空格替换为单个空格
javascript
  • 4 个回答
  • 70 Views
Martin Hope
Лена
Asked: 2024-12-08 04:45:22 +0000 UTC

仅使用 css:flex;

  • 5

在此输入图像描述

请告诉我。有以下结构,1 个父块和 3 个子块。

<div>
   <div></div>
   <div></div>
   <div></div>
</div>

可以放置第一个子块(红色),使其占据 2 行。第二个(橙色)位于红色右侧的顶部,占据了所有可用空间。也就是,他将绿色的方块压到了底部。

只有柔性,没有网格。红色块的宽度和高度是已知的;当然,红色块拉伸以匹配右侧两个块的高度是不希望的。好吧,如果没有其他办法,你能做什么呢...

.listtr {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    align-content: flex-start;
    justify-content: space-between;
    gap: 10px;
    height: 100px;
    padding: 10px;
  }
  
.listtr > * {
    &.img {
        width: 11%;
        min-width: 80px;
        max-width: 120px;
    }
    &.title {
        width: calc(100% - 10px);
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
    }
    &.st {
        color: #6a6a6a;
        font-size: 13px;
    }
}
css3
  • 1 个回答
  • 37 Views
Martin Hope
Лена
Asked: 2024-11-28 01:40:44 +0000 UTC

无法将图像加载到 SD 卡

  • 5

在此输入图像描述

需要帮助,因为这不是第一次在 SD 卡上安装映像失败。而且,它总是在不同的进展阶段崩溃。

该卡是新的,三星的。这里可能有什么困难?

RUFUS程序日志:

+++++++++++++++++++++++++++++++
Write error at sector 6750208: [0x000001B1] A device which does not exist was specified.
Retrying in 5 seconds...

Write error at sector 6750208: [0x00000037] The specified network resource or device is no longer available.
Retrying in 5 seconds...

Write error at sector 6750208: [0x00000037] The specified network resource or device is no longer available.
Retrying in 5 seconds...

Write error at sector 6750208: [0x00000037] The specified network resource or device is no longer available.
Opened \\.\PhysicalDrive3 for shared write access
Remounted \\?\Volume{d01013d6-acd2-11ef-8769-08d40cec633b}\ as E:
Re-mounted volume as E: after error
ubuntu
  • 2 个回答
  • 42 Views
Martin Hope
Лена
Asked: 2024-11-24 05:05:42 +0000 UTC

从 url 中删除 index.php

  • 5
https://site.ru/index.php/news-3750

RewriteEngine On
RewriteBase /
RewriteRule ^news-([^/]*)$ index.php?do=news&po=$1 [QSA]

我不明白如何解决它,强制类似的网址

https://site.ru/index.php/news-3750

重定向到

https://site.ru/news-3750

网上好像有所有可能的选项,我都试过了,没有一个有帮助......

# Удаление index.php c конца
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/  [NC,OR]
# С wwww на без
RewriteCond %{HTTP_HOST} ^www\..+ [NC,OR]
# Удал.повтр //         
RewriteCond %{THE_REQUEST} // [NC,OR]
# С http на https
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule ^(.*) https://site.ru/$1 [R=301,L]
.htaccess
  • 1 个回答
  • 22 Views
Martin Hope
Лена
Asked: 2024-11-15 06:52:54 +0000 UTC

使填充等于子 SVG 对象

  • 5

在此输入图像描述

2 个物体、一个黑色方块和我作为总和或概述的文本...

我弄清楚了如何对齐对象。但我也希望弄清楚如何确保黑色方块相对于内部对象(最小的)的内部边距是相同的。

此外,确保黑色方块的尺寸发生变化,并且不要拉伸或收缩文本对象......

或者,计算并移动。也许可以自动完成此操作。通过仅指定填充...

第二个问题。我做出了改变,在黑色方块上,最小的物体将被嵌入,就像以前一样。可以将两个对象合二为一。与差异一样,只有最小的物体没有被切掉。假设它是白色或黄色的,一个物体......而不是两个......

html
  • 2 个回答
  • 25 Views
Martin Hope
Лена
Asked: 2024-11-11 23:25:40 +0000 UTC

调整 SVG 图标的比例

  • 5

她的所作所为,是不可能平衡规模的。宽度和高度都是36,按我的理解,比例应该是1

<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 36000000 36000000" width="36" height="36"><circle fill="#273b7a" cx="18000000" cy="18000000" r="18000000"/><path fill="#4285f4" d="M18392187 16345311v3450000h5395311a6059374.6 6059374.6 0 0 1-11843749-1796875 6057812 6057812 0 0 1 6056250-6056249c1562500 0 2984375 598437 4057812 1570312l2531250-2709375a9759374.4 9759374.4 0 1 0 3024999 5542187z"/><path fill="#ea4335" d="M17999999 11942187c1562500 0 2984375 598437 4057812 1570312l2531250-2709375a9756249.3 9756249.3 0 0 0-15210936.6 2625000l2978124.6 2385937a6054687.1 6054687.1 0 0 1 5643750-3871874z"/><path fill="#fbbc05" d="M11942187 17999999c0-771875 150000-1507813 414062-2187500l-2978124.6-2382812a9714061.7 9714061.7 0 0 0-1137500 4571874c0 1659375 415624.9 3221874 1146874.9 4590625l2960937.7-2426562a6031249.6 6031249.6 0 0 1-406250-2164063z"/><path fill="#34a853" d="M21367186 23031248a6023437.1 6023437.1 0 0 1-3367187 1026563 6054687.1 6054687.1 0 0 1-5651562-3893750l-2960937.7 2426562A9756249.3 9756249.3 0 0 0 24342186 25412498Z"/><path fill="#4285f4" d="M27759374 17999999c0-564063-53126-1117187-145314-1654688h-9223437v3450000h5395312a6068749.5 6068749.5 0 0 1-2420312 3234375l2974999 2384374a9734374.2 9734374.2 0 0 0 3417189-7414061z"/></svg>

在此输入图像描述

svg
  • 1 个回答
  • 26 Views
Martin Hope
Лена
Asked: 2024-11-10 09:40:58 +0000 UTC

从该行中提取一些参数

  • 5
URL.match(/(?<=(auto|news)-|[?&]mdl=)\d+/g)?.map(v => +v)

如果有 Get 参数 mdl,我们会提取连字符后面的数字和数字。我们立即将值转换为数字......

如何使另一个值出现在数组的输出中。字符串,拉出连字符之前的内容。也就是说,无论是汽车还是新闻......

示例字符串

https://example.com/auto-123?mdl=789
https://example.com/news-123
https://example.com/auto-123?asd=22&mdl=789
https://example.com/mmm-123

如果该行既不包含“auto”也不包含“news”。必须返回NULL。数组中的第一个值必须始终是“auto”或“news”,第二个是“123”,第三个可能不是这个 mdl 值

javascript
  • 2 个回答
  • 47 Views
Martin Hope
Лена
Asked: 2024-11-05 21:49:09 +0000 UTC

刻度元素

  • 5

.gl {
  background: green;
  width:1000px;
  height: 500px
}

.gl div {
  background: blue;
  width:50px;
  height: 30px
}
<div class='gl'>
  <div></div>
</div>

子块的高度和宽度的尺寸是固定的。它们可以完全不同,块可以大于必须遵守的尺寸......

问题是如何通过javascript。计算数字为

transform: scale(*)

当需要减小尺寸时,该数字可以为负值,或者当需要增加蓝色块时,该数字可以为正值。

有必要将蓝色块的宽度设为其父块的 10%,或高度设为 250px。如果宽度为 10%,高度将超过 250px...

蓝色块的尺寸、高度和宽度可以完全不同,并且不可更改。要改变尺寸,需要通过scale来改变。您需要计算其数量。

实际上,如何做到这一点?

javascript
  • 1 个回答
  • 51 Views
Martin Hope
Лена
Asked: 2024-10-27 20:21:53 +0000 UTC

将一个 svg 对象拆分为 2 个

  • 10

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256l105.3-105.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3z"/></svg>

有谁知道如何使用 svg,我想寻求帮助。将十字分成两条斜线,这样在视觉上它仍然是一个十字。仅从两个物体...

html5
  • 3 个回答
  • 90 Views
Martin Hope
Лена
Asked: 2024-10-26 22:49:39 +0000 UTC

将块左对齐、居中对齐、右对齐

  • 5

.g {
  display:flex;
  height:50px;
  width:100%;
  background: green;
}
.l {
  height:100%;
  aspect-ratio:1;
  background: red;
  margin-right:auto;
}
.r {
  height:100%;
  aspect-ratio:1;
  background: blue;
}
<div class='g'>
  <div class='l'>L</div>
  <div class='r'>R</div>
</div>

.g {
  display:flex;
  height:50px;
  width:100%;
  background: green;
}
.l {
  height:100%;
  aspect-ratio:1;
  background: red;
  margin-right:auto;
}
.r {
  height:100%;
  aspect-ratio:1;
  background: blue;
}

.C {
  height:100%;
  aspect-ratio:1;
  background: #000;
  color:#fff;
  margin: 0 auto;
}

.l {
   margin:unset;
}
<div class='g'>
  <div class='l'>L</div>
  <div class='C'>C</div>
  <div class='r'>R</div>
</div>

当中间出现一个方块时,需要修复左边

.l {
   margin:unset;
}

否则,中心块将不会居中。

问题是是否可以通用,这样你就不必再次修复左侧的块。

最初在左侧块

margin-right:auto;

否则右边的方块不会被压到右边缘...

html
  • 1 个回答
  • 29 Views
Martin Hope
Лена
Asked: 2024-10-26 13:47:30 +0000 UTC

从第二个表计算几个时间段的记录数

  • 5
SELECT t1.*,
COUNT(CASE WHEN t2.time >= UNIX_TIMESTAMP() - 86400)  AS 24_hours,
COUNT(CASE WHEN t2.time >= UNIX_TIMESTAMP() - 172800) AS 48_hours,
COUNT(CASE WHEN t2.time >= UNIX_TIMESTAMP() - 259200) AS 72_hours
FROM table1 AS t1
LEFT JOIN table2 AS t2 ON t2.t1_id = t1.id

这不起作用,我正在尝试计算,添加 3 个字段,每个字段 3 个时间段。我们需要计算第二个表中的记录数......

mysql
  • 1 个回答
  • 21 Views

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5