40 Matching Annotations
  1. Last 7 days
    1. CMS

      改进点在于。 1. stop the world,把和 GC Roots 直接相关的进行标记 2. 解除 stw,应用线程和并发的依赖标记线程一起做; 3. stop the world,把标记期间应用线程影响到的线程进行标记; 4. 解除 stw,和应用程序同时一起清除没被标记的对象。

    2. 更早的 JDK 6 则把驻留字符串放在永久代中

      It is very unclear, String will be stored in PermGen in JDK 6, but PermGen is one part of Heap memory too.

      So, whenever String objects will be stored in Heap.

    1. 注册回调不代表一定会切换线程。

      future.thenApply(value -> value.length()); The registration of callback function does NOT guarantee which thread (new or old) will server to do this logic.

    2. 类型擦除不代表所有泛型信息都消失了

      if we know the clazz object, we can know what we define in code in reflection mechanism. but if we only have one of the object, we can not know what is exact parameter when creating because of type erasure mechanism.

    3. 为什么需要泛型?

      2 main reasons: - code reuse, developers don't need to prepare different version of code for different types. - compile-time checking instead of runtime checking, e,g, if we want put “123” and 123 in a list, but if this list can only store Integer? if we use generic, such as List<Integer> we can discover it on compile-time.

    4. 实现深拷贝的三种方法是什么
      1. Cloneable interface, and implement the clone method.
      2. Serializable interface, using streaming to realize clone
      3. mutual implementation
    5. 六大原则

      SOILD: - S for Single, every class must take 1 role. - O for Open, open for extension, close for modification - I for Interface, it should be small and specific - L for Liskov, subclass object can replace all parent class object - D for Dependency, Dependency Inverse.

    6. 装箱和拆箱是什么?
      1. What is boxing and unboxing
      2. boxing: int \(\rightarrow\) Integer
      3. unboxing: Integer \(\rightarrow\) int
      4. When Java will do boxing and unboxing
      5. assignment, e.g. java Integer x = 1; // boxing int y = x; // unboxing
      6. method invocation java private void printInt(int x) { System.out.println(x); } Integer a = 1; // boxing printInt(a); // unboxing
      7. potential efficiency problem: Integer sum = 0; for (int i = 0; i <= 1000000; i++) { sum += i; } boxing & unboxing is automatic, but need time!!! it will create many disposable Integer objects, which will increase GC pressure.
    7. 舍入规则

      if we define BigDecimal a = 1, b = 3, and run a.divide(b), the target answer will be 0.333333... which can not represent in BigDecimal format, so it will throws an ArithmeticException.

      If we want to fix this, we should use rounding mode, e.g. half_up (\(1.04 \rightarrow 1.0, 1.05 \rightarrow 1.1\))

    8. equals和compareTo
      • equal() return true or false, means a.unscaledvalue == b.unscaledvalue && a.scale == b.scale
      • compareTo return number -1, 0, 1, means a < b, a == b, a > b
    9. 可以使用BigDecimal.valueOf,它会通过double的字符串表示来构造

      BigDecimal.valueOf(0.1) - step #1: 0.1 \(\rightarrow\) "0.1" - step #2: "0.1" $\rightarrow$ BigInteger = 1, scale = 1

  2. Oct 2026
    1. 类型互转会出现什么问题吗?
      • basic data types conversion problem
      • data overflow, e.g. long to int
      • precision loss, e.g. double to float
      • object conversion problem
      • upcasting, son to father, is ok, e.g. Cat to Animal
      • downcasting, father to son, is maybe not ok, we must use forced casting, e.g. Animal to Cat, ClassCastingException

      we should use instanceof to judge

    2. 数据类型转换方式你知道哪些?

      4 types of data conversion: 1. automatic type conversion, e.g. int to long 2. forced type conversion, e.g. long to int 3. String to Object, e.g. Integer.parseInt() 4. basic data type \(\leftrightarrow\) their wrapper class

    3. long和int可以互转吗 ?
      • automous type conversion, int \(\rightarrow\) long cpp int a = 10; long b = a;
      • force type conversion, long \(\rightarrow\) int cpp long c = 10L; int d = (int) c;
    4. int和long是多少位,多少字节的?
      • byte(1 byte), short(2 bytes), int(4 bytes), long(8 bytes)
      • float(4 bytes), double(8 bytes)
      • boolean(1 bit)
      • char(2 bytes)
    5. Python和Java区别是什么?
      • Python: almost pure interpreted language.
      • Java: 2 stages, (1) .java \(\rightarrow\) .class, compiled; (2) .class \(\rightarrow\) bytecode, interpreted(iced code) & compiled (hot code)
    6. 编译型语言和解释型语言的区别?

      very important trade-off: efficiency vs. platform independence - compiled language: 1. source code compiles to the target platform's bytecode, 2. run or debug. run very fast online but development and changing platform is slow. - interpreted language: 1. interpret each line of source code in each platform, it is very easy to change environment and develop but slow

    7. jvm是什么
      1. JVM = Java Virtual Machine, .class to bytecode
      2. compile once (get .class) run anywhere (different platform has its own different platform-specific JVM)
    8. JVM、JDK、JRE三者关系

      JVM < JRE < JDK - JVM: run Java bytecode; or core engine - JRE: JVM + ClassLoader + library, providing runtime - JDK: JRE + javac + javadb + develop tools, providing development environment.

    9. 跨平台
      1. .java \(\rightarrow\) .class, “compile once”.
      2. each platform will have its own JVM, mapping .class \(\rightarrow\) machine code, "run anywhere".

      JVM is the most key software.

    1. several distinct trees can encode the same function

      比如 \(x_1, x_2\) 先算 \(x_1\) 还是先算 \(x_2\) 导致决策树不同,但是表示函数可以是同一个。

    Annotators

    Annotators

  3. Sep 2026
    1. System one models

      System One Model 指的是快速判断模型,不像普通 LLM 一样生成一大堆文本,而是做快速判断(Noul)、分类(Choice)、打分(Score)

    2. DSPy 3.4.0

      DSPy 是一个用代码来优化 LLM 应用的框架。

      传统的 Prompt Engineering:手写提示词、调模型、结构不好、人肉修改 Prompt

      DSPy:定义任务模块、准备训练和验证样本、定义评分指标、DSPy 自动优化 Prompt 和示例