Java IO流(详解)

news/2024/5/19 3:41:08/文章来源:https://blog.csdn.net/m0_54355172/article/details/128118750

  • 1. File
    • 1. 创建
    • 2. 操作
      • 1. 获取文件信息
      • 2. 目录创建/删除
  • 2. IO流
    • 1. FileInputStream
      • 1. 简单使用
      • 2. 读取中文
    • 2. FileOutputStream
      • 1. 简单使用
      • 2. 追加写入
    • 3. 文件拷贝
    • 4. FileReader
      • 1. 简单使用
      • 2. 提高读取速度
    • 5. FileWriter
      • 1. 简单使用
    • 6. 节点流和处理流简介
    • 7. BufferedReader
      • 1. 简单使用
    • 8. BufferedWriter
      • 1. 简单使用
    • 9. Buffered字符流拷贝
    • 10. Buffered字节流拷贝
    • 11 对象流
      • 1. 简单使用
      • 2. 注意事项
    • 12. 标准输入/输出流
    • 13. 转换流
      • 1. 乱码问题
      • 2. InputStreamReader
      • 3. OutputStreamWriter
    • 14. 打印流
      • 1. PrintStream
      • 2. PrintWriter
    • 15. 读写.properties 文件

1. File

文件: 保存数据的地方。

1. 创建

构造器:
new File

  • (String pathName) // 根据路径构建一个 File对象
  • (File parent, String child) // 根据父目录文件 + 子路径构建
  • (String parent, String child) // 根据父目录 + 子路径构建

创建对象:
createNewFile


(String pathName) —— 目录必须存在,才能创建文件
如果 D:\Study\file_demo\ 路径不存在,会抛出异常:java.io.IOException: 系统找不到指定的路径

    public static File create_01(String path) {File file = new File(path);try {file.createNewFile();} catch (IOException e) {e.printStackTrace();}return file;}public static void main(String[] args) {String path = "D:\\Study\\file_demo\\demo1.txt";File file = create_01(path);}

(File parent, String child)
如果 D:\Study\file_demo\ 路径不存在,会抛出异常:java.io.IOException: 系统找不到指定的路径

    public static File create_02(File parent, String child) {File file = new File(parent, child);try {file.createNewFile();} catch (IOException e) {e.printStackTrace();}return file;}public static void main(String[] args) {File parent = new File("D:\\Study\\file_demo\\");String path = "demo2.txt";File file = create_02(parent, path);}

(String parent, String child)
如果 D:\Study\file_demo\ 路径不存在,会抛出异常:java.io.IOException: 系统找不到指定的路径

    public static File create_03(String parent, String child) {File file = new File(parent, child);try {file.createNewFile();} catch (IOException e) {e.printStackTrace();}return file;}public static void main(String[] args) {String parent = "D:\\Study\\file_demo\\";String child = "demo3.txt";File file = create_03(parent, child);}

注意:

  • new File 只是在内存中创建了一个对象
  • createNewFile 才是在磁盘上创建了一个文件

2. 操作

1. 获取文件信息

方法:

  • getName
  • getAbsolutePath
  • getParent
  • length
  • exists
  • isFile
  • isDirectory
    public static Map<String, String> getFileInfo(File file) {Map<String, String> info = new HashMap<>();info.put("文件名", file.getName());info.put("文件绝对路径", file.getAbsolutePath());info.put("文件父级目录", file.getParent());info.put("文件大小(byte)", String.valueOf(file.length()));info.put("文件是否存在", file.exists() + "");info.put("是否是文件", file.isFile() + "");info.put("是否是目录", String.valueOf(file.isDirectory()));return info;}public static void main(String[] args) {File file = new File("D:\\Study\\file_demo\\demo1.txt");getFileInfo(file).forEach((k, v) -> {System.out.println(k + ":" + v);});}

2. 目录创建/删除

方法:

  • mkdir
    创建一级目录
  • mkdirs
    创建多级目录
  • delete
    删除空目录/文件

注意: Java中,目录也被当做文件。

    public static void create_01(String path) {File file = new File(path);String flagE = null;String flagM = null;String flagMs = null;if (file.exists()) {flagE = file.delete() ? "文件删除成功" : "文件删除失败";} else {flagE = "文件不存在";}System.out.println(flagE);boolean isMk = file.mkdir();flagM = isMk ? "一级目录创建成功" : "一级目录创建失败";System.out.println(flagM);if (!isMk) {flagMs = file.mkdirs() ? "多级目录创建成功" : "多级目录创建失败";System.out.println(flagMs);}}public static void main(String[] args) {String path = "D:\\Study\\file_demo\\test";create_01(path);}

2. IO流

IO Input/Output,处理数据传输的技术。

Stream 流,Java中的数据的输入/输出都以流的方式进行。

  • 分类(数据单位)
    • 字节流(1 byte)—— InputStreamOutputStream
    • 字符流(1 字符)—— ReaderWriter
  • 分类(流向)
    • 输入流
    • 输出流
  • 分类(角色)
    • 节点流
    • 处理流/包装流

1. FileInputStream

1. 简单使用

    public static String readFile_01(String path) {FileInputStream inputStream = null;StringBuilder sb = new StringBuilder();int curr = 0;try {inputStream = new FileInputStream(path);while ((curr = inputStream.read()) != -1) {// read ———— 每次读取 1byte, 读取完毕就返回 -1sb.append((char) curr + "");}} catch (IOException e) {e.printStackTrace();} finally {try {inputStream.close();} catch (IOException e) {e.printStackTrace();}}return sb.toString();}public static void main(String[] args) throws IOException {String path = "D:\\Study\\file_demo\\user.txt";System.out.println(readFile_01(path));}

注意:

  • read 每次读取 1byte,读取完毕返回 -1
  • 每次使用完流,都得使用 close 关闭流,避免资源浪费
  • 使用 FileInputStream 读取中文可能会出现中文乱码问题
    • 原因:
      FileInputStream 每次读取大小为 1byte = 8bit,在 GBK 编码模式下,每个中文为 2bit,但在 UTF-8 编码 模式下,每个中文为 3bit,显然不能刚好装进一个 byte 数组。
    • 解决方案:
      • 使用 FileReader
      • 使用 read(byte b[]),并将 byte 数组的容量设置足够大
        这个方法就是自定义每次读取的字节数组的大小

2. 读取中文

思路: 声明一个容量足够大的 byte 数组(能一次性吧文件读完),然后使用 public int read(byte b[]) 读取文件(会将文件内容存入 b[],并返回 b.length)。

    public static String readFile_01(String path) {FileInputStream inputStream = null;StringBuilder sb = new StringBuilder();// 用一个足够大的 byte 数组来装下内容byte [] bytes = new byte[83];int readLen = 0;try {inputStream = new FileInputStream(path);// 返回值是读取的字节长度while ((readLen = inputStream.read(bytes)) != -1) {// read ———— 每次读取 1byte, 读取完毕就返回 -1sb.append(new String(bytes, 0, readLen));}} catch (IOException e) {e.printStackTrace();} finally {try {inputStream.close();} catch (IOException e) {e.printStackTrace();}}return sb.toString();}public static void main(String[] args) throws IOException {String path = "D:\\Study\\file_demo\\user.txt";System.out.println(readFile_01(path));}

2. FileOutputStream

1. 简单使用

write

  • write(int b)

  • write(byte b[])

  • write(byte b[], int off, int len)

    public static void write_01(String path, String words) {FileOutputStream outputStream = null;try {outputStream = new FileOutputStream(path);//outputStream.write(words.getBytes());} catch (IOException e) {e.printStackTrace();} finally {try {outputStream.close();} catch (IOException e) {e.printStackTrace();}}}public static void main(String[] args) {String words = "在龟友百货上班,规规矩矩地纳税。";String path = "D:\\Study\\file_demo\\user.txt";write_01(path, words);}

注意:

  • 直接这样 write 会覆盖掉之前的内容
  • 进行写操作的时候,文件可以不存在,但目录必须存在

2. 追加写入

在初始化 FileOutputStream 的时候,传入一个参数 true,表明——在文件末尾追加内容。

outputStream = new FileOutputStream(path, true);

3. 文件拷贝

需求: 将如图所示的四种文件拷贝到另外一个文件夹:

步骤: 输入流(读取到内存)→ 输出流(写入到磁盘)
读取部分数据,就写入磁盘,不能一次性读完再写(防止内存不够)。

    public static void copy(String resPath, String tarPath) {FileInputStream inputStream = null;FileOutputStream outputStream = null;byte []bytes = new byte[1024 * 1024]; // 一次读 1MBint len = 0;try {inputStream = new FileInputStream(resPath);outputStream = new FileOutputStream(tarPath);while ((len = inputStream.read(bytes)) != -1) {outputStream.write(bytes, 0, len); // 这里必须使用此方法,防止文件读取时没装完}} catch (IOException e) {e.printStackTrace();} finally {try {if (inputStream != null) {inputStream.close();}if (outputStream != null) {outputStream.close();}} catch (IOException e) {e.printStackTrace();}}}public static void main(String[] args) {String res1 = "D:\\Study\\file_demo\\resource\\pic.jpg";String res2 = "D:\\Study\\file_demo\\resource\\user.txt";String res3 = "D:\\Study\\file_demo\\resource\\电锯人5.mp4";String res4 = "D:\\Study\\file_demo\\resource\\周杰伦 - 我是如此相信.mp3";String tar1 = "D:\\Study\\file_demo\\target\\pic.jpg";String tar2 = "D:\\Study\\file_demo\\target\\user.txt";String tar3 = "D:\\Study\\file_demo\\target\\电锯人5.mp4";String tar4 = "D:\\Study\\file_demo\\target\\周杰伦 - 我是如此相信.mp3";copy(res1, tar1);copy(res2, tar2);copy(res3, tar3);copy(res4, tar4);}

4. FileReader

1. 简单使用

    public static String readFile_02(String path) {FileReader reader = null;StringBuilder sb = new StringBuilder();int curr = 0;try {reader = new FileReader(path);while (true) {if ((curr = reader.read()) == -1) break;sb.append((char) curr + "");}} catch (IOException e) {e.printStackTrace();} finally {if (reader != null) {try {reader.close();} catch (IOException e) {e.printStackTrace();}}}return sb.toString();}public static void main(String[] args) {String path = "D:\\Study\\file_demo\\target\\user.txt";System.out.println(readFile_02(path));}

注意: 因为 FileReader 是一个字符一个字符地读取的,所以不存在中文乱码问题。

2. 提高读取速度

按照上面的写法,每次只读取一个字符,效率太低,为了提高读取效率,可以使用这个方法:public int read(char cbuf[])

    public static String readFile_02(String path) {FileReader reader = null;StringBuilder sb = new StringBuilder();char []chars = new char[8]; // 一次读取 8 个字符int len = 0;try {reader = new FileReader(path);while (true) {if ((len = reader.read(chars)) == -1) break;sb.append(new String(chars, 0, len));}} catch (IOException e) {e.printStackTrace();} finally {if (reader != null) {try {reader.close();} catch (IOException e) {e.printStackTrace();}}}return sb.toString();}public static void main(String[] args) {String path = "D:\\Study\\file_demo\\target\\user.txt";System.out.println(readFile_02(path));}

5. FileWriter

常用用法:

  • FileWriter(String fileName)
    覆盖写入

  • FileWriter(String fileName, boolean append)
    appendtrue => 追加写入

  • write(int c)
    写入单个字符

  • write(char cbuf[])
    写入指定数组

  • write(char cbuf[], int off, int len)
    写入指定数组的指定部分

  • write(String str)
    写入整个字符串

  • write(String str, int off, int len)
    写入字符串的指定部分

注意: FileWriter 使用完后,必须关闭 closeflush 才能向文件写入内容。

1. 简单使用

    public static void write_02(String path, String words, boolean flag) {FileWriter fileWriter = null;try {if (flag) {fileWriter = new FileWriter(path, true);} else {fileWriter = new FileWriter(path);}fileWriter.write(words);} catch (IOException e) {e.printStackTrace();} finally {try {// close = flush + 关闭流fileWriter.close();} catch (IOException e) {e.printStackTrace();}}}public static void main(String[] args) {String path = "D:\\Study\\file_demo\\user.txt";String words = "每晚八点回家却不会觉得累。";write_02(path, words, true);}

6. 节点流和处理流简介

节点流: 可以从一个特定的数据源 读写数据(FileReader、FileWriter、…)。

处理流/包装流: 基于已存在的流(节点流或处理流),为程序提供较为强大的读写功能(BufferedReader、BufferedWriter、…)。

处理流就是在节点流简单读写数据源的基础上,对读写功能进行扩展,比如说增加一个缓冲区。处理流的构造必须基于已存在的流。

两者关联

  • 节点流是 底层流/低级流,直接跟数据源连接
  • 处理流 包装节点流,可以消除不同节点流的实现差异,也可以提供更方便的方法来完成输入输出
  • 处理流 包装节点流,使用了 修饰器设计模式,不会直接与数据源相连
  • 处理流的优势:
    • 性能提高:主要以增加缓冲的方式来提高读写的效率
    • 操作便捷:提供了一系列便捷的方法来一次输入输出大批量的数据,更加灵活轻便

7. BufferedReader

1. 简单使用

    public static String read_03(String path) {StringBuilder sb = new StringBuilder();BufferedReader reader = null;String line;try {reader = new BufferedReader(new FileReader(path));while ((line = reader.readLine()) != null) {sb.append(line);}} catch (IOException e) {e.printStackTrace();} finally {try {reader.close();} catch (IOException e) {e.printStackTrace();}}return sb.toString();}public static void main(String[] args) {String path = "D:\\Study\\file_demo\\user.txt";System.out.println(read_03(path));}

注意: 关闭了处理流,其节点流也会自动关闭。

8. BufferedWriter

1. 简单使用

    public static void write_03(String path, String words) {BufferedWriter writer = null;try {writer = new BufferedWriter(new FileWriter(path, true));writer.write("\n" + words);} catch (IOException e) {e.printStackTrace();} finally {try {writer.close();} catch (IOException e) {e.printStackTrace();}}}public static void main(String[] args) {String path = "D:\\Study\\file_demo\\user.txt";String words = "喝酒从来止于浅尝从不买醉。";write_03(path, words);}

9. Buffered字符流拷贝

    public static void copy(String src, String target) {BufferedReader reader = null;BufferedWriter writer = null;BufferedWriter clear = null;String line;try {reader = new BufferedReader(new FileReader(src));writer = new BufferedWriter(new FileWriter(target, true));// 清空文件内容clear = new BufferedWriter(new FileWriter(target));clear.write("");while (true) {if ((line = reader.readLine()) != null) {// 每写一行writer.write(line);// 就换一行writer.newLine();continue;}break;}} catch (IOException e) {e.printStackTrace();} finally {try {clear.close();reader.close();writer.close();} catch (IOException e) {e.printStackTrace();}}}public static void main(String[] args) {String src = "D:\\sedemo\\src\\main\\java\\io\\file\\FileCreate.java";String target = "D:\\Study\\file_demo\\target\\FileCreate.java";copy(src, target);}

注意: BufferedReaderBufferedWriter 只用来处理文本文件,别用来处理二进制文件。

10. Buffered字节流拷贝

需求: 将下图中的 电锯人6周杰伦 - 倒影.mp3 分别移动到指定文件夹

    public static void copy(String src, String tar) {byte []bytes = new byte[1024*1024];int len = 0;try (BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(src));BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(tar))) {while ((len = inputStream.read(bytes)) != -1) {outputStream.write(bytes, 0, len);}} catch (IOException e) {e.printStackTrace();}}public static void main(String[] args) {String mp4Src = "D:\\迅雷下载\\电锯人6.mp4";String mp3Src = "D:\\迅雷下载\\周杰伦 - 倒影.mp3";String mp4Tar = "D:\\迅雷下载\\电视剧\\电锯人\\电锯人6.mp4";String mp3Tar = "D:\\迅雷下载\\音乐\\周杰伦 - 倒影.mp3";copy(mp3Src, mp3Tar);copy(mp4Src, mp4Tar);}

11 对象流

对象流: 对Java对象进行序列化和反序列化操作,使对象便于持久化到本地,并从本地传到内存(ObjectInputStreamObjectOutputStream)。

Java序列化和反序列化

1. 简单使用

  • 定义一个 User 对象
    需要实现了 Serializable 接口的对象才能序列化
    这个接口是一个标记接口,只表明该类可以序列化

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public class User implements Serializable {private String name;private Integer age;private char gend;
    }
    
  • 写读

    public static void writeObj(String path) {try (ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(path))){// 序列化数据oos.writeInt(1); // 包装类都实现了 Serializable 接口, 可序列化oos.write(2);oos.writeBoolean(true);oos.writeObject(new User("吉良吉影", 33, '男'));} catch (IOException e) {e.printStackTrace();}
    }public static void readObj(String path) {try (ObjectInputStream ois = new ObjectInputStream(new FileInputStream(path))){// 注意:读取顺序必须与保存顺序一致System.out.println(ois.readInt());System.out.println(ois.read());System.out.println(ois.readBoolean());User user = (User) ois.readObject();System.out.println(user);System.out.println(user.getName());} catch (IOException | ClassNotFoundException e) {e.printStackTrace();}
    }public static void main(String[] args) {// 序列化后保存的格式不是纯文本,这里指定后缀没啥意义String path = "D:\\Study\\file_demo\\obj.hehe";writeObj(path);readObj(path);
    }
    

2. 注意事项

  • 序列化写入是啥顺序,读取的时候就应该是啥顺序

  • 可以被 ObjectOutputStream 序列化写入的对象,都必须实现 Serializable 接口

  • 序列化的类中建议添加 serialVersionUID,提高版本的兼容性

    private static final long serialVersionUID = 1L
    

    虚拟机是否允许反序列化,不仅取决于类路径和功能代码是否一致,一个非常重要的一点是两个类的序列化 ID 是否一致

  • 序列化对象,默认将里面所有的属性都进行序列化(除了 statictransient 修饰的成员)

  • 序列化对象,要求对象的所有属性的类型也要实现 Serializable 接口

  • 序列化具备可继承性,父类可以序列化,那么其子类也可以进行序列化

12. 标准输入/输出流

System.in 标准输入——默认设备:键盘

  • 编译类型:

    public final static InputStream in = null;
    
  • 运行类型:java.io.BufferedInputStream

System.out 标准输出——默认设备:屏幕

  • 编译类型:

    public final static PrintStream out = null;
    
  • 运行类型:java.io.PrintStream

    public static String sys_in() {Scanner scanner = new Scanner(System.in);StringBuilder sb = new StringBuilder();while (scanner.hasNextInt()) {int cur = scanner.nextInt();if (cur == 0) break;sb.append(cur + "");}return sb.toString();}public static void main(String[] args) {System.out.println(sys_in());}

13. 转换流

转换流: 将字节流转换为字符流,常用于解决中文乱码问题。

  • InputStreamReader
  • OutputStreamWriter

1. 乱码问题

我们已经分析过:直接使用字节流,如 FileInputStream 读取含有中文的文档,就会出现乱码问题,这是因为字节流默认一次读取 8bit。

其实,使用字符流读取中文文档的时候也会出现乱码问题:

    public static void main(String[] args) throws IOException {FileReader reader = new FileReader("D:\\Study\\file_demo\\user1.txt");int curr = 0;while ((curr = reader.read()) != -1) {System.out.print((char) curr);}reader.close();}

那为什么读取user.txt就不会出现此类问题呢?
因为编码问题:txt默认 UTF-8,编码,这时候使用字符流去读取不会出现乱码(读取的编码方式,默认也是 UTF-8),但是修改了编码,就会出现乱码:


可以使用转换流来解决中文乱码——指定读取文件的编码方式

转换流:

  • 可以将一个字节流转换成字符流
  • 字节流可以指定编码读取方式

解决思路:

  • 先指定字节流读取的编码方式
  • 先后将字节流转换为字符流

2. InputStreamReader

InputStreamReader(InputStream in, Charset cs)

当处理纯文本数据时,如果使用字符流效率更高,并且可以有效解决中文乱码问题,建议使用转换流将字节流转换为字符流。

    public static void main(String[] args) throws IOException {InputStream inputStream = new FileInputStream("D:\\Study\\file_demo\\user1.txt");InputStreamReader streamReader = new InputStreamReader(inputStream, "gbk");int curr = 0;while ((curr = streamReader.read()) != -1) {System.out.print((char) curr);}streamReader.close();}

3. OutputStreamWriter

    public static void main(String[] args) {String path = "D:\\Study\\file_demo\\test.txt";try (OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream(path), "gbk")) {osw.write("睡前一杯热牛奶下肚,非常暖胃。\n再做20分钟拉伸运动有点小累,11点的钟声响起,必须倒头就睡。\n一觉睡到天亮,精神倍儿爽不颓废。");} catch (IOException e) {e.printStackTrace();}}

14. 打印流

打印流: 字节打印流

  • PrintStream
  • PrintWriter 字符打印流

注意: 打印流只有输出流,没有输入流。

1. PrintStream

System.out 就是打印流。

    public static void main(String[] args) {PrintStream out = System.out;out.print("The World !");out.close();}

因为 out.print 的底层就是 out.write

    public void print(String s) {if (s == null) {s = "null";}write(s);}

所以,可以直接使用 out.write

out.write(("The World !").getBytes());

使用 PrintStream 写入本地文件:

    public static void main(String[] args) throws IOException {System.setOut(new PrintStream("D:\\Study\\file_demo\\test.txt"));System.out.println("The World !");}

2. PrintWriter

public static void main(String[] args) {// PrintWriter writer = new PrintWriter(System.out);PrintWriter writer = null;try {writer = new PrintWriter(new FileWriter("D:\Study\file_demo\test.txt"));writer.print("The World !");} catch (IOException e) {e.printStackTrace();} finally {writer.close();}
}

注意: 因为是基于 PrintWriter 初始化的,所以必须要 close 才能将数据写入文件。

15. 读写.properties 文件

properties类:.properties 配置文件进行读写操作。

常用方法:

  • load
    加载配置文件的键值对到 properties 对象
  • list
    将数据显示到指定设备
  • getProperty(key)
    根据键获取值
  • setProperty(key, value)
    设置键值对到 Properties 对象中
  • store
    .properties 中的键值对存储到配置文件(Idea中,保存信息到配置文件,如果包含中文,会存储为 Unicode 码)

data.properties

driverClass=com.mysql.cj.jdbc.Driver
url=jdbc:mysql://localhost:3306/mybatis_plus?serverTimezone=GMT&characterEncoding=utf-8&useSSL=false
username=root
password=admin

读取:

public static void main(String[] args) {Properties properties = new Properties();try {// 加载配置文件properties.load(new FileReader("D:\sedemo\io\src\main\resources\data.properties"));// 显示properties.list(System.out);properties.list(new PrintStream("D:\Study\file_demo\data.txt"));// 根据key,获取valueSystem.out.println(properties.getProperty("url"));} catch (IOException e) {e.printStackTrace();}
}

修改:

public static void main(String[] args) throws IOException {Properties properties = new Properties();// 该配置文件没有 对应的key,就是新增一对键值对,否则就是修改 valueproperties.setProperty("role.name", "张三");properties.setProperty("role.age", "17");properties.setProperty("role.gend", "男");properties.store(new FileOutputStream("D:\yinhai\gonghui\sedemo\clone\src\main\resources\role.properties"), "这是一段注释,可以为空");
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.luyixian.cn/news_show_230682.aspx

如若内容造成侵权/违法违规/事实不符,请联系dt猫网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

yolo后处理操作-如何获取我们想要的目标框及置信度?

yolo后处理就是模型的输出进行处理&#xff0c;得到我们想要的坐标框的xywhxywhxywh以及confidenceconfidenceconfidence 学习笔记 这是yolov1的模型&#xff0c;他将图像划分成了7x7个网格&#xff0c;每个网格负责预测两个边界框&#xff0c;每个边界框都有5个信息$x、y、w、…

腾讯云年终选购云服务器攻略!

随着云计算的快速发展&#xff0c;很多用户都选择上云&#xff0c;上运中最常见的产品就是云服务器CVM和轻量应用服务器了&#xff0c;那么怎么选购最优惠呢&#xff0c;这篇文章将介绍新老用户选购腾讯云服务器的几个优惠方法。 一、买赠专区 第一个介绍的就是买赠专区&…

MySQL下载安装运行

方式1、MySQL 官方网站&#xff1a;http://www.mysql.com 拉到最下面&#xff1a; 方式2、Windows版 MySQL 的官方下载地址&#xff1a;https://dev.mysql.com/downloads/mysql/ 配置环境变量&#xff1a;在Path中添加至“\bin”&#xff08;系统盘C盘&#xff09;形式 使用管…

(02)Cartographer源码无死角解析-(33) LocalTrajectoryBuilder2D: 点云数据流向、处理、消息发布等→流程复盘

讲解关于slam一系列文章汇总链接:史上最全slam从零开始&#xff0c;针对于本栏目讲解(02)Cartographer源码无死角解析-链接如下: (02)Cartographer源码无死角解析- (00)目录_最新无死角讲解&#xff1a;https://blog.csdn.net/weixin_43013761/article/details/127350885 文末…

我国跨国企业外汇风险管理——以海尔公司为例

目 录 摘 要 I 一、 绪论 1 &#xff08;一&#xff09; 选题背景及意义 1 &#xff08;二&#xff09; 国内研究现状 1 1&#xff0e; 国外研究现状 1 2&#xff0e; 国内研究现状 3 &#xff08;三&#xff09; 研究内容及方法 3 &#xff08;四&#xff09; 跨国企业外汇风险…

java+mysql基于SSM的大学生兼职信息系统-计算机毕业设计

开发环境 运行环境&#xff1a; 开发工具:IDEA /Eclipse 数据库:MYSQL5.7 应用服务:Tomcat7/Tomcat8 使用框架:SSM(springspringMVCmybatis)vue 项目介绍 论文主要是对大学生兼职信息系统进行了介绍&#xff0c;包括研究的现状&#xff0c;还有涉及的开发背景&#xff0c;然…

构建全真互联数字地图底座 腾讯地图产业版WeMap重磅升级

前言 &#xff1a;伴随着地理信息产业的不断演进&#xff0c;以及LBS、大数据、5G、云、AI等新技术的持续应用&#xff0c;数实融合发展呈现出加速态势&#xff0c;数字地图也从移动互联网时代向产业互联网时代进化。 WeMap腾讯地图产业版重磅升级&#xff01;12月1日&#xff…

Python解题 - CSDN周赛第12期 - 蚂蚁的烦恼

问哥本期有幸all pass&#xff0c;而且用时50分钟内。不过回想起来&#xff0c;本期的四道题目的设计都或多或少不太严谨&#xff0c;或者说测试用例不够全面&#xff08;后面会细说&#xff09;。这样的话就极有可能造成虽然通过了测试&#xff0c;拿到了分数&#xff0c;但代…

数据结构—链表

文章目录链表&#xff08;头插法、尾插法、单链表反转&#xff09;二分查找算法&#xff1a;哈夫曼编码构建链表insert()创建链表&#x1f447;【1】尾插法【2】头插法【3】遍历输出链表【4】输出链表的长度【5】查找链表上是否有该元素【6】指定位置插入数据链表经典面试题【1…

12家硬件厂商发布飞桨生态发行版 软硬一体协同发展

11月30日&#xff0c;由深度学习技术及应用国家工程研究中心主办、百度飞桨承办的WAVE SUMMIT2022深度学习开发者峰会如期举行。峰会上&#xff0c;百度AI技术生态总经理马艳军发布了飞桨深度学习平台的最新技术和生态进展&#xff0c;全新发布飞桨开源框架2.4版本&#xff0c;…

【论文简述】 Point-MVSNet:Point-Based Multi-View Stereo Network(ICCV 2019)

一、论文简述 1. 第一作者&#xff1a;Rui Chen、Songfang Han 2. 发表年份&#xff1a;2019 3. 发表期刊&#xff1a;ICCV 4. 关键词&#xff1a;MVS、深度学习、点云、迭代改进 5. 探索动机&#xff1a;很多传统方法通过多视图光度一致性和正则化优化迭代更新&#xff…

【Java实战】大厂都是怎样进行单元测试的

目录 一、前言 二、单元测试 1.【强制】好的单元测试必须遵守 AIR 原则。 2.【强制】单元测试应该是全自动执行的&#xff0c;并且非交互式的。测试用例通常是被定期执行的&#xff0c;执行过程必须完全自动化才有意义。输出结果需要人工检查的测试不是一个好的单元测试。不…

清华、北大、中科大、UMA、MSU五位博士生畅聊深度学习理论

点击蓝字关注我们AI TIME欢迎每一位AI爱好者的加入&#xff01;伴随着深度学习的蓬勃发展&#xff0c;进入人们视线的好像都是算法或AlphaGo等应用层面的东西。但是在理论上&#xff0c;深度学习似乎却没有很出圈的相关理论。因此&#xff0c;部分人也在批评深度学习是缺乏理论…

蓝海创意云·11月大事记 || 12月,暖心相伴

秋尽冬生&#xff0c;日短天寒 告别了立冬与小雪 时光不紧不慢开启了新一月的篇章 万物冬藏&#xff0c;沉淀酝酿 站在十二月的路口 蛰伏打磨&#xff0c;静待厚积而薄发 导 读 ● 客户端更新&#xff1a;新增PSD通道合成选项 ● 渲染案例&#xff1a;绝代双骄重启江湖…

Reading Note(10)——AutoBridge

这篇论文是FPGA 2021年的best paper award&#xff0c;主要解决的是在HLS编译过程中优化布局和布线&#xff0c;最终达到整个multi-die的FPGA板上的大规模HLS设计时钟频率尽可能提升的目的&#xff0c;这篇工作在当前chiplet工艺铺展开来的当下更加有现实意义&#xff0c;通过这…

浅谈ES标准的演变

ECMAScript从1997年第一版诞生依赖&#xff0c;经过无数人的“踩坑”和“填坑”&#xff0c;到现在&#xff0c;ES12呼之欲出。那么我们不妨讨论一下ES的发展历程&#xff0c;看它如何统一江湖&#xff0c;看它“曲折”而又令人期待的发展之路。 最近分析typescript&#xff0c…

jsp网络申报审批系统Myeclipse开发mysql数据库web结构java编程计算机网页项目

一、源码特点 JSP 网络申报审批系统 是一套完善的web设计系统&#xff0c;对理解JSP java编程开发语言有帮助&#xff0c;系统具有完整的源代码和数据库&#xff0c;系统主要采用B/S模式开发。开发环境为TOMCAT7.0,Myeclipse8.5开发&#xff0c;数据库为Mysql&#xff0c;使用…

16S全长测序揭示绿头虻肠道微生物及共生细菌

论文题目&#xff1a;Greenhead (Tabanus nigrovittatus) Wolbachia and Its Microbiome: A Preliminary Study 期刊&#xff1a;Microbiol Spectrum 研究背景 绿头虻&#xff08;Tabanus nigrovittatus&#xff09;的雌虫刺吸牲畜的血液&#xff0c;危害家畜&#xff0c;是美…

【从零开始学习深度学习】6.使用torchvision下载与查看图像分类数据集Fashion-MNIST

目录1.1 获取Fashion-MNIST数据集2.2 读取小批量小结图像分类数据集中最常用的是手写数字识别数据集MNIST。但大部分模型在MNIST上的分类精度都超过了95%。为了更直观地观察算法之间的差异&#xff0c;我们将使用一个图像内容更加复杂的数据集Fashion-MNIST。 本节我们将使用to…

分享几款免费实用的国产内网穿透工具

对于没有公网IP的用户来说&#xff0c;如何实现远程管理或让局域网的服务可以被公网访问到是一个问题。当然&#xff0c;也有很多类似的需求&#xff0c;比如&#xff1a; 微信公众号小程序开发调试公网访问本地web项目异地远程处理公司服务问题异地访问公司内网财务/管理系统…