小编pra*_*tom的帖子

SRC_URI不适用于bitabake配方

我创建了一个用于安装https://pypi.python.org/pypi/Adafruit-GPIO/1.0.3 python包的bitbake配方.以下是我的食谱

DESCRIPTION = "Library to provide a cross-platform GPIO interface on the Raspberry Pi and Beaglebone Black using the RPi.GPIO and Adafruit_BBIO libraries"
SECTION = "devel/python"
LICENSE = "CLOSED"

PR = "r1"

SRC_URI = "https://pypi.python.org/packages/db/1c/2dc8a674514219f287fa344e44cadfd77b3e2878d6ff602a8c2149b50dd8/Adafruit_GPIO-1.0.3.tar.gz"

inherit pypi setuptools

do_install_append() {
  rm -f ${D}${libdir}/python*/site-packages/site.py*
}

do_compile_prepend() {
    ${STAGING_BINDIR_NATIVE}/python setup.py install ${DISTUTILS_BUILD_ARGS} || \
    true
}
SRC_URI[md5sum] = "dfcdb1ba90188d18ba80b6d2958c8c33"
Run Code Online (Sandbox Code Playgroud)

但每当我尝试咬食谱时,我总会收到以下错误

ERROR: Function failed: Fetcher failure for URL: 'https://pypi.python.org/packages/source/A/Adafruit-GPIO/Adafruit-GPIO-1.0.3.tar.gz'. Unable to fetch URL from any source
Run Code Online (Sandbox Code Playgroud)

我的问题为什么当我在SRC_URI中有其他链接时,bitbake会尝试从其他链接下载?我怎样才能纠正我的食谱>

bitbake yocto

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

在c#中更改超时按钮的文本

如何在超时时更改按钮文本?我尝试使用以下代码,但它无法正常工作.

private void button1_Click(object sender, EventArgs e)
{
    Stopwatch sw = new Stopwatch();
    sw.Start();
    if (button1.Text == "Start")
    {
        //do something
        button1.Text = "stop"
        if (sw.ElapsedMilliseconds > 5000)
        {
            button1.Text = "Start";

        }
    }
Run Code Online (Sandbox Code Playgroud)

我该如何更正我的代码?

.net c# timeout timer winforms

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

ConcurrentQueue <T>类真的是线程安全吗?

我在串口上快速接收数据,而在其他线程中我正在处理串口上收到的数据包.因此,对于线程安全的读写操作,我使用concurrentqueue.以下是我在串行端口上接收数据的代码,我将其存储在concurrentqueue中.

System.Collections.Concurrent.ConcurrentQueue<byte> receivedData = new System.Collections.Concurrent.ConcurrentQueue<byte>();
private void receiveData(object sender, SerialDataReceivedEventArgs e)
{
    while (connectComPort.BytesToRead > 0)
    {
        receivedData.Enqueue((byte)connectComPort.ReadByte());
    }
}
Run Code Online (Sandbox Code Playgroud)

以下是在后台线程中运行的concurrentqueue中处理数据的代码.

private void processBuffer()
{
    while (1 == 1)
    {
        try
        {
            List<byte> storeData = new List<byte>();
            if (startProcessState == 0)
            {

                storeData.Clear();
                break;
            }
            if (receivedData.Count() > 7)
            {
                byte first = 0x00;
                receivedData.TryPeek(out first);
                if (startProcessState == 0)
                {

                    storeData.Clear();
                    break;
                }


                if (first == 0x55)
                {
                    first = 0x00;
                    receivedData.TryDequeue(out first);
                    storeData.Add(first);

                    receivedData.TryPeek(out first);

                    if (first …
Run Code Online (Sandbox Code Playgroud)

c# multithreading

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

引导日期选择器位置

我正在为日期选择器使用以下示例代码

<html>
<head>
<!--  jQuery -->
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<!-- Isolated Version of Bootstrap, not needed if your site already uses Bootstrap -->
<link rel="stylesheet" href="https://formden.com/static/cdn/bootstrap-iso.css" />

<!-- Bootstrap Date-Picker Plugin -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/js/bootstrap-datepicker.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/css/bootstrap-datepicker3.css"/>


</head>
<body>
<div class="bootstrap-iso">
    <div class="container-fluid">
    <div class="row">
    <div class="col-md-6 col-sm-6 col-xs-12">

    <!-- Form code begins -->
    <form method="post">
        <div class="form-group"> <!-- Date input 1-->
            <label class="control-label" for="date">Start Date</label>
            <input class="form-control" id="date" name="date" placeholder="MM/DD/YYY" type="text"/>
        </div>
        <div class="form-group"> <!-- Date input 2--> …
Run Code Online (Sandbox Code Playgroud)

javascript datepicker twitter-bootstrap-3

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

c#以更短,更有效的方式连接字符串

如何以最短和最有效的方法将各种字符串连接到字符串中.目前我正在以下列方式进行

string str1 = string.Format(BitConverter
       .ToString(pass_packet, local_index + 511, 1) +
       BitConverter.ToString(pass_packet, local_index + 510, 1) +
       BitConverter.ToString(pass_packet, local_index + 509, 1) +
       BitConverter.ToString(pass_packet, local_index + 508, 1) + 
       ... + BitConverter.ToString(pass_packet, local_index + 400, 1));
Run Code Online (Sandbox Code Playgroud)

c# string string-concatenation

0
推荐指数
1
解决办法
104
查看次数

打印sql查询结果在一行

我在表中有两列(groupID,memberID),我执行以下mysql查询

select `groupID` from `tbl_groupassign` where `memberID` = 'check1';
Run Code Online (Sandbox Code Playgroud)

打印列groupID但我想在单行中显示groupID,每个groupID用逗号分隔.例如,我通过执行上面的查询得到以下结果

组ID

1组

第2组

但我希望将它显示为group1,group2

mysql

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