RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

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

全部问题

Martin Hope
Dream
Asked: 2025-02-14 22:40:00 +0000 UTC

如何在 css 中制作一个带有尾巴的矩形?

  • 7

请告诉我如何制作一个左上角带有箭头的矩形?我尝试::before用半圆形,但无法实现这种形状。

.BigField {
  position: relative;
  left: 0;
  top: 74px;
  height: 50px;
  width: 624px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
  background-color: white;
}

.SmallField {
  position: relative;
}

.SmallField form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.textarea-wrapper {
  position: relative;
}


.textarea-wrapper::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: 10px solid transparent;
  border-right-color: rgb(255, 0, 0);
  border-radius: 50%;
  left: 20px;
  top: 3px;
}


.SmallField textarea {
  position: absolute;
  height: 28px;
  width: 572px;
  top: 8px;
  right: 8px;
  resize: none;
  border-radius: 14px;
  outline: none;
  border: none;
  color: white;
  background-color: rgba(0, 0, 0);
  padding: 0 11px;
  line-height: 28px;
  cursor: text;
  caret-color: white;
  box-sizing: border-box;
}

.SmallField textarea::placeholder {
  color: white;
}
<div class="BigField">
  <div class="SmallField">
    <form>
      <div class="textarea-wrapper">
        <textarea placeholder="Текст"></textarea>
      </div>
    </form>
  </div>
</div>

在此处输入图片描述

css
  • 1 个回答
  • 141 Views
Martin Hope
Kirill Mineev
Asked: 2025-02-14 22:21:43 +0000 UTC

在 Windows PowerShell 中运行“npm ci && npm start”命令时出错

  • 5

根据任务条款,该团队npm ci && npm start必须启动该项目。我使用 vite 汇编器。我知道如何组建一个团队npm start。但是当我运行它时它npm ci && npm start出现错误:

在此版本中,“&&”标记不是有效的语句分隔符。 + CategoryInfo:ParserError:(:) [],ParentContainsErrorRecordException + FullyQualifiedErrorId:InvalidEndOfLi

我使用 NodeJs 版本 22.14.0 LTS。

npm ci && npm start我想知道如何使用这个( )命令来运行项目。

node.js
  • 1 个回答
  • 24 Views
Martin Hope
Sergio
Asked: 2025-02-14 19:39:18 +0000 UTC

QML:TypeError:对象“包含”的属性...不是一个函数

  • 4

我刚刚开始使用 Qt Quick 但遇到了一个问题。有一堂课

class CanHandler : public QObject
{
    Q_OBJECT
    Q_PROPERTY(QStringList plugins READ plugins NOTIFY pluginsChanged)
    Q_PROPERTY(QStringList interfaceNames READ interfaceNames NOTIFY interfacesChanged)
    Q_PROPERTY(QString selectedPlugin READ selectedPlugin WRITE setSelectedPlugin NOTIFY selectedPluginChanged)
public:
    explicit CanHandler(QObject *parent = nullptr);

    QStringList plugins() const { return m_plugins; }
    QStringList interfaceNames() const { return m_interfaceNames; }
    QString selectedPlugin() const { return m_selectedPlugin; }

signals:
    void pluginsChanged();
    void interfacesChanged();
    void selectedPluginChanged();

public slots:
    void setSelectedPlugin(const QString &pluginName)
    {
        if (pluginName == m_selectedPlugin)
            return;

        m_selectedPlugin = pluginName;
        updateInterfaceNames();
        emit selectedPluginChanged();
    }

private:
    QStringList m_plugins;
    QList<QCanBusDeviceInfo> m_interfaces;
    QStringList m_interfaceNames; // Store names for QML access
    QString m_selectedPlugin;

    void updateInterfaceNames() {
        m_interfaceNames.clear();
        if (!m_selectedPlugin.isEmpty()) {
            m_interfaces = QCanBus::instance()->availableDevices(m_selectedPlugin);
            for (const auto &info : m_interfaces) {
                m_interfaceNames.append(info.name());
            }
        }

        emit interfacesChanged();
    }
};

有CanPluginComboBox.qml

ComboBox {
    id: pluginComboBox
    property var can: null
    model: can ? can.plugins : []
    Component.onCompleted: {
        // Initialize currentIndex based on selectedPlugin
        if (can && can.plugins.contains(can.selectedPlugin)) {
            currentIndex = can.plugins.indexOf(can.selectedPlugin);
        } else if (can && can.plugins.length > 0) {
            currentIndex = 0;
        }
    }
    onActivated: can.setSelectedPlugin(currentText)

    Connections {
        target: can
        ignoreUnknownSignals: true

        onSelectedPluginChanged: {
            if (can && can.plugins.contains(can.selectedPlugin)) {
                currentIndex = can.plugins.indexOf(can.selectedPlugin);
            }
        }
    }
}

有 SettingsPageForm.ui.qml

Page {
    width: 1024
    height: 700

    title: qsTr("Settings")

    Label {
        text: qsTr("You are on Page 2.")
        anchors.centerIn: parent
    }

    CanPluginComboBox {
        // Use the custom component
        id: plugin_ComboBox
        can: can0
        width: 170
    }

    ComboBox {
        id: comboBox_canInterface
        x: 317
        y: 65
        width: 128
        model: can0.interfaceNames
    }
}

在 main.qml 中:

CanHandler {
   id: can0
}

问题出在can.plugins.contains(can.selectedPlugin)) 我收到的错误行中:

TypeError:对象 passthrucan、peakcan、socketcan、tinycan、virtualcan 的属性“contains”不是函数

console.log("can.plugins =", can.plugins)

输出一个数组 qml: can.plugins = [passthrucan,peakcan,socketcan,tinycan,virtualcan] 但数组检查失败

if (Array.isArray(can.plugins)) {
    console.log("can.plugins is array")
} else {
    console.error("can.plugins is not array!")
}
c++
  • 1 个回答
  • 39 Views
Martin Hope
Дима Й
Asked: 2025-02-14 06:58:39 +0000 UTC

通过 PDO 进行长 SELECT 查询

  • 3

有一个通过 PDO 进行的 mysql 查询

    $statement = $this->database->getConnection()->prepare(
        'SELECT a, b, c, d, e, f, g, h, timeReceipt
         FROM data
         WHERE idModem = :idModem
         AND  timeReceipt BETWEEN :startTime AND :endTime order by timeReceipt ASC'
    );
    $statement->execute([
        'startDatetime' => (int) $startDatetime,
        'endDatetime' => (int) $endDatetime,
        'idModem' => $idModem
    ]);
    $res = $statement->fetchAll(PDO::FETCH_NUM); 

从一个包含700多万条记录的表中查询。使用了两个索引:idModem(bigInt)和timeReceipt(bigInt)-timestump。结果是一个包含 720 个元素的关联数组。大约需要5秒钟才能完成。在此处输入图片描述

只是,通过微时间,这个片段大约需要5秒。

     $time4 = microtime(true);
         //запрос
     $time5 = microtime(true);

解释在此处输入图片描述

在 phpmyadmin 显示配置文件中查询执行时间;0.03c在不同的值下。为什么 PDO 中的查询执行如此缓慢?

php
  • 1 个回答
  • 85 Views
Martin Hope
Евгений
Asked: 2025-02-14 06:50:27 +0000 UTC

用于 PDF 压缩的 BASH 脚本 - 带文件列表的空格

  • 6

我想使用 ps2pdf 压缩目录中的 PDF,但无法设置 for 循环。文件命名不断出现错误。

filelist=$(find . -name \*.pdf)
for i in "$filelist"; do
    ps2pdf -dPDFSETTINGS=/ebook "$i"
done

变量用引号引起来是因为文件名包含空格。

如果目录中有一个文件,则脚本有效。如果目录中有多个文件,脚本将返回错误Error: /undefinedfilename in。

告诉我,可能是什么问题?

bash
  • 1 个回答
  • 35 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