男单 618

生活象筒装的卫生纸,开始的时候怎么扯都不觉得在转,后来转的越来越快。

Lena Söderberg

without comments

1951年3月31日,Lena Söderberg生于瑞典。Lena是1972年11月份Play男孩杂志的封面女郎,当时用的名字是Lenna Sjööblom。

搞数字图像处理的朋友是不是觉得眼熟?没错,就是Lenna。

1997年,Lena作为嘉宾参加了第50届图像科技学会年会(the 50th annual Conference of the Society for Imaging Science and
Technology),并做了关于她自己的一个报告。

更多图片点击此处

Written by amao

2010/02/02 at 13:35

Posted in 其他

Tagged with

Beamer中自定义定理环境的风格继承问题

without comments

为了修改定理环境的标题,我们需要使用
\newtheorem{liti}{例}[section]
这样的命令重新定义一个新的环境。但是这样定义的liti块的风格是与theorem块相同,而不是我们想要的exampleblock的风格。

要想继承原有的block风格,先用
\theoremstyle{example}
命令切换成exampleblock的风格,再定义新的环境liti
\newtheorem{liti}{例}[section]
这样出来的块就和exampleblock的风格完全一致。

其他细节参见beamerbasetheorems.sty这个文件。

Written by amao

2010/01/27 at 2:14

Posted in LaTeX相关

Tagged with

给Beamer中的图表加编号

without comments

默认的Beamer设置中,图表都是没有编号的,因为作者认为没人会关注这些编号。如果你很希望加上这个编号,可以使用:
\setbeamertemplate{caption}[numbered]

Written by amao

2010/01/26 at 22:32

Posted in LaTeX相关

Tagged with

Google Reader可以订阅任何网页——好消息?坏消息?

without comments

之前,对于没有提供RSS输出的网站,我一直使用Page2RSS订阅网页的更新,现在Google Reader直接提供了这一功能。应该说是好消息,但是谁知道呢。

Written by amao

2010/01/26 at 22:03

Posted in 软件

Tagged with

Sage绘制摆线动画

without comments

在Sage中绘制动画,实际上是先画出每一帧,再使用imagemagick将多幅图像转化为gif动画。先来看一个简单例子:

t,u=var(‘t,u’)
cc=[point((cos(t),sin(t)),pointsize=30,rgbcolor='red')+parametric_plot((cos(u),sin(u)),(0,t)) for t in srange(0.01,2*pi,0.2)]
myan=animate(cc,xmin=-1.5, xmax=1.5,ymin=-1.5, ymax=1.5,aspect_ratio=1)
show(myan)

第2行中每帧图像由两部分组成,一是动点,二是圆弧。这里,srange函数中的初值不能取零,否则会出错。第3行中将绘图的坐标范围固定,如果不固定,Sage会将当前图像主体放置在图像中央,自动调整坐标轴的显示范围。这一特性在绘制静态图像时,非常有用,但这样得到的动画往往不是我们想要的。

下面来看圆摆线x=a*(u-sin(u)), y=a*(1-cos(u)),  0<u<2*pi的绘制:

u=var(‘u’)
a=2
pic=[parametric_plot((a*(u-sin(u)),a*(1-cos(u))),(u,0,t),rgbcolor='red')\
+circle((a*t,a),a,rgbcolor='blue')\
+point((a*(t-sin(t)),a*(1-cos(t))),pointsize=20,rgbcolor='red')\
+line([(a*t,a),(a*(t-sin(t)),a*(1-cos(t)))],rgbcolor=’blue’) for t in srange(0.01,2*pi+0.1,0.2)]
bbb=animate(pic,xmin=-0.5,xmax=(2*pi+1)*a,ymin=-1, ymax=2*a+1,aspect_ratio=1)
show(bbb)

注:其他一些数学软件绘图时,如果不手工清除绘图区域,则上一个图像会保留下来,这与Sage的工作方式不同。Sage中的每一帧都是“全新”绘制的。

下面将其转化为交互式的图形:

@interact
def _(t=(0.01,2*pi,0.5)):
u=var(‘u’)
a=2
pic=parametric_plot((a*(u-sin(u)),a*(1-cos(u))),(u,0,t),rgbcolor=’red’)\
+circle((a*t,a),a,rgbcolor=’blue’)\
+point((a*(t-sin(t)),a*(1-cos(t))),pointsize=20,rgbcolor=’red’)\
+line([(a*t,a),(a*(t-sin(t)),a*(1-cos(t)))],rgbcolor=’blue’)
show(pic,xmin=-0.5,xmax=(2*pi+1)*a,ymin=-1, ymax=2*a+1,aspect_ratio=1)

由于刷新的问题,更新不连贯,拖放之后,需要等一下。

Written by amao

2010/01/21 at 22:23

Posted in sage

Tagged with

24-第8季

without comments

明天,期待。

Written by amao

2010/01/17 at 17:24

Posted in 其他

Tagged with

Mysql乱码问题(备忘)

without comments

升级网站的时候,php版本高了,mysql的版本也高了,再加上原来没经验,用的都是GBK,没用UTF8,数据库导过去经常乱码。
两次成功的经验如下。
先保证phpmyadmin中看到的字符是正确的,再在mysql_connect语句之后加一句mysql_query(“SET NAMES ‘GBK’”),差不多就可以了。

Written by amao

2010/01/16 at 1:52

Posted in linux, 软件

8310一周年

without comments

准确的说是1月11日,那天还看了阿凡达。

作为手机,满意。作为PDA,远不如Palm系列。

Written by amao

2010/01/15 at 20:52

Posted in 其他

Tagged with ,

使用Sage绘制动画的一个例子

without comments

先把代码放在这里,有时间再解释:

t,u=var(‘t,u’)
cc=[point((cos(t),sin(t)),pointsize=30,rgbcolor='red')+parametric_plot((cos(u),sin(u)),(0,t)) for t in srange(0.01,2*pi,0.2)]
myan=animate(cc,xmin=-1.5, xmax=1.5,ymin=-1.5, ymax=1.5)
show(myan)

Written by amao

2010/01/15 at 1:29

Posted in sage

Tagged with

Sage Tutorial中文版

without comments

Sage Tutorial是一份快速了解Sage的入门文档,花了两周多的时间将其翻译为中文。但是“Some more advanced mathematics”一节没有翻译,因为完全不熟悉这一节所涉及到的内容。

第一次翻译开源软件的技术文档,水平有限,希望各位多提意见,任何方面的都可以。如果没有大的问题,大概一周后会向Sage开发组提交。

源文件使用Sphinx管理,PDF文件是由自动转换而来的LaTeX文件编译的,因此其中很多格式不符合中文的习惯。所以请大家先以HTML文件为准,最后发布前,我会手工调整LaTeX文件后再编译。

Email: amao@ai7.org

相关内容:翻译Sage文档的准备工作

Sage Tutorial 中文版rst源文件

Sage Tutorial 中文版(HTML)

Sage Tutorial 中文版(PDF)

Written by amao

2010/01/09 at 10:43

Posted in linux, python, sage

Tagged with ,