XpandNotes

exploring the intersection of technology and creativity

java 爬蟲教學

這篇教學會利用 jsoup 函式庫寫出一個爬取單一網頁並擷取網頁內所有文字的爬蟲,也算是一個筆記,以防自己將來需要用到這個程式的時候要 trace 半天才看得懂… 使用環境 Ubuntu 18.04 openjdk version “1.8.0_242” jsoup 1.13.1 我沒有使用 maven 管理 java 套件,都是用手動管理的(之後學會用 maven 再補上 pom),...

Hadoop 3.2.1 安裝教學

最近正在學習 Hadoop,發現 Hadoop 的安裝過程繁瑣,每個人的裝置又可能產生不一樣的問題,且中文資源較少,所以想好好寫個筆記紀錄一下,未來安裝 Hadoop 時可以參考,同時也希望能幫助新手 Step 1: 安裝 java 打開 terminal 運行以下指令 $ sudo apt install openjdk-8-jre-headless $ sudo apt insta...

Pointer, Function, Structure

Pointer and Structure Pointers can also points to user-defined structures: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 #include<iostream> #include<string> using namesp...

Pointer (2)

Pointer Arithmetic In the previous post, we mentioned that an array is actually a pointer. Array pointers support to return a shifted address via + operator and - operator. Now we learn how to shi...

Pointer (1)

Pointer Variables The concept of pointer in C++ is quite important for developing class. Before talking about pointer, let’s learn to find the address of a variable by & (address) operator. 1...

Union and Enumeration

Union A union, like a structure, consists of several members, possibly of different types. The compiler allocates only enough space for the largest of the members, which overlay each other within ...

Structure

Structure Variables Suppose you want to store data of a student, you may store his name, age, height, score… Though an array can store several elements, every element must be the same type! For in...

Array and String

What is an Array An array is a data format that store several value of the same type. For example, an array can store 12 integers indicating day number of every month. Compiler won’t check i...

Variables

Naming Variables C++ encourages user declare meaningful variables. For instance, to express “cost of trip”, the corresponding variable can be named as cost_of_trip or CostOfTrip, instead of cot, x...

C++ Beginning

main() Function 1 2 3 4 5 int main() //function heading { statements return 0; } A function has two parts. One is called function heading. The first word int is call return type, indicati...