Insertion sortÝ tưởng của insertion sort như sếp bài nếu số phía sau nhỏ hơn phía trước thì cho thì cho nó lên trên.
|
Tư tưởng của thuật toán là i, j để chỉ vị trí, ví dụ j=2 tức là vị trí thứ 2 INSERTION-SORT.A/ for j = 2 to A:length key = A[j] // Insert A[j] into the sorted sequence A[1.. j - 1]. i = j - 1 while i > 0 and A[i] > key A[i + 1] = A[i] i = i - 1 A[i + 1] = key |
Cách thực hiện như sau
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
void insertionSort(int arr[], int n) { int i, key, j; for (i = 1; i < n; i++) { key = arr[i]; j = i - 1; /* Move elements of arr[0..i-1], that are greater than key, to one position ahead of their current position */ while (j >= 0 && arr[j] > key) { arr[j + 1] = arr[j]; j = j - 1; } arr[j + 1] = key; } } |
Các bạn sau khi đã cài đặt Mautic trên server nhưng nếu bạn chưa thiết lập crontab thì bạn không thể chạy các campaign và segment.
|
5,35 * * * * /path/to/php /path/to/mautic/app/console mautic:segments:update */10 * * * * /path/to/php /path/to/mautic/app/console mautic:campaigns:rebuild */5 * * * * /path/to/php /path/to/mautic/app/console mautic:campaigns:trigger */5 * * * * /path/to/php /path/to/mautic/app/console mautic:emails:send */5 * * * * /path/to/php /path/to/mautic/app/console mautic:email:fetch */5 * * * * /path/to/php /path/to/mautic/app/console mautic:social:monitoring */5 * * * * /path/to/php /path/to/mautic/app/console mautic:webhooks:process */5 * * * * /path/to/php /path/to/mautic/app/console mautic:iplookup:download */5 * * * * /path/to/php /path/to/mautic/app/console mautic:maintenance:cleanup --days-old=365 --dry-run |
1. Bỏ hoặc theme www vào domain:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301] // Không theme WWW vào URL RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^domain.com$ [NC] RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301] |
2. Redirect đến trang thông báo lỗi riêng Trong web thì có nhiều lỗi như: 401, 403, 404, 500 … là các …
Read More “Cấu hình htaccess cơ bản”