class & function names highlighting in Vim

I just recently set up my Vim environment from Textmate, after becoming addicted to its modal input. However, syntax highlighting seems to be not so beautiful in Vim. I code in C++ and since the function call and class names can't be highlighted, the code is more difficult to read. I played with color scheme for a bit, but couldn't find any field that corresponded to "class name&

在Vim中突出显示类和函数名称

我最近刚刚从Textmate开始设置我的Vim环境,在沉迷于模态输入之后。 然而,语法突出显示在Vim中似乎并不那么美丽。 我使用C ++编写代码,并且由于函数调用和类名称不能突出显示,因此代码更难以阅读。 我用颜色方案玩了一下,但找不到任何对应于“类名”或“函数名”的字段。 在下面的图片中,注意DroughtLayer::和*.size() DroughtLayer:: *.size()在MacVim中的右侧没有突出显示。 Textmate(左)和Vim(右)之间的图片比较

Mouse cursor position in C on multi screen system

how can I set the mouse cursor in an X window in C under Linux with multi screens? I have 2 monitors (with different resolution) plugged to a single linux pc. I used ":0.1" to address the second monitor. I run the application from monitor 1 keeping the mouse on the monitor 1 as well....as result mouse moves but don't jump on monitor 2. If I manually put the mouse cursor on monito

多屏幕系统中C鼠标光标位置

我怎么能在Linux下用多屏幕在C中的X窗口中设置鼠标光标? 我有2台显示器(不同的分辨率)插入到一个单一的Linux电脑。 我用“:0.1”来解决第二台显示器。 我运行监视器1上的应用程序,并将鼠标保持在监视器1上,结果鼠标移动但不会跳到监视器2上。如果手动将鼠标光标放在监视器2上并从监视器1运行应用程序,鼠标移动。 我需要一种方法来在显示器之间移动光标。 #include "Xlib.h" int main() { int delta_x = 5, delta_y =

gcc and g++ library search paths

I had all my code compiling under a system that had gcc 4.1.1 and g++ 4.1.1. IT just gave me another system , that had gcc 4.1.2 and g++ 4.1.2. When I run with -v option, it says ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/x86_64-redhat-linux" ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include" ignoring nonex

gcc和g ++库搜索路径

我有我的所有代码编译在一个系统有gcc 4.1.1和g ++ 4.1.1。 IT只是给了我另一个系统,它有gcc 4.1.2和g ++ 4.1.2。 当我用-v选项运行时,它说 ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/x86_64-redhat-linux" ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include" ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-l

NULL definition problem on 64 bit system

I'm running on RHEL 5.1 64 bit platfrom using gcc 4.1.2. I have a utility function: void str_concat(char *buff, int buffSize, ...); which concats char * passed in variadic list(...), while last argument should be NULL, to designate end of the arguments. On 64 bit system NULL is 8 bytes. Now to the problem. My application includes directly/indirectly 2 stddef.h files. First one is /u

64位系统上的NULL定义问题

我使用gcc 4.1.2在RHEL 5.1 64位平台上运行。 我有一个实用功能: void str_concat(char *buff, int buffSize, ...); 其中concat char *在可变参数列表(...)中传递,而最后一个参数应该为NULL,以指定参数的结尾。 在64位系统上,NULL是8个字节。 现在解决问题。 我的应用程序包括直接/间接2 stddef.h文件。 第一个是/usr/include/linux/stddef.h ,它定义了NULL,如下所示: #undef NULL #if defined(__cplusplus)

Tesseract or any other OCR lib

I'm looking for an explanation / API doc / examples of how to use (and train?) Tesseract in C++, nothing useful on the google Tesseract page, and yet to find something over the web. Anyone useful sources, experiences would be more than welcome, as I have no idea how to begin with it. PS: I'm open for suggestions on other libraries. Only FREE libraries I have some experience with

Tesseract或任何其他OCR库

我正在寻找一个解释/ API文档/关于如何在C ++中使用(和培训?)Tesseract的示例,在谷歌Tesseract页面上没有任何用处,但还没有找到网络上的东西。 任何有用的资源,经验都会受到欢迎,因为我不知道如何开始。 PS: 我对其他图书馆的建议持开放态度。 只有免费的库 我有一些Tesseract的经验...一个简单的谷歌'培训tesseract'揭示了这个网页:http://code.google.com/p/tesseract-ocr/wiki/TrainingTesseract

SVG icons not showing up in Qt4 release build in windows

I have a Qt4 application with SVG icons, compiled with mingw (in windows), linked to Qt shared libraries. When application is run, SVG icons show up in debug and release builds in linux, however in windows SVG icons show up only in debug build but not in release build. All SVG icons are listed in project.qrc , and project.pro has RESOURCES = project.qrc . Application uses QtSvg4.dll (version

在Qt4版本中没有显示SVG图标

我有一个带有SVG图标的Qt4应用程序,使用mingw编译(在Windows中),链接到Qt共享库。 运行应用程序时,SVG图标显示在Linux中的调试和发布版本中,但是在Windows中,SVG图标仅在调试版本中显示,而不在发布版本中显示。 所有SVG图标都列在project.qrc ,而project.pro RESOURCES = project.qrc 。 应用程序使用QtSvg4.dll(版本4.7.0)。 Qt 4.7.0,Qt Creator 2.0.1,mingw / g ++ 4.4.0。 解决方案更新:在应用程序目

Is it possible to run a cuda kernel on multiple gpus

This is a fairly simple question but googling doesn't seem to have the answer, so. What I want to know is if I have two gpu cards (identical) capable of running cuda, can my kernel span these cards? Or is it bound to one card or the other? Ie is cuda presented with the entire set of available gpu cores, or just the ones on the card it is run on. If so, is there anything special I need t

可以在多个gpus上运行cuda内核吗?

这是一个相当简单的问题,但Google似乎没有答案,所以。 我想知道的是,如果我有两个能够运行cuda的gpu卡(相同),我的内核可以跨越这些卡吗? 或者它是绑定到一张卡片还是另一张? 也就是说cuda提供了整套可用的gpu内核,或者仅仅是它所运行的卡上的那些内核。 如果是这样,是否有什么特别的我需要知道,以实现目标?除了cuda sdk之外,还有什么例子值得了解? 目标语言当然是C / C ++。 提前致谢。 单个CUDA内核

Timer Callback in C++

I need to call a function asynchronously for every x miliseconds. I am coding in C++, Linux environment. What functions could I call to achieve that? Look into the Boost timers. http://www.boost.org/doc/libs/1_40_0/doc/html/boost_asio/tutorial/tuttimer2.html

定时器在C ++中的回调

我需要每x毫秒异步调用一个函数。 我在C ++,Linux环境中编写代码。 我可以通过什么功能来实现这个功能? 看看升压计时器。 http://www.boost.org/doc/libs/1_40_0/doc/html/boost_asio/tutorial/tuttimer2.html

C++: Tool to reduce compile

After reading about the pimpl idiom I was horrified! Isn't there a tool out there that can inspect a .h/.cpp file and deduce what dependencies could be waivered? Sorry, but no there isn't. C++ still relies on preprocessing source files, very mechanical. Large-scale C++ development is all about reducing the dependencies. In my opinion, C++ is simply not suitable for those kinds of t

C ++:减少编译的工具

在阅读了pimpl的成语后,我感到很震惊! 是不是有一个工具可以检查一个.h / .cpp文件并推断哪些依赖关系可以被放弃? 对不起,但没有。 C ++仍然依赖预处理源文件,非常机械。 大规模的C ++开发都是关于减少依赖关系。 在我看来,C ++根本不适合这些类型的任务。 预编译头文件不能解决许多这些恐怖问题。 MS和g ++现在都支持这些。 C ++的静态代码检查是一个噩梦,因为它的语法和宏预处理器,我怀疑有像你描述的工具

Libcurl infrequently crashes on content POST

I'm sending HTTP POST commands to an external device using libCURL library. I have two basic commands. The first tells the device to wipe current content on the device, and the second sends new content. I use identical POST header structures/addresses for both, with the only difference being the attachment of the data during the "send content" command. Both commands execute prop

Libcurl在内容POST上很少崩溃

我使用libCURL库将HTTP POST命令发送到外部设备。 我有两个基本命令。 第一个告诉设备擦除设备上的当前内容,第二个发送新内容。 我使用两个相同的POST头结构/地址,唯一的区别是在“发送内容”命令期间数据的附件。 两个命令都可以正确执行:第一个擦除数据,第二个擦除数据。 然而,该程序很少(约30%的时间)在“发送内容”命令之后崩溃。 没有错误给出。 正如我之前所说,数据发送之前它不会崩溃,并且它不会一直发生,