Skip to content

日常收集

zeze.li edited this page May 6, 2021 · 4 revisions

navicat连接MySQL8+时出现2059错误解决方法

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password';

大屏页面计算公式

 const 设备宽度=document.documentElement.clientWidth
 const 设备高度=document.documentElement.clientHeight
 let 页面宽度
 if(设备宽度/设备高度>16/9){
 页面宽度=设备宽度*(16*9)
  }else{
 页面宽度=设备宽度
}
const 页面高度=页面宽度/(16/9)

子元素盛满父元素

.parent {
display:flex;
flex-direction:column;
}
.sun{
 flex:1;
}

文件合并

 File f = new File(fileSavePath, saveName);
            map.put("savePath", saveDate);
            FileOutputStream fos = new FileOutputStream(f);
            int index = 1;
            while (index <= length) {
                File eachFile = new File(folder + File.separator + index + "." + partFileSuffix);
                if (!eachFile.exists()) {
                    break;//如果子文件不存在就退出
                }

                index++;
                //读取子文件内容
                FileInputStream fis = new FileInputStream(eachFile);
                byte[] eachContent = new byte[(int) eachFile.length()];
                fis.read(eachContent);
                fis.close();

                fos.write(eachContent);
                fos.flush();//手动刷新一次缓冲区
            }
            fos.close();//每次都要关闭