试了网上很多种都不行,下载dotnetfx35.exe,指定源路径D:\Sxs等;还是这个一键安装的好使,有需要的自取;https://www.bobchen.top/wp-content/uploads/Win8.1_Net3.5.exe
Mysqlbinlog恢复
最近同事误删了线上的数据差点跑路,之前也没咋研究过mysql恢复,今天花了点时间研究这个;先说下环境,公司用的是docker镜像,拉的mysql8,可能查阅网上的文章就会有一些问题,所以还请大家对号入座,大概步骤如下:
#查看日志
show master logs
#查看状态
show master status
#查看日志详细信息
show binlog events in 'binlog.000025';
#简单恢复(适用于日志没报错的情况)
mysqlbinlog /var/lib/mysql/binlog.000025 --start-position=124 --stop-position=1752 | mysql -uroot -p
#将日志输出为sql语句(--base64-output=decode-rows代表将二进制日志转化为SQL语句,-d代表数据库)
mysqlbinlog --base64-output=decode-rows -v /var/lib/mysql/binlog.000009 --skip-gtids=true --start-datetime="2021-12-01 00:00:00" --stop-datetime="2022-01-01 00:00:00" -d PSC_YHJGTEST > PSC_YHJGTEST.sql;
#筛选数据为新的sql语句(退出docker容器,在宿主机上用grep命令筛选数据)
grep -A50 -w 'UPDATE <code>PSC_YHJGTEST</code>.<code>PATROL_INFO</code>' PSC_YHJGTEST.sql |grep -v '^--$' > PATROL_INFO_update8.sql;
纯Css轮播
<!DOCTYPE html>
<body class="center">
<div style="flex: 1;height: 300px;z-index: 10;box-shadow: inset 0 0 300px rgba(0, 0, 0, 0.99);" class="border">
left
</div>
<div class="showbox border box-shadow">
<div class="left border">
左
</div>
<div class="right border">
右
</div>
<div id="imgbox" class="center imgbox">
<img class="myimg" src="https://cdn.pixabay.com/photo/2018/01/03/05/33/the-sun-3057622__340.jpg" />
<img class="myimg" src="https://cdn.pixabay.com/photo/2021/07/29/20/23/mountains-6508015_960_720.jpg" />
<img class="myimg" src="https://cdn.pixabay.com/photo/2021/07/29/21/03/cereals-6508088__340.jpg" />
<img class="myimg" src="https://cdn.pixabay.com/photo/2018/01/03/05/33/the-sun-3057622__340.jpg" />
</div>
</div>
<div style="flex: 1;height: 300px;z-index: 10;box-shadow: inset 0 0 300px rgba(0, 0, 0, 0.99);" >
right
</div>
</body>
<style>
body {
width: 100%;
height: 100%;
z-index: 0;
/* background-color: rgba(0, 0, 0, 0.5); */
box-shadow: inset 0 0 300px rgba(0, 0, 0, 0.1);
}
.center {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.showbox {
width: 300px;
height: 300px;
/* background: chocolate; */
position: relative;
overflow: visible;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
/* z-index: -1; */
opacity: 1;
}
.left {
position: absolute;
left: 0;
top: 50%;
cursor: pointer;
background: blue;
z-index: 100;
}
.right {
position: absolute;
right: 0;
top: 50%;
cursor: pointer;
background: blue;
z-index: 100;
}
.border {
border: 1px solid black;
}
.centerimg {
width: 100%;
height: 100%;
}
.myimg {
width: 300px;
height: 300px;
z-index: -1;
opacity: 1;
/* filter: alpha(opacity=60); */
}
.imgbox {
position: absolute;
left: -600px;
top: 0;
z-index: -1;
animation: slideshow 10s both infinite;
}
@keyframes slideshow {
0% {
left: -900px;
}
33% {
left: -600px;
}
66% {
left: -300px;
}
100% {
left: 0;
}
}
</style>
</html>
C#获取多个时间段的并集
/// <summary>
/// 获取时间段并集
/// </summary>
/// <param name="list">传入的时间(开始时间正序)</param>
/// <returns></returns>
private List<Time> GetListTime(List<Time> list)
{
for (int i = 0; i < list.Count; i++)
{
var dataI = list[i];
for (int j = i + 1; j < list.Count; j++)
{
var dataJ = list[j];
if (dataI.eTime.CompareTo(dataJ.bTime) >= 0 && dataI.eTime.CompareTo(dataJ.bTime) <= 0)
{
dataI.eTime = dataJ.eTime;
list.Remove(dataJ);
j--;
}
else if (dataI.eTime.CompareTo(dataJ.eTime) >= 0)
{
list.Remove(dataJ);
j--;
}
else
{
break;
}
i = j;
}
}
return list;
}
public class Time
{
public DateTime bTime { get; set; }
public DateTime eTime { get; set; }
}
vue data数据被修改了
今天被这个问题困住了,检查了所有代码都没有修改的痕迹,但数据就是被修改了;在此记录一下教训,可能是一时疏忽,但就是掉坑里去了。
例如(错误代码):
let obj = _this.data.find(f => f.id = _this.projectCode)
正确代码:
let obj = _this.data.find(f => f.id == _this.projectCode)