kanpiaoxue
kanpiaoxue · 共 723 篇文章
域名解析网址
很多网址由于地址被挂载了钩子而无法被正常访问,可以通过下面的域名解析找到正确的IP地址,然后在本地电脑的hosts文件里面重新指定域名和ip地址的映射,即可正常访问。 域名解析网址 : https://www.ipaddress.com/
swagger生成javaAPI的server&client代码
文章原文: 《Spring Boot: API First Approach》: https://dzone.com/articles/spring-boot-api-first-approach?edition=664392 提到的工具: 1、 https://editor.swagger.io/ 2、 https://openapi-generator.tech/ I describe how I created the API definition, then how I created the server and client code from the API definitio…
2021-03-25 11:05 · java · Spring · 经验 · api · springboot · open api · 评论(0)
springboot 返回JSON日期格式问题
springboot返回的时间格式,根据版本的不同,可能返回时间戳,还可能返回UTC时间格式。 如: "createTime": 1537407384500 或者 "createTime": "2018-09-18T10:54:06.000+0000" 如何定制化springboot返回的时间格式呢? 修改 application.properties/yml 里面的配置即可。 spring: jackson: date: yyyy-MM-dd HH:mm:ss time-zone: GMT+8 serialization: write-dates-as-timestamps: false …
2021-03-24 16:36 · java · Spring · 经验 · springboot · 评论(0)
在其他项目中如何依赖一个springboot的jar?
资料:How to add a dependency to a Spring Boot Jar in another project? 地址: https://stackoverflow.com/questions/40089443/how-to-add-a-dependency-to-a-spring-boot-jar-in-another-project 原文: By default, Spring Boot repackages your JAR into an executable JAR, and it does that by putting all of your classe…
2021-03-17 16:08 · java · Spring · 经验 · springboot · 评论(0)
指定java stream中并行处理的线程池大小
Java8实战:并行线程池 写道 并行流内部使用了默认的ForkJoinPool,它默认的 线程数量就是你的处理器数量,这个值是由Runtime.getRuntime().availableProcessors()得到的。 但是你可以通过系统属性 java.util.concurrent.ForkJoinPool.common.parallelism 来改变线程池大小,如下所示: System.setProperty("java.util.concurrent.ForkJoinPool.common.parallelism","12"); 这是一个全局设置,因此它将影响代码中所有的并行流。反…
Can we disable the default web server in the Spring Boot application?
The major strong point in Spring is to provide flexibility to build your application loosely coupled. Spring provides features to disable the web server in a quick configuration. Yes, we can use the application.properties to configure the web application type, i.e. spring.main.web-application-type=…
2021-02-22 11:07 · java · Spring · 经验 · springboot · 评论(0)
Java 8 Comparator: How to Sort a List
文章地址: https://dzone.com/articles/java-8-comparator-how-to-sort-a-list In this article, we’re going to see several examples on how to sort a List in Java 8. Sort a List of Strings Alphabetically 1 List<String> cities = Arrays.asList( 2 "Milan", 3 "london", 4 "San Francisco", 5 "Tokyo", 6 "New Delhi"…
Java Getter and Setter: Basics, Common Mistakes, and Best Practices
文章地址: https://dzone.com/articles/java-getter-and-setter-basics-common-mistakes-and Getter and setter are widely used in Java. It is seemingly simple, but not every programmer understands and implements this kind of method properly. So in this article, I would like to deeply discuss getter and sette…
Java String Format Examples
参考资料地址: 文章地址: https://dzone.com/articles/java-string-format-examples jdk API地址: https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html Have you tried to read and understand Java’s String format documentation ? I have and found it nearly impenetrable. While it does include all the inform…
位运算&位掩码示例(权限)
参考资料地址: 1、 https://juejin.cn/post/6844903909333401607 2、 https://www.jianshu.com/p/78a984173985 3、【精华】《位运算(位掩码BitMask)的简单应用场景浅析》 https://www.jianshu.com/p/78a984173985 位掩码示例: import org.apache.commons.lang3.StringUtils; import com.google.common.collect.Lists; import java.util.Arrays; import java.ut…
docker容器在系统启动的时候自动启动
Yes, docker has restart policies such as docker run --restart=always that will handle this. This is also available in the compose.yml config file as restart: always . 参考资料: https://stackoverflow.com/questions/30449313/how-do-i-make-a-docker-container-start-automatically-on-system-boot
excel高亮选择的行和列
【开始】 - 【条件格式】- 【管理规则】- 新建。 行的高亮规则,新建对话框: 样式选择“经典”,使用公式确定要设置格式的单元格。输入公式:=CELL("row")=ROW() 列的高亮规则,新建对话框: 样式选择“经典”,使用公式确定要设置格式的单元格。输入公式:=CELL("col")=COLUMN() 选中excel的单元格,按F9进行刷新。
Java 位移运算符
参考文章: 1、【精华】https://zhuanlan.zhihu.com/p/30108890 2、【精华】https://baike.baidu.com/item/%E7%A7%BB%E4%BD%8D%E8%BF%90%E7%AE%97%E7%AC%A6 3、https://juejin.cn/post/6844903783307149319 public static void test() throws Exception { int intValue = 5;// 随意写一个数 /** * 数学意义: * 在数字没有溢出的前提下,对于正数和负数,左移一位都相当于乘以2的1次方,左…
确定 Mac 笔记本电脑的电池循环计数
《确定 Mac 笔记本电脑的电池循环计数》来做官网。 地址: https://support.apple.com/zh-cn/HT201585 了解如何确定 Mac 笔记本电脑的电池循环次数。 关于电池循环 您使用 Mac 笔记本电脑时,电池会经过充电循环。当您使用电池的所有电量时,便会发生充电循环,但这不一定意味着一次充电。 例如,您可能会在一天内使用了笔记本电脑的一半电量,然后将其重新充满电。如果您第二天同样如此,则会计作一次充电循环,而非两次。通过这种方式,可能需要几天的时间才能完成一个循环。 电池的充电循环计数是有限的,超出后性能会降低。一旦达到循环计数,建议更换电池以保持性能。电池…
逻辑M720鼠标的按键设置
1、滚轮之后的那个按键:M720的滚轮后方有一个开关,通过按压可以切换滚轮的工作状态,分为疾速状态和正常状态。 2、如何设置Logitech鼠标M720按钮?罗技鼠标设置方法,参考地址: http://www.pc-fly.com/a/ruanjian/article-264109-1.html