小编Joh*_*Tan的帖子

如何查看所有命令的日志?

我正在尝试查看我在Git Bash中输入unix环境的所有命令.

所以我不是要查看Git Hub的可能命令列表.我也没有尝试查看日志以进行推送和拉取.

我只想查看我在命令行中输入的内容.这是因为我最近遇到了一个连接问题,我无法从我的git推或拉.它突然发生了.一分钟前,我仍然完美地推拉.

然后,有人帮助我通过git bash中的命令提示符解决它.

现在,我的朋友有同样的问题.所以我正在寻找命令日志,希望它也能解决他的问题.

写入失败:管道致命致命:远程端意外挂断.

unix logging github git-bash

10
推荐指数
3
解决办法
5万
查看次数

iframe定位

这是谷歌翻译的iframe代码.

<div id="contentframe" style="top: 160px; left: 0px;">
<iframe src="/translate_p?hl=en&amp;ie=UTF8&amp;prev=_t&amp;sl=auto&amp;tl=en&amp;u=http://yahoo.co.jp/&amp;depth=1&amp;usg=ALkJrhjrVT6Mc1tnruB-zgrtu9cyQ1bSeA" name="c" frameborder="0" style="height:100%;width:100%;position:absolute;top:0px;bottom:0px;">&lt;/div&gt;
</iframe></div>
Run Code Online (Sandbox Code Playgroud)

我尝试使用相同的div和iframe标签做类似的事情,但html页面最终不像谷歌翻译.

<div id="contentframe" style="top: 160px; left: 0px;">
<iframe src="http://stackoverflow.com" style="height:100%;width:100%;position:absolute;top:0px;bottom:0px;">&lt;/div&gt;
</iframe></div>
Run Code Online (Sandbox Code Playgroud)

iframe显示在页面顶部,而不是出现160px之后,由div指定.

我不确定我的代码有什么问题,这与Google代码几乎相同.

编辑:添加位置:相对于标记不适合作为解决方案.它将div缩小为高度较小的条形.它还意味着不能指定相对于页面的确切位置.

html iframe position css-position

9
推荐指数
1
解决办法
9万
查看次数

Titanium:获取png高度而不创建ImageView

有没有办法在不创建ImageView的情况下获得.png高度?

我在google上找到的方法首先需要createImageView然后执行.height.

我想避免创建ImageView,因为在获得png的高度并执行一些更改后我将创建createImageView.

或者更确切地说,我将在var imagevariablename = Ti.UI.createImageView本身期间使用高度值,因此我无法使用imagevariablename.height,因为var imagevariablename的声明尚未完成.

height png image width titanium

8
推荐指数
2
解决办法
5844
查看次数

Perl:阅读网络文本文件并"打开"它

我正在尝试创建一个脚本来读取文本文件,然后分析它们,无论文本文件是在线还是离线.

离线部分完成,使用

open(FILENAME, "anyfilename.txt")
analyze_file();

sub analyze_file {
   while (<FILENAME>) {analyze analyze}
}
Run Code Online (Sandbox Code Playgroud)

现在对于在线部分,无论如何都要在网站上阅读文本文件,然后"打开"它?

我希望实现的是:

if ($offline) {
   open(FILENAME, "anyfilename.txt")
}
elsif ($online) {
   ##somehow open the http web text so that I can do a while (<FILENAME>) later
}

analyze_file();

sub analyze_file {
   while (<FILENAME>) {analyze analyze}
}
Run Code Online (Sandbox Code Playgroud)

有"get('http://weblink.com/textfile.txt;)"但它会创建一个字符串.我不能用那个字符串做一个while().

有谁知道如何做到这一点?

perl file-io http while-loop

5
推荐指数
1
解决办法
4555
查看次数

Perl:在"显示"上打印,也在文件中打印

有没有办法在不重复打印"字符串"代码的情况下同时打印到"显​​示"和文件中?

我想做的事:

if ($ofile) {
   open (FILE, '>>', "file");
   print "Hello" #some code#; #prints on the display and into the file
}
Run Code Online (Sandbox Code Playgroud)

代替:

if ($ofile) { open (FILE, '>>', "file"); }
print "Hello";
if ($ofile) { print FILE "Hello"; }
Run Code Online (Sandbox Code Playgroud)

尝试使用谷歌搜索但我发现的只是或者,不是两个功能在一起.

编辑以添加问题:

然后使用IO :: Tee创建一个新的T形手柄,然后选择$ tee,以便print默认使用它. - Eric Strom

@EricStrom创建一个新的T恤手柄是什么意思?你是说这个Local::TeeOutput吗?search.cpan.org/~mschilli/Log-Log4perl-1.34/lib/Log/Log4perl.pm

@EricStrom你有一个例子吗?

@EricStrom Local :: TeeOutput在Strawberry Perl的默认库中不可用.在默认库中是否有任何替代方案?

printing string perl file

4
推荐指数
2
解决办法
7517
查看次数

Perl Log4perl在一行中同时打印和记录

我正在读这个,我感到困惑和困惑.

我应该同时使用ALWAYSprint_portfolio('themessage')同时打印和登录文件吗?

我想做的事:

if ($logfile) {
   open (FILE, '>>', "logfile");
   print "Hello" #some code from Log4perl#;
   #prints on the display and into the logfile
}
Run Code Online (Sandbox Code Playgroud)

代替:

if ($logfile) { open (FILE, '>>', "logfile"); }
print "Hello";
if ($logfile) { print FILE "Hello"; }
Run Code Online (Sandbox Code Playgroud)

printing perl logging log4perl

1
推荐指数
1
解决办法
752
查看次数

Titanium Javascript:如何创建动态eventListeners?

我有一个按钮数组,我想为每个按钮添加一个eventListener.

在eventListener中,我想检索当前正在按下的按钮的宽度值.我怎样才能做到这一点?

for (i=0; i<5; i++) {
button[i].addEventListener(click, function(e) {
alert(/*How should I refer to THAT button*/)
})
}
Run Code Online (Sandbox Code Playgroud)

javascript arrays reference addeventlistener titanium

1
推荐指数
1
解决办法
1311
查看次数