stream笔记

1、 创建流stream

  • 1.1、 Stream 的操作三个步骤

1.2、 stream中间操作

  • 1.2.1 、 limit、skip、distinct

  • 1.2.2、 map and flatMap

  • 1.2.3、 sort 自然排序和定制排序

1.3、 add and andAll difference:

1.4、 终止操作

  • 1.4.1、 allmatch、anyMatch、noneMatch、max、min
  • 1.4.2、 reduce
  • 1.4.3 、 collect

1、创建流stream:

流(Stream) 到底是什么 呢 ?
是数据渠道,用于操作数据源(集合、数组等)所生成的元素序列。
“ 集合讲的是数据 , 流讲的是 计 算 ! ”
注意 :
①Stream 自己不会存储元素。
②Stream 不会改变源对象。相反,他们会返回一个持有结果的新Stream。
③Stream 操作是延迟执行的。这意味着他们会等到需要结果的时候才执行。

1.1 Stream 的操作三个步骤
  • 创建 建 Stream
    一个数据源(如:集合、数组),获取一个流
  • 中间操作
    一个中间操作链,对数据源的数据进行处理
  • 终止操作( ( 终端操作) )
    一个终止操作,执行中间操作链,并产生结果

在这里插入图片描述

default Stream stream()List list = new ArrayList<>(); Stream stream = list.stream(); //获取一个顺序流返回一个顺序流
default Stream parallelStream()Stream parallelStream = list.parallelStream(); //获取一个并行流返回一个并行流
Integer[] nums = new Integer[10]; Stream stream1 = Arrays.stream(nums);通过 Arrays 中的 stream() 获取一个数组流
//迭代 Stream stream3 = Stream.iterate(0, (x) -> x + 2).limit(10); stream3.forEach(System.out::println);创建无限流
Stream stream4 = Stream.generate(Math::random).limit(2);生成
        //下面两个遍历一样
        stream4.forEach(System.out::println);
//        stream4.forEach(s->{
//            System.out.println(s);
//        });

1.2:stream中间操作

filter接收 Lambda , 从流中排除某些元素。
limit截断流,使其元素不超过给定数量。
skip(n)跳过元素,返回一个扔掉了前 n 个元素的流。若流中元素不足 n 个,则返回一个空流。与 limit(n) 互补
distinct筛选,通过流所生成元素的 hashCode() 和 equals() 去除重复元素
map接收 Lambda , 将元素转换成其他形式或提取信息。接收一个函数作为参数,该函数会被应用到每个元素上,并将其映射成一个新的元素。
flatMap接收一个函数作为参数,将流中的每个值都换成另一个流,然后把所有流连接成一个流,流中流
sorted()自然排序 comparable
sorted(Comparator com)定制排序

1.2.1 limit、skip、distinct、
public class Employee {
    private int id;
    private String name;
    private int age;
    private Double salary;

}
List<Employee> emps = Arrays.asList(
        new Employee(102, "李四", 59, 6666.66),
        new Employee(101, "张三", 18, 9999.99),
        new Employee(103, "王五", 28, 3333.33),
        new Employee(104, "赵六", 8, 7777.77),
        new Employee(104, "赵六", 8, 7777.77),
        new Employee(104, "赵六", 8, 7777.77),
        new Employee(105, "田七", 38, 5555.55)
);
    //内部迭代:迭代操作 Stream API 内部完成(filter  过滤时需要迭代一下)
    @Test
    public void test2() {
        //所有的中间操作不会做任何的处理
        Stream<Employee> stream = emps.stream()
                //断言,传入参数,返回布尔值
                .filter((e) -> {
                    System.out.println("测试中间操作");
                    return e.getAge() <= 35;
                });

        //只有当做终止操作时,所有的中间操作会一次性的全部执行,称为“惰性求值”
        stream.forEach(System.out::println);
    }

    //外部迭代
    @Test
    public void test3() {
        Iterator<Employee> it = emps.iterator();

        while (it.hasNext()) {
            System.out.println(it.next());
        }
    }


    //找到三个之后就不往下找了。提高效率
    @Test
    public void test4() {
        emps.stream()
                .filter((e) -> {
                    System.out.println("短路!"); // &&  ||
                    return e.getSalary() >= 5000;
                }).limit(3)
                .forEach(System.out::println);
    }


    //大于5000的前两个跳过,也就是不取
    @Test
    public void test5() {
        emps.parallelStream()
                .filter((e) -> e.getSalary() >= 5000)
                .skip(2)
                .forEach(System.out::println);
    }


    //去重。如果是对象,hashcode和equals  进行比较,所以要去重。  lambda 已经重写的了去重操作
    @Test
    public void test6() {
        emps.stream()
                .distinct()
                .forEach(System.out::println);
    }

1.2.2 map and flatMap:
  •    @Test
          public void test7() {
              Stream<String> str = emps.stream()
                      .map((e) -> e.getName());
      
              System.out.println("-------------------------------------------");
      
              List<String> strList = Arrays.asList("aaa", "bbb", "ccc", "ddd", "eee");
      
              Stream<String> stream = strList.stream()
                      .map(String::toUpperCase);
      
              stream.forEach(System.out::println);
      
              //TODO:下面两种一样的。内部迭代
      //        emps.stream().map(Employee::getName).forEach(System.out::println);
              emps.stream().map(s -> s.getName()).forEach(System.out::println);
      
      
              Stream<Stream<Character>> stream2 = strList.stream()
                      .map(TestStreamApI::filterCharacter);
      
              stream2.forEach((sm) -> {
                  sm.forEach(System.out::println);
              });
      
              System.out.println("---------------------------------------------");
      
              Stream<Character> stream3 = strList.stream()
                      .flatMap(TestStreamApI::filterCharacter);
      
              stream3.forEach(System.out::println);
      
      
              System.out.println("----------------------------------------------");
              //解决结果两次for循环
              strList.stream().flatMap(item -> Arrays.stream(item.split(" "))).forEach(System.out::println);
      
          }
      
          public static Stream<Character> filterCharacter(String str) {
              List<Character> list = new ArrayList<>();
      
              for (Character ch : str.toCharArray()) {
                  list.add(ch);
              }
      
              return list.stream();
          }
    

1.2.3 sort 自然排序和定制排序:
public class Employee {
    private int id;
    private String name;
    private int age;
    private Double salary;

}
  @Test
    public void test9() {
        emps.stream()
                .map(Employee::getName)
                .sorted()
                .forEach(System.out::println);

        System.out.println("------------------------------------");

        emps.stream()
                .sorted((x, y) -> {
                    if (x.getAge() == y.getAge()) {
                        //两种排序方式
                        return x.getName().compareTo(y.getName());
                    } else {
                        return Integer.compare(x.getAge(), y.getAge());
                    }
                }).forEach(System.out::println);

        System.out.println("---------------------------------------------");
        List<String> list1 = Arrays.asList("zzzzzz", "aaaa", "bbbb", "cccc", "ddddd", "eeeee");
        list1.stream().sorted().forEach(System.out::println);

    }

1.3add and andAll difference:

add 和addall 区别:

  • 1、add 是把集合添加进去,addAll 是把集合中的元素添加进去
 @Test
    public void test8() {
        List<String> list1 = Arrays.asList("aaaa", "bbbb", "cccc", "ddddd", "eeeee");
        List list2 = new ArrayList<>();
        list2.add(1111);
        list2.add(2222);

        list2.add(list1);

        System.out.println(list2);
//[1111, 2222, [aaaa, bbbb, cccc, ddddd, eeeee]]
        System.out.println("================================");

        list2.addAll(list1);
        System.out.println(list2);
        //addall  是把集合中的元素取出来添加list1中。  里面的[aaaa, bbbb, cccc, ddddd, eeeee]   是上面添加的
        //[1111, 2222, [aaaa, bbbb, cccc, ddddd, eeeee], aaaa, bbbb, cccc, ddddd, eeeee]

    }

1.4 终止操作

anyMatch检查是否至少匹配一个元素
noneMatch检查是否没有匹配的元素
findFirst返回第一个元素
findAny返回当前流中的任意元素
count返回流中元素的总个数
max返回流中最大值Optional max = emps.stream().map(Employee::getSalary).max((v1,v2)->Double.compare(v1,v2)); .max(Double::compare); .max((v1,v2)->v1.compareTo(v2));
min返回流中最小值
reduce归约。可以将流中元素反复结合起来,得到一个值。
collect将流转换为其他形式。接收一个 Collector接口的实现,用于给Stream中元素做汇总的方法.collect(Collectors.toList());.collect(Collectors.toSet()); 放到hashset中:: .collect(Collectors.toCollection(HashSet::new)); .collect(Collectors.maxBy(Double::compare)); 总薪水: .collect(Collectors.summingDouble(Employee::getSalary)); 平均值: .collect(Collectors.averagingDouble(Employee::getSalary)); 总数: .collect(Collectors.counting()); 计算薪水总函数(最大值,最小值、平均值、数量):.collect(Collectors.summarizingDouble(Employee::getSalary)); 分组:.collect(Collectors.groupingBy(Employee1::getStatus)); 多级分组:Collectors.groupingBy(Employee1::getStatus, Collectors.groupingBy()。 分区:.collect(Collectors.partitioningBy((e) -> e.getSalary() >= 5000)); joining: .collect(Collectors.joining(“,”, “----”, “----”));
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Employee1 {
    private int id;
    private String name;
    private int age;
    private double salary;
    private Status status;

    public enum Status {
        FREE, BUSY, VOCATION;
    }
}
List<Employee1> empss = Arrays.asList(
        new Employee1(102, "李四", 59, 6666.66, Employee1.Status.BUSY),
        new Employee1(101, "张三", 18, 9999.99, Employee1.Status.FREE),
        new Employee1(103, "王五", 28, 3333.33, Employee1.Status.VOCATION),
        new Employee1(104, "赵六", 8, 7777.77, Employee1.Status.BUSY),
        new Employee1(104, "赵六", 8, 7777.77, Employee1.Status.FREE),
        new Employee1(104, "赵六", 8, 7777.77, Employee1.Status.FREE),
        new Employee1(105, "田七", 38, 5555.55, Employee1.Status.BUSY)
);

1.4.1allmatch、anyMatch、noneMatch、max、min
 @Test
    public void test10() {
        //返回false ,并不是匹配所有元素
        boolean bl = empss.stream()
                .allMatch((e) -> e.getStatus().equals(Employee1.Status.BUSY));
        System.out.println(bl);

//true,有这个样的元素
        boolean bl1 = empss.stream()
                .anyMatch((e) -> e.getStatus().equals(Employee1.Status.BUSY));

        System.out.println(bl1);

        //没有匹配元素 false
        boolean bl2 = empss.stream()
                .noneMatch((e) -> e.getStatus().equals(Employee1.Status.BUSY));
        System.out.println(bl2);

//得到最大值
        Optional<Double> max = emps.stream().map(Employee::getSalary)
//                .max(Double::compare);
        .max((v1,v2)->Double.compare(v1,v2));
      // .max((v1,v2)->v1.compareTo(v2));  
      System.out.println(max.get());

//得到最小值,的成员
        Optional<Employee> min = emps.stream().min((v1, v2) -> Double.compare(v1.getSalary(), v2.getSalary()));
        System.out.println(min.get());

//得到薪水的最小值,把薪水通过map映射出来
        Optional<Double> min1 = emps.stream().map(item -> item.getSalary()).min(Double::compare);
        System.out.println(min1.get());
    }

1.4.2reduce
  @Test
    public void test20() {
        List<Integer> list = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);

        /**
         * x=0,y=1,x=x+y=1
         * x=1 y=2 x=x+y=3
         * ...........
         */
        Integer sum = list.stream()
                .reduce(0, (x, y) -> x + y);
        System.out.println(sum);


        System.out.println("----------------------------------------");

        Optional<Double> op = emps.stream()
                .map(Employee::getSalary)
                .reduce(Double::sum);
        System.out.println(op.get());


        System.out.println("====");
        double identity = 0.0;
        double d = emps.stream().map(Employee::getSalary)
                .reduce(identity, (x, y) -> x + y);
        System.out.println(d);

        //为什么这个是optional  因为可能为空,而上面那个为什么不是?因为有初始值,所以即使你传入的为null,但结果也不会为空。
        Optional<Double> reduce = emps1.stream().map(Employee::getSalary).filter(item -> {
                    System.out.println("item" + item);
                    boolean equals = item == null;
                    return !equals;
                })
                .reduce(Double::sum);
        //如果上面为null的话,下面可以使用这个变成null。如果有值还会删除你的结果的。
        System.out.println(reduce.orElse(null));

/**
 * itemnull
 * itemnull
 * null
 */
    }

1.4.3 collect
 @Test
    public void test21() {
//        把名字收集到list中去
        List<String> list = emps.stream()
                .map(Employee::getName)
                .collect(Collectors.toList());

        list.forEach(System.out::println);

        System.out.println("----------------------------------");
//        把名字收集到set中去
        Set<String> set = emps.stream()
                .map(Employee::getName)
                .collect(Collectors.toSet());

        set.forEach(System.out::println);

        System.out.println("----------------------------------");

        //把名字放到hashset中去
        HashSet<String> hs = emps.stream()
                .map(Employee::getName)
                .collect(Collectors.toCollection(HashSet::new));
        hs.forEach(System.out::println);
    }


    @Test
    public void test22() {

        Optional<Double> max = emps.stream()
                .map(Employee::getSalary)
                .collect(Collectors.maxBy(Double::compare));
        //如果上面为空的话就为null,不为空就为  计算的值
        /**
         * 结果
         * 9999.99
         * 9999.99
         */
        System.out.println(max.orElse(null));
        System.out.println(max.get());


        Optional<Employee> op = emps.stream()
                .collect(Collectors.minBy((e1, e2) -> Double.compare(e1.getSalary(), e2.getSalary())));

        System.out.println(op.get());


        //总薪水
        Double sum = emps.stream()
                .collect(Collectors.summingDouble(Employee::getSalary));
        System.out.println(sum);


        //平均值
        Double avg = emps.stream()
                .collect(Collectors.averagingDouble(Employee::getSalary));
        System.out.println(avg);

        //总数
        Long count = emps.stream()
                .collect(Collectors.counting());

        System.out.println(count);

        System.out.println("--------------------------------------------");

        DoubleSummaryStatistics dss = emps.stream()
                .collect(Collectors.summarizingDouble(Employee::getSalary));

        System.out.println(dss.getMax());
    }


 //计算薪水总和,里面能得到一系列的东西。总函数的形式
    @Test
    public void test28() {

        DoubleSummaryStatistics statistics = emps.stream()
                .collect(Collectors.summarizingDouble(Employee::getSalary));
        System.out.println(statistics.getMax());
        System.out.println(statistics.getAverage());
        System.out.println(statistics.getCount()
        );
        System.out.println(statistics.getMin());
        System.out.println(statistics.getSum());


        IntSummaryStatistics summaryStatistics = emps.stream().collect(Collectors.summarizingInt(Employee::getAge));

//        Collectors.summarizingDouble(Employee::getSalary);
//        System.out.println(sum.get());
    }


 //分组
    @Test
    public void test23() {
        Map<Employee1.Status, List<Employee1>> map = empss.stream()
                .collect(Collectors.groupingBy(Employee1::getStatus));
        System.out.println(map);

//        遍历hashmap
        map.forEach((key, value) -> {
            System.out.println("key" + key + "======value" + value);
        });
    }


    //多级分组
    @Test
    public void test27() {
        Map<Employee1.Status, Map<String, List<Employee1>>> map = empss.stream()
                .collect(Collectors.groupingBy(Employee1::getStatus, Collectors.groupingBy((e) -> {
                    if (((Employee1) e).getAge() >= 60) {
                        return "老年";
                    } else if (((Employee1) e).getAge() >= 35) {
                        return "中年";
                    } else {
                        return "成年";
                    }

                })));

        System.out.println(map);
    }


    //分区
    @Test
    public void test24() {
        Map<Boolean, List<Employee>> map = emps.stream()
                .collect(Collectors.partitioningBy((e) -> e.getSalary() >= 5000));
        System.out.println(map);
    }

    //收集名字,分割,添加前后缀
    @Test
    public void test25() {
        String str = emps.stream()
                .map(Employee::getName)
                .collect(Collectors.joining(",", "----", "----"));

        System.out.println(str);
    }

    //计算薪水总和。
    @Test
    public void test26() {
        Optional<Double> sum = emps.stream()
                .map(Employee::getSalary)
                .collect(Collectors.reducing(Double::sum));
        //结果保存小数点后保存两位
        System.out.println(sum.get().floatValue());
    }


    //计算薪水总和,里面能得到一系列的东西。总函数的形式
    @Test
    public void test28() {

        DoubleSummaryStatistics statistics = emps.stream()
                .collect(Collectors.summarizingDouble(Employee::getSalary));
        System.out.println(statistics.getMax());
        System.out.println(statistics.getAverage());
        System.out.println(statistics.getCount()
        );
        System.out.println(statistics.getMin());
        System.out.println(statistics.getSum());


        IntSummaryStatistics summaryStatistics = emps.stream().collect(Collectors.summarizingInt(Employee::getAge));

//        Collectors.summarizingDouble(Employee::getSalary);
//        System.out.println(sum.get());
    }


1.4.5 将名字拼接起来
@Test
public void test29(){
    String collect = emps.stream().map(Employee::getName)
            .distinct()
            .sorted()
            .collect(Collectors.joining(" "));
    System.out.println(collect);
}
//第二种方法:

  //使用计算的形式,如果没有起始值,不知道加起来的值是字符串还是什么。如果没有起始值需要强制转换一下
        String reduce1 = emps.stream().map(Employee::getName).distinct().sorted()
                .reduce("", String::concat);
        System.out.println(reduce1);



结果 张三李四王五田七赵六

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

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

相关文章

前端开发中,定位bug的几种常用方法

目录 第一章 前言 第二章 解决bug的方法 2.1 百度 2.2 有道翻译 2.3 debugger 2.4 console.log 日志打印 2.5 请求体是否携带参数 2.6 注释页面渲染代码 2.7 其他 第三章 尾声 备注&#xff1a;该文章只是本人在工作/学习中常用的几种方法&#xff0c;如果有不对大家…

朋友去华为面试,轻松拿到30K的Offer,羡慕了......

最近有朋友去华为面试&#xff0c;面试前后进行了20天左右&#xff0c;包含4轮电话面试、1轮笔试、1轮主管视频面试、1轮hr视频面试。 据他所说&#xff0c;80%的人都会栽在第一轮面试&#xff0c;要不是他面试前做足准备&#xff0c;估计都坚持不完后面几轮面试。 其实&…

第四十六章 Unity 布局(上)

学习了UI元素的使用&#xff0c;并不能构建出一个完整的UI界面&#xff0c;我们需要使用一些方法将这些UI元素按照“设计稿”的效果&#xff0c;将其摆放到对应的位置上。如何摆放这些UI元素&#xff0c;就是我们需要讲的“布局”&#xff0c;当然这需要借助一些布局组件来完成…

毕业论文相关

毕业论文参考文献和Word保存 一、Word中出现[7-9]多个文献的引用 在正文中选中参考文献角标&#xff0c;右击选择“切换域代码”&#xff0c;参考文献角标[7][8][9]变为{ REF _Ref98345319 \r \h * MERGEFORMAT }{ REF _Ref98345321 \r \h * MERGEFORMAT }{ REF _Ref99390603…

第5章 负载均衡

第5章 负载均衡 5.1 proxy_pass详解 在nginx中配置proxy_pass代理转发时&#xff0c;如果在proxy_pass后面的url加/&#xff0c;表示绝对根路径&#xff1b;如果没有/&#xff0c;表示相对路径&#xff0c;把匹配的路径部分也给代理走。 假设下面四种情况分别用 http://192.…

Java并发编程实践学习笔记(三)——共享对象之发布和异常

目录 1 公共静态变量逸出 2 非私有方法逸出私有变量 3 this引用逸出 4 构造函数中的可覆盖方法调用逸出 发布&#xff08;publishing&#xff09;一个对象的意思是&#xff1a;使对象能够在当前作用域之外的代码中使用。例如&#xff0c;将一个指向该对象的引用保存到其他代…

InnoDB线程模型

新版本结构演变 MySQL 5.7 版本 将 Undo日志表空间从共享表空间 ibdata 文件中分离出来&#xff0c;可以在安装 MySQL 时由用户自行指定文件大小和数量增加了 temporary 临时表空间&#xff0c;里面存储着临时表或临时查询结果集的数据Buffer Pool 大小可以动态修改&#xff0…

你不知道的自动化?使用自动化测试在项目中创造高业务价值...

目录&#xff1a;导读 前言一、Python编程入门到精通二、接口自动化项目实战三、Web自动化项目实战四、App自动化项目实战五、一线大厂简历六、测试开发DevOps体系七、常用自动化测试工具八、JMeter性能测试九、总结&#xff08;尾部小惊喜&#xff09; 前言 脱离数据支撑谈价…

GRPC - JAVA笔记

GRPC - JAVA笔记 gRPC简介 由google开源的一个高性能的RPc框架&#xff0c;由google内部的Stubby框架演化而来。2015年正式开源。云原生时代的RPC标准&#xff0c;由Go语言开发 gRPC的核心设计思路 网络通信 ------> gRPC 自己封装了网络通信的部分&#xff0c;提供了多种…

VS2022编译libiconv-1.17

需求概述 获得最新版本的windows下可用的libiconv静态库。 解决方案 概述 使用VS2022编译libiconv-1.17。需要对源码手动进行配置。 本文所述的方法同样适用于动态库&#xff0c;并且理论上适用于VS2010~2022所有版本。 如果你不在乎libiconv的版本&#xff0c;可以参考 …

Redis缓存

就先不连接数据库了 我们测试缓存 实体类&#xff1a; Data AllArgsConstructor NoArgsConstructor public class User implements Serializable {private int id;private String name;private String sex;private String addr; } service&#xff1a; Service public…

小家电LED显示驱动多功能语音芯片IC方案 WT2003H4 B002

随着时代的进步&#xff0c;智能家电的普及已经成为了一个趋势。而在智能家电中&#xff0c;LED显示屏也成为了不可或缺的一部分。因此&#xff0c;在小家电的设计中&#xff0c;LED显示驱动芯片的应用也越来越广泛。比如&#xff1a;电饭煲、电磁炉、数字时钟、咖啡机、电磁炉…

java版spring cloud 企业电子招投标采购系统源码之首页设计

随着公司的快速发展&#xff0c;企业人员和经营规模不断壮大&#xff0c;公司对内部招采管理的提升提出了更高的要求。在企业里建立一个公平、公开、公正的采购环境&#xff0c;最大限度控制采购成本至关重要。符合国家电子招投标法律法规及相关规范&#xff0c;以及审计监督要…

“正大杯”第十三届市场调查与分析大赛[省一]经验总结+复盘

目录 1 前期组队 2 队员组成 队长-成员1 应用统计学专业 成员2 化学实验专业 成员3-本人 物联网工程专业 成员4 金融ACCA专业 成员5 应用物理学 总结 3 比赛进度 3月中旬 部分图表的制作 问卷设计与制作 稍微改动主题 问卷相关总结 前期调查部分论文框架 3月…

怎么把webp文件转换为jpg?这几种方法值得学习!

怎么把webp文件转换为jpg&#xff0c;我想这样的问题对于那些和图片打交道不多的人来说确实有些困难吧。在我们要处理这个问题之前&#xff0c;我们先来了解一下图片格式webp吧。要是知道Youtube、Gmail、Google Play 中都可以看到 WebP 的身影&#xff0c;而 Chrome 网上商店甚…

高阶python | 堆栈列表:RPN应用(模拟逆波兰式功能实现)

python版本&#xff1a;3.10 在列表中&#xff0c;append和pop方法有一个特殊的用途。可以在列表上使用这两个方法让列表变成一个堆栈使用。 这就是一个栈&#xff0c;它是先进后出&#xff0c;类似单门轿厢电梯一样的设计&#xff0c;出入口共用 堆栈最有用的应用之一就是做逆…

如何解决请求参数为JSON时,采用IO流读取,只能请求一次的问题?

如何解决请求参数为JSON时&#xff0c;采用IO流读取&#xff0c;只能请求一次的问题&#xff1f; 一、错误演示1. 创建项目&#xff0c;添加所需依赖2. 配置redis环境3. 写一个简单的测试请求4. 写一个拦截器&#xff0c;拦截请求5. WebConfig 注册拦截器6. 测试请求 二、问题解…

VR全景园区:数字化旅游业的新未来

VR全景园区是未来数字化旅游业的一种新兴形式。它利用高清晰度的3D图像和360度全景拍摄技术&#xff0c;将景区中的自然风光、历史文化和人文风情等元素呈现在游客面前。VR全景园区不仅可以为游客提供身临其境的参观体验&#xff0c;还可以有效地推广当地的文化和旅游资源。 【…

调试和优化遗留代码

1. 认识调试器 1.1 含义 一个能让程序运行、暂停、然后对进程的状态进行观测甚至修改的工具。 在日常的开发当中使用非常广泛。(PHP开发者以及前端开发者除外) 1.2 常见的调试器 Go语言的自带的 delve 简写为 “dlv”GNU组织提供的 gdbPHP Xdebug前端浏览器debug 调试 1.3…

English Learning - L3 作业打卡 Lesson2 Day8 2023.5.12 周五

English Learning - L3 作业打卡 Lesson2 Day8 2023.5.12 周五 引言&#x1f349;句1: The color green is natural for trees and grass.成分划分弱读语调 &#x1f349;句2: But it is an unnatural color for humans.成分划分弱读连读语调 &#x1f349;句3: A person who h…