区分 gcc 诊断

2024-04-09

我在解释 gcc (4.8.2) 警告和错误时遇到问题。更准确地说,很难判断一个问题从哪里结束,另一个问题从哪里开始。我只能通过控制台访问构建机器,因此不能选择使用 IDE。

我真的需要能够快速区分各个问题。有没有办法让 GCC 在不同的诊断消息之间插入一些内容?

这是我得到的示例输出:

/usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp: In member function ‘virtual bool xmodel::Core::DataItemCollection::tryAdditionalItemRegistration(std::shared_ptr<xmodel::Core::IDataItem>) const’:
/usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp:414:66: error: no matching function for call to ‘bind(<unresolved overloaded function type>, const std::_Placeholder<1>&, const QUuid&)’
       , std::bind(&IDataItemCollectionScope::findItemById, _1, id)
                                                                  ^
/usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp:414:66: note: candidates are:
In file included from /gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/bits/stl_algo.h:66:0,
                 from /gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/algorithm:62,
                 from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/qglobal.h:68,
                 from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/qatomic.h:45,
                 from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/qhash.h:45,
                 from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/QHash:1,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/rappserv/code/include/convenience/stdhash_quuid.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/ItemId.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/IDataItem.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/DataItemDescriptor.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/IDataItemCollection.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp:9:
/gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/functional:1655:5: note: template<class _Func, class ... _BoundArgs> typename std::_Bind_helper<std::__or_<std::is_integral<typename std::decay<_Tp>::type>, std::is_enum<typename std::decay<_Tp>::type> >::value, _Func, _BoundArgs ...>::type std::bind(_Func&&, _BoundArgs&& ...)
     bind(_Func&& __f, _BoundArgs&&... __args)
     ^
/gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/functional:1655:5: note:   template argument deduction/substitution failed:
/usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp:414:66: note:   couldn't deduce template parameter ‘_Func’
       , std::bind(&IDataItemCollectionScope::findItemById, _1, id)
                                                                  ^
In file included from /gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/bits/stl_algo.h:66:0,
                 from /gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/algorithm:62,
                 from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/qglobal.h:68,
                 from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/qatomic.h:45,
                 from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/qhash.h:45,
                 from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/QHash:1,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/rappserv/code/include/convenience/stdhash_quuid.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/ItemId.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/IDataItem.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/DataItemDescriptor.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/IDataItemCollection.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp:9:
/gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/functional:1682:5: note: template<class _Result, class _Func, class ... _BoundArgs> typename std::_Bindres_helper<_Result, _Func, _BoundArgs>::type std::bind(_Func&&, _BoundArgs&& ...)
     bind(_Func&& __f, _BoundArgs&&... __args)
     ^
/gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/functional:1682:5: note:   template argument deduction/substitution failed:
/usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp:414:66: note:   couldn't deduce template parameter ‘_Result’
       , std::bind(&IDataItemCollectionScope::findItemById, _1, id)
                                                                  ^
/usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp:417:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^

实际上,这还不算太糟糕,因为不涉及宏扩展(我们也使用 Boost.Preprocessor)。尽管如此,一眼看出这个输出是关于两个问题的,第二个是最后 3 行,第一个占据了之前的整面文本墙,这是非常困难的。

有没有办法在它们之间插入一些分隔符?即使是一个空行也可以,你可以搜索或grep for.

我读过有关控制诊断消息格式的选项的 GCC 文档 http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Language-Independent-Options.html#Language-Independent-Options,但我找不到任何东西。[也不能用作搜索锚点,因为并非所有消息都有一个(上面的第一个消息没有)。我没主意了。


Analysis

我正在使用其他人编写的一些代码(准确地说,调试有关 SO 的另一个问题),并且我抑制了-Werror获取警告的选项:

$ gcc -O3 -g -std=c11 -Wall -Wextra stl.c -o stl
stl.c: In function ‘printStudent’:
stl.c:84:5: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘List’ [-Wformat=]
     printf("Name: %s ", student->first);
     ^
stl.c:84:5: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘List’ [-Wformat=]
stl.c:85:5: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Wformat=]
     printf("Grade: %s\n", student->grade);
     ^
stl.c:85:5: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Wformat=]
$

并启用-Werror获取错误消息:

$ gcc -O3 -g -std=c11 -Wall -Wextra -Werror stl.c -o stl
stl.c: In function ‘printStudent’:
stl.c:84:5: error: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘List’ [-Werror=format=]
     printf("Name: %s ", student->first);
     ^
stl.c:84:5: error: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘List’ [-Werror=format=]
stl.c:85:5: error: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Werror=format=]
     printf("Grade: %s\n", student->grade);
     ^
stl.c:85:5: error: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Werror=format=]
cc1: all warnings being treated as errors
$

您会收到一些“上下文消息”,例如In function消息,但每个警告都以<source file>:<line>:<col>: warning:,每个错误都以包含以下内容的行开头error代替warning。它继续到下一条上下文消息,或下一条警告或错误消息,或最后的摘要行(“所有警告都被视为错误”)。如果您有额外的信息正在生成(-H, or -v选项),那么生活就更复杂了,但是对于常规编译来说,这已经涵盖了。

在更广泛的 C++ 示例中,您有一条上下文消息和两个错误,并有多个注释来解释为什么会产生第一个错误。

合成

因此,可以使用合适的标记来分割消息。事实上,用一个简单的方法就可以很容易地完成sed script:

#!/bin/sh
#
# Insert markers before GCC warning and error messages

sed -e '
/^.*:[1-9][0-9]*:[1-9][0-9]*: warning: /i\
\
-- WARNING --\
\

/^.*:[1-9][0-9]*:[1-9][0-9]*: error: /i\
\
-- ERROR --\
\
' "$@"

该脚本在诊断输出中发现了第二个错误,而我在第一眼浏览时就错过了该错误。

Example

这是您的示例和我的示例的一些复合输出(加上未删除的编译命令行,其他):

/usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp: In member function ‘virtual bool xmodel::Core::DataItemCollection::tryAdditionalItemRegistration(std::shared_ptr<xmodel::Core::IDataItem>) const’:

-- ERROR --

/usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp:414:66: error: no matching function for call to ‘bind(<unresolved overloaded function type>, const std::_Placeholder<1>&, const QUuid&)’
       , std::bind(&IDataItemCollectionScope::findItemById, _1, id)
                                                                  ^
/usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp:414:66: note: candidates are:
In file included from /gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/bits/stl_algo.h:66:0,
                 from /gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/algorithm:62,
                 from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/qglobal.h:68,
                 from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/qatomic.h:45,
                 from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/qhash.h:45,
                 from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/QHash:1,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/rappserv/code/include/convenience/stdhash_quuid.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/ItemId.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/IDataItem.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/DataItemDescriptor.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/IDataItemCollection.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp:9:
/gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/functional:1655:5: note: template<class _Func, class ... _BoundArgs> typename std::_Bind_helper<std::__or_<std::is_integral<typename std::decay<_Tp>::type>, std::is_enum<typename std::decay<_Tp>::type> >::value, _Func, _BoundArgs ...>::type std::bind(_Func&&, _BoundArgs&& ...)
     bind(_Func&& __f, _BoundArgs&&... __args)
     ^
/gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/functional:1655:5: note:   template argument deduction/substitution failed:
/usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp:414:66: note:   couldn't deduce template parameter ‘_Func’
       , std::bind(&IDataItemCollectionScope::findItemById, _1, id)
                                                                  ^
In file included from /gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/bits/stl_algo.h:66:0,
                 from /gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/algorithm:62,
                 from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/qglobal.h:68,
                 from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/qatomic.h:45,
                 from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/qhash.h:45,
                 from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/QHash:1,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/rappserv/code/include/convenience/stdhash_quuid.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/ItemId.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/IDataItem.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/DataItemDescriptor.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/IDataItemCollection.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.h:11,
                 from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp:9:
/gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/functional:1682:5: note: template<class _Result, class _Func, class ... _BoundArgs> typename std::_Bindres_helper<_Result, _Func, _BoundArgs>::type std::bind(_Func&&, _BoundArgs&& ...)
     bind(_Func&& __f, _BoundArgs&&... __args)
     ^
/gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/functional:1682:5: note:   template argument deduction/substitution failed:
/usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp:414:66: note:   couldn't deduce template parameter ‘_Result’
       , std::bind(&IDataItemCollectionScope::findItemById, _1, id)
                                                                  ^

-- ERROR --

/usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp:417:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
'stl' is up to date.
    gcc -O3   -g   -I/Users/jleffler/inc   -std=c11   -Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition     stl.c -o stl -L/Users/jleffler/lib/64 -ljl
    gcc -O3   -g   -I/Users/jleffler/inc   -std=c11   -Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition     stl.c -o stl -L/Users/jleffler/lib/64 -ljl
stl.c: In function ‘printStudent’:

-- WARNING --

stl.c:84:5: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘List’ [-Wformat=]
     printf("Name: %s ", student->first);
     ^

-- WARNING --

stl.c:84:5: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘List’ [-Wformat=]

-- WARNING --

stl.c:85:5: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Wformat=]
     printf("Grade: %s\n", student->grade);
     ^

-- WARNING --

stl.c:85:5: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Wformat=]
    gcc -O3   -g   -I/Users/jleffler/inc   -std=c11   -Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition -Werror    stl.c -o stl -L/Users/jleffler/lib/64 -ljl
stl.c: In function ‘printStudent’:

-- ERROR --

stl.c:84:5: error: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘List’ [-Werror=format=]
     printf("Name: %s ", student->first);
     ^

-- ERROR --

stl.c:84:5: error: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘List’ [-Werror=format=]

-- ERROR --

stl.c:85:5: error: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Werror=format=]
     printf("Grade: %s\n", student->grade);
     ^

-- ERROR --

stl.c:85:5: error: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Werror=format=]
cc1: all warnings being treated as errors
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

区分 gcc 诊断 的相关文章

  • ELF动态符号表

    我有一个关于 ELF 动态符号表的问题 对于 FUNC 类型的符号 我注意到某些二进制文件中的值为 0 但在其他二进制文件中 它具有一些非零值 这两个二进制文件都是由 gcc 生成的 我想知道为什么会出现这种差异 有没有编译器选项来控制这个
  • 包括带有大量全局变量的 C 头文件

    我有一个包含 100 多个全局变量的包含文件 它正在库中使用 但我链接库的一些程序也需要访问全局变量 它的构建方式 In one library c file define Extern In the programs that use t
  • gcc 与 clang:符号剥离

    gcc 和 AMD Open64 opencc 都有一个 s选项 剥离符号表和重定位信息 到目前为止我还没能在 Clang LLVM 中找到相同的选项 它存在吗 您可以使用stripbinutils 中的实用程序 实际上 llvm ld 有
  • clang 实例化后静态成员初始化

    这样的代码可以用 GCC 编译 但 clang 3 5 失败 include
  • 在GCC中添加父目录的包含路径

    我想将父目录中的文件包含在我正在处理的项目中 所有的头文件都在父目录中 有没有办法在命令行上使用 I 来搜索父目录中的包含而不使用绝对路径 我知道我可以使用 makefile 解决这些问题 并且我可能最终会这样做 但我想知道是否有一个可以使
  • C语言中如何通过内存地址映射函数名和行号?

    如何用 GCC 中的内存地址映射回函数名称和行号 即假设一个 C 语言原型 void func Get the address of caller maybe this could be avoided MemoryAddress get
  • 无法使用maven编译java项目

    我正在尝试在 java 16 0 1 上使用 maven 构建 IntelliJ 项目 但它无法编译我的项目 尽管 IntelliJ 能够成功完成 在此之前 我使用maven编译了一个java 15项目 但我决定将所有内容更新到16 0 1
  • Gtk-ERROR **:检测到 GTK+ 2.x 符号

    我正在使用 gcc 编译我的 c 应用程序 并使用以下标志 gcc evis c pkg config cflags libs gtk 2 0 libs clutter gtk 1 0 libs gthread 2 0 Wall o evi
  • constexpr lambda / ‘x’ 不命名类型;您指的是“x”吗?

    我正在尝试使用 C 17 的 constexpr lambda 来获取编译时字符串 include
  • 开放简历fisherfaces

    我有这个问题 当我使用 vs2010 调试 opencv 2 4 0 facetec demo c 运行时 程序出现此错误 OpenCV错误 未知函数中图像步长错误 矩阵不连续 因此其行数无法更改 文件 src opencv modul e
  • Windows 上 libcurl 的静态库[重复]

    这个问题在这里已经有答案了 如何将此库 libcurl 静态链接到 exe 我努力了 disable share enable static 没有帮助 我使用的是MingW32 有没有一种简单的方法来静态链接这个库 这样我的应用程序就不再有
  • 声明一个负长度的数组

    当创建负长度数组时 C 中会发生什么 例如 int n 35 int testArray n for int i 0 i lt 10 i testArray i i 1 这段代码将编译 并且启用 Wall 时不会出现警告 并且似乎您可以分配
  • 如何使用 mingw gcc 链接 msvcr90.dll?

    如何使用 mingw gcc 链接 msvcr90 dll 我尝试了 lmsvcr90 这是最小的示例 include
  • Code::Blocks 中的调试似乎不起作用 - 缺少调试符号

    我正在尝试在 Code Blocks 中调试程序 我跟着本指南 http wiki codeblocks org index php title Debugging with Code Blocks and 这个短视频 http www y
  • 如何从 g++ 获取缺少原型警告?

    我目前有一个使用 g 编译其代码的项目 我正在清理代码 我想确保所有函数都有原型 以确保像 const char 这样的事情得到正确处理 不幸的是 当我尝试指定 Wmissing prototypes 时 g 会抱怨 g Wmissing
  • 如何使用 pyinstaller 包含文件?

    我也使用 tkinter 使用 python 3 7 编写了一个程序 由于我使用的是外部图片 因此当我将所有内容编译为一个 exe 时 我需要包含它们 我试过做 add data bg png files 但我仍然收到此错误 tkinter
  • 如何构建gcc multilib工具链?

    我正在尝试在新安装的 ubuntu 14 04 的 AMD64 版本上构建 gcc multilib 工具链 它只有 x86 64 gcc 和 g 安装 没有 multilib 支持 我的配置行是 configure disable che
  • 如何最好地以编程方式将 `__attribute__ ((unused))` 应用于这些自动生成的对象?

    In my makefile我有以下目标 它将文本 HTML 资源 编译 为unsigned char数组使用xxd i http linuxcommand org man pages xxd1 html 我将结果包装在匿名命名空间和标头保
  • 如何明智地解释这个编译器警告?

    当我执行这段代码时question https stackoverflow com a 51056490 2411320 我收到这个警告 warning format d expects argument of type int but a
  • 为什么 GCC 在堆栈上压入额外的返回地址?

    我目前正在学习汇编的基础知识 在查看 GCC 6 1 1 生成的指令时遇到了一些奇怪的情况 这是来源 include

随机推荐

  • 如何在nextjs中添加字体ttf文件

    我是 Nextjs 的新手 我想将自定义字体添加到我的项目中 我完全不知道如何做到这一点 我的字体位于 public fonts 中 我的 global css 文件是这样的 html body padding 0 margin 0 fon
  • 如何在jquery中向FormData添加变量?

    实际上我正在使用以下脚本来发布我的表单 var formData new FormData form driver information 0 ajax type POST url data formData success functio
  • C 中的三重指针:这是风格问题吗?

    我觉得 C 中的三重指针被视为 坏 对我来说 有时使用它们是有意义的 从基础开始 单指针有两个目的 创建数组 并允许函数更改其内容 通过引用传递 char a a malloc or void foo char c means I m go
  • 我如何解密签名并添加到目标 c 中的 YouTube 提取 URL?

    我正在尝试在我的应用程序中播放 YouTube 视频 一切正常 但是当我尝试观看包含 YouTube 内容的视频时 它失败 我研究发现有人认为你应该加密和解密签名并将其添加到 URL 中 我不知道该怎么做decrypt signature
  • 在多个文件上循环一个函数

    我写了一个简单的函数 myfunction lt function fileName stringsAsFactors TRUE check names FALSE skip 1 Data lt read delim fileName sk
  • 更新 Microsoft Dynamics 365 CRM 中的多个记录的 Soap 请求

    我们试图在 CRM 中一次更新多个记录 但基于 wsdl 没有直接的方法可以做到这一点 一种方法是通过传递要更新的记录的 CRM ID 来更新 CRM 中的每条记录 然而 通过阅读文档 我们发现有一种方法可以运行 ExecuteMultip
  • System.IO.FileSystemWatcher 监视网络服务器文件夹 - 性能注意事项

    我想查看网络服务器上的文件夹树的更改 这些文件都有特定的扩展名 树中大约有 200 个文件夹和大约 1200 个带有我正在查看的扩展名的文件 我无法编写在服务器上运行的服务 禁止 因此解决方案必须位于客户端本地 及时性并不是特别重要 我可以
  • 键监听器与键绑定? [复制]

    这个问题在这里已经有答案了 可能的重复 比较 KeyListener 和 Key Bindings 之间的功能 https stackoverflow com questions 8664250 comparing functionalit
  • WCF路由——如何以编程方式正确添加过滤表

    我正在使用 WCF 4 路由服务 并且需要以编程方式配置该服务 而不是通过配置 我见过的这样做的例子很少见 创建一个 MessageFilterTable 如下 var filterTable new MessageFilterTable
  • 如何在 Android 中的列表视图中显示联系人(适用于 Android api 11+)

    如果这看起来像同一个问题一百万次 我很抱歉 但是谷歌搜索没有提供任何结果 只是一堆过时的教程使用managedQuery以及其他已弃用的解决方案 我经历了用于检索联系人列表的 Android 开发人员培训 http developer an
  • 有没有办法将operator.itemgetter与切片表示法一起使用?

    我在 python 列表中有一堆 numpy 数组lst 我可以对这些数组之一进行切片 通过使用以下命令对其进行索引来获取特定视图 1 例如 我需要将此切片操作应用于所有 numpy 数组lst 使用生成器理解 我可以这样做 my arra
  • Terraform - 迭代模板中的对象列表

    我在迭代由 解释的模板内的对象列表时遇到问题templatefile功能 我有以下变量 variable destinations description A list of EML Channel Destinations type li
  • 将参数放入webservlet的url中

    我正在使用 Webservlet 我想在 url 本身中传递参数 就像是 WebServlet profile id public class ProfileServlet extends HttpServlet Override publ
  • 如何重新加载当前的路线守卫?

    假设我有一条有守卫的路线AdminGuard 只有当我是管理员时才允许我进入 但是当我在那个页面上点击Logout状态通过 Observables 传播到所有应用程序中 但我仍然处于一条我不应该处于的路线中 因为我已经注销了 如何 重新激活
  • PHP 对齐数组键值

    我在 Google 上搜索了两天 并尝试查看 PHP 手册 但我仍然不记得那个对齐 PHP 数组键值的函数 我正在寻找的只是需要这个的函数 Array 0 gt 1 3 gt 2 4 gt 3 7 gt 4 9 gt 5 并将其转换成这样
  • 查找早于 FILE 的文件而不包含 FILE

    我有一个计划要使用find给我一个比某些 FILE 更旧的文件列表 然后使用xargs or exec 将文件移动到其他地方 搬东西不是问题 xargs mv trash工作正常 现在 如果我尝试使用 newer FILE then FIL
  • Django 注销问题

    这是我在 Django 身份验证中遇到的问题 访问需要登录的页面 注销 访问 django contrib auth logout 访问原始登录保护页面 您仍处于登录状态 有什么想法如何解决这个问题吗 我的 Django 会话设置是 SES
  • Gradle 自定义插件:添加扩展对象的依赖项

    我正在尝试编写一个插件来添加依赖项project dependencies根据插件扩展对象中收集的信息 但这似乎是不可能的 事实上 来自扩展对象的数据仅在新任务或project afterEvaluate关闭 但在这些地方添加的依赖项将被忽
  • 如何更改图像中的像素

    我实际上尝试执行以下操作 我已在 bitmapdata 对象中加载了外部图像 并从中创建了一个位图 我将其附加到 sprite MovieClip 以便在其上包含鼠标事件 现在 根据前面的逻辑 我加载了两个相同大小的图像 比方说圆圈 其中一
  • 区分 gcc 诊断

    我在解释 gcc 4 8 2 警告和错误时遇到问题 更准确地说 很难判断一个问题从哪里结束 另一个问题从哪里开始 我只能通过控制台访问构建机器 因此不能选择使用 IDE 我真的需要能够快速区分各个问题 有没有办法让 GCC 在不同的诊断消息