標籤

bat (52) 作品 (38) python (21) shell (17) windows (11) 虛擬機 (11) php (10) CPP (6) KMS (6) 程式設計 (6) docker (5) 使用教學 (5) xoops (4) 公文 (4) Apache2 (3) Excel (3) juniper (3) 資料庫 (3) mysql (2) 免動手 (2) 資料結構 (2) 軟體廣播 (2) 電腦維修 (2) Android Studio (1) Apple IPAD管理 (1) Arduino (1) CSS (1) LAMP (1) NAS (1) Ubuntu (1) VHD (1) Windows Server (1) 原因 (1) 程式應用 (1) 程式積木 (1) 編輯器 (1) 雲端硬碟 (1)

2021年7月11日 星期日

Xubuntu 20.04.2 x64 用shell 安裝Apache、MySQL、PHP、Geany、Bluefish、Chrome 與 Visual Studio Code

現在用shell 安裝下列步驟1~7的套件。
檔案名稱:Xub2004LAMP.sh
檔案內容:
#!/bin/bash
apt install -y apache2 apache2-utils
apt install mariadb-server mariadb-client
apt install php7.4 libapache2-mod-php7.4 php7.4-mysql php-common php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-readline
a2enmod php7.4
systemctl restart apache2
apt install phpmyadmin
apt install -y geany
apt install -y bluefish
apt install software-properties-common apt-transport-https wget
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
apt install code
clear
echo "請下指令  sudo mysql_secure_installation ,完成最後MySQL密碼設定"

1.安裝 Apache
$sudo apt install -y apache2 apache2-utils

2.安裝 MySQL
$sudo apt install mariadb-server mariadb-client
$sudo mysql_secure_installation

3.安裝 PHP
$sudo apt install php7.4 libapache2-mod-php7.4 php7.4-mysql php-common php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-readline
$sudo a2enmod php7.4
$sudo systemctl restart apache2

4.安裝phpMyAdmin
$sudo apt install phpmyadmin

5.安裝Geany
$sudo apt install -y geany

6.安裝Bluefish
$sudo apt install -y bluefish

7.安裝Chrome
$wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
$sudo apt install ./google-chrome-stable_current_amd64.deb

8.安裝Visual Studio Code
$sudo apt install software-properties-common apt-transport-https wget
$wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
$sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
$sudo apt install code


9.裝Visual Studio Code 套件 
EditorConfig for VS Code
統一專案中檔案的編輯風格

ESLint
編輯器會自動幫你檢查 coding style,需搭配 .eslintrc 檔

Git History
方便查看 Git 紀錄以及檔案歷史,包括 Line History,並可直接連結到變更的檔案。

Git Lens
版本控紀錄,一目了然誰在什麼時間點修改檔案

Path Intellisense
輸入 / 編輯器會自動查詢該目錄底下建議路徑

Path Autocomplete for Visual Studio Code
路徑自動補完

Preview on Web Server
前端開發時預覽的好幫手

vscode-icons
幫你 VS Code 檔案與資料夾 icon 美化

DotENV
讓 .env 檔也有 syntax 效果

Markdown All in One
一應俱全的 Markdown 工具,包括 highlight、快速鍵、自動補完、預覽

Docker
方便管理及操作 Docker Image、Container 的官方工具

YAML
讓 VSCode 支援 YAML 格式

Guides
在程式開關符號(例如左右大括號)拉一條線,方便識別程式區塊

Auto Close Tag
自動把右括號或結束標籤補上

資料來源:


2021年7月2日 星期五

C++ Pointer 與 Array 的相關範例筆記

觀念:
指標是用來指向記憶體位址的,可用*設指標變數跟取指向位址的值。&就是取變數記憶體位址。

陣列宣告
資料型態 陣列名稱[陣列長度];
int A[10];

程式名稱:
程式碼:

資料來源:
1.C++ Array of Pointers



C++ Class 的範例筆記

程式名稱:ClassRectangle01.cpp
程式內容:

#include <iostream>
using namespace std;

class CRectangle {
int x,y;
  public:
     void set_values (int a,int b) {
        x = a;
y = b;
}
     int area(void){
      return x*y;
}
};

int main() {

  CRectangle rect;
  rect.set_values(3,4);
  cout << " area: " << rect.area();
}

建構子
建構子 constructor, 它透過一個與 class 同名的函數來定義。當且僅當要生成一個 class 的新的物件的 時候或給該 class 的一個物件分配記憶體的時候,這個建構子將自動被調用。。一個建構子永遠沒有返回值,也不用宣告成 void。

程式名稱:ClassRectangle02.cpp
程式內容:
#include <iostream>
using namespace std;

class CRectangle {
int width,height;
public:
CRectangle (int a, int b) {
width = a;
height = b;
}
int area(void) {
return width*height;
};

int main() {
CRectangle rect01 (3,4),rect02 (5,6);
        cout << " rect01 area:" << rect01.area()<< endl;
        cout << " rect02 area:" << rect02.area()<< endl;
}

解構子
解構子 destructor 完成相反的功能。它在 objects 被從記憶體中釋放的時候被自動 調用。釋放可能是因為它存在的範圍已經結束了(例如,如果 object 被定義為一 個函數內的 local (區域) 物件變數,而該函數結束了);或者是因為它是一個動 態分配的物件,而被使用運算子 delete 釋放了。 解構子必頇與 class 同名,加上水波號 tilde (~) 首碼,一樣必頇無返回值

程式名稱:ClassRectangle03.cpp
程式內容:
#include <iostream>

using namespace std;

class CRectangle {
int *width,*height;
public:
CRectangle (int a, int b) {
width = new int;
height = new int;
*width = a;
*height = b;
}
~CRectangle (){
delete width;
delete height;
}; 
int area(void) {
return *width * *height;
};

int main() {
CRectangle rect01 (3,4),rect02 (5,6);
    cout << " rect01 area:" << rect01.area()<< endl;
    cout << " rect02 area:" << rect02.area()<< endl;
}



只要點兩下,傳統右鍵選單改回Win11右鍵選單

系列文章: 1. 只要點兩下,就能將Win11 右鍵選單 回復 傳統右鍵選單 2. 只要點兩下,傳統右鍵選單改回Win11右鍵選單 上一篇提到只要點兩下,就能將Win11選單回到傳統選單。但是有沒有方法能夠回到Win11選單呢?                    ...