关于编程的体会和心得
so we have been talking/hearing about Object Oriented Programming for long long time.

I have never been able to come up with the idea to OOP the controllers, how can it possible to do OOP on controller, you have to use if else statement to determine what action to take, but Zend Framework use Front Controller Pattern to make controller OOP, great structure, and great seperation of code.

PHP Comet Trial

2008/05/15 10:17 joedarkangel3
I tried to implement Comet application for the first time.

Dont know what is Comet , read my post on http://www.chendaping.info/post/39.htm

After serveral trials , here are some outcome by using server side long polling and client side long polling

Server Side Long polling: I use while(true) loop to keep connection alive, which in result use hugh resource, only two simutanous clients make server spike to 100%, so give applicaiton a break, do some sleep for the long running implementation.

Client Side Long Polling: I still use while loop on Javascript, but It turns out to be pretty well adjust to the client number, 10 simutanous client only use about 60% resource, I think It is because the connection setup give application a break.

the conclusion would be: give some break to long running application, never tie up all resource use while(true) infinite loop.

One more thought would be: Java multithreading model would come to play a big role on Comet application, However, I dont really a fan of Java.
I have been doing web developerment for quite a while. In different programming language, there are Model View Control Concept inside them. as well as Web, here comes MVC -> Model-Html, Xml, JSON : View-CSS, Control-Javascript.

So as many programming language best practice suggested, It is best to follow MVC pattern, and seperate them as much as possible, and here comes unobtrusive Javascript, and seperation of HTML and CSS.

The current popularity of AJAX is great example of using XMLHttp and some event model. event model has capturing, bubbleing state etc. very important to all these fancy effect created without using any flash. I think It probably reduce the file size a bit, and still very fancy and useful, especially for the sake of User Experience.

One Thing I notice on FIrefox is that It support global Error Handling, onError method, that is probably the method Firebug plugin based on, great method, And IE really need to implement such method, otherwise, Firefox could be the only developing choice for programmer, and everytime, It would be like just use IE to check if it works to meet the rest of large population.

Javascript imporve user experience a lot when use with AJAX, and easily help solved the limitation of flash. That is probably why Adobe come out with Spry Framework to compete on javascript market when AJAX become popular.
Tags:
Ha, really enjoy writing blog entry in English now, so much faster than written in Chinese, or it just imply my Chinese PingYing sucks?

so since long time ago, I already realized the different between include_once and require _once function in PHP language, which is require will halt the process and report error immediately , and include_once will continue process.

As well as I being told in many articles that use require on unconditional import, and use include on conditional import, which this is also a standard coding style in PHP Pear and Pecl repository.

So what is the real difference on using "include_once" and "require_once", or by meaning of "uncondictional" or "conditional" import, Here is some of my thoughts: unconditional import are usually used by the developer which needs to be there. and use "conditional" import to deal with dynamical generated code, such as "template", "user style", which the user generate, and they could make mistakes, and should be ignored, and mistakes by developer is not allowed, so use "require_once" to enable the strict standard.

^.^  , the (^ Not) regular expression still bother me, will figure it out soon, I hope, and write a entry about it.
Tags:

花了3天时间, 作了一个facebook的应用程序, 不是很复杂的程序, 就是简单的日常记事本, 来记录每天你想要记录的事情,本来是打算开发来给自己的blog用到, 后来想一下, 还是可以用它来试一下facebook platform。

总体来说, facebook platform是很不错的, 就是一个强大的PHP framework, 但是跟许多framework, 对开发者的flexibility控制的比较严格, 毕竟涉及到安全问题, 也不能怪facebook, 经过这几天的实践,觉得还是不要用太多framework的比较好,个人不喜欢被限制, 但是有一点就是自己写的东西很多时候都不是那么完美, 毕竟没有facebook那样经过这么多开发者的测试,anyway, 个人觉得开发facebook程序不值得推荐, facebook程序大多数是用来玩的, 没有什么真正有用的程序。

footprint程序连接: http://apps.facebook.com/footprint-zuji/

截图:
facebook

Tags: ,
我写的是我这一年看过书和我自己想的总结, 有不对的地方请大家指出, 给我意见。


1。 服务端的配置和优化 (大纲, 不包含细节)

Squid Proxy Server (这个好像是细节)

所谓程序服务端,也就是程序所在的主机。 当用户使用浏览器(IE, Firefox)来读取你网站的网页的时候, 你的程序服务器就开始工作了, 程序服务器就要对这个网页进行编译, 从MYSQL读取数据, 然后把HTML文件发给你的浏览器来读。 当别人的浏览器也读取这个网页的时候, 程序服务端又要对同一个网页进行处理后返回HTML, 如果网页的内容是一样的话,而在同一时间内有大量相同的请求的话, 就浪费了大量的CPU来进行编译, 我们可以使用Squid Proxy Server对文件进行缓存, 这样不仅减轻程序服务端的负担, 也可以使用户更快的浏览页面。

服务器群组

尽管有Squid的帮助, 一个程序服务器很容易就达到了它的瓶颈(普通的程序服务器在同时处理100个请求的时候就已经非常的吃力了), 这时候就需要加入更多的程序服务器进行分担, 每个程序服务器上都含有一样的程序。 在ALEXA前10名的网站的服务器都是以万计的。 这样每当用户向程序服务端要求网页的时候, 就会被平均的分配到所有的服务器上。进行平均分配可以通过不同的方法来实现, 有Layer 4 , Layer 7 , 和Round robin DNS等等。

MYSQL 群组

Tags: ,
It is really cool operating system, very intuitive interface, almost same as window vista, but I still need some time to figure out how to master everything.

I can only use English to write diary now, no language support text input is enable now ( I dont know how to at this time), graphic is fantastic even without install my G-force 7800 driver, It is already very smooth, but I will figure it out how to install my driver later on.

One bad thing about this system is that the wireless is work worse than windows XP, even though XP is not very well either, but Ubuntu is still not very good at supporting hardwares, or the other way around, hardware doesnt support Linux well yet.

It is a bit laggy when switch workplace, I think I really need install graphic driver anyway. There are so much more option you can do to control the looking and feel of the operating system. even the most trivial thing, like orientation of every part.

Before really make my mind to use Linux, I never know there are so many cool application you can use for free, the best thing about open source. and by using this system, I can concentrate myself on using the computer as a tool instead of entertaining system, gaming and entertainment is not very well support under Linux. (may be I am wrong with the entertainment part).

let me talk about the experience of using Ubuntu following days, really cool for me right now.
Tags:
因为工作要求, 试着用了一下PHPExcel这个PHP库, 很不错的一个库, 有许多支持格式的输出, 有个不好的地方就是PHPExcel好像只支持Excel2007的读取, Excel2000的文件, 就要用Excel2007来先进行转换, 今天就通过PHP来取出Excel的数据而已, 明天就开始做数据统计。
通过PHPExcel也接触了其他好的库, 也就Java和PHP作了一下比较:

个人认为PHP和Java各有个的优点

1。 PHP社区强大, 而且PHP的软件%80以上是开源加上可以用于商业用途, 而Java的开源程序很少, 就是有, 也大多不可以拿来修改来作为自己用。
Tags:
今天写了一个query Alexa 网站的php代码, 发现18c.com 排在第一位哦, 可能是alexa的bug吧, 还是有人用了作弊器. hehe, 其实都不是, 就是一个yahoo的服务器而已。 最近对编程有点不感兴趣的说, anyway, 明天要去interview一份工作先, wish me good luck. good luck good luck good luck, hehe...
花了2天时间整理了一下SBU文学社的网站, 增添了相册, 历程2个功能, 但是维护起来相对以前要比较吃力了。 这个网站已经有差不多一年半的历史了吧, 从一个小不点开始慢慢长大, 虽然管理这个网站花费了我相当大的精力, 现在却越来越喜欢这个网站, 我第一个投入心血的网站。 这两天也作了不少东西, 自己写了一个sitemap generator for 这个网站only, 优化网站, 改模板, 挺好玩的说。 anyway。。。
分页: 1/2 第一页 1 2 下页 最后页 [ 显示模式: 摘要 | 列表 ]