小编Red*_*row的帖子

将vim设置为C++ IDE

我希望将vim设置为C++ IDE,这样我就能完成所有工作.

我正在使用这些插件用于vim:

    • Clang完成 - 准确完成
    • nerdtree - 浏览文件
    • snipmate - 插入片段
    • AutoComplPop - 全方位完成
    • buffergator - 缓冲管理
    • vim-powerline - 很好的状态栏
    • vundle - 管理插件

但我缺少像跳转定义和在一个可执行文件中编译多个文件,项目视图...

我正在使用

nmap <F8> :w % <bar> :!g++ -W -Wall -Wextra -pedantic -std=c++11 % -o %:t:r<CR> <bar> :!./%:t:r<CR>
Run Code Online (Sandbox Code Playgroud)

编译当前文件,但如果有多个文件创建一个可执行文件,它将无法工作.

我知道我可以使用eclipse,netbeans,code :: blocks等,但我真的很喜欢vim ...如果vim ide这样的东西不可能,我是否必须学习GNU构建系统或其他方法?

欢迎任何建议.

c++ ide vim

15
推荐指数
1
解决办法
9064
查看次数

Python - 无法使用KeyboardInterrupt杀死主线程

我正在制作一个简单的多线程端口扫描器.它扫描主机上的所有端口并返回打开的端口.麻烦在于中断扫描.扫描完成需要花费大量时间,有时我希望在扫描过程中用Cc杀死程序.麻烦的是扫描不会停止.主线程被锁定在queue.join()上,并且忘记了KeyboardInterrupt,直到处理了队列中的所有数据,因此解除了主线程并正常退出程序.我的所有线程都被守护进来,所以当主线程死掉时,他们应该和他一起死掉.

我尝试使用信号库,没有成功.覆盖threading.Thread类和正常终止的添加方法不起作用...主线程在执行queue.join()时不会收到KeyboardInterrupt

import threading, sys, Queue, socket

queue = Queue.Queue()

def scan(host):
    while True:
        port = queue.get()

        if port > 999 and port % 1000 == 0:
            print port
        try:
            #sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 
            #sock.settimeout(2) #you need timeout or else it will try to connect forever! 
            #sock.connect((host, port))
            #----OR----
            sock = socket.create_connection((host, port), timeout = 2)

            sock.send('aaa')
            data = sock.recv(100)
            print "Port {} open, message: {}".format(port, data)
            sock.shutdown()
            sock.close()
            queue.task_done()
        except:
            queue.task_done()


def main(host):
    #populate queue
    for i in range(1, …
Run Code Online (Sandbox Code Playgroud)

python multithreading keyboardinterrupt

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

标签 统计

c++ ×1

ide ×1

keyboardinterrupt ×1

multithreading ×1

python ×1

vim ×1