• boost 系列 1:boost 直接使用


    boost 系列 1:boost 直接使用 - 邓维 - 博客园

    boost 系列 1:boost 直接使用

    PART 1
    windows

    1. 在www.boost.org的文档中:

        example program (不编译直接使用)

      复制代码
      #include <boost/lambda/lambda.hpp>
      #include 
      <iostream>
      #include 
      <iterator>
      #include 
      <algorithm>

      int main()
      {
          
      using namespace boost::lambda;
          typedef std::istream_iterator
      <int> in;

          std::for_each(
              
      in(std::cin), in(), std::cout << (_1 * 3<< " " );
      }
      复制代码
        2. 配置:
    • From Visual Studio's File menu, select New > Project…

    • In the left-hand pane of the resulting New Project dialog, select Visual C++ > Win32.

    • In the right-hand pane, select Win32 Console Application (VS8.0) or Win32 Console Project (VS7.1).

    • In the name field, enter “example”

    • Right-click example in the Solution Explorer pane and select Properties from the resulting pop-up menu

    • In Configuration Properties > C/C++ > General > Additional Include Directories(关键,添加下列路径到Include文件夹), enter the path to the Boost root directory, for example

      C:\Program Files\boost\boost_1_46_1

    • In Configuration Properties > C/C++ > Precompiled Headers, change Use Precompiled Header (/Yu) to Not Using Precompiled Headers.3

    • Replace the contents of the example.cpp generated by the IDE with the example code above.

    • From the Build menu, select Build Solution.

      然后可以运行。

     PART 2  Linux

    1.  Linux

      参考http://www.boost.org/doc/libs/1_46_1/more/getting_started/unix-variants.html

     example program (不编译直接使用)

    复制代码
    #include <boost/lambda/lambda.hpp>
    #include 
    <iostream>
    #include 
    <iterator>
    #include 
    <algorithm>

    int main()
    {
        
    using namespace boost::lambda;
        typedef std::istream_iterator
    <int> in;

        std::for_each(
            
    in(std::cin), in(), std::cout << (_1 * 3<< " " );
    }
    复制代码

    编译:

    c++ -I path/to/boost_1_46_1 example.cpp -o example
    关键是包含boost代码文件夹
    然后,同样可以直接运行。

    进程的挂起及恢复 - 邓维 - 博客园

    进程的挂起及恢复

    进程的挂起及恢复

    #ctrl+z:挂起,程序放到后台,程序没有结束。
    #jobs:查看被挂起的程序工作号
    恢复进程执行时,有两种选择:fg命令将挂起的作业放回到前台执行;用bg命令将挂起的作业放到后台执行
    格式:fg 工作号;bg 工作号
    进程:正在执行的一个程序
    程序:是一种写好的代码或脚本
    &:后台执行,不占用终端
    如:xeyes &

    ps命令进程查看命令
    ps命令:process status
    -e 显示所有进程
    -f 全格式
    -h 不显示标题
    -l 长格式
    -w 宽输出
    a 显示终端上的所有进程,包括其他用户的进程
    r 只显示正在运行的进程
    x 显示没有控制终端的进程

    最常用三个参数是u、a、x。
    #ps axu的输出格式
    USER:进程拥有者
    PID:进程号
    %CPU:占用的CPU使用率
    %MEM:占用的内存使用率
    VSZ;占用的虚拟内存大小
    RSS:占用的内存大小
    TTY:终端设备号
    STAT:改进程状态
    START:进程开始时间
    TIME:执行的时间
    COMMAND:所执行的指令
    D:不可中断的休眠(通常表示该进程正在进行I/O动作)
    R:正在执行中
    S:休眠状态
    T:暂停执行
    W:没有足够的内存分页可分配
    <:高优先顺序的进程
    N:低优先顺序的进程
    L:有内存分页分配并锁在内存内(即时系统或定制I/O)

    Kill:中断一个处理进程(process)
    当中断一个前台进程是通常用ctrl+c;对于后台进程用kill命令
    kill命令是通过向进程发送指定的信号来结束的。默认为TERM信号。TERM信号将终止所有不能捕获该信号的进程,对于能捕获该信号的进程需要使用kill –9信号,该信号是不能被捕获的。
    kill杀终端,只能可以把终端的shell杀死,而退出终端,但终端不关闭
    pkill 命令名 可以直接杀死进程
    pkill qmail //直接杀死qmail程序进程
  • 相关阅读:
    linux 下的文件IO基础
    git命令-切换分支
    专利搜索引擎
    在此位置打开CMD
    2017 JAVA神器 Btrace详细介绍
    linux下的find文件查找命令与grep文件内容查找命令
    Linux如何查看JDK的安装路径
    JavaScript SetInterval与setTimeout使用方法详解
    ssh 登录出现Are you sure you want to continue connecting (yes/no)?解决方法
    ssh连接提示 "Connection closed by remote host"
  • 原文地址:https://www.cnblogs.com/lexus/p/2870696.html
Copyright © 2020-2023  润新知