0%

**System.arraycopy**的用法

1
System.arraycopy(Object src, int srcPos, Object dest, int destPos, int length)

src: 原数组

srcPos: 原数组要复制的起始位置

dest: 目的数组

destPos: 目的数组放置的起始位置

length: 复制的长度

**removeIf**的用法

1
boolean removeIf(Predicate<? super E> filter)

Predicate是一个函数式接口,它定义一个带有参数的bool类型表达式,removeIf根据该表达式的值决定是否移除集合中的元素

示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import java.util.ArrayList;
import java.util.List;

public class RemoveIfExample {
public static void main(String[] args) {
List<Integer> numbers = new ArrayList<>();
numbers.add(1);
numbers.add(2);
numbers.add(3);
numbers.add(4);
numbers.add(5);

// 使用 removeIf 移除偶数
numbers.removeIf(n -> n % 2 == 0);

// 打印剩余的元素
System.out.println(numbers); // 输出 [1, 3, 5]
}
}

什么是操作系统

1
操作系统是配置在计算机硬件上的第一层软件,是对硬件系统的首次扩充

操作系统的作用

  1. OS作为用户与计算机硬件系统之间的接口
  2. OS作为计算机系统资源的管理者
  3. OS实现了对计算机资源的抽象

单批道处理系统

1
解决人机矛盾和CPU与I/O设备速度不匹配矛盾,旨在提高系统资源的利用率和系统吞吐量

单批道处理系统的缺点

1
系统中的资源得不到充分的利用。内存中仅有一道程序,每当程序在运行中发出I/O请求,CPU处于等待状态

多批道处理系统

1
用户提交的作业先存放在外存上,排成一个队列,称为“后备队列”。然后由作业调度程序按一定的算法,从后备队列中选择若干个作业调入内存 ,使他们共享CPU和系统中的各种资源

echo

1
echo [-neE] [ARGUMENTS]
  • 当-n 选项,则取消尾随换行符

  • 如果-e 选项,则将解释以下反斜杠转义字符:

    • \ 显示反斜杠字符

    • \a 警报(BEL)

    • \b 显示退格字符

    • \c 禁止任何进一步的输出

    • \e 显示转义字符

    • \f 显示窗体提要字符

    • \n 显示新行

    • \r 显示回车

    • \t 显示水平标签

    • \v 显示垂直标签

    • 这个-E 项禁用转义字符的解释。这是默认值

windows关闭休眠:

1
powercfg -h off

windows开启休眠:

1
powercfg -h on

Table:

1
以按行按列形式组织及展现的数据

数据

1
数据是数据库中存储的基本对象。

Database:

1
相互之间有关联关系的Table的集合

DB:

1
Database

DBMS:

1
数据库管理系统

DBAP:

1
数据库应用

DBA:

1
数据库管理员

DDL:

1
数据库定义语言

DML:

1
数据库操纵语言

DCL:

1
数据库控制语言

模式:

1
2
对数据库中数据所进行的一种结构性的描述
所观察到的数据的结构信息

视图:

1
某一种表现形式下表现出来的数据库中的数据

三级模式:

1
2
3
External Schema(外模式): 某一用户能够看到与处理的数据的结构描述
Conceptual Schema(概念模式):从全局角度理解\管理的结构描述,含相应的关联约束
Internal Schema(内模式 ):存储在介质上的数据的结构描述,含存储路径、存储方式、索引方式 等

两层映像:

1
2
E-C Mapping: 将外模式映射为概念模式,从而支持实现数据概念视图向外部视图的转换
C-I Mapping:将概念模式映射为内模式,从而支持实现数据概念视图向内部视图的转换

两个独立性:

1
2
逻辑数据独立性:当概念模式变化时,可以不改变外部模式(只需改变E-C Mapping),从而无需改变应用程序
物理数据独立性:当外部模式变化时,可以不改变概念模式(只需改变C-I Mapping),从而不改变外部模式

数据模型:

1
2
规定模式统一描述方式的模式,包括:数据结构、操作和约束
数据模型是对模式本身结构的抽象,模式是对数据本身结构形式的抽象

关系模型:

1
2
3
描述DB各种数据的基本结构形式(Table/Relation)
描述Table与Table之间所可能发生的各种操作(关系运算)
描述这些操作所应遵循的约束 条件(完整性约束)

域(Domain)

1
2
一组值的集合,这组值具有相同的数据类型
集合中元素的个数 成为域的基数

关系模式 :

1
2
3
同一关系模式下,可有很多的关系
关系模式时关系的结构,关系是关系模式在某一时刻的数据
关系模式是稳定的;而关系是 某一时刻的值,是随时间可能变化的

关系的特性:

1
属性不可再分特性

候选码:

1
关系中的一个属性组,其值能唯一标识一个元组,若从该属性组中去掉任何一个属性,它就不具有这一性质 了,这样的属性组称作候选码

主码:

1
当有多个候选码时,可以选定一个作为主码

主属性与非主属性:

1
包含在任何一个候选码的属性被称作主属性,而其他属性被称作 非主属性

外码:

1
关系R中的一个属性组,它不是R的候选码,但它与另一个关系 S的候选码相对应,则成这个 属性组为R的外码或外键

实体完整性:

1
关系的主码中的属性值不能为空值

参照完整性:

1
如果关系R1的外码FK与关系R2的主码PK相对应,则R1中的每一个元组 的FK值 或者等于 R2中的某个元组的PK值,或者为空值

用户自定义完整性:

1
用户针对具体的应用环境定义的完整性约束条件

数据模型的概念

1
数据模型是一种模型,它是对现实世界数据特征的抽象

数据模型的作用

1
数据模型是用来描述数据、组织数据和对数据进行操作的

数据模型的三个要素

1
一是能比较真实地模拟现实世界,二是为人所理解,三是便于在计算机上实现

关系

1
一个关系对应通常来说的一张表

属性

1
表中的一列即为一个属性

1
域是一组具有相同数据类型的值的集合

元组

1
表中的一行即为一个元组

1
也称码键。表中的某个属性组,它可以唯一确定一个元组 

分量

1
元组中的一个属性值

关系模式

1
2
对关系的描述,一般表示为
关系名(属性1、属性2、···,属性n)

逻辑独立性

1
当模式改变时,由数据库 管理员对各个外模式/模式的映像作相应改变,可以使外模式保持不变。应用程序是依据数据的外模式编写的 ,从而应用程序不必改变,保证的数据与程序的逻辑 独立性,简称数据的逻辑独立性

物理独立性

1
当数据库的存储结构改变时,由数据库管理员对模式 /内模式 映像作相应 改变,可以使模式保持不变,从而应用程序也不必改变。保证了数据与程序的物理独立性

第一章

计算机的五大基本部件

1
2
3
4
5
6
7
8
9
输入设备:将编好的程序和原始数据送到计算机中,使它们转换成计算机内部能识别和接受的信息方式
输出设备:将计算机 的处理结果以数字、字符、图形、图像、声音等形式送出计算机
存储器:存放程序和数据的部件,是一个记忆装置,是计算机能够实现“存储 程序控制”的基础
常见的三级存储系统:高速缓冲存储器、主存储器、辅助存储器
主存储器可由CPU直接访问,存取速度快,容量小
辅助存储器设置在主机外部,存储容量大,价格低,存取速度慢
高速缓冲存储器位于主存和CPU之间,存取速度比主存快,容量更小
运算器:对信息机型处理和运算的部件。又称算术逻辑运算部件(ALU)
控制器:按照预先确定的操作步骤,控制整个计算机的各部件有条不紊的自动工作

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Registration Form</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<h1>Registration Form</h1>
<p>Please fill out this form with the required information</p>
<form method="post" action='https://register-demo.freecodecamp.org'>
<fieldset>
<label for="first-name">Enter Your First Name: <input id="first-name" name="first-name" type="text" required /></label>
<label for="last-name">Enter Your Last Name: <input id="last-name" name="last-name" type="text" required /></label>
<label for="email">Enter Your Email: <input id="email" name="email" type="email" required /></label>
<label for="new-password">Create a New Password: <input id="new-password" name="new-password" type="password" pattern="[a-z0-5]{8,}" required /></label>
</fieldset>
<fieldset>
<label for="personal-account"><input id="personal-account" type="radio" name="account-type" class="inline" /> Personal Account</label>
<label for="business-account"><input id="business-account" type="radio" name="account-type" class="inline" /> Business Account</label>
<label for="terms-and-conditions">
<input id="terms-and-conditions" type="checkbox" required name="terms-and-conditions" class="inline" /> I accept the <a href="https://www.freecodecamp.org/news/terms-of-service/">terms and conditions</a>
</label>
</fieldset>
<fieldset>
<label for="profile-picture">Upload a profile picture: <input id="profile-picture" type="file" name="file" /></label>
<label for="age">Input your age (years): <input id="age" type="number" name="age" min="13" max="120" /></label>
<label for="referrer">How did you hear about us?
<select id="referrer" name="referrer">
<option value="">(select one)</option>
<option value="1">freeCodeCamp News</option>
<option value="2">freeCodeCamp YouTube Channel</option>
<option value="3">freeCodeCamp Forum</option>
<option value="4">Other</option>
</select>
</label>
<label for="bio">Provide a bio:
<textarea id="bio" name="bio" rows="3" cols="30" placeholder="I like coding on the beach..."></textarea>
</label>
</fieldset>
<input type="submit" value="Submit" />
</form>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
body {
width: 100%;
height: 100vh;
margin: 0;
background-color: #1b1b32;
color: #f5f6f7;
font-family: Tahoma;
font-size: 16px;
}

h1, p {
margin: 1em auto;
text-align: center;
}

form {
width: 60vw;
max-width: 500px;
min-width: 300px;
margin: 0 auto;
padding-bottom: 2em;
}

fieldset {
border: none;
padding: 2rem 0;
border-bottom: 3px solid #3b3b4f;
}

fieldset:last-of-type {
border-bottom: none;
}

label {
display: block;
margin: 0.5rem 0;
}

input,
textarea,
select {
margin: 10px 0 0 0;
width: 100%;
min-height: 2em;
}

input, textarea {
background-color: #0a0a23;
border: 1px solid #0a0a23;
color: #ffffff;
}

.inline {
width: unset;
margin: 0 0.5em 0 0;
vertical-align: middle;
}

input[type="submit"] {
display: block;
width: 60%;
margin: 1em auto;
height: 2em;
font-size: 1.1rem;
background-color: #3b3b4f;
border-color: white;
min-width: 300px;
}

input[type="file"] {
padding: 1px 2px;
}



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Colored Markers</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>CSS Color Markers</h1>
<div class="container">
<div class="marker red">
<div class="cap"></div>
<div class="sleeve"></div>
</div>
<div class="marker green">
<div class="cap"></div>
<div class="sleeve"></div>
</div>
<div class="marker blue">
<div class="cap"></div>
<div class="sleeve"></div>
</div>
</div>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
h1 {
text-align: center;
}

.container {
background-color: rgb(255, 255, 255);
padding: 10px 0;
}

.marker {
width: 200px;
height: 25px;
margin: 10px auto;
}

.cap {
width: 60px;
height: 25px;
}

.sleeve {
width: 110px;
height: 25px;
background-color: rgba(255, 255, 255, 0.5);
border-left: 10px double rgba(0, 0, 0, 0.75);
}

.cap, .sleeve {
display: inline-block;
}

.red {
background: linear-gradient(rgb(122, 74, 14), rgb(245, 62, 113), rgb(162, 27, 27));
box-shadow: 0 0 20px 0 rgba(83, 14, 14, 0.8);
}

.green {
background: linear-gradient(#55680D, #71F53E, #116C31);
box-shadow: 0 0 20px 0 #3B7E20CC;
}

.blue {
background: linear-gradient(hsl(186, 76%, 16%), hsl(223, 90%, 60%), hsl(240, 56%, 42%));
box-shadow: 0 0 20px 0 blue;
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Cafe Menu</title>
<link href="styles.css" rel="stylesheet"/>
</head>
<body>
<div class="menu">
<main>
<h1>CAMPER CAFE</h1>
<p class="established">Est. 2020</p>
<hr>
<section>
<h2>Coffee</h2>
<img src="https://cdn.freecodecamp.org/curriculum/css-cafe/coffee.jpg" alt="coffee icon"/>
<article class="item">
<p class="flavor">French Vanilla</p><p class="price">3.00</p>
</article>
<article class="item">
<p class="flavor">Caramel Macchiato</p><p class="price">3.75</p>
</article>
<article class="item">
<p class="flavor">Pumpkin Spice</p><p class="price">3.50</p>
</article>
<article class="item">
<p class="flavor">Hazelnut</p><p class="price">4.00</p>
</article>
<article class="item">
<p class="flavor">Mocha</p><p class="price">4.50</p>
</article>
</section>
<section>
<h2>Desserts</h2>
<img src="https://cdn.freecodecamp.org/curriculum/css-cafe/pie.jpg" alt="pie icon"/>
<article class="item">
<p class="dessert">Donut</p><p class="price">1.50</p>
</article>
<article class="item">
<p class="dessert">Cherry Pie</p><p class="price">2.75</p>
</article>
<article class="item">
<p class="dessert">Cheesecake</p><p class="price">3.00</p>
</article>
<article class="item">
<p class="dessert">Cinnamon Roll</p><p class="price">2.50</p>
</article>
</section>
</main>
<hr class="bottom-line">
<footer>
<p>
<a href="https://www.freecodecamp.org" target="_blank">Visit our website</a>
</p>
<p class="address">123 Free Code Camp Drive</p>
</footer>
</div>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
body {
background-image: url(https://cdn.freecodecamp.org/curriculum/css-cafe/beans.jpg);
font-family: sans-serif;
padding: 20px;
}

h1 {
font-size: 40px;
margin-top: 0;
margin-bottom: 15px;
}

h2 {
font-size: 30px;
}

.established {
font-style: italic;
}

h1, h2, p {
text-align: center;
}

.menu {
width: 80%;
background-color: burlywood;
margin-left: auto;
margin-right: auto;
padding: 20px;
max-width: 500px;
}

img {
display: block;
margin-left: auto;
margin-right: auto;
}

hr {
height: 2px;
background-color: brown;
border-color: brown;
}

.bottom-line {
margin-top: 25px;
}

h1, h2 {
font-family: Impact, serif;
}

.item p {
display: inline-block;
margin-top: 5px;
margin-bottom: 5px;
font-size: 18px;
}

.flavor, .dessert {
text-align: left;
width: 75%;
}

.price {
text-align: right;
width: 25%;
}

/* FOOTER */

footer {
font-size: 14px;
}

.address {
margin-bottom: 5px;
}

a {
color: black;
}

a:visited {
color: black;
}

a:hover {
color: brown;
}

a:active {
color: brown;
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!DOCTYPE html>

<html lang="en">
<head>

<title>CatPhotoApp</title>
</head>
<body>
<main>
<h1>CatPhotoApp</h1>
<section>
<h2>Cat Photos</h2>
<!-- TODO: Add link to cat photos -->
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
</section>
<section>
<h2>Cat Lists</h2>
<h3>Things cats love:</h3>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<figure>
<img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/lasagna.jpg" alt="A slice of lasagna on a plate.">
<figcaption>Cats <em>love</em> lasagna.</figcaption>
</figure>
<h3>Top 3 things cats hate:</h3>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
<figure>
<img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/cats.jpg" alt="Five cats looking around a field.">
<figcaption>Cats <strong>hate</strong> other cats.</figcaption>
</figure>
</section>
<section>
<h2>Cat Form</h2>
<form action="https://freecatphotoapp.com/submit-cat-photo">
<fieldset>
<legend>Is your cat an indoor or outdoor cat?</legend>
<label><input id="indoor" type="radio" name="indoor-outdoor" value="indoor" checked> Indoor</label>
<label><input id="outdoor" type="radio" name="indoor-outdoor" value="outdoor"> Outdoor</label>
</fieldset>
<fieldset>
<legend>What's your cat's personality?</legend>
<input id="loving" type="checkbox" name="personality" value="loving" checked> <label for="loving">Loving</label>
<input id="lazy" type="checkbox" name="personality" value="lazy"> <label for="lazy">Lazy</label>
<input id="energetic" type="checkbox" name="personality" value="energetic"> <label for="energetic">Energetic</label>
</fieldset>
<input type="text" name="catphotourl" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
</section>
</main>
<footer>
<p>
No Copyright - <a href="https://www.freecodecamp.org">freeCodeCamp.org</a>
</p>
</footer>
</body>
</html>