幹工作進度

2025-09-01

这罗永浩老是打断李想的发言,作为一个采访者显得很不专业,没有让其做出完整表达。而且时间长不见得是深度访谈,提问的方式应该层层递进

【李想×罗永浩!四小时马拉松访谈!李想首度公开讲述25年创业之路】

https://www.bilibili.com/video/BV1FwY4zkEef/?share_source=copy_web&vd_source=a6b620917b053db9586b3ee8d0f54ca6

老罗总是在为自己的私欲去提问,不会去考虑观众应该会怎么提问。看创业者的创业故事,也会带来很多启发。比如怎么组建团队,怎么熟悉业务,怎么融资等等

2025-09-02

KeyboardEvent: keyCode property Deprecated

Inconsistent behavior: Different browsers and keyboard layouts can return different values for the same key, making it unreliable for cross-browser use.

Ambiguity: keyCode does not always clearly indicate which key was pressed, especially for non-character keys or when modifier keys are involved.

Css 诞生的背景,一开始居然是用户能改变样式,反而程序员却不能

继续阅读“幹工作進度”

去洞口看寳

2025-08-31

格鲁夫给经理人的第一课,这个书还是很有料,能带来不少启发

要提高超出,第一要培训,让大家成为大佬;第二要激励,要给钱。

脑力劳动不是工厂流水线,设定 kpi 就能搞定,绩效的评定指标和效用没有那么明显。

2025-08-30

chatgpt 是什么时候流行的,感觉现在的大模型满天飞

Anthropic PBC is an American artificial intelligence (AI) startup company founded in 2021. Anthropic has developed a family of large language models (LLMs) named Claude. According to the company, it researches and develops AI to “study their safety properties at the technological frontier” and use this research to deploy safe models for the public.[5][6]

Anthropic was founded by former members of OpenAI, including siblings Daniela Amodei and Dario Amodei.[7] In September 2023, Amazon announced an investment of up to $4 billion, followed by a $2 billion commitment from Google in the following month.

继续阅读“去洞口看寳”

A monad demo given by AI

// Generic Monad structure
class Monad {
  constructor(value) {
    this.value = value;
  }

  // Bind: chains computations that return a Monad
  bind(fn) {
    return fn(this.value);
  }

  // Unit: wraps a value in the Monad
  static of(value) {
    return new Monad(value);
  }

  // For debugging
  get() {
    return this.value;
  }
}

// Example: Maybe Monad
class Maybe extends Monad {
  bind(fn) {
    if (this.value == null) {
      return new Maybe(null);
    }
    return fn(this.value);
  }

  static of(value) {
    return new Maybe(value);
  }

  getOrElse(defaultValue) {
    return this.value == null ? defaultValue : this.value;
  }
}

// Demo: chaining computations with Monad
const double = x => Monad.of(x * 2);
const increment = x => Monad.of(x + 1);

const result = Monad.of(5)
  .bind(double)      // 10
  .bind(increment);  // 11

console.log(result.get()); // Output: 11

// Demo: chaining with Maybe Monad
const safeDivide = x => x === 0 ? Maybe.of(null) : Maybe.of(10 / x);

const maybeResult = Maybe.of(2)
  .bind(safeDivide)       // 10 / 2 = 5
  .bind(x => Maybe.of(x + 3)); // 8

console.log(maybeResult.getOrElse("fail")); // Output: 8

const maybeFail = Maybe.of(0)
  .bind(safeDivide)       // null
  .bind(x => Maybe.of(x + 3));

console.log(maybeFail.getOrElse("fail")); // Output: "fail"

maybe functor

class Maybe {
  constructor(value) {
    this.value = value;
  }

  // Functor map: applies a function if value is not null/undefined
  map(fn) {
    if (this.value === null) {
      return new Maybe(null);
    }
    return new Maybe(fn(this.value));
  }

  // getOrElse: safely extract value with a fallback
  getOrElse(defaultValue) {
    return this.value === null ? defaultValue : this.value;
  }

  // static helpers for convenience
  static of(value) {
    return new Maybe(value);
  }

  static nothing() {
    return new Maybe(null);
  }
}

// Example usage:
const maybeNumber = Maybe.of(5)
  .map(n => n * 2)
  .map(n => n + 1);

console.log(maybeNumber.getOrElse(0)); // Output: 11

const maybeNull = Maybe.of(null)
  .map(n => n * 2);

console.log(maybeNull.getOrElse(0)); // Output: 0

追回来了

2025-07-31

大端序,小端序

Examples with the number 0x12345678 (i.e., 305 419 896 in decimal):

little-endian: 0x78 0x56 0x34 0x12
big-endian: 0x12 0x34 0x56 0x78
mixed-endian (historic and very rare): 0x34 0x12 0x78 0x56

https://developer.mozilla.org/en-US/docs/Glossary/Endianness

2025-07-30

zig 这门语言似乎是和 rust 产生竞争,抢占 c 语言的市场

The primary goal of Zig is to be a better solution to the sorts of tasks that are currently solved with C. A primary concern in that respect is readability; Zig attempts to use existing concepts and syntax wherever possible, avoiding the addition of different syntax for similar concepts. Further, it is designed for “robustness, optimality and maintainability”, including a variety of features to improve safety, optimization, and testing.

继续阅读“追回来了”

简易优先队列(heap) js 版

这个优先队列使用数组存储。下面的代码是一个最大(不管是现实世界还是计算机的世界,什么是大什么是小,都是可以定义的)堆的实现。

基于堆的优先队列,出队,入队都是 logn 级别的时间复杂度。

提供 heapify 的实现。

继续阅读“简易优先队列(heap) js 版”

宝回老家了

2025-06-30

菜鸟面试官的一点思考

2025-06-26

“The boolean trap” is just one example of how seemingly simple modeling decisions can have unexpected consequences as systems grow. While booleans are perfect for their intended purpose – representing true/false technical states – they often fall short when applied to a domain. By choosing enums and enum sets we create code that is better prepared for the “real world”‘ of the problem domain.

Sometimes it’s better to rethink how we represent the state instead of blindly adding another boolean flag.

https://katafrakt.me/2024/11/09/booleans-are-a-trap

乱语:这位老哥说在领域模型内,使用布尔值不是很好,得用枚举或者是状态机。

继续阅读“宝回老家了”