ICode9

精准搜索请尝试: 精确搜索
  • Cannot convert from an IEnumerable<T> to an ICollection<T>2022-09-08 15:30:09

    Cannot convert from an IEnumerable<T> to an ICollection<T> I have defined the following: public ICollection<Item> Items { get; set; } When I run this code: Items = _item.Get("001"); I get the following message: Error 3 Ca

  • C#中Linq常用用法2022-08-28 21:02:19

    1、linq中交集、并集、差集的用法 简单的交集、并集、差集用法如下: List<string> ListA = new List<string>(); List<string> ListB = new List<string>(); List<string> ListResult = new List<string>(); ListResult = ListA.Distinct().ToList();//去重 ListResul

  • java8从集合中查找对象的属性 + 集合筛选功能2022-07-29 10:35:20

    // 根据流程实例ID查询已经撤销的流程 List<String> processInstanceIds = models.stream().map(ProcessForLineScreenResponse::getInstanceId).collect(Collectors.toList()); if (processInstanceIds.size() > 0) { List<String> ids

  • java8新特性之List处理2022-07-13 09:03:06

      1.集合中获取指定的一个属性值 List<String> items = li.stream().map(ScdCostChargeItemEntity::getItem).collect(Collectors.toList()); 2.集合分组 Map<String, List<T>> yearData = allData.stream().collect(Collectors.groupingBy(T::getYear)); 2.集合过滤筛选(单条

  • java8实战:使用流收集数据之toList、joining、groupBy(多字段分组)2022-07-10 02:32:44

    java8专栏目录:java8实战读书笔记:Lambda表达式语法与函数式编程接口java8实战读书笔记:复合Lambda表达式java8实战读书笔记:初识Stream、流的基本操作(流计算)java8实战读书笔记:数值流、Stream创建与Optional类的使用java8读书笔记:探究java8流收集数据原理本文将从Collectos中构建收集

  • Java Stream Collectors的toList()、toSet()、toCollection()和toMap()的使用2022-06-21 21:32:01

    Stream是Java 8的新特性,基于lambda表达式,是对集合对象功能的增强,它专注于对集合对象进行各种高效、方便聚合操作或者大批量的数据操作,提高了编程效率和代码可读性。Collectors通常在Stream处理后,返回转换成集合类时使用,本文主要介绍Java Stream中Collectors.toList()、Collectors.

  • java ListMap排序2022-06-19 14:02:41

    list.stream().sorted(Comparator.comparing(map -> Integer.parseInt(map.get("monthtime").toString()))).collect(Collectors.toList()); List<Map<String, Object>> lista = list.stream().sorted(Comparator.comparing(map -> Integer.pars

  • 简述Linq中.ToList(), .AsEnumerable(), AsQueryable()的区别和用法2022-06-17 10:32:31

    简述Linq中.ToList(), .AsEnumerable(), AsQueryable()的区别和用法 标签: blog   目录 简述Linq中.ToList(), .AsEnumerable(), AsQueryable()的区别和用法 AsQueryable() lazy load 特性 显式调用 AsQueryable()? IQueryable的限制 AsEnumerable() 同样支持 lazy load,

  • PostgreSQL Array 数组类型与 FreeSql 打出一套【组合拳】2022-06-07 13:33:05

    前言 PostgreSQL 是世界公认的功能最强大的开源数据库,除了基础数据类型 int4/int8/varchar/numeric/timestamp 等,还支持 int4[]/int8[]/varchar[]/numeric[]/timestamp[] 数组类型、hstore 类型(类似 c# Dictionary<string, string>)、gis 类型。 选择一项技术一定是可以帮助我们提

  • 【Spring Boot】autoconfigure模块2022-06-05 19:34:56

      springboot 实现了根据classpath下依赖内容自动配置bean到IOC容器,----》Auto configuration(自动配置) Springboot可以完美配置各种Spring子项目,如Spring mvc,security、data。。。。 springboot auto configuration会尝试推断哪些bean是用户需要的,并进行初始化   Auto configura

  • FreeSql学习笔记——8.数据返回类型2022-05-26 17:31:57

    前言   FreeSql数据返回格式比较丰富,包括单条、列表、导航属性数据、指定字段、Dto等;可以有效的减少代码量,减少字段复制等操作;   前面的查询已经用到了日常基本需要用到的数据格式,本篇是常用格式的总结;   数据格式   首先是最简单的查询单条数据,FreeSql提供了两个获取单条

  • [C#] 多分隔符文本分割2022-05-04 08:32:07

    1 string s = "1,\r\n2,\r\n3,\r\n"; 2 s.Replace(",", "").Replace("\r", "").Split('\n').ToList(); //结果 : [1,2,3,"&quo

  • jdk1.8 新特性_Steam22022-04-27 16:01:18

    jdk 1.8 Stream 使用 主要有如下几种场景: 1、group by (分组) 2、order by (排序) 3、where (筛选) 4、distinct (去重) 5、appLy (根据某个属性进行各种操作) 6、提取某个属性为列表 2.1、group by 根据性别进行分组 userList.stream() .collect(Coll

  • C# list去重合并查找2022-04-19 10:36:28

    1 List<int> listA = new List<int> { 1, 2, 3, 5, 7, 9 }; 2 List<int> listB = new List<int> { 2,3,88 }; 3 //合并 4 listA.AddRange(listB); 5

  • 比较爽的导航查询 功能 - SqlSugar ORM2022-04-14 02:03:35

    1、导航查询特点 作用:主要处理主对象里面有子对象这种层级关系查询 1.1 无外键开箱就用 其它ORM导航查询 需要 各种配置或者外键,而SqlSugar则开箱就用,无外键,只需配置特性和主键就能使用 1.2 高性能优   查询 性能非常强悍    支持大数据分页导航查询 3.3 语法超级爽 注意:多级

  • Java对象类型集合单独取出对象中一个属性成为集合或数组2022-04-13 13:02:45

        集合 List<DictEntity> dictEntityList = dictService.findByType(6);1取出属性为集合 List<String> stateNameList = dictEntityList.stream().map(DictEntity::getName).collect(Collectors.toList());1取出属性为数组 Long[] ids = dictEntityList.stream().map(DictEnti

  • Stream.map方法2022-03-19 12:36:17

    map 方法用于映射每个元素到对应的结果 map方法一般写法如下: //提取对象中的姓名一列的数据List<String> idcards= students.stream().map(Student::getName).collect(Collectors.toList())//对集合中的字符转换为大写List<String> list= Arrays.asList("a", "b", "c", "d&quo

  • 数据可视化之二手房数据实战(一)2022-03-10 12:33:46

    1、导包 import pandas as pd from pyecharts.charts import Bar, Pie, Map, Line, Scatter from pyecharts import options as opts from pyecharts.render import make_snapshot from snapshot_selenium import snapshot from pyecharts.globals import CurrentConfig 2、读取

  • 绘制双子图含图例完整代码2022-02-27 20:02:13

    import matplotlib.pyplot as plt from matplotlib import ticker import seaborn as sns import pandas as pd import numpy as np plt.style.use('ggplot') # fig, ax = plt.subplots(1,len(scenarios), figsize=(25,4.5)) # plt.show() # colors = ["#46

  • stream()流式算法2022-02-16 22:33:14

    java8的流式处理极大的简化了对于集合的操作,实际上不光是集合,包括数组、文件等,只要是可以转换成流,我们都可以借助流式处理,类似于我们写SQL语句一样对其进行操作。java8通过内部迭代来实现对流的处理,一个流式处理可以分为三个部分:转换成流、中间操作、终端操作 关于list.stream().m

  • List<Integer>里有可能存String类型元素吗?2022-01-30 10:34:13

    这其实是我遇到的一个线上bug,在这里分享给大家。 如果是用反射,那就很简单了,毕竟泛型只是在编译期进行约束,对运行期是无能为力的。 想想看,如果不使用反射,有没有办法做到呢? 问题起因 在我们公司的实际业务中,有一段类似于这样逻辑的代码,文章最后会放出做测试构造的getList()方法:

  • List分段2022-01-26 16:05:31

    private static <T> List<List<Wuzicaigoujihuamingxi>> splitList(List<Wuzicaigoujihuamingxi> collection, int splitSize) { if(CollectionUtils.isEmpty(collection)) { return Collections.emptyList(); } int maxSize = collection.s

  • python 列表叠加:2022-01-25 13:05:26

    2022-01-25,12点28 python 列表叠加:https://blog.csdn.net/pzl_pzl/article/details/106236676 a=[[1,2],[2,3]]sum(a.tolist()) #报错,因为默认sum是对0求和sum(a.tolist(),[]) # 返回 [1,2,2,3] 表示sum对[]进行求和操作,每一次抽取前面迭代器a.tolist()里面的一个元素加上去.

  • pandas2022-01-25 11:58:39

    Pandas的NaN和numpy的np.nan是一回事 创建Series Series是带标签的一维数组,Dataframe是Series的二维容器 import pandas as pd t = pd.Series([1,1,1,1,1], index=...) t.astype(float) for i in t.index: print(i) type(t.index) >>> pandas.indexes.base.Index type(t.v

  • list.stream().map().collect(Collectors.toList())2022-01-22 14:34:39

    java api 特性 stream只能被“消费”一次,一旦遍历过就会失效,就像容器的迭代器那样,想要再次遍历必须重新生成 map():用于映射每个元素到对应的结果。 filter():filter 方法用于通过设置的条件过滤出元素。 Collectors.toList() 用来结束Stream流 例如: //userList User实体类对象

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有