我目前正在尝试使用以下命令安装我自己的软件包:pip3 install --user .调用此安装脚本。但是,当我这样做时,我得到以下输出:
cherrybomb@cherrybomb:~/cherrybomb$ pip3 install --user .
Processing /home/cherrybomb/cherrybomb
Collecting twisted>=17.9.0 (from cherrybomb==0.1.0)
Collecting pyopenssl>=17.5.0 (from cherrybomb==0.1.0)
Using cached pyOpenSSL-17.5.0-py2.py3-none-any.whl
Collecting wheel>=0.30.0 (from cherrybomb==0.1.0)
Using cached wheel-0.30.0-py2.py3-none-any.whl
Collecting hyperlink>=17.1.1 (from twisted>=17.9.0->cherrybomb==0.1.0)
Using cached hyperlink-17.3.1-py2.py3-none-any.whl
Collecting constantly>=15.1 (from twisted>=17.9.0->cherrybomb==0.1.0)
Using cached constantly-15.1.0-py2.py3-none-any.whl
Collecting Automat>=0.3.0 (from twisted>=17.9.0->cherrybomb==0.1.0)
Using cached Automat-0.6.0-py2.py3-none-any.whl
Collecting incremental>=16.10.1 (from twisted>=17.9.0->cherrybomb==0.1.0)
Using cached incremental-17.5.0-py2.py3-none-any.whl
Collecting zope.interface>=4.0.2 (from twisted>=17.9.0->cherrybomb==0.1.0)
Using cached zope.interface-4.4.3-cp36-cp36m-manylinux1_x86_64.whl
Collecting cryptography>=2.1.4 (from pyopenssl>=17.5.0->cherrybomb==0.1.0)
Using cached cryptography-2.1.4-cp36-cp36m-manylinux1_x86_64.whl
Collecting six>=1.5.2 (from …Run Code Online (Sandbox Code Playgroud) 我刚刚用 bash 写了一个 IRC 机器人(我知道,我知道)。它可以完成我需要的一切(SASL 身份验证、解析链接等),只是它不通过 SSL 进行连接。在 IRC 上进行了大量的谷歌搜索和大量的麻烦之后,我还没有找到一种让 /dev/tcp 使用 SSL 的方法。这是我当前的代码:
#!/bin/bash
if [[ "$1" == "-debug" ]]; then
set -x
fi
irc_send() {
printf ">>> %s\n" "$1"
printf "%s\r\n" "$1" >&3 &
}
sasl_successful() {
while read -ru3 line; do
printf "%s\n" "$line"
read -r location numeric rest <<< "$line"
if [[ "$numeric" == "903" ]]; then
return 0
elif [[ "$numeric" == "904" || "$numeric" == "906" ]]; then
return 1
fi
done
}
sasl_connect() …Run Code Online (Sandbox Code Playgroud) 我正在用 python 构建一个需要使用小型状态机的项目。我当然可以创建一堆像这样的状态
__StateOne__ = 0
__StateTwo__ = 1
__StateThree__ = 2
# etc
Run Code Online (Sandbox Code Playgroud)
然后跟踪类似 state = _ StateOne _ 的东西,但我希望能够做一些像Elixir 风格的atoms 的事情。对于某些导入或第三方库来说这可能吗?
我现在用Google搜索turning off the gcc preprocessor on linux了一段时间(使用那个确切的短语),一切都无关紧要.例如,我想关闭除预处理器之外的所有内容(与我想要的相反)或加压警告.有谁知道禁用预处理器的方法?我发现Facebook开发和声称的更快,我想测试一下.
我最近学会了如何使用std :: tuple(之前我从未需要它),并且很好奇何时才能在容器上使用它?我只是问,因为std :: tuple不像容器,因为它需要诸如std :: get和std :: make_tuple之类的东西.
经过数小时的研究,我一无所获,所以我求助于各位好心人,希望能找到解决方案。我将用 C++ 编写一个机器人,并且在某个时候想为它制作一个插件系统。现在我知道我可以为它编写一种脚本语言,但是,我知道可以只编写一个 api 并在运行时动态地将程序链接到它。我的问题是,我如何获得动态链接(就像 hexchat 的插件一样)?是否有任何优雅的解决方案,或者至少是典型设计的理论?
我正在用c ++编写一个程序,它可以从std :: cin或std :: istringstream获取文件的输入(作为命令行arg传递给它).它工作正常,并使用std :: istream*进行管理.我被告知这很糟糕,处理原始指针,所以我决定将它包装在std :: unique_ptr(即std :: unique_ptr)中.问题是它无法编译.至于我可以从错误中辨别出来,std :: istream已经保护自己不被用来分配内存.我试过谷歌搜索它,但我认为之前没有人发布过这样的问题(因为我只看到只引用std :: unique_ptr的问题).有谁知道如何实现这一目标?
edit: errors: In file included from /usr/include/c++/4.8/iostream:40:0,
from /home/dtscode/Desktop/SLang/src/main.cpp:1:
/usr/include/c++/4.8/istream: In function ‘int main(int, char**)’:
/usr/include/c++/4.8/istream:606:7: error: ‘std::basic_istream<_CharT, _Traits>::basic_istream() [with _CharT = char; _Traits = std::char_traits<char>]’ is protected
basic_istream()
^
compilation terminated due to -Wfatal-errors.
make[2]: *** [CMakeFiles/slang.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/slang.dir/all] Error 2
make: *** [all] Error 2
Run Code Online (Sandbox Code Playgroud)
响应这一行:std :: unique_ptr Stream(new std :: istream());
我也尝试过它而不调用istreams构造函数,并且在unique_ptrs构造函数中没有任何东西
编辑2:
#include <iostream>
#include <fstream>
#include …Run Code Online (Sandbox Code Playgroud) 我正在使用POSIX API在C ++中编写命令外壳,但遇到了麻烦。我正在通过execvp(3)执行,所以我需要以某种方式将包含命令的std :: string转换为可以传递给以下字符的合适的char * consts *数组:
int execvp(const char *file, char *const argv[]);
Run Code Online (Sandbox Code Playgroud)
我已经花了好几个小时动脑筋,但我想不出任何现实或理智的方法来做到这一点。对于我如何实现这种转换的任何帮助或见解,将不胜感激。谢谢你,有一个美好的一天!
编辑:根据Chnossos的请求,这是一个示例:
const char *args[] = {"echo", "Hello,", "world!"};
execvp(args[0], args);
Run Code Online (Sandbox Code Playgroud) 前段时间,我在php写了一个网站,现在我正在我的网络服务器上设置它.回到我写的时候,一切都很好,但现在,它产生了这些错误:
Strict Standards: Only variables should be passed by reference in /home/dragonto/public_html/source/navbar.php on line 4
class="current">Home Strict Standards: Only variables should be passed by reference in /home/dragonto/public_html/source/navbar.php on line 4
>About Strict Standards: Only variables should be passed by reference in /home/dragonto/public_html/source/navbar.php on line 4
>Contact Us Strict Standards: Only variables should be passed by reference in /home/dragonto/public_html/source/navbar.php on line 4
>Projects Strict Standards: Only variables should be passed by reference in /home/dragonto/public_html/source/navbar.php on line 4
>Tutorials
Run Code Online (Sandbox Code Playgroud)
我不确定这些是什么意思.我做过关于在PHP中传递ref的研究,看起来我没有做任何违规.这是有问题的脚本:
<?php
function …Run Code Online (Sandbox Code Playgroud)