SpringBoot项目如何从配置文件引入Map结构配置

  • Post author:
  • Post category:其他

方案一:使用@Value注解 配置文件yaml test: map: '{"k1":"v1","k2":"v2"}' Java @Value("#{${test.map:{}}}") public Map<String,String> testMap1; 方案二:配置类 配置文件yaml test: map: k1: v1 k2: v2 Java配置类 @Data @Configura…

继续阅读 SpringBoot项目如何从配置文件引入Map结构配置

SpringBoot关于自动注入mapper为空的坑

  • Post author:
  • Post category:其他

目录 1、初始环境 配置类 启动类 mapper接口 目录 2、测试 Test1 Test2 测试类 结果 3、总结 1、初始环境 配置类 package com.sofwin.yygh.config; import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; import org.mybatis.spring…

继续阅读 SpringBoot关于自动注入mapper为空的坑

iOS多线程中的dispatch_semaphore_t

  • Post author:
  • Post category:其他

void dispatch_apply(size_t iterations, dispatch_queue_t queue, void (^block)(size_t)); //重复执行block,需要注意的是这个方法是同步返回,也就是说等到所有block执行完毕才返回,如需异步返回则嵌套在dispat void dispatch_apply(size_t iterations, dispatch…

继续阅读 iOS多线程中的dispatch_semaphore_t

hive优化参数map,reduce优化

  • Post author:
  • Post category:其他

目录 har小文件归档 hive调优参数 hive 调优 扩展优化 动态分区属性 数据建模 维度建模 硬刚Hive | 4万字基础调优面试小总结 - 知乎 (zhihu.com) har小文件归档 --用来控制归档是否可用 set hive.archive.enabled=true; --通知Hive在创建归档时是否可以设置父目录 set hive.archive.har.parentdir.se…

继续阅读 hive优化参数map,reduce优化

mappedBy reference an unknown target entity property

  • Post author:
  • Post category:其他

mappedBy reference an unknown target entity property: com.chinacache.oss.entity.resource.ChannelSmsUpStreamToIp.channelSmsUpStream in com.chinacache.oss.entity.resource.ChannelSmsUpStream.channelSmsUp…

继续阅读 mappedBy reference an unknown target entity property

解决WARN:Skipping MapperFactoryBean with name ‘xxxBeanMapper‘ and ‘com.xxx.xxxMapper‘ mapperInterface

  • Post author:
  • Post category:其他

问题描述 报错信息:Skipping MapperFactoryBean with name ‘xxxMapper’ and ‘xxx.xxx.xxx.mapper.xxxxxMapper’ nterface. Bean already defined with the same name! 项目启动时控制台打印出以下WARN 日志,Bean already defined with the sa…

继续阅读 解决WARN:Skipping MapperFactoryBean with name ‘xxxBeanMapper‘ and ‘com.xxx.xxxMapper‘ mapperInterface

ArrayList 和 HashMap 的默认大小是多数?

  • Post author:
  • Post category:其他

今天继续分享一道Java经典面试题(前几天没有更新 楼主出去玩了,滑稽!) 看到这样的一道Java面试题: ArrayList 和 HashMap 的默认大小是多数? 在 Java 7 中,ArrayList 的默认大小是 10 个元素,HashMap 的默认大小是16个元素(必须是2的幂)。这就是 Java 7 中 ArrayList 和 HashMap  类 的代码片段: 1 2 3 4 5 …

继续阅读 ArrayList 和 HashMap 的默认大小是多数?

【回顾】HashMap的重要性

  • Post author:
  • Post category:其他

为什么在面试中会深入考察HashMap? Java工程师需要通过写Java代码,来实现一些逻辑的运转, 比如: 后端接收到一个请求,可能会创建一些数据结构,来存放一些数据,做一些循环、跳转、判断、加加减减之类的数据处理工作,通过一大堆的逻辑处理,完成系统或软件的一些功能。 在完成这些逻辑处理的过程中,可能会不可避免的涉及到HashMap这一数据结构,使用HashMap进行一定的逻辑的处理。 总结 …

继续阅读 【回顾】HashMap的重要性

Android中百度地图计算MapView任意位置的经纬度

  • Post author:
  • Post category:其他

SDK版本:3.2.0 百度地图sdk只提供了直接获取MapView中心点经纬度的方法,求其他地方的经纬度要自己算。获取任一点经纬度的方法为: mMap.getProjection().fromScreenLocation(new Point(x, y)); 计算的准不准看一下就知道啦~这里用直接获取到的中心点的经纬度和通过上面方法获取到的对比一下。 获取中心点经纬度的方法为: mMap = mM…

继续阅读 Android中百度地图计算MapView任意位置的经纬度

记一次byte[]和Bitmap的转换问题

  • Post author:
  • Post category:其他

在利用Socket传输图片的时候,用到了byte[]和Bitmap的相互转换。 问题是这样的:首先将自己的Bitmap转换为byte[]传给对方,而对方在收到byte[]后转换为Bitmap,但是明明自己的Bitmap不为null,而对方转换后的Bitmap却为null。我就去找原因,刚好看到有篇文章说这样将byte[]转为Bitmap有问题 return BitmapFactory.decode…

继续阅读 记一次byte[]和Bitmap的转换问题