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”);

Không có ảnh

Code C cài đặt thuật toán tìm kiếm tuyến tính – Linear search

20/11/2017 Nosomovo 0

// Tim kiem tuyen tinh (LinearSearch) #include<stdio.h> #include<conio.h> int LinearSearch1(int Day[],int n,int x) { int vitri=0; while(vitri<n&&Day[vitri]!=x) vitri++; if(vitri==n) return -1; else return 1; } int LinearSearch2(int Day[],int n,int x) { int vitri=0; while(vitri<n&&Day[vitri]!=x) vitri++; if(vitri==n) return -1; else return vitri; } int Mang[10]={1,2,3,4,5,6,7,8,9,10}; int X; void main() { clrscr();

Không có ảnh

Code C đổi số hệ cơ số 10 sang các hệ cơ số khác

20/11/2017 Nosomovo 0

/*———————————————- Chuong trinh doi co so he 10 ra co so n bat ky ———————————————–*/ #include <conio.h> #include <stdio.h> typedef int ElementType; struct Node { ElementType Element; Node *Next; }; typedef Node *Stack; typedef Node *Position; void MakeNullStack(Stack S) { S->Next=NULL; } Position Pop(Stack S) { return S->Next; } void

Không có ảnh

Code C minh họa danh sách liên kết sử dụng con trỏ

20/11/2017 Nosomovo 0

/* —————————————————————————– – Su Dung Con Tro / ———————————————– a) nhap ds so nguyen b) Sap xep giam c) Tong cac so nguyen la so 9 phuong d) in ket qua vua tinh e) Sap xep theo phuong phap noi bot f) Tong cac so nguyen to trong danh sach

Không có ảnh

Code cài đặt thuật toán sắp xếp nổi bọt dùng con trỏ – Code Bubble Sort use pointer

20/11/2017 Nosomovo 0

/*————————————————— -Thuat Toan: Bubble Sort (Sap Xep Noi Bot) -Kieu: Pointer (Dung con tro). —————————————————-*/ #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <dos.h> struct Node { int Value; Node *Next; }; typedef Node *List; typedef Node *Position; // Tao DS Rong void MakeNullList(List L) { L->Next=NULL; } //Nhap DS void

Code cài đặt thuật toán sắp xếp nổi bọt sử dụng mảng – Code Bubble Sort use array

20/11/2017 Nosomovo 0

//Minh hoa thuat BubbleSort (sap xep noi bot) #include<stdio.h> #include<conio.h> int Mang[10]={10,9,8,7,6,5,4,3,2,1}; // ham in day so trong mang voi n phan tu void inday(int mang[],int n) { int vtin; for(vtin=0;vtin<n;vtin++) printf(“%d “,mang[vtin]); } void BubbleSort(int mang[],int n) { int i,j,xtam; for(i=0;i<n;i++) for(j=n-1;j>i;j–) if(mang[j]<mang[j-1]) //neu mang[j]>mang[j-1] thi doi cho {

Hàm nối chuỗi trong mysql

12/11/2017 Nosomovo 0

Để nối chuỗi trong mysql, chúng ta sử dụng hàm CONCAT. CONCAT(‘chuoi_1’, ‘chuoi_2’, ‘…’, ‘chuoi_n’) Ví dụ: CONCAT(‘no’,’so’,’mo’,’vo’) // Ket quả: nosomovo Để hiểu rõ hơn về nguyên tắt hoạt động của hàm các bạn xem hình bên dưới đây nhé. Nosomovo