当我运行时php --version(在CentOS版本6.4上),我得到:
# php --version
Failed loading /usr/lib/php/modules/xdebug.so: /usr/lib/php/modules/xdebug.so: cannot open shared object file: No such file or directory
PHP 5.4.19 (cli) (built: Aug 22 2013 08:03:53)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
Run Code Online (Sandbox Code Playgroud)
"无法加载/usr/lib/php/modules/xdebug.so:/usr/lib/php/modules/xdebug.so:无法打开共享对象文件:没有这样的文件或目录"消息的来源是什么?
我使用以下方法确认了我的php.ini文件的位置:
# php -a
Failed loading /usr/lib/php/modules/xdebug.so: /usr/lib/php/modules/xdebug.so: cannot open shared object file: No such file or directory
Interactive shell
php > echo php_ini_loaded_file() . "\n";
/etc/php.ini …Run Code Online (Sandbox Code Playgroud) 我需要在预先安装了Python 2.3.4的Linux机器上运行一些代码.我不在该机器的sudoers列表中,所以我将Python 2.6.4构建到我的主目录的(子目录)中.然后我尝试使用virtualenv(第一次),但得到了:
$ Python-2.6.4/python virtualenv/virtualenv.py ENV
New python executable in ENV/bin/python
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Installing setuptools.........
Complete output from command /apps/users/dspitzer/ENV/bin/python -c "#!python
\"\"\"Bootstrap setuptoo...
" /apps/users/dspitzer/virtualen...6.egg:
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "<string>", line 67, in <module>
ImportError: No module named md5
----------------------------------------
...Installing setuptools...done.
Traceback (most recent call last): …Run Code Online (Sandbox Code Playgroud) 我熟悉一些JRuby代码,我希望能够在代码中放置一个断点并从命令行运行(像往常一样),让它在到达那一点时进入调试器.我可以在代码中添加一些东西来强制JRuby进入调试器吗?
我试过运行jruby -r debug foo.rb(而不是通常jruby foo.rb),然后设置断点b bar.py:98,然后继续.但是每次出现异常时调试器都会停止,并且在它到达我感兴趣的代码行之前似乎有很多它们.我希望能够将"break-into-debugger"放入在我的代码中运行并运行jruby foo.rb调试器停在该行的第一个位置.
(即我正在寻找import pdb;pdb.set_trace()Python中的Ruby/JRuby等价物.)
我希望能够使用Cmockery来模拟从我正在测试的C++代码调用的C函数.作为向前迈出的一步,我将Cmockery示例run_tests.c重命名为run_tests.cpp,并尝试使用cmockery.c进行编译和链接:
g++ -m32 -DHAVE_CONFIG_H -DPIC -I ../cmockery-0.1.2 -I /usr/include/malloc -c run_tests.cpp -o obj/run_tests.o
gcc -m32 -DHAVE_CONFIG_H -DPIC -Wno-format -I ../cmockery-0.1.2 -I /usr/include/malloc -c ../cmockery-0.1.2/cmockery.c -o obj/cmockery.o
g++ -m32 -o run_tests obj/run_tests.o obj/cmockery.o
Run Code Online (Sandbox Code Playgroud)
前两个命令行(编译)是成功的,但在最后我得到:
Undefined symbols:
"_run_tests(UnitTest const*, unsigned long)", referenced from:
_main in run_tests.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)
该未定义的符号来自run_tests.cpp的第29行:
return run_tests(tests);
Run Code Online (Sandbox Code Playgroud)
run_tests()函数在cmockery.c中定义.
在阅读" 使用'gcc'(没有g ++)链接C++代码 "之后,我尝试了:
gcc -lstdc++ -m32 -o run_tests obj/run_tests.o obj/cmockery.o
Run Code Online (Sandbox Code Playgroud)
但得到了相同的结果:
Undefined symbols:
"_run_tests(UnitTest const*, unsigned long)", …Run Code Online (Sandbox Code Playgroud) 我想以编程方式(从插件)更改CDT托管构建项目中单个文件的"工具设置"选项卡中"其他设置"中的"其他标志"字段.(请参阅此Eclipse文档页面以获取截图以及如何使用UI进行此更改的简要说明.)
注意:当我接近解决方案时,我已经更新了两次.但是我没有在最后添加更新(正如我对更短的问题所做的那样),而是在修改整个问题.如果看到面包屑导致我现在的位置有帮助,您可以阅读历史记录.
以下代码将导致写入.cproject文件的设置(我将在下面详细介绍),但是当我打开文件的Properties对话框,然后单击C/C++ Build-> Settings然后单击Miscellaneous,更改不会出现在"其他标志"字段中(就像我使用对话框进行更改时一样).
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow workbenchwindow = workbench.getActiveWorkbenchWindow();
IWorkbenchPage workbenchpage = workbenchwindow.getActivePage();
IEditorPart editorpart = workbenchpage.getActiveEditor();
IEditorInput editorinput = editorpart.getEditorInput();
IResource file = ((IFileEditorInput)editorinput).getFile();
IProject project = file.getProject();
IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(project);
IConfiguration[] configurations = buildInfo.getManagedProject().getConfigurations();
IConfiguration conf = configurations[0];
IFileInfo fileInfo = conf.createFileInfo(file.getFullPath());
ITool[] tools = fileInfo.getTools();
ITool tool = tools[0];
IOption option = tool.getOptionById("my.gnu.compiler.misc.other");
String oldOptionValue = option.getDefaultValue().toString();
String newOptionValue = oldOptionValue + " -eg";
ManagedBuildManager.setOption(fileInfo, tool, option, newOptionValue);
ManagedBuildManager.saveBuildInfo(project, true); …Run Code Online (Sandbox Code Playgroud) 我正在像这样从命令行调用 TestNG:
java org.testng.TestNG -groups "foo" testng.xml
Run Code Online (Sandbox Code Playgroud)
...只打算运行带有以下注释的测试:
@Test(groups = { "foo" })
Run Code Online (Sandbox Code Playgroud)
...但它正在运行我所有的测试。我需要更改我的 testng.xml 文件吗?
<suite name="BarSuite" verbose="1">
<test name="AllInPackage">
<packages>
<package name="com.example.bar"/>
</packages>
</test>
</suite>
Run Code Online (Sandbox Code Playgroud)
TestNG 是否忽略了 -groups 命令行参数,因为 testng.xml 说要运行包中的所有测试?如果是这样,我应该如何更改我的 testng.xml 文件?
我可以使用以下方法在Numbers电子表格中设置单元格的格式:
tell application "Numbers"
activate
tell document 1
tell active sheet
set the selectedTable to ¬
(the first table whose class of selection range is range)
end tell
tell selectedTable
tell column "J"
set the format of cell 3 to number
end tell
end tell
end tell
end tell
Run Code Online (Sandbox Code Playgroud)
但是如何设置单元格的小数位数?
我/docker-entrypoint-initdb.d从这个答案中发现了目录,还阅读了“如何使用这个图像”MySQL 文档的“初始化一个新实例”部分。但是当我docker-compose up在包含以下docker-compose.yml文件的目录中运行时,我的数据库没有初始化。
services:
# Use root/root as MySQL user/password credentials
db:
image: mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: root
MYSQL_PASSWORD: root
MYSQL_DATABASE: db
volumes:
- ./mysql/data:/var/lib/mysql
- ./mysql/init:/docker-entrypoint-initdb.d/:ro
adminer:
image: adminer
restart: always
ports:
- 8080:8080
Run Code Online (Sandbox Code Playgroud)
我确认该./mysql/init目录包含一个名为init.sql. 我确认在清空./mysql/data目录并运行后docker-compose up,db创建了一个数据库。但是没有填充数据库,除非我在 Adminer 中手动执行脚本。(我单击“导入”,然后选择文件并按“执行”按钮。)
运行后docker-compose up,我在控制台输出中查找消息,这些消息表明尝试运行init.sql但找不到任何内容。
更新: MySQL 版本为 8.0.19。
我无法安装Homebrew(请参阅我在 apple.stackexchange.com 上的问题),所以我查看了https://raw.github.com/mxcl/homebrew/go Ruby 脚本并尝试了它运行的相同命令:
$ git init -q
$ git remote add origin https://github.com/mxcl/homebrew
$ git fetch origin master:refs/remotes/origin/master -n
error: Could not resolve host: (nil); nodename nor servname provided, or not known while accessing https://github.com/mxcl/homebrew/info/refs?service=git-upload-pack
fatal: HTTP request failed
Run Code Online (Sandbox Code Playgroud)
为什么我收到这个错误?
更新:(回应madhead的回答)
当我使用带有.git后缀的 URL 时,我遇到了同样的问题:
$ git init -q
$ git remote add origin https://github.com/mxcl/homebrew.git
$ git fetch origin master:refs/remotes/origin/master -n
error: Could not resolve host: (nil); nodename nor …Run Code Online (Sandbox Code Playgroud) java ×2
applescript ×1
break ×1
c ×1
c++ ×1
cmockery ×1
command-line ×1
debugging ×1
docker ×1
eclipse ×1
eclipse-cdt ×1
gcc ×1
git ×1
github ×1
https ×1
ini ×1
init ×1
jruby ×1
mysql ×1
numbers ×1
php ×1
phpstorm ×1
plugins ×1
python ×1
ruby ×1
spreadsheet ×1
testng ×1
unit-testing ×1
virtualenv ×1
xdebug ×1