有人说我应该尽可能使用正则表达式,其他人说我应该尽可能使用它.关于那个问题还是仅仅是TIMTOWTDI,有类似"Perl Etiquette"的东西吗?
我有以下代码创建带有标题和图片的odf文档:
#!/usr/bin/perl
use strict;
use warnings;
use OpenOffice::OODoc;
my $doc = odfDocument(
file => 'test.odt',
create => 'text'
);
my $head = $doc->appendHeading(
text => "This is a Test",
style => 'Heading 1'
);
my $style = $doc->createImageStyle("Photo");
my $image = $doc->createImageElement(
'some picture',
style => 'Photo',
attachment => $head,
size => '4cm, 12cm',
link => '/full/path/to/picture.png'
);
$doc->save();
Run Code Online (Sandbox Code Playgroud)
如何在图片中添加文字标题?当我在LibreOffice中创建文本标题时,创建标题的'content.xml'部分就是这样的.
<draw:frame draw:style-name="fr1" draw:name="Frame1" text:anchor-type="as-char" svg:y="0cm" svg:width="4.001cm" draw:z-index="0">
<draw:text-box fo:min-height="12cm">
<text:p text:style-name="Caption">
<draw:frame draw:style-name="fr2" draw:name="Eiffel Tower" text:anchor-type="paragraph" svg:x="0.004cm" svg:y="0.002cm" svg:width="4.001cm" style:rel-width="100%" …Run Code Online (Sandbox Code Playgroud) Perl中的实例方法应该像这样互相调用:
package BlaBla;
sub foo {
my($self) = @_;
#do something awesome;
}
sub bar {
my($self) = @_;
foo();
}
Run Code Online (Sandbox Code Playgroud)
或者像这样:
package BlaBla;
sub foo {
my($self) = @_;
#do something awesome
}
sub bar {
my($self) = @_;
$self->foo();
}
Run Code Online (Sandbox Code Playgroud)
谢谢大家的时间.
OASIS-ODF规范中未提及该目录.有谁知道这个目录的目的?
其结构如下:
accelerator/current.xml
floater
images/Bitmaps
menubar
popupmenu
progressbar
statusbar
toolbar
toolpanel
Run Code Online (Sandbox Code Playgroud)
此可疑文件夹中的目录或文件中没有内容.
我想编写一个bash脚本,直接在最大化窗口中启动gvim-session.
那是我的bash脚本:
#!/bin/bash -
set -o nounset
cd /home/alexthebird/vim-stuff; # directory of the gvim-session file
gvim -S bootmap; # start gvim from the sessionfile 'bootmap'
Run Code Online (Sandbox Code Playgroud)
你有任何想法如何用bashscript完成这个?只有在通过此脚本启动时才应最大化Gvim.当然,欢迎任何其他想法如何实现这一目标.
我使用Ubuntu 11.04和gnome.
感谢您抽出宝贵时间阅读我的留言.
AlexTheBird
这个脚本有效:
#!/bin/bash -
set -o nounset
# directory of the gvim-session file
cd /home/alexthebird/vim-stuff;
# -f because of a ubuntu global-menu bug
# -S starts from session-file named 'bootmap'
# -geom solved the problem. see post of Lstor
gvim -geom '200x50+0+0' -f -S bootmap; # start gvim from the sessionfile …Run Code Online (Sandbox Code Playgroud) 我必须创建一个在不同的Gnu-Linux / Unix终端上写大量文本的应用程序。有没有我可以参考的标准宽度或标准宽度?我的意思是像在网页设计领域一样,他们通常使用1024像素宽度。
谢谢你的时间。
完全用Perl编写的XML-Parser的优点和缺点是什么只提供像GNOME的LibXML这样的Parser的接口?