-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from NEUQ-ACM/master
9
- Loading branch information
Showing
156 changed files
with
8,449 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,9 @@ | |
[submodule "付锦润/week6/Management"] | ||
path = 付锦润/week6/Management | ||
url = [email protected]:Twrathe/Management.git | ||
[submodule "付锦润/week8/Management"] | ||
path = 付锦润/week8/Management | ||
url = https://github.com/Twrathe/Management.git | ||
[submodule "韩文博/week8/week8_practice"] | ||
path = 韩文博/week8/week8_practice | ||
url = [email protected]:Maple-Yorkin/week8_practice.git |
Submodule Management
added at
1b5406
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# 0726 周报 | ||
|
||
#### 学习笔记/记录 | ||
|
||
1.学习文件储存、参数配置化和登录校验 JWT | ||
|
||
2.完善 Management 项目 | ||
|
||
3.刷力扣题,做 SQL 排序和分组章节 | ||
|
||
#### 遇到难题解决方法 | ||
|
||
1.jjwt 0.9.1 的许多方法在 jjwt 0.12.6 中已被弃用 | ||
|
||
> 查看官方使用[文档](https://github.com/jwtk/jjwt?tab=readme-ov-file#signature-algorithms-keys) | ||
> 根据其中给的示例进行修改 | ||
2.存储到本地的文件怎么让 web 通过 url 访问 | ||
|
||
> ```java | ||
> File dir = new File("upload_images/"); | ||
> if (!dir.exists()) { | ||
> dir.mkdirs(); | ||
> } | ||
> // 创建目录防止报错 | ||
> image.transferTo(new File(dir.getCanonicalPath() + "/" + newFileName)); | ||
> // 这里必须使用 getCanonicalPath() 方法来获取绝对路径,直接填入 dir 会在前面拼接上其他路径,导致路径不存在 | ||
> String url = "http://" + uploadProperties.getAddress() + ":" + | ||
> String.valueOf(uploadProperties.getPort()) + "/images/" + newFileName; | ||
> // 获取 url 并返回 | ||
> return url; | ||
> ``` | ||
> ```java | ||
> // 需要在 config 中配置对应的路径跳转 | ||
> public void addResourceHandlers(ResourceHandlerRegistry registry) { | ||
> registry.addResourceHandler("images/**") // 访问路径 | ||
> .addResourceLocations("file:./upload_images/"); // 跳转到本地路径 | ||
> } | ||
> ``` | ||
#### leetcode 刷题 | ||
##### 力扣 180. 连续出现的数字 | ||
##### 题解 | ||
三个表错位对齐,比较它们的值,三者都相等则连续出现三次 | ||
##### 代码 | ||
```mysql | ||
# Write your MySQL query statement below | ||
select distinct | ||
l1.num ConsecutiveNums | ||
from | ||
Logs l1, | ||
Logs l2, | ||
Logs l3 | ||
where | ||
l1.id = l2.id - 1 and | ||
l2.id = l3.id - 1 and | ||
l1.num = l2.num and | ||
l2.num = l3.num | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
<style> | ||
* { | ||
margin: 0; | ||
padding: 0; | ||
box-sizing: border-box; | ||
} | ||
|
||
.list { | ||
width: 990px; | ||
margin: 100px auto 0; | ||
} | ||
|
||
.item { | ||
padding: 15px; | ||
transition: all .5s; | ||
display: flex; | ||
border-top: 1px solid #e4e4e4; | ||
} | ||
|
||
.item:nth-child(4n) { | ||
margin-left: 0; | ||
} | ||
|
||
.item:hover { | ||
cursor: pointer; | ||
background-color: #f5f5f5; | ||
} | ||
|
||
.item img { | ||
width: 80px; | ||
height: 80px; | ||
margin-right: 10px; | ||
} | ||
|
||
.item .name { | ||
font-size: 18px; | ||
margin-right: 10px; | ||
color: #333; | ||
flex: 2; | ||
} | ||
|
||
.item .name .tag { | ||
display: block; | ||
padding: 2px; | ||
font-size: 12px; | ||
color: #999; | ||
} | ||
|
||
.item .price, | ||
.item .sub-total { | ||
font-size: 18px; | ||
color: firebrick; | ||
flex: 1; | ||
} | ||
|
||
.item .price::before, | ||
.item .sub-total::before, | ||
.amount::before { | ||
content: "¥"; | ||
font-size: 12px; | ||
} | ||
|
||
.item .spec { | ||
flex: 2; | ||
color: #888; | ||
font-size: 14px; | ||
} | ||
|
||
.item .count { | ||
flex: 1; | ||
color: #aaa; | ||
} | ||
|
||
.total { | ||
width: 990px; | ||
margin: 0 auto; | ||
display: flex; | ||
justify-content: flex-end; | ||
border-top: 1px solid #e4e4e4; | ||
padding: 20px; | ||
} | ||
|
||
.total .amount { | ||
font-size: 18px; | ||
color: firebrick; | ||
font-weight: bold; | ||
margin-right: 50px; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div class="list"> | ||
<!-- <div class="item"> | ||
<img src="https://yanxuan-item.nosdn.127.net/84a59ff9c58a77032564e61f716846d6.jpg" alt=""> | ||
<p class="name">称心如意手摇咖啡磨豆机咖啡豆研磨机 <span class="tag">【赠品】10优惠券</span></p> | ||
<p class="spec">白色/10寸</p> | ||
<p class="price">289.90</p> | ||
<p class="count">x2</p> | ||
<p class="sub-total">579.80</p> | ||
</div> --> | ||
</div> | ||
<div class="total"> | ||
<div>合计:<span class="amount">1000.00</span></div> | ||
</div> | ||
<script> | ||
const goodsList = [ | ||
{ | ||
id: '4001172', | ||
name: '称心如意手摇咖啡磨豆机咖啡豆研磨机', | ||
price: 289.9, | ||
picture: 'https://yanxuan-item.nosdn.127.net/84a59ff9c58a77032564e61f716846d6.jpg', | ||
count: 2, | ||
spec: { color: '白色' } | ||
}, | ||
{ | ||
id: '4001009', | ||
name: '竹制干泡茶盘正方形沥水茶台品茶盘', | ||
price: 109.8, | ||
picture: 'https://yanxuan-item.nosdn.127.net/2d942d6bc94f1e230763e1a5a3b379e1.png', | ||
count: 3, | ||
spec: { size: '40cm*40cm', color: '黑色' } | ||
}, | ||
{ | ||
id: '4001874', | ||
name: '古法温酒汝瓷酒具套装白酒杯莲花温酒器', | ||
price: 488, | ||
picture: 'https://yanxuan-item.nosdn.127.net/44e51622800e4fceb6bee8e616da85fd.png', | ||
count: 1, | ||
spec: { color: '青色', sum: '一大四小' } | ||
}, | ||
{ | ||
id: '4001649', | ||
name: '大师监制龙泉青瓷茶叶罐', | ||
price: 139, | ||
picture: 'https://yanxuan-item.nosdn.127.net/4356c9fc150753775fe56b465314f1eb.png', | ||
count: 1, | ||
spec: { size: '小号', color: '紫色' }, | ||
gift: '50g茶叶,清洗球,宝马, 奔驰' | ||
} | ||
] | ||
|
||
// 1. 根据数据渲染页面 | ||
document.querySelector('.list').innerHTML = goodsList.map(item => { | ||
// console.log(item) // 每一条对象 | ||
// 对象解构 item.price item.count | ||
const { picture, name, count, price, spec, gift } = item | ||
// 规格文字模块处理 | ||
const text = Object.values(spec).join('/') | ||
// 计算小计模块 单价 * 数量 保留两位小数 | ||
// 注意精度问题,因为保留两位小数,所以乘以 100 最后除以100 | ||
const subTotal = ((price * 100 * count) / 100).toFixed(2) | ||
// 处理赠品模块 '50g茶叶,清洗球' | ||
const str = gift ? gift.split(',').map(item => `<span class="tag">【赠品】${item}</span> `).join('') : '' | ||
return ` | ||
<div class="item"> | ||
<img src=${picture} alt=""> | ||
<p class="name">${name} ${str} </p> | ||
<p class="spec">${text} </p> | ||
<p class="price">${price.toFixed(2)}</p> | ||
<p class="count">x${count}</p> | ||
<p class="sub-total">${subTotal}</p> | ||
</div> | ||
` | ||
}).join('') | ||
|
||
// 3. 合计模块 | ||
const total = goodsList.reduce((prev, item) => prev + (item.price * 100 * item.count) / 100, 0) | ||
// console.log(total) | ||
document.querySelector('.amount').innerHTML = total.toFixed(2) | ||
</script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
week7 周报 | ||
|
||
一、学习笔记 | ||
|
||
1. 学习了黑马关于JS进阶的视频,然后补充了上周因为三下乡落下的AJAX的课程 | ||
2. 学习了一些vue的基本内容 | ||
|
||
二、学习中的问题 | ||
|
||
1. 问题:对于JS中的一些语法掌握还不是很熟,有些内容看视频里会写但是自己独立写出来还有些困难;关于CSS的一些操作也不是特别熟悉,有部分遗忘 | ||
2. 解决方案:后续会多自己写而一些案例,然后遇到由以往的会查看以前的笔记或者上网搜索 | ||
|
||
三、leetcode刷题 | ||
|
||
1. 爬楼梯 | ||
1. 题目:假设你正在爬楼梯。需要 n 阶你才能到达楼顶。 | ||
每次你可以爬 1 或 2 个台阶。你有多少种不同的方法可以爬到楼顶呢? | ||
|
||
**示例 1:** | ||
|
||
``` | ||
输入:n = 2 | ||
输出:2 | ||
解释:有两种方法可以爬到楼顶。 | ||
1. 1 阶 + 1 阶 | ||
2. 2 阶 | ||
``` | ||
**示例 2:** | ||
``` | ||
输入:n = 3 | ||
输出:3 | ||
解释:有三种方法可以爬到楼顶。 | ||
1. 1 阶 + 1 阶 + 1 阶 | ||
2. 1 阶 + 2 阶 | ||
3. 2 阶 + 1 阶 | ||
``` | ||
1. 题解:class Solution { | ||
public int climbStairs(int n) { | ||
int a=1,b=1,sum; | ||
for(int i=0;i<n-1;i++){ | ||
sum=a+b; | ||
a=b; | ||
b=sum; | ||
} | ||
return b; | ||
} | ||
} | ||
2. 删除回文子序列 | ||
1. 题目:给你一个字符串 s,它仅由字母 'a' 和 'b' 组成。每一次删除操作都可以从 s 中删除一个回文 子序列。 | ||
返回删除给定字符串中所有字符(字符串为空)的最小删除次数。 | ||
「子序列」定义:如果一个字符串可以通过删除原字符串某些字符而不改变原字符顺序得到,那么这个字符串就是原字符串的一个子序列。 | ||
「回文」定义:如果一个字符串向后和向前读是一致的,那么这个字符串就是一个回文。 | ||
2. class Solution { | ||
public int removePalindromeSub(String s) { | ||
int n = s.length(); | ||
for(int i=0;i<n/2;i++){ | ||
if(s.charAt(i)!=s.charAt(n-1-i)){ | ||
return 2; | ||
} | ||
} | ||
return 1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Document</title> | ||
<style> | ||
.box { | ||
width: 500px; | ||
height: 500px; | ||
background-color: #ccc; | ||
color: #fff; | ||
text-align: center; | ||
font-size: 100px; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div class="box"></div> | ||
<script> | ||
const box = document.querySelector('.box') | ||
let i = 1 // 让这个变量++ | ||
// 鼠标移动函数 | ||
function mouseMove() { | ||
box.innerHTML = ++i | ||
// 如果里面存在大量操作 dom 的情况,可能会卡顿 | ||
} | ||
// console.log(mouseMove) | ||
// 节流函数 throttle | ||
function throttle(fn, t) { | ||
// 起始时间 | ||
let startTime = 0 | ||
return function () { | ||
// 得到当前的时间 | ||
let now = Date.now() | ||
// 判断如果大于等于 500 采取调用函数 | ||
if (now - startTime >= t) { | ||
// 调用函数 | ||
fn() | ||
// 起始的时间 = 现在的时间 写在调用函数的下面 | ||
startTime = now | ||
} | ||
} | ||
} | ||
box.addEventListener('mousemove', throttle(mouseMove, 500)) | ||
|
||
// throttle(mouseMove, 500) === function () { console.log(1) } | ||
|
||
|
||
// box.addEventListener('mousemove', function () { | ||
// // 得到当前的时间 | ||
// let now = Date.now() | ||
// // 判断如果大于等于 500 采取调用函数 | ||
// if (now - startTime >= t) { | ||
// // 调用函数 | ||
// fn() | ||
// // 起始的时间 = 现在的时间 写在调用函数的下面 | ||
// startTime = now | ||
// } | ||
// }) | ||
|
||
</script> | ||
</body> | ||
|
||
</html> |
Oops, something went wrong.