Header line Regular expression: ^[\w ]+( [\w ]+)*$ As string literal: "^[\\w ]+( [\\w ]+)*$" Other lines Regular expression: ^([\w ]+)( \d+)( \d+)( \d+)$ As string literal: "^([\\w ]+)( \\d+)( \\d+)( \\d+)$" Aren’t those invisible tab characters annoying? Define a tab character class Aren’t those invisible space characters annoying? Us...
27 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1242 | Lượt tải: 0
“To make life easier for the serious programmer” i.e., primarily me and my friends/colleagues I love writing code I like reading code I hate debugging Elegant and efficient code I really dislike choosing between the two Elegance, efficiency, and correctness are closely related in many application domains Inelegance/verbosity is a major sour...
40 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1313 | Lượt tải: 0
// a very useful algorithm (missing from the standard library):
template
37 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1402 | Lượt tải: 0
Chỉ play dạng chuẩn dành cho audio kĩ thuật số trên nền tảng PC của Intel. File audio phải có kích thước thích hợp với bộ nhớ có sẵn. Không thể được sử dụng một cách đồng thời bởi nhiều tiểu trình trong cùng một tiến trình
7 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1355 | Lượt tải: 0
By default, use a vector You need a reason not to You can “grow” a vector (e.g., using push_back()) You can insert() and erase() in a vector Vector elements are compactly stored and contiguous For small vectors of small elements all operations are fast compared to lists If you don’t want elements to move, use a list You can “grow” a list (e...
43 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1363 | Lượt tải: 0
An introduction to the STL, the containers and algorithms part of the C++ standard library. Here we’ll meet sequences, iterators, and containers (such as vector, list, and map). The algorithms include find(), find_if(), sort(), copy(), copy_if(), and accumulate().
43 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1279 | Lượt tải: 1
We’ll see how we can change vector’s implementation to better allow for changes in the number of elements. Then we’ll modify vector to take elements of an arbitrary type and add range checking. That’ll imply looking at templates and revisiting exceptions.
38 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1327 | Lượt tải: 0
Think of a reference as an automatically dereferenced pointer Or as “an alternative name for an object” A reference must be initialized The value of a reference cannot be changed after initialization int x = 7; int y = 8; int* p = &x; *p = 9; p = &y; // ok int& r = x; x = 10; r = &y; // error (and so is all other attempts to change what r ...
35 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1174 | Lượt tải: 0
The next three lectures will show how the standard vector is implemented using basic low-level language facilities. This is where we really get down to the hardware and work our way back up to a more comfortable and productive level of programming.
32 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1200 | Lượt tải: 0
Graphical user interfaces Windows and Widgets Buttons and dialog boxes
50 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1229 | Lượt tải: 0