Archive for February, 2010


PECL vs PEAR in PHP

What the difference between Pecl and Pear?
——————————————————————————–
Pecl is a repository of PHP extensions, while PEAR is a repository of PHP classes.

Extensions are written in C and included into PHP, while classes are written in PHP and included into your code.

Cruise Control as PHPUnderControl vs. Hudson for PHP

The Question:

I’m using PHPUnderControl (a Cruise Control plugin for PHP) as the CI server for PHP development. I use Ant to build my project. Main used features of PHPUC are

  • PHPUnit test review
  • PHPCS review
  • Diagrams, PHP PMD, PHPCPD and some misc. thing.

What are the pros of Hudson vs. PHPUC? I heard it’s development is faster and more widely used day by day.

Answer 1:

We switched from PHPUC to Hudson about a year ago and have certainly enjoyed it. One of the main advantages is how easy it is to create and edit projects since it is all done through a nice web UI, no messing about in XML config files. You also don’t have to restart Hudson after changing settings, so I found it a lot easier and quicker to iterate on a project.

Another thing that really impressed me about Hudson was how many problems it can detect and point out for you. For example, more than once with PHPUC the build stopped working in such a way that the phpunit XML was no longer generated, but PHPUC happily used the old results for days or weeks until we realized. Hudson pointed this out right away saying that the log file had not been touched since the build started! When setting up projects too in the web UI, it will tell you if directories / SCM locations don’t exist as you type, and offer google-esque suggestions as to what you meant, spotting problems before you even save the configuration! Also if building periodically with a cron entry like “* 4 * * *” it will say, “did you really mean every minute of 4, or do you mean ’0 4 * * *’?”

That said, while the community and plugin ecosystem is rich, Hudson is also more generic than PHPUC so it isn’t as tightly integrated into PHP projects, but can happily publish code coverage and phpdoc (and any HTML report) reports via plugins.

Also, don’t forget that if a solution (PHPUC) isn’t broken, there may not be a need to fix it. However you can easily evaluate Hudson for initial impressions by downloading the .war file and running “java -jar hudson.war”, and you’ll be running an instance in under a minute.

Overall I feel it has made our builds and deployments more robust and repeatable, catching errors faster, and also speeding up many tasks (it can install slaves for itself via SSH and distribute jobs or run them concurrently!)

Answer 2:

Hudson as a nice Ui and can be configured 99% of the time through the webui. Last time I looked at cruise control, you had to sniff around in various xml files.

phpUnderControl – Continuous Integration for PHP

phpUnderControl – Continuous Integration for PHP

phpUnderControl is an addon application for the continuous integration tool CruiseControl, which integrates some of the best PHP development tools. This project aims to make your first steps with CruiseControl and PHP as easy as possible. Therefore phpUnderControl comes with a command line tool that performs all modifications to an existing CruiseControl installation.

A good website about Search Engine Guilde

http://www.searchengineguide.com/

Example on Chemical: http://www.searchengineguide.com/pages/Business/Chemicals/index.html

Chemicals Search Engines:

Adhesives - [New Window] – Specialized industrial directory for adhesive supplies, equipment and services.

AdhesivesMart - [New Window] – Database of adhesives, sealants and tapes for industrial use.

BuyersGuideChem - [New Window] – A directory of suppliers of chemicals and chemical products.

Chem.com - [New Window] – Catalogs and directories of suppliers, distributors, manufacturers, custom synthesis companies.

Chemcompass - [New Window] – The buyers guide for manufacturers and traders of the chemical trade. Search for companies, product entries, product lines, brand names.

Chemical World - [New Window] – A portal which guides you through the world of the chemical industry: chemistry, fuel cell, explosives, polymers, biochemistry etc.

ChemIndustry.com - [New Window] – Worldwide search engine of the chemical industry – search for chemicals, equipment, services and chemical information.

ChemNet - [New Window] – Directory and database of chemicals and chemical manufacturers.

Indian Chemical Portal - [New Window] – A chemical portal that gives you an insight into the Indian Chemical Industry with information about relevant trade offers, EXIM policies, international events, organisations and lots more.

Industrial Chemicals - [New Window] – Thomas Regional’s specialized directory of industrial chemicals and related products and services.

Plastics.com - [New Window] – Plastics directory and plastics professionals databases.

PlasticsNet - [New Window] – Find products and suppliers, read current headlines, and keep up with the latest information in the plastics process industry.

PSI – Polymer Search on the Internet - [New Window] – Search engine for the global polymer, plastic and rubber industries. Includes daily industry news.

CAM(枪版) -

CAM通常是用数码摄像机从电影院盗录。即所谓的“电影版”,有时可以使用小三角架在电影院进行盗录,但大多数时候不可能,除非管理员是你家亲戚或者你把管理员都干掉了,出于这种原因摄像机会经常抖动。并且由于声音是从摄像机自带的话筒录制,所以经常会录到观众的笑声等声音,尤其是喜剧片。因为这些因素,图象和声音质量通常都很差。我们平常说的枪版就是CAM版。

TELESYNC (TS) -

TS比CAM优越的地方是,在偷录的时候使用了外置的音源(一般是影院座椅上为听力不好的人而设的耳机孔),但是这并不代表TELESYSNC(TS) 比CAM好很多,外置的音源通常会受到背景所处环境的干扰,听起来也很吵杂。很多时候TS是在空的影院录制,或是用专业摄像机在投影室录制,所以图象质一般要比CAM好。但质量的起伏可能很大,在下载前最好查看SAMPLE。很大比例的TS是从CAM错误标记成。

TELECINE (TC) -

TELECINE (TC) 使用电视电影机从胶片直接数字拷贝,其图象和声音质量本来应该很好。但由于使用的设备和费用很高,TC很少见。通常会使用正确的高宽比,但有时也有4:3 的TC。侏罗纪公园III是一个很好的例子。不应将TC和TimeCode(时间码)混淆,时间码是一个在屏幕上可见的计数器。

SCREENER (SCR) -

SCR,是在电影正式发行前,送到录像租用店或其他地方进行试看的促销录影带(VHS)转录而成,通常使用4:3的全屏幕格式,1.85:1 宽屏幕格式非常少见。SCR最大的缺点是”ticker”(在屏幕下面不断滚动的反盗版电话和版权声明)。同时,如果图像里面含有任何版本序列号或者任何可以追查来源的记号,都必须屏蔽,这些记号有时只会出现几秒钟,但有时他们会很不幸的由始至终贯穿在整部电影,有时甚至会很大!!如果SCR是母带转录的话,图像质量会很好,但是如果是其他的拷贝转录,就不敢肯定了,并且SCR对于转录的设备要求也很高,通常会转录为VCD格式,(也有转录成SVCD格式的,质量似乎好一些),但是总体来说不能保证质量上乘!

DVD-SCREENER (DVDscr) -

DVDscr也是由促销产品转录而成,但不同于SCR的是,它是由用于促销的DVD转录而来的,因而通常是1.85:1 宽屏幕格式,并且也有”ticker”和屏蔽,如果转录的是一个高手的话,DVDscr的质量很高,通常会转录为SVCD或DivX/XviD 格式。

DVDRip -

由DVD的最终零售版转制,质量非常高…..通常会转录成SVCD或DivX/XviD 格式

VHSRip -

VHSRip是从零售版VHS录象带转制,

DivX Re-Enc -

DivXRe-Enc是从原始VCD发布用DivX编码成的小一些的文件。它们通常以Film.Name.Group (1of2)等形式命名。常见的发布组织有SMR和TND。这些版本通常不值得下载,除非你不清楚某部电影,只想要200MB的版本。

SUBBED -

SUBBED通常表示字幕被压进了电影。它们通常是马来语/中文/泰文等,有时有两种语言。它们可能占据了很大一部分屏幕。

UNSUBBED -

UNSUBBED版本表示字幕没有被压进电影,需要用VOBSUB等外挂字幕工具显示字幕.

其它:

PROPER – 完整版

UNARATE – 未删节

R_RATEE – 有删节

WS – 表示宽银幕

FS – 表示全屏幕

WITH EXTRAS – 影片带花絮

三、识别各种影视资源常见格式。

  1. DVDRip(Divx)

  所谓的DVDRip,就是用Divx压缩技术对DVD碟片的视频图像进行高质量的压缩,用MP3或AC3对音频进行压缩,然后将视频、音频部分合并成一个AVI(AVI即Audio Video Interleaved,音频视频交错),最后再加上外挂的字幕文件而形成的影音播放格式。其大小一般为数百兆,是DVD体积的数分之一。注意,当DVD转成DVDRip后,会损失掉一些如菜单导航、音轨选择、分段选择等DVD特性,不过相对于它的优点和从便于收藏等方面考虑,这些损失都是微不足道的。

  2. RMVB

  该格式是由RM影片格式升级延伸而来。VB即VBR,是 Varable Bit Rate(可改变之比特率)的英文缩写,它打破了以前RM格式平均压缩采样的方式,在保证平均压缩比的基础上,合理利用了比特率资源,使RMVB在牺牲少部分影片质量的情况下,最大限度地压缩了影片的大小,最终完美的接近于DVD品质的效果。
  相比DVDRip, RMVB的优势不言而喻,首先在保证影片整体视听效果的前提下,RMVB的个头只有300MB→450MB左右(以90分钟标准电影计算),而 DVDRip却需要700MB甚至更多。此外,它拥有内置字幕、无需外挂插件支持、播放是系统占有率低等优点,这些优势使它已成为当前网络电影的真正主流格式。

  3. MKV

  被很多朋友认为是颠覆DVDRip的未来主流媒体格式。它实际上是一种新型多媒体封装格式,也称多媒体容器 (Multimedia Container)。它不同于Divx、Xvid等视频编码格式,也不同于MP3、Ogg等音频编码格式。MKV只是为这些音、视频提供外壳的“组合”和“封装”格式。换句话就是一种容器格式,常见的AVI、VOD、MPGE、RM格式其实也属于这种类型。但它们要么结构陈旧,要么不够开放,这才促成了MKV这类型多媒体封装格式的诞生。
  MKV最大的特点就是能容纳多种不同类型编码的视频、音频及字幕流,甚至连非常封闭的RealMedia及QuickTime这类流媒体也被它囊括进去,可以说是对传统媒体格式的一次大颠覆,几乎变成了一个万能的媒体容器。
  播放MKV并不需要专用的播放器,任何基于DirectShow的播放器都能播放它,如常见的Media Player Classic、 BSplayer、ZoomPlayer的播放器等,甚至包括Windows Media Player,仅需安装相应Matroska解码分离器插件即可。推荐下载:HapyShow这个解码器集成软件。

(1) AVI

  也就是一般称的DVD版本,一部电影700M~1.5G左右,相对于高清较不如,不过,是目前普及的最好品质的电影,DVD的各种选项都有,基本上最新的电影上映后2~3个月左右就会有AVI格式出现网络。

(2) ASF
  
  ASF 是 Advanced Streaming format 的缩写,由字面(高级流格式)意思就应该看出这个格式的用处了吧。说穿了 ASF 就是 MICROSOFT 为了和现在的 Real player 竞争而发展出来的一种可以直接在网上观看视频节目的文件压缩格式!由于它使用了 MPEG4 的压缩算法,所以压缩率和图像的质量都很不错。因为 ASF 是以一个可以在网上即时观赏的视频“流”格式存在的,所以它的图象质量比 VCD 差一点点并不出奇,但比同是视频“流”格式的 RAM 格式要好。不过如果你不考虑在网上传播,选最好的质量来压缩文件的话,其生成的视频文件比 VCD (MPEG1)好是一点也不奇怪的,但这样的话,就失去了 ASF 本来的发展初衷,还不如干脆用 N AVI 或者 DIVX 。但微软的“子第”就是有它特有的优势,最明显的是各类软件对它的支持方面就无人能敌。

(3) MPEG

  MPEG 是 Motion Picture Experts Group 的缩写,它包括了 MPEG-1, MPEG-2 和 MPEG-4 (注意,没有MPEG-3,大家熟悉的MP3 只是 MPEG Layeur 3)。MPEG-1相信是大家接触得最多的了,因为它被广泛的应用在 VCD 的制作和一些视频片段下载的网络应用上面,可以说 99% 的 VCD 都是用 MPEG1 格式压缩的,(注意 VCD2.0 并不是说明 VCD 是用 MPEG-2 压缩的)使用 MPEG-1 的压缩算法,可以把一部 120 分钟长的电影(未视频文件)压缩到 1.2 GB 左右大小。MPEG-2 则是应用在 DVD 的制作(压缩)方面,同时在一些 HDTV(高清晰电视广播)和一些高要求视频编辑、处理上面也有相当的应用面。使用 MPEG-2 的压缩算法压缩一部 120 分钟长的电影(未视频文件)可以到压缩到 4 到 8 GB 的大小(当然,其图象质量等性能方面的指标 MPEG-1 是没得比的)。MPEG-4 是一种新的压缩算法,使用这种算法的 ASF 格式可以把一部 120 分钟长的电影(未视频文件)压缩到 300M 左右的视频流,可供在网上观看。其它的 DIVX 格式也可以压缩到 600M 左右,但其图象质量比 ASF 要好很多。

(4) QuickTime(MOV)

  QuickTime(MOV)是 Apple(苹果)公司创立的一种视频格式,在很长的一段时间里,它都是只在苹果公司的 MAC 机上存在。后来才发展到支持 WINDOWS 平台的,但平心而论,它无论是在本地播放还是作为视频流格式在网上传播,都是一种优良的视频编码格式。

(5) REAL VIDEO(RA、RAM)

  REAL VIDEO (RA、RAM)格式由一开始就是定位就是在视频流应用方面的,也可以说是视频流技术的始创者。它可以在用 56K MODEM 拨号上网的条件实现不间断的视频播放,当然,其图象质量和 MPEG2、DIVX 等比是不敢恭维的啦。毕竟要实现在网上传输不间断的视频是需要很大的频宽的,这方面 ASF 的它的有力竞争者!

目前网络上流行的高清晰影音文件,主要分为DVDRip、RMVB、MKV等三大类,它们以高清晰的画质、接近原汁原味的音效,让许多人通过网络欣赏到了高品质的电影。

Win32 API Programming Tutorial – Dialog FAQ

Example: dlg_three

[images/dlg_three.gif]

Now don’t get me wrong, this is a

Example: ctl_one

[images/ctl_one.gif]

I realize I’ve already used buttons in previous examples, so you should already be more or less familiar with them, however I figured that since I was using them in this example I might as well add it to the title for the sake of being complete.

Controls

One thing to remember about controls is that

Win32 API Programming Tutorial – Modeless Dialogs

Example: dlg_two

[images/dlg_two.gif]

Now we take a look at

Win32 API Programming Tutorial – Dialogs, GUI coders best friend

Example: dlg_one

[images/dlg_one.gif]There’s hardly a windows program out there that doesn’t use dialog boxes. Just go File -> Open in any text editor or any other kind of editor for that matter and voila, you are presented with a dialog box, one that probably allows you to select a file to be opened.

Dialogs aren’t limited to the standard open file ones, they can look like and do whatever you choose. The attractive point of dialogs is that they provide a quick way to arrange and create a GUI (Graphic User Interface) and even some default processing, cutting down on the amount of code you must write.

One thing to remember is that

Win32 API Programming Tutorial – Menus and Icons

Example: menu_one

[images/menu_one.gif]

This is just a small section to show how to add basic menus to your window. Usually you use a pre-made menu resource. This will be in an .rc file and will be compiled and linked into your .exe. This is rather compiler specific, commercial compilers will have a resource editor that you can use to create your menus, but for this example I will show the text of the .rc file so you can add it in manually. I usually have an .h file as well which is included in both my .rc file and my .c source files. This file contains the identifiers for controls and menu items etc.

For this example you can start with the window code from simple_window and add this code into it as instructed.

First the .h file. Usually called “resource.h”

#define IDR_MYMENU 101
#define IDI_MYICON 201

#define ID_FILE_EXIT 9001
#define ID_STUFF_GO 9002

Not much there, but our menu will be pretty simple. The names and values here are up to you for the choosing. Now we write our .rc file.

#include "resource.h"

IDR_MYMENU MENU
BEGIN
    POPUP "&File"
    BEGIN
        MENUITEM "E&xit", ID_FILE_EXIT
    END

    POPUP "&Stuff"
    BEGIN
        MENUITEM "&Go", ID_STUFF_GO
        MENUITEM "G&o somewhere else", 0, GRAYED
    END
END

IDI_MYICON ICON "menu_one.ico"

You will want to add the .rc file to your project or makefile depending on what tools you are using.

You also want to

Powered by WordPress | Theme: Motion by 85ideas.