我可以通过两种方式在Puppet中显示自定义消息
notice("My extra information as a function")
Run Code Online (Sandbox Code Playgroud)
或者
notify{"My extra information as a resource":}
Run Code Online (Sandbox Code Playgroud)
共通的地方:
不同的事情:
notify可以设置为虚拟或出口资源,具有重要的意义,这是不可用noticenotice无法显示主叫路(没有withpath => true)notice有一个姐妹功能fail,它有能力使清单编译失败.notify不能那样做,因为它在编译完成后就开始工作了.我有一种感觉,我错过了重要方面,或者在某些方面我错了.Puppet比我更好的人会填写更多细节吗?
我编写了一个脚本来管理创建lxc虚拟容器的创建.它由在主机上执行的部分和由容器(虚拟客户)执行的部分组成.如果我可以在文件中编写这两个脚本,并在需要时从中提取第二个脚本(并随后在容器上运行),那将更加优雅.
我依稀记得,在bash中有一种方法可以做到这一点,但我不知道如何找到这个功能的名称以及如何使用它.
我需要这样的东西:
#/bin/bash
# here are commands that are to
# be executed by the host
<declare start of the code chunk that will be exported to file>
# here go commands that
# need to be invoked by the guest
<end of code chunk. Paste the above code into the /var/lib/lxc/<mycontainer>/rootfs/tmp/second-stage.sh>
sudo lxc-attach -n <container name> /tmp/second-stage.sh
Run Code Online (Sandbox Code Playgroud) 该程序编译和链接:
struct A{
int m;
}
void main()
{
A a;
int x = a.m;
}
Run Code Online (Sandbox Code Playgroud)
虽然这不是:
struct A{
int m;
}
void main()
{
A a();
int x = a.m;
}
Run Code Online (Sandbox Code Playgroud)
$dmd app.d 收益:
app.o: In function `_Dmain':
app.d:(.text._Dmain+0xb): undefined reference to `_D3app4mainFZ1aMFZS3app1A'
collect2: error: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)
我很困惑.
假设我有一个a如下构建的列表:
a1<-list(1,2,list("X",10))
a2<-list("A",list("B"),"C")
a3<-list(list("D",list("E")),3.14)
a<-list(a1,a2,a3)
Run Code Online (Sandbox Code Playgroud)
我怎样才能a变成这样:
list(1,2,list("X",10),"A",list("B"),"C",list("D",list("E")),3.14)
Run Code Online (Sandbox Code Playgroud)
我想,对于任意数量的有效的解决方案a1, a2, a3... an不仅为,a1, a2并a3如上面的例子英寸
在Mathematica我会简单地使用Flatten[a,1],但是如何在R中做到这一点?