Archive for 六月, 2011

SELECT允许0

allowNonIdValues

boolean

If “foreign_table” is enabled:

If set, then values which are not integer ids will be allowed. May be needed if you use itemsProcFunc or just enter additional items in the items array to produce some string-value elements for the list.

Notice: If you mix non-database relations with database relations like this, DO NOT use integers for values and DO NOT use “_” (underscore) in values either!

Notice: Will not work if you also use “MM” relations!

 


python常用模块

Tkinter———— Python默认的图形界面接口。
Tkinter是一个和Tk接口的Python模块,Tkinter库提供了对Tk API的接口,它属于Tcl/Tk的GUI工具组。Tcl/Tk是由John Ousterhout发展的书写和图形设备。Tcl(工具命令语言)是个宏语言,用于简化shell下复杂程序的开发,Tk工具包是和Tcl一起开发的,目的是为了简化用户接口的设计过程。Tk工具包由许多不同的小部件,如一个按钮、一个滚动条等。通过Tk提供的这些小部件,我们就可快速地进行GUI开发。Perl、Scheme等语言也利用Tk库进行GUI开发。Tkinter是跨平台,在各种平台下都能使用。 (continue reading…)


os.system()和os.exec()

Python提供几种方式从Python代码中执行系统命令和其他程序。一种方式是调用os.system函数,它使用shell来执行系统命令,然后在命令结束之后将控制权返回给原始进程。另一种方式是通过os.exec这个“函数家族”来执行程序。和os.system不同,所有os.exec函数在执行了指定命令之后,都不将控制权返回给调用进程。

程序调用os.exec函数时,由os.exec函数执行的程序会“接管”Python进程。事实上,Python进程会在调用os.exec函数时立即终止。然后执行被调用的程序,它的pid与之前执行的Python进程一样。os.system函数和os.exec函数家族适用于UNIX和Windows系统。

 


Mencoder和ffmpeg使用实例

下载电影的时候,我们总希望在全部下载完成之前能够预览一下影片内容,于是发布者时常会放一些影片截图在种子文件中,或者直接贴到网上,也有一些截图是一张图片,但包含很多幅影片在一起,就像下面这张: imagemagick-montage-sample

有很多软件能够截取影片图像、合并图像,但如果影片太多,比如视频网站为用户上传的图像生成预览图之类的,人工在gui方式下操作就不可取了,我们需要在命令行方式下来截取、合并。 (continue reading…)


ffmpeg视频截图

php也可以使用ffmpeg-php扩展ffmpeg。但是我个人觉的这个效率可能不太高。
还是决定用shell 去执行,或放在服务器端的让任务去执行。 (continue reading…)


typo3强制生成缓存图

$gifCreator = t3lib_div::makeInstance(‘tslib_gifbuilder’);

$gifCreator->init();

$imgarray =  $gifCreator->imageMagickConvert(‘photo_350_210.jpg’, ‘web’, ”, ”, ‘-colorspace RGB -quality 90’, ”, array(‘maxW’=>1000,’maxH’=>900),1);

echo ‘<img src=”‘.$imgarray[3].'”/>’;

 

typo3temp/pics/9577836ec0.jpg


substituteOldMailAPI

Boolean: If this is set, old calls to t3lib_utility_mail::Mail() will be translated to new t3lib_mail calls. This should work on most cases and thus respect the above transport settings. If you get garbled emails (or no attachments), consider setting this off. Ask the extension author to upgrade their code to make use of t3lib_mail (instead of the deprecated t3lib_htmlmail).


PHP – $argv

$argv — 传递给脚本的参数数组

说明

包含当运行于命令行下时传递给当前脚本的参数的数组。

Note: 第一个参数总是当前脚本的文件名,因此 $argv[0] 就是脚本文件名。

Note: 这个变量仅在 register_argc_argv 打开时可用。 (continue reading…)



sql语法:inner join on, left join on, right join on详细使用方法

inner join(等值连接) 只返回两个表中联结字段相等的行
left join(左联接) 返回包括左表中的所有记录和右表中联结字段相等的记录

right join(右联接) 返回包括右表中的所有记录和左表中联结字段相等的记录 (continue reading…)


Copyright © 1996-2010 Add Lives. All rights reserved.
iDream theme by Templates Next | Powered by WordPress