我想tar和目录及其子目录中的所有.php和.html文件.如果我使用
tar -cf my_archive *
它会记录我不想要的所有文件.如果我使用
tar -cf my_archive *.php *.html
它忽略了子目录.我如何递归地使它tar,但只包括两种类型的文件?
如何获取AS3 TextField中文本的实际高度?TextField.textHeight似乎报告了一些不依赖于TextField内容的固定值.
以下示例代码生成以下内容:
text=o p g y d j
textWidth=120.8
textHeight=**96**
text=o
textWidth=15
textHeight=**96**
text=oW
textWidth=43.3
textHeight=**96**
Run Code Online (Sandbox Code Playgroud)
显然,"o"和"p"等的高度应该不同.
AS3代码:
import flash.text.TextField;
var format : TextFormat = new TextFormat();
format.font = "Times New Roman";
format.size = 30;
format.align = TextFormatAlign.CENTER;
var textField1 : TextField = new TextField();
textField1.defaultTextFormat = format;
textField1.selectable = false;
textField1.sharpness = 0;
textField1.embedFonts = true;
textField1.multiline = false;
textField1.height = 50;
textField1.width = 200;
textField1.x = 10;
textField1.y = 10;
addChild(textField1);
textField1.text = "o p g y …Run Code Online (Sandbox Code Playgroud) 我有一个函数将String写入文本文件.它有效,但由于某种原因(编码?),它会在文件的开头添加一些奇怪的数据.
这是相关代码:
var file:File = new File(OUTPUT_FILE_NAME);
var stream:FileStream = new FileStream();
stream.open(file, FileMode.WRITE);
stream.writeUTF("Hello World!");
stream.close();
Run Code Online (Sandbox Code Playgroud)
当我在Notepad ++中打开文件时,它显示如下:
我究竟做错了什么?
我想把CSS按钮放到几个表中.理想情况下,每个按钮应填充相应的表格单元格.这提出了一个问题,因为如果我在CSS中硬编码按钮宽度,我需要为每个表维度单独的一个类.
有没有办法让按钮适合表格单元格?
HTML:
<center>
<table border="1" width="90%" class="buttons">
<tr>
<td width="25%"><a href="http://www.google.com">Link1 goes here</a></td>
<td width="25%"><a href="http://www.google.com">Link2<br>goes<br>here</a></td>
<td width="25%"><a href="http://www.google.com">Link3<br>goes<br>here</a></td>
<td width="25%"><a href="http://www.google.com">Link4<br>goes<br>here</a></td>
</tr>
</table>
<p>
<table border="1" width="90%" class="buttons">
<tr>
<td width="20%"><a href="http://www.google.com">Link1 goes here</a></td>
<td width="20%"><a href="http://www.google.com">Link2<br>goes<br>here</a></td>
<td width="20%"><a href="http://www.google.com">Link3<br>goes<br>here</a></td>
<td width="20%"><a href="http://www.google.com">Link4<br>goes<br>here</a></td>
<td width="20%"><a href="http://www.google.com">Link5<br>goes<br>here</a></td>
</table>
</center>
Run Code Online (Sandbox Code Playgroud)
CSS:
.buttons
{
overflow:auto;
text-align: center;
font-size: 1.0em;
font-weight: bold;
line-height: 200%;
}
.buttons a
{
display: inline-block;
width: 18em;
height: 6em;
margin-bottom: 0.5em;
padding-top: .6em;
padding-bottom: .6em;
color: #fff; …Run Code Online (Sandbox Code Playgroud)