我startx用来启动X来评估我的.xinitrc.在我的.xinitrc开始我的窗口管理器使用/usr/bin/mywm.现在,如果我杀了我的WM(为了测试其他一些WM),X也将因为.xinitrc脚本达到EOF而终止.所以我在最后添加了这个.xinitrc:
while true; do sleep 10000; done
Run Code Online (Sandbox Code Playgroud)
这样,如果我杀了我的WM,X就不会终止.现在我的问题是:如何进行无限次睡眠而不是循环睡眠?有没有一个命令有点像冻结脚本?
最好的祝福
我怎么能转换为字符串像Žvaigžd?s aukštyb?j užges或äüöÖÜÄ到Zvaigzdes aukstybej uzges或auoOUA分别使用bash?
基本上我只想转换所有不在拉丁字母表中的字符.
谢谢
我有一个类似于以下的Latex代码:
\usepackage{listings}
\lstset{
breaklines = true,
numbers = left,
stepnumber = 5,
}
\begin{lstlisting}
for (int i = 0, j = 0, k = 1; i <= 10, j < foo; i++, j *= factor, k--) { // a comment here
% something code here ...
}
\end{lstlisting}
Run Code Online (Sandbox Code Playgroud)
由于纸张太窄,带有for循环的长行会在中间某处自动断开.这正是我想要的,否则该线将在论文的最后消失.但现在我的问题是,是否有办法标记或表明这条线被打破了.否则,它看起来像是创建了一个新行.
这样的东西就是我想要的(用行号,注意箭头):
10 for (int i = 0, j = 0, k = 1; i <= 10, j < foo;
? i++, j *= factor, k--) { // a comment here
11 …Run Code Online (Sandbox Code Playgroud) 我正在编写一个小的chrome扩展供个人使用,我想通过上下文菜单运行一个可执行文件,并将某些信息作为参数传递给所述可执行文件.
实现这一目标的最简单和/或最简洁的方法是什么?对我而言,由于铬的沙盒,它似乎是不可能的.
在过去的几个小时里,我一直忙于理解MusicBrainz数据库,因为我注意到没有用于标记或指纹音频文件的命令行应用程序.Musicbrainz的指纹识别是否有任何CLI实现?我怎样才能创建这些指纹?
我在他们的网站上发现了一些开发工具(python-musicbrainz2,libdiscid和XML webs服务),但我找不到创建这些指纹的简单工具或应用程序(开发工具似乎只对检索曲目/艺术家信息有用)使用指纹).我理解错了吗?
亲切的问候
audio command-line-interface fingerprint fingerprinting musicbrainz
在编写非阻塞程序(处理多个套接字)时,使用open(2),stat(2)文件或使用opendir(2)打开目录,在某一点需要打开文件,如何确保系统调用不阻止?
对我来说似乎除了使用线程或fork(2)之外别无选择.
我xmlstarlet el -v用来显示xml文件的结构,包括所有属性和值.我想将其输出转换为某种键值对,即每个属性的值在一个单独的行上(包括XPath); 每一行必须是唯一的.
目前的结果:
topRoot/topSystem/commSvcEp/commSyslog[@descr='Syslog Service' and @name='syslog' and @policyOwner='local' and @severity='critical']
topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[@adminState='disabled' and @forwardingFacility='local7' and @hostname='none' and @name='secondary' and @severity='critical']
topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[@adminState='disabled' and @forwardingFacility='local7' and @hostname='none' and @name='tertiary' and @severity='critical']
topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[@adminState='disabled' and @forwardingFacility='local7' and @hostname='none' and @name='primary' and @severity='critical']
Run Code Online (Sandbox Code Playgroud)
期望的结果(可能是类似的;指数只是一个想法):
topRoot/topSystem/commSvcEp/commSyslog@descr='Syslog Service'
topRoot/topSystem/commSvcEp/commSyslog@name='syslog'
topRoot/topSystem/commSvcEp/commSyslog@policyOwner='local'
topRoot/topSystem/commSvcEp/commSyslog@severity='critical'
topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[0]@adminState='disabled'
topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[0]@forwardingFacility='local7'
topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[0]@hostname='none'
topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[0]@name='secondary'
topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[0]@severity='critical'
topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[1]@adminState='disabled'
topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[1]@forwardingFacility='local7'
topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[1]@hostname='none'
topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[1]@name='tertiary'
topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[1]@severity='critical'
topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[2]@adminState='disabled'
topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[2]@forwardingFacility='local7'
topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[2]@hostname='none'
topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[2]@name='primary'
topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[2]@severity='critical'
Run Code Online (Sandbox Code Playgroud)
我想要完成的是能够运行diff两个这样的文件或使用grep过滤匹配模式.我确信有一种方法可以创建这样的输出,不使用sed,awk或者除了xmlstarlet它自己以外的任何其他东西.
我几乎是关于xmlstarlet和整个xml世界的新手(不仅因为它因为它的复杂性和解析开销等而不喜欢xml),所以我非常感谢你的帮助.谢谢!
我有以下C代码:
typedef unsigned char uint8_t;
void main(void) {
uint8_t a = 1, b = 2, res;
res = a + b;
}
Run Code Online (Sandbox Code Playgroud)
当我使用编译此代码时gcc -Wconversion,我收到以下警告:
test.c: In function 'main':
test.c:5:10: warning: conversion to 'uint8_t' from 'int' may alter its value [-Wconversion]
Run Code Online (Sandbox Code Playgroud)
有人可以解释为什么出现这个警告?所有三个变量都是类型的uint8_t,所以我真的不明白它的int来源.
如何使用LocationMatchapache 匹配查询字符串?
<LocationMatch "/index.php\?a=b.*">
// ...
Run Code Online (Sandbox Code Playgroud)
......不幸的是不行.
我有一个函数,它返回一个值并将数据打印到stdout和stderr.我无法修改此功能.我现在想要执行此函数,捕获打印到stdout和stderr的数据,将其存储在两个单独的变量中.如果可能的话,我还想将函数的返回值存储在第三个变量中.
我来了,(with-output-to-string (*standard-output*) ...)但这不会让我捕获stdout和stderr.我有什么选择?
在使用Swisscom的myCloud Web客户端查看流量时,承载令牌用于客户端和服务器之间的所有交互(storage.prod.mdl.swisscom.ch):
Authorization: Bearer 5E9Ra2n2kwI7JZDoy1f7og==
Run Code Online (Sandbox Code Playgroud)
(显然这个标记是假的).
如何使用Swisscom Passeport登录名和密码获取此类不记名令牌?使用示例curl是优选的.
另外,有没有关于myCloud API的文档?
我想在Haskell中使用Aeson解析以下JSON:
{
"foo": {
"name": "name 1",
"location": "location 1"
},
"bar": {
"name": "name 2",
"location": "location 2"
}
}
Run Code Online (Sandbox Code Playgroud)
按键name和location是已知的,但foo和bar未知.
我想将JSON数据加载为以下数据类型([Entry])的列表:
data Entry = Entry
{ id :: String -- "foo" or "bar" etc.
, name :: String -- "name 1" or "name 2" etc.
, location :: String -- "location 1" or "location 2" etc.
} deriving Show
Run Code Online (Sandbox Code Playgroud)
我的第一次尝试看起来如下(它不起作用):
instance FromJSON Entry where
parseJSON (Object o) = …Run Code Online (Sandbox Code Playgroud) bash ×2
c ×2
linux ×2
aeson ×1
apache ×1
api ×1
ascii ×1
audio ×1
bsd ×1
casting ×1
chromium ×1
command ×1
common-lisp ×1
curl ×1
executable ×1
fingerprint ×1
ghc ×1
haskell ×1
infinite ×1
int ×1
key-value ×1
latex ×1
lisp ×1
musicbrainz ×1
nonblocking ×1
query-string ×1
sbcl ×1
sleep ×1
swisscomdev ×1
typedef ×1
xml ×1
xmlstarlet ×1