22 Matching Annotations
  1. Mar 2023
    1. Use inline, inline-block, and block to control the flow of text and elements

      block 表示整行都是我的, inline-block 表示整个元素是一个整体 inline表示每个单词(还是字母)是一个整体?

    2. Use box-border to set an element’s box-sizing to border-box, telling the browser to include the element’s borders and padding when you give it a height or width.This means a 100px × 100px element with a 2px border and 4px of padding on all sides will be rendered as 100px × 100px, with an internal content area of 88px × 88px.

      元素的高宽是否包含间距(padding,margn) 可以又box-sizing 确定

  2. Feb 2023
    1. Why I'm Optimistic About JavaScript's Future

      本文提出 JavaScript 有三种使用场合:浏览器、服务器和边缘计算。在这三种场合都可以使用的语言,只有 JavaScript 一种。

    1. The beauty of Unix pipelines

      本文举了 Unix 管道运算符(|)的三个例子,讲解为什么它体现了 Unix 哲学。本文可以作为管道运算的教程。

  3. Aug 2022
    1. Links are bi-directional. If you link two processes and one of them crashes, the other side will crash too (unless it is trapping exits). A monitor is uni-directional: only the monitoring process will receive notifications about the monitored one. In other words: use links when you want linked crashes, and monitors when you just want to be informed of crashes, exits, and so on.

      link 是双向的,如果你 link 两个进程,一个进程 crash 会导致另一个进程也 crash(除非它阻止退出?)。monitor 是单项的,只有正在监听的进程会收到被监听进程的消息。换句话说,当你希望绑定 crashed 关系,使用 link。 当你希望收到crash,exit 等消息时,使用 monitor

  4. Jul 2022
    1. To minimize the amount work the query engine must do, query authors should put the most restrictive or narrowing :where clauses first, and then proceed on to less restrictive clauses.

      先写范围较小的查询可以降低查询量

  5. May 2022
    1. 定义下标使用 subscript 关键字,与定义实例方法类似,都是指定一个或多个输入参数和一个返回类型。与实例方法不同的是,下标可以设定为读写或只读。这种行为由 getter 和 setter 实现,类似计算型属性

      下标包含关键字subscript

  6. swiftgg.gitbook.io swiftgg.gitbook.io
    1. 输入输出参数

      如何修改实参并保留修改结果

    2. 属性包装器

      一种提高公共逻辑判断复用性的技术

    3. 属于引用类型的类则不一样。把一个引用类型的实例赋给一个常量后,依然可以修改该实例的可变属性。

      所以,js里面的array 和object 和swift 的类行为类似,和struct 不一样

    4. 这种行为是由于结构体属于值类型。当值类型的实例被声明为常量的时候,它的所有属性也就成了常量。

      这个比js 严格,js里面虽然array 和object 可以是const,但是还是可以修改它里面的值

  7. Feb 2021
    1. The rest of this article explores why Prisma does not support long-running transactions, and why we believe you will be better off using other strategies to deal with the sort of situations described before.

      Prisma 不支持长时间的事务

    2. It is important to think about what should happen if another user updated the initial value after it was read, but before the manipulated data is written back to the database

      需要重点思考的是当另一个用户更新了当前用户正在读取的一个初始值,当前用户的数据写会数据库会发生什么?

    3. Durability

      持久性

    4. Isolated

      隔离性

    5. Consistent

      一致性

    6. Atomic

      原子性

    7. a transaction allows developers to group a set of read- and/or write-operations into a single operation which is guaranteed to succeed ("the transaction is committed") or fail ("the transaction is aborted and rolled back") as a whole.

      事务允许开发者将一系列读写操作合并到一次操作里面,并且确保这次操作要么成功,要么失败。

    8. Most databases support a mechanism called transactions. Transactions are a "magic trick" that allow developers to pretend like there is only one user interacting with the database system at a given time. This allows the developers to ignore a full class of errors that could otherwise occur with concurrent database access.

      事务提供饿了一种机制确保每次对数据库的更新像是一次原子操作一样,并且提供了方式撤销失败。

    1. 兴趣是最好的导师,跟着自己的兴趣走,往滑箱里添加笔记。只要你对一个主题还感兴趣,你就会主动地阅读更多,沉淀更多。

      折腾并不是无意义的

    2. 做“文献笔记”

      如何管理文献笔记,可能可以用 https://hypothes.is/ 的 api 自动化解决

  8. Nov 2020
    1. 仅使用一个主题提供程序(无主题嵌套)。 样式表的名称以 Mui 开头(包含所有 Material-UI 组件)。 类名生成器的 disableGlobal 选项为 false(默认值)。

      Mui 开头的组件,不增加随机 ID,方便重写