小编gre*_*gor的帖子

Python LogicError:clGetPlatformIDs失败:未找到平台khr

在Ubuntu中为Python程序集进行鼻子测试时会发生错误:

devices = [ d for d in cl.get_platforms()[0].get_devices() if
LogicError: clGetPlatformIDs failed: platform not found khr


File "/home/fateeva/prog/deflectometry/SGMFMeasurement/_PhaseShifts.py", line 30, in <module>
    devices = [ d for d in cl.get_platforms()[0].get_devices() if
LogicError: clGetPlatformIDs failed: platform not found khr
Run Code Online (Sandbox Code Playgroud)

如何修复它?

ubuntu pyopencl

5
推荐指数
3
解决办法
6494
查看次数

是否有 Javascript LLVM IR 位码解释器?

我正在尝试在浏览器中运行现有的 C 项目,而不依赖于插件/插件/等。源是 3MB,生成的编译位代码(llvm-link)是 3.5M。

使用 lli 运​​行 bitcode 时,内存使用量约为 150MB,与编译本机 ELF 二进制文件并运行时相同。

Emscripten (-O2 --closure 0) 将位码编译为 24MB .js 文件,当使用 Node.js 运行该文件时,内存不足(顶部显示大约 2GB 的内存使用)。

正如 jslinux 演示所示,应该可以解释本机代码。可以说,以可接受的性能解释编译后的位码应该更容易。我的问题是是否有任何项目试图在 javascript 中解释 LLVM IR(而不是像 Emscripten、mandreel 和其他人那样将 IR 翻译成 javascript)。

javascript interpreter llvm llvm-ir

5
推荐指数
0
解决办法
1079
查看次数

Arduino没有得到认可

我不确定这是问的正确地方,但是我已经在stackoverflow上看到了其他Arduino线程,所以我认为这没问题。

我的arduino不兼容的主板未得到认可。我在Windows 8和Windows XP上尝试过。当我打开设备管理器时,“端口(COM和LPT)”部分下只有一个名为“ USB串行端口”的条目。但是,Arduino在连接时不会闪烁。

我尝试卸载USB串行端口驱动程序或对其进行更新,但两者均无效:这些驱动程序似乎是最新的,当我卸载并重新连接arduino时,它们再次出现。

当我尝试上传程序时,我得到

avrdude: stk500_getsync(): not in sync: resp=0x00
Run Code Online (Sandbox Code Playgroud)

要么

avrdude: usbdev_open(): did not find any USB device "usb"
Run Code Online (Sandbox Code Playgroud)

(当我使用“使用编程器上传”时)。

我希望任何人都可以帮助我,我已经尝试了很长时间了。

设备管理器的屏幕快照,连接了Arduino Uno兼容板并闪烁

编辑2:我在父母的装有Windows Vista的计算机上尝试了相同的操作。在那里,该板被识别为“未知设备”下的USB串行端口(首先,我认为这是一个包含两个大写字母然后四个数字的代码,但我不确定,我无法得到该代码)重命名,即使卸载驱动程序也是如此。

arduino arduino-uno

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

使用 Node.js 和 Johnny-Five 找不到模块“串行端口”

我尝试使用 Johnny- Five 和 node.js 来运行脚本,使用 Leap Motion Controls。现在,当我尝试运行脚本时,它说:(错误:找不到模块“串行端口”)我尝试了 npm install -g 串行端口 它会通过然后给我很多红色的(错误)代码。我怎样才能解决这个问题 ?

D:>节点robotarm.js

module.js:338
    throw err;
          ^
Error: Cannot find module 'serialport'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Board.Serial.detect (D:\node_modules\johnny-five\lib\board.js:70:7)
    at new Board (D:\node_modules\johnny-five\lib\board.js:303:23)
    at Object.<anonymous> (D:\robotarm.js:90:9)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
Run Code Online (Sandbox Code Playgroud)

#

然后我尝试

D:>npm 安装串口

它给

npm WARN package.json github-url-from-git@1.1.1 No repository field.
npm http GET https://registry.npmjs.org/serialport
npm http 304 https://registry.npmjs.org/serialport
npm http GET https://registry.npmjs.org/optimist …
Run Code Online (Sandbox Code Playgroud)

node.js

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

使用 PHP 的 shell_exec() 运行 cordova -v

有没有人成功地让 PHPshell_exec()成功运行 Cordova-CLI 命令?本质上,当我运行以下命令时:

<?php
    try {
        putenv('PATH='. getenv('PATH') .':/usr/local/bin');
        exec('cordova -v 2>&1', $output);
        print_r($output);
    }
    catch(Exception $ex) {
        echo '<pre>';
        print_r($ex);
    }
?>
Run Code Online (Sandbox Code Playgroud)

我得到以下结果:

Array
(
    [0] => path.js:8
    [1] =>     throw new TypeError('Path must be a string. Received ' +
    [2] =>     ^
    [3] => 
    [4] => TypeError: Path must be a string. Received undefined
    [5] =>     at assertPath (path.js:8:11)
    [6] =>     at Object.posix.join (path.js:479:5)
    [7] =>     at Object.<anonymous> (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/util.js:35:31)
    [8] =>     at Module._compile (module.js:410:26)
    [9] …
Run Code Online (Sandbox Code Playgroud)

php linux ubuntu cordova

5
推荐指数
0
解决办法
269
查看次数

没有库的Arduino伺服器

作为发送数字信号的教育练习,我试图在不使用伺服.h 库的情况下为伺服编码脉冲序列。

舵机是一个 9g 的微型舵机。硬件是正确的,因为许多使用servo.h 的例子工作正常。

我有以下代码。问题是伺服系统会猛烈晃动 3 秒钟,而不是移动并保持静止。

void loop() {
    movePulse_1000();
    delay(3000);
}

void movePulse_1000(){
    Serial.print("Start movePulse_1000()\t\t");
    for (int pulseCounter=0; pulseCounter<=150; pulseCounter++){
        digitalWrite(pinServo,LOW);
        delay(20); // between pulses
        digitalWrite(pinServo,HIGH);
        delayMicroseconds(1000);
    }
    Serial.println("End movePulse_1000()");
}
Run Code Online (Sandbox Code Playgroud)

arduino servo

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

如何将串行数据流读入闪亮的应用程序

我想从串行端口(USB 端口)读取数据流。

就我而言,它是来自 Arduino 板的数据,但我认为这个问题很普遍。

这在 R 中很容易完成。例如:

library(serial)
conn <- serialConnection("arduino", port="ttyUSB0", mode="9600,n,8,1") # port may be different on other machines and OS's
open(conn)
while(TRUE) { print(read.serialConnection(conn) ) }
Run Code Online (Sandbox Code Playgroud)

这将不断地将数据流吐出为文本(包括许多 NULL)。

我想在 Shiny App 中做类似的事情。尽管在此处对 R/Shiny 和数据流进行了出色的介绍,但我还没有设法使其正常工作:链接。下面有一个最小的非工作示例。

报告的错误是:argument 1 (type 'closure') cannot be processing by 'cat' which has been changed. 是print() 可以处理而renderText() 不能处理的数据类型问题吗?

library(shiny)
library(serial)

conn <- serialConnection("arduino", port="ttyUSB0", mode="9600,n,8,1")
open(conn)

ui <- fluidPage(
  titlePanel("Shiny Data Serial Stream"),
  fluidRow(
    column(4, 
       hr(),
       textOutput('serial'),
       hr()
      ) 
    )
  )

server …
Run Code Online (Sandbox Code Playgroud)

serial-port r shiny

5
推荐指数
0
解决办法
656
查看次数

Arduino 未编译 - 可执行文件中的 CPU 类型错误

最近我试图在我的 Arduino 上上传一些代码并得到这个错误:

****Arduino: 1.8.9 (Mac OS X), Board: "Arduino/Genuino Uno"

fork/exec /Users/Gu/Desktop/Every single yhing/coding stuff/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++: bad CPU type in executable
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.****
Run Code Online (Sandbox Code Playgroud)

我很快了解到这是由于 macOS 更新 Catalina 不再支持 32 位应用程序,并且 avr-g++ 钥匙串工具通过 32 位进程运行。

如果有人有解决此问题的任何解决方案,请帮助我。

macos arduino avr-gcc macos-catalina

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

Python MySQLClient 安装失败并显示“元数据生成失败”

好吧,我已经“谷歌搜索”但没有找到答案。基于 Python 的站点(基于其 )的例行更新requirements.txt现在在尝试更新“mysqlclient”时失败,并显示元数据生成失败。问题是为什么。

python mysql

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

使用Meteor.js从服务器下载文件

这是我现在的工作流程:

在按钮单击事件中,我将搜索结果导出到.csv文件,该文件将保存到服务器.保存文件后,我想将其发送到浏览器下载.使用此问题如何在meteor.js中处理条件文件下载,我创建了一个在保存文件返回的方法之后调用的方法.这是方法:

exportFiles: function(file_to_export) {
    console.log("to export = "+file_to_export);
    Meteor.Router.add('/export', 'GET', function() {
        console.log('send '+file_to_export+' to browser');
        return [200,
        {
           'Content-type': 'text/plain',
           'Content-Disposition': "attachment; filename=" + this.request.query.file
        }, fs.readFileSync( save_path + this.request.query.file )];
    });
}
Run Code Online (Sandbox Code Playgroud)

然而,我的问题是如何调用该路线?使用.Router.to('/export?file=filename.ext')不起作用,并导致用户离开当前页面.我希望这对用户来说是无缝的,我不希望他们知道他们被重定向.在任何人问之前save_path,在方法之外声明,所以它确实存在.

javascript download url-routing meteor

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