RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

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

Роман's questions

Martin Hope
Роман
Asked: 2024-12-26 00:41:51 +0000 UTC

无需创建,无需进行点击。打开文件选择窗口

  • 5
(x.i = eCr('input', {type:'file', accept:x.dts.upload+'/*'})).click();
x.i.onchange = e => {

目前,我正在创建一个元素并进行一次单击。

然后将打开一个窗口以选择文件。

问题是,他们是否想出了一些不需要创建文件或单击它的东西。只需从js打开一个窗口来选择文件?

javascript
  • 1 个回答
  • 19 Views
Martin Hope
Роман
Asked: 2024-12-25 08:16:41 +0000 UTC

sh 脚本不能从 php 运行

  • 5

在控制台中

sh /var/www/bash.sh

该脚本在 ffmpeg 命令脚本中运行...

当尝试运行脚本时,从 php 下

exec("$(sh /var/www/bash.sh)");
exec("sh /var/www/bash.sh");

它不起作用,它加载 html 页面并重置。该脚本将文件添加到目录中,从控制台运行,文件就在那里。从 php 启动,崩溃,没有文件......

php
  • 1 个回答
  • 26 Views
Martin Hope
Роман
Asked: 2024-12-25 01:37:38 +0000 UTC

结果 1 包含值的数组

  • 6
data=$(ffmpeg -i /video.mp4 -vf cropdetect -f null - 2>&1 | 
       awk \'/crop=/ {time=$(NF-2); crop=$NF} END {print time, crop}\')

echo $data | cut -d" " -f1
echo $data | cut -d" " -f2

结果

t:49.960000 
crop=1920:1072:0:4

我试图立即以数组形式获取结果

eval declare -A data=(`ffmpeg -i /video.mp4 -vf cropdetect -f null - 2>&1 | 
       awk \'/crop=/ {time=$(NF-2); crop=$NF} 
                            END {print "[time]=" time,
                                       "[crop]=" crop}\'`)
                                   
echo ${data[time]}

不起作用,结果是空的,我没有尝试过任何选项......

linux
  • 1 个回答
  • 25 Views
Martin Hope
Роман
Asked: 2024-12-24 10:40:00 +0000 UTC

一行执行3条bash命令

  • 5

理论上

exec('ffmpeg ... && ffmpeg ... && ffmpeg ...')

它应该可以工作,但没有办法测试它。由于执行前 2 个命令的应用程序的结果必须写入变量。并将2个变量的值插入到第三个命令的执行中......

问题是如何从 php.ini 一行一行地运行 3 个任务。将前两个命令的结果写入变量,并在运行第三个命令时插入前两个命令的结果...

怎么可能?

我试图在命令中执行命令,但它不起作用。

ffmpeg -i /video.mp4 -c:v libwebp -lavfi 'fps=1/30,$(echo ffmpeg -i /video.mp4 -vf cropdetect -f null - 2>&1 | awk '/crop/ { print  \$NF }' | tail -1),split=2,scale=-1:594' -vsync vfr -start_number 0 /img%d.webp

咒骂语法

php
  • 2 个回答
  • 31 Views
Martin Hope
Роман
Asked: 2024-12-24 07:49:04 +0000 UTC

在exec中执行Python代码

  • 5

是否可以在 exec 中以 2-3 行执行 Python 代码?我通过 exec 运行脚本,为了 2-3 行而创建一个 Python 脚本是愚蠢的......

php
  • 1 个回答
  • 12 Views
Martin Hope
Роман
Asked: 2024-12-24 04:18:38 +0000 UTC

在bash中执行命令,将其写入变量

  • 6
time = exec "ffprobe -i /video.mp4 -show_entries format=duration -v quiet -of csv='p=0'"

echo ${time}

此命令返回视频的持续时间。问题是。如何执行命令并将其返回值存储在变量中?

ffmpeg -i /video.mp4 -vf cropdetect -f null - 2>&1 | awk '/crop/ { print  \$NF }' | tail -1

我就是这样得到的

crop=*:*:*:*

问题是,是否可以将持续时间值与作物一起获取。并将作物和时间分别分成两个变量?

bash
  • 1 个回答
  • 37 Views
Martin Hope
Роман
Asked: 2024-12-21 22:52:41 +0000 UTC

使用正则表达式分割字符串

  • 5
/test-user

如何正确分割线

preg_split

假设对于地方test和user可能还有其他值,并得到一个具有两个值test和 的输出数组user

php
  • 2 个回答
  • 39 Views
Martin Hope
Роман
Asked: 2024-10-15 10:47:59 +0000 UTC

相对于画布对齐动画图标

  • 8

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 198 350" width="350px" height="198px" style="background: #ab9c9c;">
  <circle xmlns="http://www.w3.org/2000/svg" cx="77" cy="80.5" fill="none" stroke="#ff0000" stroke-width="25" r="120" stroke-dasharray="270">
     <animateTransform keyTimes="0;1" values="0 77 80.5;360 77 80.5" dur="1s" repeatCount="indefinite" type="rotate" attributeName="transform"/>
  </circle>
</svg>

就是没法让它在中心,我通过浏览器改变参数,动画歪了,这样那样。但通过 Inkscape,动画消失了......

svg
  • 2 个回答
  • 47 Views
Martin Hope
Роман
Asked: 2024-10-13 05:04:36 +0000 UTC

网格模板,在一个父级中排列 12 个块

  • 4
grid-template:
        "a a b b b b b b b b " 110px
        "c c c c c c c c c c" 70px / 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;

在第二行中,您需要放置 10 个相同的块和图像。如果将每个图像grid-area: с;相互分配,它将重叠。并为每个图像分配一个唯一的区域。这有点贵,所有的块都在一个父级中......

按顺序,块a- 1 块(图像),c- 10 块(图像),b- 简单 div

在第一行中,该块a应占据 20%,其余的是块“b”。在第二行中,您需要排列 10 个图像,使它们均匀地占据整个宽度。

.container { 
  display: grid;
  gap: 10px;
  padding:10px;
  grid-template:
    "a a b b b b b b b b" 170px 
    "c3 c4 c5 c6 c7 c8 c9 c10 c11 c12" 70px;
}

.b { grid-area: b; }
.a { grid-area: a; }

.c:nth-child(3) {grid-area: c3}
.c:nth-child(4) {grid-area: c4}
.c:nth-child(5) {grid-area: c5}
.c:nth-child(6) {grid-area: c6}
.c:nth-child(7) {grid-area: c7}
.c:nth-child(8) {grid-area: c8}
.c:nth-child(9) {grid-area: c9}
.c:nth-child(9) {grid-area: c9}
.c:nth-child(11){grid-area: c11}
.c:nth-child(12){grid-area: c12}

.container * {
  border: 1px solid red;
  position: relative;
}

.container *:after {
  content:attr(class);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  align-items: center;
  justify-content: center;
}
<div class="container">
  <div class="b"></div>
  <div class="a"></div>
  <div class="c"></div>
  <div class="c"></div>
  <div class="c"></div>
  <div class="c"></div>
  <div class="c"></div>
  <div class="c"></div>
  <div class="c"></div>
  <div class="c"></div>
  <div class="c"></div>
  <div class="c"></div>
</div>

html
  • 1 个回答
  • 28 Views
Martin Hope
Роман
Asked: 2024-10-13 02:35:04 +0000 UTC

无法在类中声明,但可以在对象中声明

  • 5
class test {
    constructor() {
        (el = 2323);
        console.log(el);
    }
}
window.addEventListener('DOMContentLoaded', _ => new test());


window.addEventListener('DOMContentLoaded', _ => ({
    int: function() {
        (m = 333);
        console.log(m);
    }
}).int())

为什么在类中,如果您需要将数据放入变量中,而不首先声明它而是将其放在括号中。它不起作用,但它适用于该对象......

在某些情况下,我会立即将数据输入括号中的变量中。当有必要时,例如,挂起一个侦听器,然后稍后访问该变量。

可以像启动对象一样启动类,我不喜欢多余的行......

javascript
  • 1 个回答
  • 23 Views
Martin Hope
Роман
Asked: 2024-10-13 01:04:43 +0000 UTC

存储临时变量的最佳方式是什么

  • 5
data = {

 upload(ms = {}) {
    this.upload.sdf = 233;
 }

}

假设我们访问了上传功能。他们传递了一个数组,这不是问题...我想知道存储临时变量的最佳方法是什么?现在我这样做,创建变量

ms.d = ''
ms.x = ''

ETC。

我想尝试一下,它返回整个对象,我想

this.upload.sdf = 233;

可以创建仅在“上传”函数中运行的变量......

还有哪些其他选择?

有必要创建许多变量,每次访问函数时这些变量都会被删除并替换为新变量。

ms.d = ''如果您存储变量并且每次访问函数并设置新变量,如何处理内存。这不会导致你的记忆被堵塞吗?

javascript
  • 2 个回答
  • 41 Views
Martin Hope
Роман
Asked: 2024-10-12 23:53:01 +0000 UTC

设置如何开始使用 Manticore

  • 5
ii  manticore                              6.3.6-24080214-593045790                     amd64        Manticore Search - database for search
ii  manticore-backup                       1.3.8-24052208-57fc406                       all          Manticore Backup
ii  manticore-buddy                        2.3.12-24071807-45f6b91                      all          Manticore Buddy
ii  manticore-columnar-lib                 2.3.0-24052206-88a01c3                       amd64        Manticore Columnar Library is a column-oriented storage library, aiming to provide decent performance with low memory footprint at big data volume
ii  manticore-common                       6.3.6-24080214-593045790                     all          Manticore Search - database for search
ii  manticore-dev                          6.3.6-24080214-593045790                     all          Manticore Search - database for search
ii  manticore-executor                     1.1.12-24071807-0565a65                      amd64        Custom built PHP executor for Manticore.
ii  manticore-galera                       3.37                                         amd64        Synchronous multi-master wsrep provider (replication engine) (Manticore's fork)
ii  manticore-icudata-65l                  5.0.3-221123-d2d9e5e56                       all          Manticore Search - database for search
ii  manticore-repo                         0.0.4                                        all          Manticore Software APT repository deployment package
ii  manticore-server                       6.3.6-24080214-593045790                     amd64        Manticore Search - database for search
ii  manticore-server-core                  6.3.6-24080214-593045790                     amd64        Manticore Search - database for search
ii  manticore-tools                        6.3.6-24080214-593045790                     amd64        Manticore Search - database for search
ii  manticore-tzdata                       1.0.0-240522-a8aa66e                         all          no description given
ii  mariadb-common                         1:10.6.18-0ubuntu0.22.04.1     

提供商在服务器上安装了 manticore 模块https://manticoresearch.com/

但我不明白如何开始使用它。我希望搜索页面能够基于它从数据库中进行选择......

如何做到这一点?有必要启动某种进程,创建一个配置...我对其工作原理的全部理解是该模块创建某种指定表和字段的记录缓存。当访问模块时,它会生成标头中最相似或最接近的记录的结果......

该死,我如何从PHP向它发出第一个请求,如何配置它。然后这个过程将自行进行......

我完全不明白这是如何运作的...

php
  • 1 个回答
  • 20 Views
Martin Hope
Роман
Asked: 2024-10-11 03:34:40 +0000 UTC

逐行读取XML文件,进行更改

  • 5
mpd = ''
file1 = open("/manifest.mpd", "r", encoding = "utf-8")
while True:
    line = file1.readline() # считываем строку
    if not line: break # прерываем цикл, если строка пустая
    if line.strip() == '</Period>':
        mpd += f'       <AdaptationSet id="1" mimeType="image/webp" contentType="image">\n'
        mpd += '        </AdaptationSet>\n'
    mpd += line
file1.write(mpd)   
#print(mpd)
file1.close()

一切都是错误的,您需要读取 mpd 文件,找到该条目,在前面添加几行并将其保存在同一个文件中。我们找到它,添加它,但无法保存它。我尝试了所有模式,最后要么是错误,要么是空文件

最好的方法是什么?

**************

我正在尝试弄清楚如何与xml.etree.ElementTree

tree = ET.parse('/manifest.mpd')
root = tree.getroot()
new_elem = ET.Element('new_tag')
new_elem.set('attribute_name', 'attribute_value')
new_elem.text = 'element_tesssssssxt'
root.findall('AdaptationSet').append(new_elem)

我不明白,他读,改变……

假设您需要添加一行,在最后一个元素之后添加AdaptationSet

这该怎么办,我可以添加线路吗?保存后,所有标签都以ns0:

root.find("{urn:mpeg:dash:schema:mpd:2011}AdaptationSet")

不起作用

python
  • 1 个回答
  • 34 Views
Martin Hope
Роман
Asked: 2024-10-10 13:06:21 +0000 UTC

换行、添加行

  • 5
tile  +=  f'<Representation bandwidth="53445" width="445" height="111">\
                <EssentialProperty schemeIdUri="http://dashif.org/thumbnail_tile" value="10x5"/>\
            </Representation>'

如何折叠线条以便出现换行符。我得到的输出是一行......

python
  • 1 个回答
  • 20 Views
Martin Hope
Роман
Asked: 2024-10-10 08:13:36 +0000 UTC

使用两个键查找 URL 中的条目,即使失败也不会出错

  • 5
document.location.pathname.match(/(news|auto)\-/)[1]

如果是 url,则目录路径...

/news-23
/auto-1113

好的,它可以工作,但是如果没有指定的出现,url 中将会出现错误。当尝试获取不在数组中的值时。

目标是在目录名称中出现指定位置的页面上执行特定代码。

如何修复它、设置条件、检查它?确保它不会立即抛出错误...可能吗?

常规赛不是专家,如果可以一切都一样,只有这一次

document.URL

这会很酷,在域名之后,在第一个斜杠之后应该有新闻或汽车的条目。 True - 我们执行以下代码。 False - 只要 js 不抛出错误。否则脚本将无法工作...

javascript
  • 1 个回答
  • 24 Views
Martin Hope
Роман
Asked: 2024-10-07 07:30:20 +0000 UTC

缩放、增加或减少块,使块宽度达到 10%

  • 7

有一个父块和一个子块。父级的宽度为 653px。子块的宽度可以是 5px 或 300px。随机的...

javascript 中的公式会是什么样子,它将给出 css 属性的值transform:scale(*),应用该值,子块的宽度将等于10%父块的宽度。

javascript
  • 2 个回答
  • 31 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