博文

Java Base == & equals

  Tags:  Integer cache, == , equals This Blogger emphasizes that in actual development, developers should prioritize using .equals() to compare object values ​​rather than simply relying on == to compare references. Java's Integer cache mechanism provides memory optimization for Java programs with values ​​in the range of -128 to 127.However, values ​​outside this range will result in the creation of new objects, resulting in unexpected results in == comparisons.       public static void main(String[] args) {         Integer a = 228;         Integer b = 228;         System.out.println(a == b); // false         Integer x = 1;         Integer y = 1;         System.out.println(x == y); // true         Integer c = 228;         Integer d = 228;         System.out.println(System.identityHash...

Data URI是由RFC 2397 ACE

https://www.rfc-editor.org/rfc/rfc2397 http://codingpy.com/article/how-to-turn-your-browser-into-code-editor/ https://ace.c9.io/build/kitchen-sink.html https://c9.io/ https://angular-ui.github.io/ The "data" URL scheme Status of this Memo This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited. Copyright Notice Copyright (C) The Internet Society (1998). All Rights Reserved. 1 . Abstract A new URL scheme, "data", is defined. It allows inclusion of small data items as "immediate" data, as if it had been included externally. 2 . Description Some applications that use URLs also have a need to embed (small...

Simplifed Chinese to Traditional Chinese in Windows 11

 Control Panel > System and Security > System > Time & language > Language & region>Preferred languages > 中文的右边3个点... 点击打开 > Language options >  Options->Keyboards > Microsoft Pinyin (... -》 ... keyboard options) > General > choose a character set: Simplifed Chinese;(Traditional Chinese)

Java Verify Code image

  /** Java  * create an image of the verify code */ public class VerifyCode { private int width = 100 ; // width of image private int height = 50 ; // height private String [] fontNames = { "Serif", "Sans Serif", "Slab Serif", "宋体" , "楷体" , "隶书" , "微软雅黑" }; private Color bgColor = new Color ( 255 , 255 , 255 ); // background private Random random = new Random (); private String codes = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" ; private String text ; // random /** * get Color * @return */ private Color randomColor () { int red = random . nextInt ( 150 ); int green = random . nextInt ( 150 ); int blue = random . nextInt ( 150 ); return new Color ( red , green , blue ); } /** * font type * @return */ private Font randomFont () { String name = fontNames...