统计目录下java代码行数
发表于|更新于
|浏览量:
画画用的是脑筋,而不是双手。——米开朗基罗
例如
1 | find /Users/achao/IdeaProjects/ -name "*.java" | xargs wc -l |
即可
相关推荐
2024-01-11
ClassPathResource踩坑
不要对一切人都以不信任的眼光看待,但要谨慎而坚定。——德谟克里特 今天看到一个问题 12345678910111213static { try { ClassPathResource resource = new ClassPathResource("ip2region.xdb"); //获取真实文件路径 String path = resource.getURL().getPath(); byte[] cBuff = Searcher.loadContentFromFile(path); SEARCHER = Searcher.newWithBuffer(cBuff); log.info("加载了ip2region.xdb文件,Searcher初始化完成!"); } catch (Exception e) { log.error("初始化ip2region.xdb文件失败,报错...
2020-11-17
Stream流の二维数组List<List>互转
少而好学,如日出之阳;壮而好学,如日中之光;老而好学,如炳烛之明。一一刘向 数组转List<List<Integer>> 1List<List<Integer>> collect = Arrays.stream(array).map(a1 -> Arrays.stream(a1).boxed().collect(Collectors.toList())).collect(Collectors.toList()); List<List<Integer>>转int[][] 1array = collect.stream().map(integers -> integers.stream().mapToInt(value -> value).toArray()).toArray(int[][]::new); 二维数组和List<List<Integer>>之间的转换使用stream的话就非常简单了 12345678910int[][] array = new in...
2024-07-10
Mybatis在Mapper上加注解关闭二级缓存
久视伤血,久卧伤气,久坐伤肉,久立伤骨,久行伤筋。——曹廷栋 代码如下 12345678910111213import org.apache.ibatis.annotations.CacheNamespace;import org.apache.ibatis.annotations.Select;import org.apache.ibatis.annotations.Mapper;import org.apache.ibatis.cache.impl.PerpetualCache;@Mapper@CacheNamespace(implementation = PerpetualCache.class, blocking = false)public interface MyMapper { @Select("SELECT * FROM my_table WHERE id = #{id}") MyEntity selectById(int id);} 上使用@CacheNamespace注解,并将imp...
2022-05-16
r2dbc
青春是有限的,智慧是无穷的,趁短的青春,去学习无穷的智慧。——高尔基 今天看了点R2DBC,官网:https://r2dbc.io/ Spring-Data-R2dbc:https://spring.io/projects/spring-data-r2dbc 学习文档:https://docs.spring.io/spring-data/r2dbc/docs/current/reference/html/ 跑了下demo,感觉还不错:https://gitee.com/VampireAchao/simple-r2dbc.git
2023-09-23
sms4j对接阿里云短信
迷信、愚昧和虚伪腰缠万贯,但真理一直是一个乞丐。——马丁·路德 开通服务:新手指引_短信服务-阿里云帮助中心 首先安装: 12345<dependency> <groupId>org.dromara.sms4j</groupId> <artifactId>sms4j-spring-boot-starter</artifactId> <version>${sms4j.version}</version></dependency> 然后配置: 12345678910111213141516171819202122232425sms: # 标注从yml读取配置 config-type: yaml is-print: false blends: # 自定义的标识,也就是configId这里可以是任意值(最好不要是中文) aliyun: # 厂商标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分 supplie...
2021-04-27
@SneakyThrows
好的木材并不在顺境中生长;风越强,树越壮。——(英)马里欧特 我们有时候会把一些受检异常try catch掉 例如 但我们每次都这么写 12345try { String encode = URLEncoder.encode("阿巴阿巴阿巴阿巴", "UTF-8");} catch (UnsupportedEncodingException e) { e.printStackTrace();} 会导致代码很臃肿 如果我们使用了lombok 可以直接在方法上加个@SneakyThrows注解 简洁多了

阿超
我的名字叫阿超 年龄25岁 家在北京市 职业是软件开发 每天最晚也会在八点前回家 不抽烟 酒浅尝辄止 晚上十二点上床 保证睡足八个小时 睡前写一篇博客 再做二十分钟俯卧撑暖身 然后再睡觉 基本能熟睡到天亮 像婴儿一样不留下任何疲劳和压力 就这样迎来第二天的早晨 健康检查结果也显示我很正常 我想说明我是一个不论何时都追求内心平稳的人 不拘泥于胜负 不纠结于烦恼 不树立使我夜不能寐的敌人 这就是我在这社会的生活态度
Follow Me公告
This is my Blog