Skip to content

Commit

Permalink
更新了部分文档和代码
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfrued committed Jun 24, 2020
1 parent 3ef3721 commit 60587f0
Show file tree
Hide file tree
Showing 106 changed files with 1,143 additions and 2,110 deletions.
2 changes: 1 addition & 1 deletion Day01-15/12.字符串和正则表达式.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
| \| | 分支 | foo\|bar | 可以匹配foo或者bar |
| (?#) | 注释 | | |
| (exp) | 匹配exp并捕获到自动命名的组中 | | |
| (? <name>exp) | 匹配exp并捕获到名为name的组中 | | |
| (?<name>exp) | 匹配exp并捕获到名为name的组中 | | |
| (?:exp) | 匹配exp但是不捕获匹配的文本 | | |
| (?=exp) | 匹配exp前面的位置 | \\b\\w+(?=ing) | 可以匹配I'm dancing中的danc |
| (?<=exp) | 匹配exp后面的位置 | (?<=\\bdanc)\\w+\\b | 可以匹配I love dancing and reading中的第一个ing |
Expand Down
6 changes: 3 additions & 3 deletions Day21-30/code/list_by_vue.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</li>
</ul>
<div>
<input @keydown.enter="addItem()" type="text" id="fname" v-model="fname">
<input @keydown.enter="addItem()" type="text" id="fname" v-model.trim="fname">
<button id="ok" @click="addItem()">确定</button>
</div>
</div>
Expand All @@ -82,8 +82,8 @@
},
methods: {
addItem() {
if (this.fname.trim().length > 0) {
this.fruits.push(this.fname.trim())
if (this.fname.length > 0) {
this.fruits.push(this.fname)
}
this.fname = ''
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<div class="search">
<!-- type属性是text的input标签代表文本框 可以接收用户输入 -->
<!-- placeholder是文本框的输入提示 -->
<input type="text" placeholder="请输入垃圾名字" v-model="word" @keydown.enter="search()">
<input type="text" placeholder="请输入垃圾名字" v-model.trim="word" @keydown.enter="search()">
<!-- button代表按钮 点击可以开始查询 -->
<button @click="search()">查询</button>
</div>
Expand All @@ -75,9 +75,9 @@
<div v-for="result in results">
<p>
<!-- img是图像标签 可以用来实现图片-->
<img :src="pictures[result.type]" width="56" :alt="types[result.type]">
<img :src="'images/' + pictures[result.type]" width="56" :alt="types[result.type]">
&nbsp;&nbsp;
<!-- span是跨度标签 代表一个逻辑区域(不分段)-->
<!-- span是跨度标签 代表一个逻辑区域-->
<span>{{ result.name }}</span>
&nbsp;&nbsp;
<span class="pre" v-if="result.aipre == 1">(预测结果)</span>
Expand All @@ -102,7 +102,7 @@
// 查询垃圾分类的函数
search() {
if (this.word.trim().length > 0) {
let key = '9aeb28ee8858a167c1755f856f830e22'
let key = '9636cec76ee2593ba6b195e5b770b394'
let url = `http://api.tianapi.com/txapi/lajifenlei/?key=${key}&word=${this.word}`
fetch(url)
.then(resp => resp.json())
Expand Down
2 changes: 2 additions & 0 deletions Day36-40/36-38.关系型数据库MySQL.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ MySQL在过去由于性能高、成本低、可靠性好,已经成为最流行
```Shell
rpm -ivh mysql-community-common-5.7.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-compat-5.7.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-devel-5.7.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.26-1.el7.x86_64.rpm
```
Expand Down
14 changes: 9 additions & 5 deletions Day36-40/code/HRS_create_and_init.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
drop database if exists hrs;
create database hrs default charset utf8;
create database hrs default charset utf8mb4;

use hrs;

Expand All @@ -14,6 +14,8 @@ dloc varchar(20) not null comment '所在地',
primary key (dno)
);

-- alter table tb_dept add constraint pk_dept_dno primary key(dno);

insert into tb_dept values
(10, '会计部', '北京'),
(20, '研发部', '成都'),
Expand All @@ -29,11 +31,13 @@ mgr int comment '主管编号',
sal int not null comment '员工月薪',
comm int comment '每月补贴',
dno int comment '所在部门编号',
primary key (eno)
primary key (eno),
foreign key (dno) references tb_dept(dno),
foreign key (mgr) references tb_emp(eno)
);

alter table tb_emp add constraint fk_emp_mgr foreign key (mgr) references tb_emp (eno);
alter table tb_emp add constraint fk_emp_dno foreign key (dno) references tb_dept (dno);
-- alter table tb_emp add constraint fk_emp_mgr foreign key (mgr) references tb_emp (eno);
-- alter table tb_emp add constraint fk_emp_dno foreign key (dno) references tb_dept (dno);

insert into tb_emp values
(7800, '张三丰', '总裁', null, 9000, 1200, 20),
Expand Down Expand Up @@ -70,4 +74,4 @@ insert into tb_emp values

-- 查询主管的姓名和职位

-- 查询月薪排名4~6名的员工姓名和月薪
-- 查询月薪排名4~6名的员工排名、姓名和月薪
Loading

0 comments on commit 60587f0

Please sign in to comment.