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

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