Một số lưu ý với CSS trên IE


Khi CSS cho các trình duyệt IE cần lưu ý các vấn đề sau:

1. padding, margin, width, height, float …
- Nếu đã set width thì không sử dụng padding 2 chiều left, right

- Nếu đã set height thì không sử dụng padding 2 chiều top, bottom

- Nếu đã float: left –> ko dùng margin-left

- Nếu đã float: right –> không dùng margin-right

(Ngược lại)


2. Bo góc bằng ảnh (img)
Ví dụ: bạn có 1 thẻ A, bao 2 thẻ IMG để bo góc thành 1 button

<a onclick=”networkManager.notifyUserFriend(’18′, ‘notifyremoveUser-18′);” href=”javascript:void(0);” class=”link-button2″> <img src=”/theme/images/pixshare_transparent.png” class=”corner-l”>

BUTTON NAME
<img src=”/theme/images/pixshare_transparent.png” class=”corner-r”>
</a>
Nếu có khoảng trắng giữa thẻ A và thẻ IMG thì sẽ bị lỗi giao diện trên IE

3. Z-index
z-index của 1 element con sẽ phụ thuộc vào z-index của element cha.
Tham khảo: http://www.brenelz.com/blog/squish-the-internet-explorer-z-index-bug/

4. Lỗi khi sử dụng onchange với thẻ SELECT Không dùng <select onchange=”function..”>, tren IE sẽ bị gọi 2 lan hàm onchange.
Khắc phục: Sử dụng jquery: $(‘select’).change(function() { .. } );

5. Event handlers trên thẻ OPTION
- Tất cả các version (6,7,8) của IE đều không hỗ trợ bất kỳ event handlers nào trên thẻ OPTION
–> Tốt nhất là ko nên bắt sự kiện trên thẻ option trên bất kỳ trình duyệt nào.

(Còn bổ sung …)

update terawurl data (wurfl.xml)


Download bản mới nhất về, giải nén và lấy file wurfl.xml trong thư mục data


http://sourceforge.net/projects/wurfl/files/WURFL%20Database/

How to remove all .svn directories from my application directories



xargs takes input, usually separated by newlines, and places them on the command line, so adding xargs makes what you had work:

find . -name .svn | xargs rm -fr

xargs is intelligent enough that it will only pass as many arguments to rm as it can accept. Thus, if you had a million files, it might run rm 1,000,000/65,000 times (if your shell could accept 65,002 arguments on the command line {65k files + 1 for rm + 1 for -fr}).

As persons have adeptly pointed out, the following also work:
find . -name .svn -exec rm -rf {} \; 
find . -depth -name .svn -exec rm -fr {} \; 
find . -type d -name .svn -print0|xargs -0 rm -rf 

The first two -exec forms both call rm for each folder being deleted, so if you had 1,000,000 folders, rm would be invoked 1,000,000 times. This is certainly less than ideal. Newer implementations of rm allow you to conclude the command with a + indicating that rm will accept as many arguments as possible:
find . -name .svn -exec rm -rf {} +

VirtualBox Add new resolutions into Virtual machine

Add new resolutions into Virtual machine
1. Shutdown virtual machine
2. Run command: VBoxManage setextradata “window xp sp3″ CustomVideoMode1 1366x768x32
(“window xp sp3″ is the machine name. )
3. Start virtual machine and change your display resolution.

 

MySQL DATETIME vs TIMESTAMP vs INT performance and benchmarking with InnoDB

Following my tests with DATETIME vs vs TIMESTAMP vs INT performance and benchmarking with MyISAM storage engine, I’ve wondered about the performance impact using InnoDB, which is usually more peaky with I/O.
Test environment was pretty much the same:
So I went to do some benchmarks to see what we can conclude. The tests were run with:
  • MySQL 5.4.0-beta (although specific 5.4/Google SMP patch configuration options left as defaults);
  • Intel Quad core x 2800 MHz
  • Solaris 10
  • For each test, the tables were recreated to be positively sure there was no caching at all (also, but not every iteration, I did a filesystem cache flush) and the test itself was repeated a couple of times.
  • I should also note that the InnoDB logs and datafiles and the exported data resided on the same storage device.

Tìm hiểu về PHP handler


1.PHP handler là cái gì ?

Khi chạy một site PHP, server phải cần thông dịch PHP và tạo ra trang web khi người dùng truy cập vào. Tùy vào từng người dùng, thời gian địa điểm mà webiste có thể được tạo ra khác nhau. Code PHP được phiên dịch dựa vào bộ thư viện PHP như PHP4 và PHP5. PHP handler sẽ điều khiển quá trình những gì load lên từ bộ thư viện PHP
Có nhiều PHP Handler hiện nay được sử dụng như DSO, CGI, SuPHP, FastCGI.Mỗi handler có những tác động đến performance của Apache khác nhau bởi vì nó xác định Apache sẽ dùng PHP như thế nào.
Có một vấn đề quan trọng là tùy thuộc vào tình hình (máy chủ, CPU, Ram, Nhu cầu, mục đích) mà chúng ta sẽ chọn handler thích hợp. Không có handler nào hoàn toàn tốt hơn cái nào. Vì vậy phải lựa chọn cho phù hợp.
Hiện tại thì FastCGI đang được dùng khá phổ biến.
Sau đây sẽ đề cập tổng quan về tất cả các PHP Handler. So sánh hiệu năng của các handler này.