Code xóa cache Nukeviet

15/03/2018 Nosomovo 0

Để xóa cache cho website Nukeviet một cách nhanh chóng, chúng ta có thể sử dụng cách sau: Tạo file deletecache.php với nội dung: <?php //Code xóa các file cache trong thu muc cache cua Nukeviet $arr_Dir=scandir(‘data/cache’); for($i=2;$i<=count($arr_Dir);$i++) { if(is_dir(‘data/cache/’.$arr_Dir[$i])) { $arr_File=scandir(‘data/cache/’.$arr_Dir[$i]); for($j=2;$j<=count($arr_File);$j++) { echo unlink(‘data/cache/’.$arr_Dir[$i].’/’.$arr_File[$j]); } } } ?>

Public and Free DNS list

15/03/2018 Nosomovo 0

There are public & free DNS list update until march 2018: Provider Primary DNS Server Secondary DNS Server Level 209.244.0.3 209.244.0.4 Verisign 64.6.64.6 64.6.65.6 Google 8.8.8.8 8.8.4.4 Quad 9.9.9.9 149.112.112.112 DNS.WATCH 84.200.69.80 84.200.70.40 Comodo Secure DNS 8.26.56.26 8.20.247.20 OpenDNS Home 208.67.222.222 208.67.220.220 Norton ConnectSafe 199.85.126.10 199.85.127.10 GreenTeamDNS 81.218.119.11 209.88.198.133 SafeDNS

Sử dụng .htaccess loại bỏ “index.php” trong đường dẫn CodeIgniter – CI

07/03/2018 Nosomovo 0

Để loại bỏ “index.php” trong đường dẫn truy cập website ta tạo file .htaccess với nội dung sau: <IfModule mod_rewrite.c> RewriteEngine on RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L,QSA] </IfModule> <IfModule !mod_rewrite.c> # Without mod_rewrite, route 404’s to the front controller ErrorDocument 404 /index.php

Không có ảnh

Cài đặt nơi lưu trữ session trong CodeIgniter – CI

06/03/2018 Nosomovo 0

CodeIgniter – Ci hỗ trợ 2 cách lưu trữ session là lưu trữ dạng file và lưu trữ trong databse. 1. Lữu trữ session dạng file: Trong file config.php (application/config/config.php) chúng ta chỉnh như sau: $config[‘sess_driver’] = ‘files’; //Hình thức lữu trữ session $config[‘sess_save_path’] =BASEPATH . ‘cache/sessions/’; //Đường dẫn lưu

Không có ảnh

Mysql connection string in C#

05/03/2018 Nosomovo 0

string Connectionstring = “SERVER=” + m_Server + “; PORT=” + m_Port + “;” + ” DATABASE=” + m_Database + “;” + “UID=” + m_UserName + “;” + “PASSWORD=” + m_PassWord + “; CharSet=utf8; POOLING=TRUE;”; nosomovo

Không có ảnh

Excel connection string in C#

05/03/2018 Nosomovo 0

string ConnectionString = “Provider=Microsoft.ACE.OLEDB.12.0; Data Source=” + “filename” + “; Extended Properties=\”Excel 12.0\”;”; Nosomovo

Không có ảnh

Sql server connection string in C#

05/03/2018 Nosomovo 0

Kết nối bằng quyền Windows: string m_ConnectString = “Data Source=” + “servername” + “;Initial Catalog=” + “databasename” + “;Integrated Security=True;”; Kết nối bằng quyền User: string m_ConnectString = “Data Source=” + “servername” + “;Initial Catalog=” + “databasename” + “;User Id=” + “username” + “;Password=” + “pasword” + “;”; Nosomovo

Không có ảnh

Cài đặt (Install) một website Nukeviet

28/02/2018 Nosomovo 0

Để thực hiện cài đặt một website Nukeviet các bạn thực hiện như sau: Bước 1: Truy cập vào trang chủ nukeviet.vn chọn và tải bộ source phù hợp nhu cầu sử dụng. Bước 2: Giải nén file cài đặt vừa tải vào thư mục gốc chạy web, thường là www,

Không có ảnh

Đặt lại password cho user trang nukeviet bằng code

28/02/2018 Nosomovo 0

Trong trường hợp bạn quên luôn tài khoản admin quản trị trang thì bạn có thể dùng cách sau để đặt lại password: Bước 1: Mở file includes/mainfile.php và thêm đoạn code sau vào cuối file: $username = ‘Username’; //Username cần đặt lại password $password = $crypt->hash(trim(‘Userpass’)); //Password mới if(

Không có ảnh

Code PHP – Chuyển nhiều mảng đơn thành một mảng 2 chiều

26/02/2018 Nosomovo 0

/* Hàm chuyển nhiều mảng một chiều thành mảng 2 chiều Ví dụ: $arr_cacmang1chieu=array( ‘col_1’=>array(‘A’,’B’,’C’), ‘col_2’=>array(‘D’,’E’,’F’) ); Sau khi chuyển kết quả sẽ là: $arr_mang2chieu=array( 0=>array( ‘col_1’=>’A’, ‘col_2’=>’D’ ), 1=>array( ‘col_1’=>’B’, ‘col_2’=>’E’ ), 2=>array( ‘col_1’=>’C’, ‘col_2’=>’F’ ) ) */ function multiArrayTotwodimensionArray($array,$remotenullrow=false) { $arr_Return=null; $maxlen=0; if(!empty($array)) { //Count Max len of

Lệnh cấu hình tài khoản git

23/02/2018 Nosomovo 0

Để cấu hình tài khoản git sau khi đã cài đặt git vào máy chúng ta dùng 2 lệnh sau: git config –global user.email “you@example.com” git config –global user.name “Your Name”   Nosomovo

Chuyển SSL khi chuyển host cho website

23/02/2018 Nosomovo 0

Khi bạn chuyển website của mình từ host A sang host B và muốn đem ssl đã cài đặt bên host A sang host B thì cách thực hiện đơn giản như sau: – Tại host A,các bạn truy cập vào phần quản lý file tìm 3 file ssl.ca, ssl.cert,

Cài đặt ngôn ngữ tiếng việt cho website WordPress

01/02/2018 Nosomovo 0

Để cài đặt Tiếng việt cho website WordPress chúng ta thực hiện với 3 bước như sau: Bước 1: Chọn Settings => Site Language là “Tiếng Việt” thay cho “English” hiện tại. Bước 2: Bấm Save Changes để lưu cài đặt lại. Bước 3: Chọn menu Bảng tin => Cập

Không có ảnh

Code C# – Upload file to web server

26/01/2018 Nosomovo 0

  public class HttpUploadHelper { private HttpUploadHelper() { } public static string Upload(string url, UploadFile[] files, NameValueCollection form) { HttpWebResponse resp = Upload((HttpWebRequest)WebRequest.Create(url), files, form); using (Stream s = resp.GetResponseStream()) using (StreamReader sr = new StreamReader(s)) { return sr.ReadToEnd(); } } public static HttpWebResponse Upload(HttpWebRequest req, UploadFile[] files, NameValueCollection form)

Code C# – Thao tác với Registry của windows

26/01/2018 Nosomovo 0

Lớp myRegistry bên dưới cung cấp cho ta các hàm thao tác với Registry của windows như: Đọc giá trị của 1 key. Đăng ký key và gi giá trị của key vào registry. Xóa key đã đăng ký. public sealed class myRegistry { /// <summary> /// Method is used to read

Không có ảnh

Code C# – Thực hiện các phép toán trên tập hợp

26/01/2018 Nosomovo 0

Lớp Set  bên dưới sẽ cung cấp cho chúng ta các hàm thực hiện các phép toán trên tập hợp như: Giao, hợp, hiệu: class Set { private string m_Set = “”; #region Contructors public Set(string str_set) { this.m_Set = str_set; } #endregion #region Properties public string SET { get

Không có ảnh

Code C cài đặt thuật toán sắp xếp chọn trực tiếp – Selection Sort

20/11/2017 Nosomovo 0

//Minh hoa thuat Selection Sort #include<stdio.h> #include<conio.h> int Mang[10]={10,9,8,7,6,5,4,3,2,1}; int X; void SelectionSort(int mang[],int n) { int i,j,tam; for(i=0;i<n;i++) { int min=i; for(j=i+1;j<n;j++) if(mang[j]<mang[min]) min=j; tam=mang[i]; mang[i]=mang[min]; mang[min]=tam; } } void inday(int mang[],int n) { int vt; for(vt=0;vt<n;vt++) printf(“%d “,mang[vt]); } void main() { clrscr(); printf(“Day truoc khi sap xep\n”);