Chuyển đến nội dung chính

Bài đăng

famous laws of software development

https://www.timsommer.be/famous-laws-of-software-development/
Các bài đăng gần đây

CGI, Fast CGI, PHP-FPM

https://help.superhosting.bg/en/cgi-common-gateway-interface-fastcgi.html First, the two protocols: CGI scripts is a way how to run a server side script when a HTTP request comes; this has nothing to do with PHP FastCGI is a "better CGI" - CGI is known to be slow, Fast CGI is a different approach with much faster results; this has also nothing to do with PHP. Now the PHP related things: mod_php  is running a PHP as Apache module - that is PHP request is run under Apache process with everything that goes with it - Apache processes are defined by Apache configuration, PHP is run with Apache permission etc. PHP-FPM  is PHP's FastCGI implementation; PHP-FPM runs as a standalone FastCGI server and Apache connects to the server using Apache's module, usually mod_fcgid or mod_fastcgi; I personally think this is much better than running as mod_php, but it depends on your requirements and is also a little more complex; in this configuration, permission, pr...

Dynamic programming - rod cutting (Quy hoạch động)

Dynamic programming - rod cutting (Quy hoạch động) Hãy xem bài toán đơn giản sau: Có một thanh thép dài n = 10 mét Có thể bán thanh thép với độ dài và giá tương ứng theo bảng sau: Độ dài 1 2 3 4 5 6 7 8 9 10 Giá 1 5 8 9 10 17 17 20 24 30 Thanh độ dài 1: giá 1$ Thanh độ dài 2: giá 5$ .... Thanh độ dài 10: giá 30$ Câu hỏi đặt ra là: chúng ta nên cắt thanh thép như thế nào để có được số tiền lớn nhất? Chúng ta có thể dễ dàng giải quyết bài toán với độ dài n=1,2,3  R1 = 1 R2 = 5 R3 = 8 Với n=4 chúng ta có 8 cách cắt như sau:  4 thanh độ dài = 1, R4=4 1 Thanh độ dài =1, 1 Thanh độ dài = 2, 1 thanh độ dài 1, R4=7 2 thanh độ dài = 2, R4 = 10 .... Như vậy R4=10 (cắt thành 2 thanh độ dài 2) Số phương án cắt sẽ tăng theo hàm số mũ: 2 mũ (n-1) (với n là độ dà...