Javascript framework usage

784 views| June 14th, 2008 | Lập trình 2.0 | No Comments » by admin

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 3 out of 5)
Loading ... Loading ...

Prototype

Prototype is one of the earlier Javascript frameworks and is also included in the Ruby on Rails framework. Of the websites in this test, a total of 13 used the Prototype framework.

JQuery

JQuery is a framework that has received a lot of attention due to its speed, size and smart modular approach which has led to a big library of plugins. Of the websites in this test, 11 used the JQuery framework.

MooTools

Just like other Javascript frameworks, MooTools contains several functions to help development. One of the more known ones is its advanced effects component. Of the websites in this test, four used the MooTools frameworks.

Yahoo! UI Library (YUI)

Yahoo has developed its own Javascript framework. They use it for their own websites, but have also made it freely available to others. Of the websites in this test, seven used the Yahoo! UI Library.

Source: http://royal.pingdom.com/?p=305

 [ trackback ]

AJAX Libraries API

692 views| June 8th, 2008 | Lập trình 2.0 | No Comments » by admin

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

What is the AJAX Libraries API?

The AJAX Libraries API is a content distribution network and loading architecture for the most popular open source JavaScript libraries. By using the Google AJAX API Loader’s google.load() method, your application has high speed, globaly available access to a growing list of the most popular JavaScript open source libraries including:

Google works directly with the key stake holders for each library effort and accept the latest stable versions as they are released. Once we host a release of a given library, we are committed to hosting that release indefinitely.

The AJAX Libraries API takes the pain out of developing mashups in JavaScript while using a collection of libraries. We take the pain out of hosting the libraries, correctly setting cache headers, staying up to date with the most recent bug fixes, etc.

<script src=“http://www.google.com/jsapi”></script>
<script>
  // Load jQuery
  google.load(“jquery”, “1″);

  // on page load complete, fire off a jQuery json-p query
  // against Google web search
  google.setOnLoadCallback(function() {
    $.getJSON(“http://ajax.googleapis.com/ajax/services/search/web?q=google&;v=1.0&;callback=?”,

      // on search completion, process the results
      function (data) {
        if (data.responseDate.results &&
            data.responseDate.results.length>0) {
          renderResults(data.responseDate.results);
        }
      });
    });
</script>
 [ trackback ]

1 Star2 Stars3 Stars4 Stars5 Stars (7 votes, average: 4.29 out of 5)
Loading ... Loading ...

Thời gian gần đây, ở Trung Quốc tôi thấy xuất hiện khá nhiều Facebook clone. Điển hình là Xiaonei.com [ 430 triệu USD ]. Qua tìm hiểu ban đầu thì website này được viết bằng Java, sử dụng framework quen thuộc trong giới lập trình web Java là Struts (dựa vào phần mở rộng .do quen thuộc của Struts) và Server: Resin/3.0.21.

 

Website này có màu sắc, giao diện, bố cục giống đến 99% so với Facebook

Ngay sau sự xuất hiện của website này, trào lưu viết facebook clone đã bùng nổ với sự xuất hiện của tên tuổi rất có tiếng ở Trung Quốc và dân lập trình web ở Việt Nam cũng nghe tiếng là Comsenz. Hành động “bột phát” này cũng là lẽ thường vì Facebook đã quá thành công với nhiều nguồn đầu tư đến từ nhiều nơi như Microsoft, Li Ka-Shing (Hong Kong).

Comsenz được biết đến với sản phẩm nổi tiếng là Discuz BBS. Nếu như ở Việt Nam, vBulletin Board (VBB) thống trị ở hầu hết các diễn đàn thì ở Trung Quốc chẳng mấy ai thích dùng VBB, Invision Power Board, phpBB. Theo ý kiến cá nhân của tôi thì Discuz thành công là nhờ nó ra đời đúng lúc (không sớm nhưng cũng không muộn quá mức), đánh vào thị hiếu thích màu mè, bản địa hóa và đặc biệt là khả năng hỗ trợ và xây dựng cộng đồng rất tốt. Dù rằng dân trong nghề đều thấy khả năng viết mã PHP của Discuz kém xa so với vBulletin Board. Tuy nhiên, chức năng của Discuz thì rất Á Đông, chẳng hạn đa số dân lập trình web ở châu Á (trong đó có Việt Nam) rất chịu khó phát triển thêm từ những mã nguồn dễ đọc. Từ diễn đàn, có thể phát triển thêm thành shop bán hàng, đấu giá sản phẩm, trang chia sẻ hình ảnh ngay trong diễn đàn chứ không cần phải viết tách ra module mới. Đây cũng chính là một phần tạo nên sự thành công của Discuz. Ngoài Discuz, Comsenz còn có các sản phẩm khác như X-Space (được coi như MySpace clone), SupeV (Youtube clone).

Gần đây, Comsenz đã cho ra mắt sản phẩm mới có tên gọi UCenter Home, một Facebook clone. Không có gì bất ngờ nếu UCenter Home phát hành “kiểu thương mại” như X-Space, SupeV. Tuy nhiên, một cơn bão khác lại xuất hiện và Comsenz đã thay đổi quyết định để UCenter Home thành mã nguồn mở, từ đó cho ra mắt bộ ba miễn phí Discuz-UCenter-UCenter Home.ucenter-home_1212769466676.png Tôi gọi đây là cơn bão Facebook clone bởi vì chỉ một thao tác tìm kiếm trên Baidu.com với từ khóa: “Powered by UCenter Home” thì có tới 318,000 lần xuất hiện (kết quả?) !!! Quả thật là một cơn bão lớn :D Vậy cơn bão đã làm Comsenz thay đổi ý định tên gì, tên nó là ThinkSNS - bão mã nguồn mở! Đây là sản phẩm hoàn toàn mã nguồn mở [http://code.google.com/p/thinksns/] tương tự như framework ThinkPHP [http://code.google.com/p/thinkphp/] dùng để phát triển ThinkSNS. thinksns1212769481501.pngKiến trúc cũng như cách viết mã của ThinkSNS chuyên nghiệp hơn rất nhiều so với cách viết cũ của Comsenz. Còn về giao diện và chức năng thì UCenterHome chiếm ưu thế hơn so với ThinkSNS.

Mong rằng sắp tới Việt Nam có nhiều “bão code” hơn so với bão từ biển Đông. Hy vọng bài viết này cũng sẽ giúp ích cho những ai đang và sẽ có ý định muốn làm Facebook clone ;)

Bên lề:

 [ trackback ]

PHP UTF-8 cheatsheet

743 views| June 6th, 2008 | Lập trình 2.0 | 1 Comment » by admin

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

1. Update your database tables to use UTF-8

CREATE DATABASE db_name
	CHARACTER SET utf8
	DEFAULT CHARACTER SET utf8
	COLLATE utf8_general_ci
	DEFAULT COLLATE utf8_general_ci
	;

ALTER DATABASE db_name
	CHARACTER SET utf8
	DEFAULT CHARACTER SET utf8
	COLLATE utf8_general_ci
	DEFAULT COLLATE utf8_general_ci
	;

ALTER TABLE tbl_name
	DEFAULT CHARACTER SET utf8
	COLLATE utf8_general_ci
	;

2. Install the mbstring extension for PHP

Windows: download the dll if it’s not in your PHP extensions folder, and uncomment the relevant line in your php.ini file: extension=php_mbstring.dll
Linux: yum install php-mbstring Xem thêm »

 [ trackback ]

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

http://www.slideshare.net/ijansch/enterprise-php-288851

  • PHP is like Lego bricks
  • Bricks allowing you to build anything

 [ trackback ]