Table of Contents
Preface xi
Introduction 1
Part I Hardware 7
1 What Is a Computer? 11
1.1 Logical Construction 13
1.1.1 Processor 14
1.1.2 Primary memory 15
1.1.3 Secondary storage 16
1.1.4 Et cetera 18
1.2 Physical Construction 18
1.3 Moore's Law 22
1.4 Summary 23
2 Bits, Bytes, and Representation of Information 25
2.1 Analog versus Digital 25
2.2 Analog-Digital Conversion 27
2.2.1 Digitizing images 27
2.2.2 Digitizing sound 28
2.2.3 Digitizing movies 31
2.2.4 Digitizing text 31
2.3 Bits, Bytes, and Binary 32
2.3.1 Bits 33
2.3.2 Powers of two and powers of ten 34
2.3.3 Binary numbers 35
2.3.4 Bytes 36
2.4 Summary 38
3 Inside the Processor 39
3.1 The Toy Computer 40
3.1.1 The first Toy program 40
3.1.2 The second Toy program 42
3.1.3 Branch instructions 43
3.1.4 Representation in memory 45
3.2 Real Processors 46
3.3 Caching 48
3.4 Other Kinds of Computers 49
3.5 Summary 51
Wrap-up on Hardware 53
Part II Software 55
4 Algorithms 59
4.1 Linear Algorithms 60
4.2 Binary Search 62
4.3 Sorting 63
4.4 Hard Problems and Complexity 67
4.5 Summary 70
5 Programming and Programming Languages 73
5.1 Assembly Language 74
5.2 High-Level Languages 75
5.3 Software Development 81
5.3.1 Libraries, interfaces, and development kits 82
5.3.2 Bugs 84
5.4 Intellectual Property 86
5.4.1 Trade secret 86
5.4.2 Trademark 87
5.4.3 Copyright 87
5.4.4 Patent 88
5.4.5 Licenses 89
5.5 Standards 91
5.6 Open Source Software 92
5.7 Summary 93
6 Software Systems 95
6.1 Operating Systems 96
6.2 How an Operating System Works 101
6.2.1 System calls 102
6.2.2 Device drivers 103
6.3 Other Operating Systems 103
6.4 File Systems 104
6.4.1 Secondary storage file systems 106
6.4.2 Removing files 108
6.4.3 Other file systems 109
6.5 Applications 110
6.6 Layers of Software 112
6.7 Summary 114
7 Learning to Program 115
7.1 Programming Language Concepts 116
7.2 A First JavaScript Program 117
7.3 A Second JavaScript Program 119
7.4 Loops and Conditionals 120
7.5 JavaScript Libraries and Interfaces 122
7.6 How JavaScript Works 124
7.7 A First Python Program 124
7.8 A Second Python Program 126
7.9 Python Libraries and Interfaces 127
7.10 How Python Works 130
7.11 Summary 130
Wrap-up on Software 133
Part III Communications 135
8 Networks 141
8.1 Telephones and Modems 142
8.2 Cable and DSL 142
8.3 Local Area Networks and Ethernet 144
8.4 Wireless 146
8.5 Cell Phones 148
8.6 Bandwidth 151
8.7 Compression 152
8.8 Error Detection and Correction 154
8.9 Summary 155
9 The Internet 157
9.1 An Internet Overview 158
9.2 Domain Names and Addresses 161
9.2.1 Domain Name System 161
9.2.2 IP addresses 162
9.2.3 Root servers 163
9.2.4 Registering your own domain 164
9.3 Routing 164
9.4 TCP/IP Protocols 166
9.4.1 IP, the Internet Protocol 168
9.4.2 TCP, the Transmission Control Protocol 169
9.5 Higher-Level Protocols 170
9.5.1 Telnet and SSH: remote login 170
9.5.2 SMTP: Simple Mail Transfer Protocol 172
9.5.3 File sharing and peer-to-peer protocols 173
9.6 Copyright on the Internet 174
9.7 The Internet of Things 176
9.8 Summary 177
10 The World Wide Web 181
10.1 How the Web Works 182
10.2 HTML 183
10.3 Cookies 185
10.4 Active Content in Web Pages 187
10.5 Active Content Elsewhere 188
10.6 Viruses, Worms and Trojan Horses 189
10.7 Web Security 191
10.7.1 Attacks on clients 191
10.7.2 Attacks on servers 196
10.7.3 Attacks on information in transit 197
10.8 Defending Yourself 198
10.9 Summary 201
Part IV Data 203
11 Data and Information 205
11.1 Search 206
11.2 Tracking 209
11.3 Social Networks 216
11.4 Data Mining and Aggregation 219
11.5 Cloud Computing 221
11.6 Summary 225
12 Artificial Intelligence and Machine Learning 227
12.1 Historical Background 228
12.2 Classical Machine Learning 229
12.3 Neural Networks and Deep Learning 232
12.4 Natural Language Processing 234
12.5 Summary 237
13 Privacy and Security 239
13.1 Cryptography 240
13.1.1 Secret-key cryptography 242
13.1.2 Public-key cryptography 243
13.2 Anonymity 247
13.2.1 Tor and the Tor Browser 247
13.2.2 Bitcoin 250
13.3 Summary 252
14 What Comes Next? 255
Notes 261
Glossary 269
Index 277