2016-06-26 ruki
You can use xmake to run the given target and need not know where is the target program. e.g. We define a simple target with named 'test'. lua target("test") set_kind("console") add_files("*.c") So, we can run it directly. bash $xmake r test or $xmake run test xmake will compile it 继续阅读 »
2015-05-18 刘太华
通过SWIG在Py里调用cpp的方法 通过Python.h接口, 在cpp里使用python脚本 经常会做改动的业务逻辑在Py里做, cpp通过SWIG暴露出某些cpp内的对象和方法,给python做调用。 同时cpp内也会有CallNoRT来调用python脚本, 完成类似闭环的调用链。 继续阅读 »
2014-09-29 Xie Jingyi
链接:Link 耗时:0.028s 一道简单的动态规划,主要思路就是: 用f[i,j]表示到达(i,j)的最长路径的长度。找到每个最高点,从其开始向四周的低处搜索。如果该点已搜过并且f值大于当前长度则退出回溯。直到达到某个最低点为止。 不多说了,直接上代码: ```pascal const delta :array [1..4, 1..2] of integer = ((-1, 0), (1, 0), (0, 1), (0, -1)); //四个方向向量 var _: Integer; name: string; n, m, i, j, x: Integer; ans: longint 继续阅读 »
2017-03-23 blademainer
我们的项目里面经常需要使用jenkins来编译docker,然后jenkins本身就是docker运行起来的,因此编译docker镜像就无法进行。通过调查发现:可以通过映射宿主机器的docker来达到运行的目的。 命令如下: bash docker run -it --rm \ --privileged=true \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /var/run/docker:/var/run/docker \ -v /usr/bin/docker:/usr/bin/docker \ --group-add=$(stat 继续阅读 »
2014-05-10 Lingxian Kong
(2017.09.11) 截止 Pike 版本,最新的 devstack 默认已经使用 systemd 管理各个服务,而不再使用 linux screen,而且大部分服务也都使用 uwsgi 的启动。关于 Systemd 的详细介绍,可以参加这里。所以要启动一个 openstack 进程,要经过systemd-->uwsgi-->wsgi application(in codebase)-->codebase 安装vmware workstation 创建ubuntu虚拟机 下载ubuntu iso,网络模式nat(前提是本机能联网),安装过程不需要人工干预。 预配置虚拟机 用创建虚拟机时指定的用户登录,修改root登录密 继续阅读 »
2016-03-04 demon7452
Java面试总结-线程 1、创建一个线程 创建线程主要分为两个方法 implements Runnable接口并实现run()方法,然后由Runnable对象创建一个Thread对象,调用Tread的start()方法启动线程。 extends Thread 构建一个Thread类的子类,复写run()方法。该方法目前已不再推荐,应该从运行机制上减少需要并行运行的任务数量。 警告:不要调用Thread类或Runnable对象的run方法。直接调用run方法,只会执行同一个线程中的任务,而不会启动新线程??。应该调用Tread.start方法,这个方法将创建一个执行run方法的新线程。 ``` /** * 创建线程的两种方式 继续阅读 »
2017-02-17 Lu Huang
本文将以 kaldi 中 timit 的例程来看整个 run.sh 脚本的执行过程。本文来自于Running the example scripts (40 minutes) 数据准备 请先进入 kaldi\egs\timit\s5\ 这个目录。 运行环境 由于 kaldi 可以在本地运行,也可以在 Oracle GridEngine 上运行,因此,请修改 cmd.sh。 如果你是在本地运行,请输入 export train_cmd="run.pl --max-jobs-run 10" export decode_cmd="run.pl --max-jobs-run 10" export cuda_cmd="run.p 继续阅读 »
2016-07-25 ruki
xmake can run and debug the given target program now. We only need configure the debug mode to compile this target and run it. e.g. ```lua -- enable debug symbols if is_mode("debug") set_symbols("debug") end -- define target target("demo") set_kind("kind") add_files("src/*.c") ``` And we compile and r 继续阅读 »
2016-07-08 ruki
xmake v2.0 has supported the plugin module and we can develop ourself plugin module conveniently. We can run command xmake -h to look over some builtin plugins of xmake Plugins: l, lua Run the lua script. m, macro Run the given macro. 继续阅读 »
2016-07-16 ruki
xmake默认在编译完程序后,可以通过以下命令运行指定目标程序: bash $xmake run [target] [arguments] ... 并且在linux/macosx下面,目前已经支持关联调试器,去直接调试指定目标了,只需要加上-d/--debug参数选项: bash $xmake run -d [target] [arguments] ... 默认情况下,xmake在macosx下用的是lldb,在linux下用的是gdb,调试器xmake会在配置的时候去自动检测,如果需要指定调试器路径,可以手动去配置它: bash $xmake f --debugger=/usr/bin/gdb 继续阅读 »