小编Phi*_*Bot的帖子

Xcode GIT无法复制新文件

我刚刚安装了Xcode 4.2,现在无法将新的图像文件复制到我的项目中.它与GIT有关,我已经粘贴了下面的错误,但我似乎无法找到谷歌的答案.有人可以说清楚这个吗?

The operation could not be performed because the file is not under version control.
Run Code Online (Sandbox Code Playgroud)

xcode

4
推荐指数
1
解决办法
2891
查看次数

Docker Buildx 无法从本地拉取继承的镜像

我的主机(Ubuntu 20.04)上有 2 个 Dockerfile。我正在运行 docker-ce 版本 Docker 版本 19.03.12,构建 48a66213fe 并启用了实验功能。我能够使用“docker buildx”为 ARM 架构构建它们中的每一个,并在我的嵌入式 Linux ARM 板上成功运行它们。

Dockerfile 1:

FROM python:3.8-slim-buster

COPY git /home/git

WORKDIR /home

RUN apt-get update -y && apt-get --no-install-recommends install build-essential pkg-config libzmq5 -y && \
    cd git && python3 setup.py install && apt remove --purge build-essential pkg-config -y && \
    apt auto-remove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*

ADD publisher.py /home/publisher.py
Run Code Online (Sandbox Code Playgroud)

Dockerfile 2:

FROM python:3.8-slim-buster

COPY git /home/git

WORKDIR /home

RUN …
Run Code Online (Sandbox Code Playgroud)

embedded-linux docker dockerfile docker-registry docker-buildkit

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

用于部署到远程Linux主机的命令行的Qt Creator stdin

我正在使用Qt Creator的Remote Deploy功能在嵌入式Linux目标板上启动我的简单命令行应用程序.我的测试应用程序非常简单,并要求用户打印他/她的名字.它交叉编译,传输到电路板,然后启动,Qt Creator底部附近的"应用输出"窗口显示"输入您的名字:"提示,但我无法在任何地方输入并为通过Qt Creator远程运行的应用程序提供标准输入.

我怎样才能在Qt Creator中实现这一目标?我可以以某种方式操纵部署'参数'来连接设备以向我的命令行应用程序提供stdin吗?我也无法通过选中Projects> Run Configuration下的'run in terminal'复选框远程启动应用程序,因为它不适用于远程部署.

码:

#include <iostream>

using namespace std;

int main() {
    cout << "Enter a number: ";
    int nb;
    cin>>nb;
    cout << "Here is your number:" << nb << endl;
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

Qt Creator中的应用程序输出:

Killing remote process(es)...
Starting remote process ...
Remote process started.
Enter a number: d
Run Code Online (Sandbox Code Playgroud)

c++ qt remote-debugging cross-compiling qt-creator

3
推荐指数
1
解决办法
2122
查看次数

Qt quint32使用QDataStream进行Little-Endianness

我正在使用QDatastream从Little-Endian ARM机器上的QByteArray填充quint32数组,如下所示:

    // Modify the header
    QByteArray header = QByteArray::fromRawData((const char*)dataPtr,HEADER_SIZE);
    QDataStream dataStream(header);
    dataStream.setByteOrder(QDataStream::LittleEndian);
    quint32 headerBuffer[NUMBER_HEADER_ENTRIES];
    int bufferCnt = 0;
    while ( !dataStream.atEnd() ) {

        // Pop off a 32 bit int
        quint32 temp;
        dataStream >> temp;

        // insert into buffer
        headerBuffer[bufferCnt] = temp;

        // Increment counter
        bufferCnt++;

    }
Run Code Online (Sandbox Code Playgroud)

问题在于字节顺序.我需要在headerBuffer [113]中获取32位字段的最后4位,所以我尝试用headerf在headerBuffer中输入该条目.检查该字段的期望值是"3".但是,这个AND操作给了我"a",如下所示.如果我交换字节使条目为"0x1a13&0x000f",那么我得到"3".您可以在下面看到预期值的一些其他示例,而不是我所看到的.所以,我将QDataStream的ByteOrder设置为LittleEndian,但仍未获得所需的结果.我究竟做错了什么?如何获得0x1a13而不是0x131a?谢谢!

        qDebug() << "ONE: " << QString("%1").arg(headerBuffer[0], 0, 16); // This prints: 494d0152 -- Should be: 4d495201
        qDebug() << "TWO: " << QString("%1").arg(headerBuffer[1], 0, 16); // This prints: 5400 -- …
Run Code Online (Sandbox Code Playgroud)

c++ qt endianness qbytearray

3
推荐指数
1
解决办法
6140
查看次数

D-Bus D-Feet在Python语法中发送字符串,变体字典

我正在尝试使用D-Feet为ConnMan发送D-Bus命令.D-Feet表示所有参数都应该是"Python语法".

D-Bus描述D-Bus方法如下:

ConnectProvider(Dict of {String,Variant} provider) => (Object Path path)
Run Code Online (Sandbox Code Playgroud)

我已经尝试过这些(Python词典):

{u'Type': u'wifi', u'Mode': u'managed', u'SSID': u'testSSID', u'Security': u'WPA', u'Passphrase': u'test'}
{'Type': 'wifi', 'Mode': 'managed', 'SSID': 'testSSID', 'Security': 'WPA', 'Passphrase': 'test'}
{"Type": "wifi", "Mode": "managed", "SSID": "testSSID", "Security": "WPA", "Passphrase": "test"}
{"Type":__import__('dbus').String("wifi", variant_level=1),"Mode":__import__('dbus').String("managed", variant_level=1),"SSID":__import__('dbus').String("testSSID", variant_level=1),"Security":__import__('dbus').String("WPA", variant_level=1),"Passphrase":__import__('dbus').String("test", variant_level=1)}
Run Code Online (Sandbox Code Playgroud)

但我不断收到错误'无效参数':

在此输入图像描述

我有dbus-monitor --system运行所以我可以查看系统总线上发生的任何事情但是当我点击'执行'时实际上没有任何东西发送到总线.我立即得到错误,所以我假设D-Feet说输入的格式不正确.

我究竟做错了什么?我该如何发送此命令?谢谢!

python dictionary dbus

3
推荐指数
1
解决办法
4294
查看次数

Python Numpy或Pandas线性插值用于与Datetime相关的值

我的数据看起来如下,但我也可以控制它的格式.基本上,我想使用带有Numpy或Pandas的Python来插入数据集,以实现逐秒插值数据,从而使分辨率更高.

因此,我想在保持原始值的同时,在我当前拥有的每个实际值之间进行线性插值并生成新值.

我如何用Pandas或Numpy来实现这一目标?

举个例子,我有这种类型的数据:

       TIME               ECI_X            ECI_Y          ECI_Z
 2013-12-07 00:00:00, -7346664.77912, -13323447.6311, 21734849.5263,@
 2013-12-07 00:01:00, -7245621.40363, -13377562.35, 21735850.3527,@
 2013-12-07 00:01:30, -7142326.20854, -13432541.9267, 21736462.4521,@
 2013-12-07 00:02:00, -7038893.48454, -13487262.8599, 21736650.3293,@
 2013-12-07 00:02:30, -6935325.24526, -13541724.0946, 21736413.9937,@
 2013-12-07 00:03:00, -6833738.23865, -13594806.9333, 21735778.2218,@
 2013-12-07 00:03:30, -6729905.37597, -13648746.6281, 21734705.6406,@
 2013-12-07 00:04:00, -6625943.01291, -13702423.5112, 21733208.9233,@
 2013-12-07 00:04:30, -6521853.17291, -13755836.5481, 21731288.1125,@
 2013-12-07 00:05:00, -6419753.85176, -13807871.3011, 21729016.1386,@
 2013-12-07 00:05:30, -6315415.32918, -13860754.6497, 21726259.4135,@
 2013-12-07 00:06:00, -6210955.33186, -13913371.1187, 21723078.7695,@
 ...
Run Code Online (Sandbox Code Playgroud)

而且我希望它能够排在第二位 - 即

 2013-12-07 00:00:00, -7346664.77912, -13323447.6311, 21734849.5263,@
 2013-12-07 00:00:01, -7346665.10000, …
Run Code Online (Sandbox Code Playgroud)

python interpolation numpy scipy pandas

3
推荐指数
1
解决办法
5397
查看次数

如何设置 Linux BlueZ 5 连接参数以实现 Apple iOS 兼容性

我发现 Linux 上的 Bluez 5.41 GATT 服务器与 iPhone 之间的 BLE 连接不可靠。连接有效,但有时会随机断开连接。

\n

Apple 有一个文档,指定了维持良好/可靠连接所需的最佳连接参数集:

\n

https://developer.apple.com/library/content/qa/qa1931/_index.html

\n

具体是指以下参数:

\n
There are certain rules and formulae that the parameters must follow. If the parameters do not comply with all of these rules, the parameter request may be rejected, or the stability and the performance of the connection may be compromised.\n\nInterval Min \xe2\x89\xa5 15 ms (multiples of 15 ms)\nInterval Min + 15 ms \xe2\x89\xa4 Interval Max (Interval Max == 15 ms is …
Run Code Online (Sandbox Code Playgroud)

linux bluetooth ios bluetooth-lowenergy bluez

3
推荐指数
1
解决办法
1886
查看次数

新的 Yocto 配方构建但编译后工作目录被删除

我正在尝试将 zbar 的配方从 0.10.0 更新到 0.20.1。这是原始配方:

https://github.com/openembedded/meta-openembedded/blob/master/meta-oe/recipes-support/zbar/zbar_0.10.bb

我修改过的食谱在这个问题的底部。包确实可以编译,但问题是在“打包”步骤期间发生了一些事情,并且“work”目录被清除,除了“work”目录中的“temp”目录。在编译过程中,如果我列出工作目录中的文件,我期望的一切都存在,但是在编译成功后,有些东西会清理文件。我究竟做错了什么?

编译期间:

user@ubuntu:~/rpi/build/tmp/work/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/zbar/0.20.1-r0$ cd ../0.20.1-r0/ ; ls
build              image            pkgdata                sysroot-destdir
configure.sstate   license-destdir  pseudo                 temp
debugsources.list  package          recipe-sysroot
git                packages-split   recipe-sysroot-native
Run Code Online (Sandbox Code Playgroud)

编译后:

user@ubuntu:~/rpi/build/tmp/work/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/zbar/0.20.1-r0$ cd ../0.20.1-r0/ ; ls
temp
Run Code Online (Sandbox Code Playgroud)

约克托食谱:

DESRIPTION = "2D barcode scanner toolkit."
SECTION = "graphics"
LICENSE = "LGPL-2.1"

DEPENDS = "pkgconfig intltool-native libpng jpeg"

LIC_FILES_CHKSUM = "file://LICENSE;md5=243b725d71bb5df4a1e5920b344b86ad"

S = "${WORKDIR}/git"

SRCREV = "edcf08b49e0a5fe71c18fa9d4b8ed83ed8fc9082"
SRC_URI = "git://github.com/mchehab/zbar.git"

inherit autotools pkgconfig

EXTRA_OECONF = " --without-x --without-imagemagick --without-qt --without-python2 --disable-video --without-gtk"

FILES_${PN} += …
Run Code Online (Sandbox Code Playgroud)

linux openembedded zbar yocto

3
推荐指数
1
解决办法
1672
查看次数

带有sendAsynchronousRequest的NSURLConnection进度条Objective-C

我正在使用以下方法下载一堆较大的zip文件.这可能需要一段时间,所以我想显示一个进度条.

我已经研究过如何处理NSURLConnection的委托方法,这似乎很简单,但是我希望用"sendAsynchronousRequest"实现相同的功能.如何获取下载时下载的字节数以及预期的总字节数,以便我可以显示进度条?我知道如果我以我正在进行的方式启动下载,我就无法使用委托方法.

// Begin the download process
- (void)beginDownload:(NSMutableArray *)requests {

    // Now fire off a bunch of requests asynchrounously to download
    self.outstandingRequests = [requests count];
    for (NSURLRequest *request in requests) { // Get the request
        [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {

                                    // Error check
                                    if ( error != nil ) {

                                        // The alertview for login failed
                                        self.appDelegate.warningView.title = @"Refresh Error!";
                                        self.appDelegate.warningView.message = [error localizedDescription];

                                        // Show the view
                                        [self.appDelegate.warningView show];

                                        // Debug
                                        if …
Run Code Online (Sandbox Code Playgroud)

iphone cocoa objective-c nsurlconnection ios

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

TypeError:解码十六进制字符串时的奇数长度字符串

我确保字符串被剥离,我仍然得到奇数字符串问题.有人可以告诉我我做错了什么吗?

>>> toSend = "FF F9 FF 00 00 FA FF F7 FF F4 FF F6 FF F7 FF F6 FF FD FF 05 00 03 00 06 00 05 00 04 00 06 00 06 00 03 00 FB FF 02 00 0B"
>>> toSend.decode("hex")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/encodings/hex_codec.py", line 42, in hex_decode
    output = binascii.a2b_hex(input)
TypeError: Odd-length string
>>> 
Run Code Online (Sandbox Code Playgroud)

python string hex decode python-2.7

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