我正在使用expect在我的服务器上启动一个应用程序:
#!/usr/bin/expect
set timeout -1
spawn "bin/start-all.sh"
expect {
-re "Found MongoDB in" { send "y\r"; exp_continue }
-re "Found Hadoop in" { send "y\r"; exp_continue }
-re "Going to start Hadoop" { interact }
}
Run Code Online (Sandbox Code Playgroud)
我可以在脚本运行的几秒钟内访问我的服务器上的应用程序,但是一旦它结束,应用程序就会变得不可用.
我在调试模式下运行expect并在结束时获得以下输出:
expect: does "vendors area. Do you want to start it? [y/n] y\r\n" (spawn_id exp6) match regular expression "Found MongoDB in"? Gate "Found MongoDB in"? gate=no
"Found Hadoop in "? Gate "Found Hadoop in "? gate=no
"Going to start Hadoop"? Gate "Going to …
Run Code Online (Sandbox Code Playgroud) 我希望我的MySQL服务器只使用unix socket,并忽略TCP网络,所以我将这一行添加到我的配置中/etc/my.cnf
:
skip-networking
Run Code Online (Sandbox Code Playgroud)
但netstat
告诉我MySQL仍然使用TCP端口3306:
# netstat -tl | grep mys
tcp 0 0 *:mysql *:* LISTEN
Run Code Online (Sandbox Code Playgroud) 我喜欢有一个方便的命令行计算器.要求是:
由于tcsh支持别名位置参数,并且由于别名扩展优先于除历史扩展之外的所有其他扩展,因此可以直接在tcsh中实现接近我理想的东西.
我用过这个:
alias C 'echo '\''\!*'\'' |tr -d '\'',\042-\047'\'' |bc -l'
Run Code Online (Sandbox Code Playgroud)
现在我可以通过最少的输入来完成以下内容:
# the basic stuff:
tcsh> C 1+2
3
# dollar signs, multiplication, exponentiation:
tcsh> C $8 * 1.07^10
15.73721085831652257992
# parentheses, mixed spacing, zero power:
tcsh> C ( 2+5 ) / 8 * 2^0
.87500000000000000000
# commas in numbers, no problem here either:
tcsh> C 1,250.21 * 1.5
1875.315
Run Code Online (Sandbox Code Playgroud)
正如你所看到的,没有必要引用任何东西来使所有这些工作.
现在出现了问题.试图在bash中做同样的事情,其中不支持参数别名迫使我将计算器实现为shell函数并使用"$ @"传递参数
function C () { echo …
Run Code Online (Sandbox Code Playgroud) 我正在使用Vowpal Wabbit并且正在生成训练为可读模型的分类器.
我的数据集有22个功能,可读模型作为输出:
Version 7.2.1
Min label:-50.000000
Max label:50.000000
bits:18
0 pairs:
0 triples:
rank:0
lda:0
0 ngram:
0 skip:
options:
:0
101143:0.035237
101144:0.033885
101145:0.013357
101146:-0.007537
101147:-0.039093
101148:-0.013357
101149:0.001748
116060:0.499471
157941:-0.037318
157942:0.008038
157943:-0.011337
196772:0.138384
196773:0.109454
196774:0.118985
196775:-0.022981
196776:-0.301487
196777:-0.118985
197006:-0.000514
197007:-0.000373
197008:-0.000288
197009:-0.004444
197010:-0.006072
197011:0.000270
Run Code Online (Sandbox Code Playgroud)
有人可以向我解释如何解释文件的最后部分(在选项之后)?我正在使用逻辑回归,我需要检查如何迭代训练更新我的分类器,以便我能够理解何时达到收敛...
提前致谢 :)
我正在使用:
R version 3.0.0 (2013-04-03) -- "Masked Marvel"
Platform: x86_64-pc-linux-gnu (64-bit)
Run Code Online (Sandbox Code Playgroud)
我尝试read.csv
直接从终端输入一个CSV数据片段+标题.
我遇到了一个问题,可能与R跳过来自/ dev/stdin 和 read.csv的行,第一行的标题,跳过第二行 但是足够不同(那里的答案没有解释我在这里看到的)到保证单独的问题.
R似乎跳过标题行并将第二个(数据)行视为标题:
R> d <- read.csv(file='/dev/stdin', header=TRUE)
a,b
1,2
3,4
# hit CTRL-D twice here to end the input
# (this is also unexpected:
# when reading a few lines interactively in bash, one CTRL-D suffices.
# Why is doing it twice necessary in R?)
R> d
X1 X2
1 3 4
R> colnames(d)
[1] "X1" "X2"
Run Code Online (Sandbox Code Playgroud)
我发现了一个解决办法:因为在默认情况下read.csv
都有blank.lines.skip …
在sklearn中,当我们将句子传递给算法时,我们可以使用文本特征提取器,如countvectorizer,tf-idf vectoriser等......我们得到一个浮点数组.
但是当我们传递到vowpal wabbit输入文件时我们得到的是这样的:
-1 |Words The sun is blue
1 |Words The sun is yellow
Run Code Online (Sandbox Code Playgroud)
什么在vowpal wabbit的内部实现中使用?这个文本如何变换?
machine-learning feature-extraction neural-network vowpalwabbit scikit-learn
我正在尝试创建一个按钮,在按下该按钮时会更改其值.
$("button").click( function() {
valor = this.html();
retorno = (valor == 'Exibir') ? 'Ocultar' : 'Exibir';
this.html(retorno);
});
Run Code Online (Sandbox Code Playgroud)
我有这样的信息:
未捕获的TypeError:对象#没有方法'html'
我感谢任何帮助.
我正在尝试将Vowpal Wabbit用于具有154个不同类别标签的一个多类别分类任务,如下所示:
在这种情况下,我能够达到> 80%的结果,这很好。但是我目前正在研究的问题是:
我必须复制实时预测方案。在这种情况下,我必须一次传递一个数据点(即文本行),以便模型可以预测值和输出。
我已经尝试了所有我知道但失败的选择。谁能让我知道如何通过将一个数据点与VW命令一起传递而不是作为文件传递来创建实时方案。
vowpalwabbit ×3
shell ×2
unix ×2
alias ×1
bash ×1
data-mining ×1
expect ×1
input ×1
javascript ×1
jquery ×1
jquery-ui ×1
linux ×1
mysql ×1
r ×1
scikit-learn ×1
stdin ×1
tcl ×1
tcsh ×1
unix-socket ×1