119 Matching Annotations
  1. Last 7 days
    1. 密码只用于直接输入,不存储、不传输,不存在于其它任何地方

      直接输入?那么输入时没有被比对程序记录的吗?

  2. Jun 2020
    1. ASP.NET Core Identity for authenticating and storing users is combined with IdentityServer for implementing Open ID Connect.

      使用IdentityServer来授权和存储用户。

    1. An object, on the other hand, refers to a block that follows the Merkle DAG protobuf data format.

      object是遵循Merkle DAG protofbuf 数据格式的block

    1. This client library implements the IPFS Core API enabling applications to change between an embedded js-ipfs node and any remote IPFS node without having to change the code. In addition, this client library implements a set of utility functions.

      实现了IPFS Core API,以及一些应用函数。

  3. May 2020
    1. 但浏览器并没有小程序规范的组件与 API 可供使用,例如我们不能在浏览器上使用小程序的 view 组件和 getSystemInfo API。因此我们需要在 H5 端实现一套基于小程序规范的组件库和 API 库。
    1. 移植相对简单,将数据拷过去就差不多了。不过要注意如果原备份还运行的话Pear ID一样会有问题的。

    1. The actions that you take only affect your own IPFS node, not nodes belonging to your peers.

      感觉象是断网状态似的,不影响其它节点,只影响本地节点,有点不解。

    2. the multicodec prefix in an IPFS CID will always be an IPLD codec.

      IPFS CID 总是使用IPLD codec

    3. Multiformats CIDs are future-proof because they use multihash to support multiple hashing algorithms rather than relying on a specific one.

      因为支持未来算法,所以不会过时。

    4. IPFS uses sha2-256 by default, though a CID supports virtually any strong cryptographic hash algorithm.

      支持任何强加密算法。

    Tags

    Annotators

    URL

    1. const cid = results[0].hash

      这一句运行有问题!undefined!

    1. Both the js-ipfs and js-ipfs-http-client libraries work in browsers, but each has some special considerations noted in their READMEs.

      两者都能运行在浏览器中!我还以为前者不行。

    2. js-ipfs-http-client is a smaller library that controls an IPFS node that is already running via its HTTP API. js-ipfs actually uses this library internally if it detects that another node is already running on your computer

      使用js-ipfs-http-client更小,并且控制一个已经运行的节点。

    3. Whenever reasonable, we recommend the second method (interacting with a separate IPFS node via the HTTP API). Keeping the IPFS node in a separate process (even if it’s one your program spawns) isolates you from any stability problems with the node.

      建议使用独立节点,然后使用Http api。

    1. If your OWNER permission’s private key is exposed, you lose access permanently to your EOS account and its funds. There is no way back from this scenario.

      失去Owner权限就失去了你的账号

    2. Keep the ACTIVE permission key in Scatter and use that for everything you can. Keep the OWNER permission key somewhere safe

      让Owner权限更加安全。

    1. The core IPFS team maintain implementations in Golang and Javascript. Those are commonly referred to as go-ipfs and js-ipfs. The official binaries are built from the Go implementation.

      IPFS主要的实现有 go-ipfs 和 js-ipfs。官方二进制包使用go实现。

    1. 恢复初始设置后,设置不会自动保存。

      不会自动保存,下次启动还是之前保存的设置。

    1. Python 中的变量赋值不需要类型声明。 每个变量在内存中创建,都包括变量的标识,名称和数据这些信息。 每个变量在使用前都必须赋值,变量赋值以后该变量才会被创建。 等号(=)用来给变量赋值。 等号(=)运算符左边是一个变量名,等号(=)运算符右边是存储在变量中的值。

      变量

    1. 像if、while、def和class这样的复合语句,首行以关键字开始,以冒号( : )结束,该行之后的一行或多行代码构成代码组。 我们将首行及后面的代码组称为一个子句(clause)。

      代码组

    2. Python语句中一般以新行作为语句的结束符。 但是我们可以使用斜杠( \)将一行的语句分为多行显示,如下所示:

      多行语句

    3. 在 Python 里,标识符由字母、数字、下划线组成。 在 Python 中,所有标识符可以包括英文、数字以及下划线(_),但不能以数字开头。 Python 中的标识符是区分大小写的。 以下划线开头的标识符是有特殊意义的。以单下划线开头 _foo 的代表不能直接访问的类属性,需通过类提供的接口进行访问,不能用 from xxx import * 而导入。 以双下划线开头的 __foo 代表类的私有成员,以双下划线开头和结尾的 __foo__ 代表 Python 里特殊方法专用的标识,如 __init__() 代表类的构造函数

      Python标识符规则。

    1. 悉尼立体模型用google map看的时候要拉近等些时间才会出现。使用工具从google地图中提取数据。通过blender读出抓到的rdc格式文件。

    1. 驱使着樋口优克服这些困难,并不断持着续开发的真正理由是什么呢——“因为兴趣。”

      “兴趣”果然是最大的动力

  4. Apr 2020
    1. 200 megabytes is not that bad. I’ve seen it rise above 700 MB easily.

      200M已经不算算,升到700M都很容易。

    2. end up with 19k dependencies by installing just one

      安装一个软件,带来19000个依赖!

    1. In the above code, we:state, that the FunctionType extends  (args: any) => anywe say that the FunctionReturnType is a conditional typeinside we declare the ReturnType and assign it with the return type of our function () => infer ReturnType results in assigning the return type to the ReturnType variablewe check if FunctionType extends  (...args: any) => infer ReturnTypeif the above condition is not met, we assign  any to FunctionReturnTypesince the above condition is always met, we assign the ReturnType to the FunctionReturnTypeBy doing all of the above, we can extract the return type of any function.

      解释infer及相关情况。

    2. Introducing the infer keyword

      介绍 infer关键字,待细究

    1. The most commonly used type parameter names are:E – Element (used extensively by the Java Collections Framework)K – KeyN – NumberT – TypeV – ValueS,U,V etc. – 2nd, 3rd, 4th types

      常见的泛型类型命名

    2. we can put a constraint on the T type variable.

      添加泛型约束

    1. From TypeScript 3.7 and onwards, you can use optional chaining to simplify working with nullable types.

      从TypeScript3.7开始,可以使用可选链

    1. Within the extends clause of a conditional type, it is now possible to have infer declarations that introduce a type variable to be inferred. Such inferred type variables may be referenced in the true branch of the conditional type. It is possible to have multiple infer locations for the same type variable.

      使用infer

    1. 对象属性的命名规则 通过[]操作符为对象添加属性时,属性名称可以是任何字符串(包括只包含空格的字符串和空字符串); 通过.操作符为对象添加属性时,属性名称必须是合法的标识符名称; 如果属性名包含非法的标识符字符,则只能采用obj[“propertyName”]的形式; 如果属性名是合法的标识符,读取时即可以采用obj.propertyName,也可以采用obj[“propertyName”]的形式;

      除此之外,根据下面的介绍,也可以用数字和布尔值作为属性名,但会自动转换为字符串。

    1. An ambient declaration introduces a variable into a TypeScriptscope, but has zero impact on the emitted JavaScript program.

      环境Declare将变量引入到TypeScript,不会生成JS代码。用它告诉TypeScript编译器其它组件会提供一个变量。

    Tags

    Annotators

    1. In addition to these development tool middleware, it also adds redux-thunk by default, since thunks are the basic recommended side effects middleware for Redux.

      redux-thunk 默认加入

    1. I'm a Redux maintainer and creator of Redux Toolkit. FWIW, nothing about making async calls with Redux changes with Redux Toolkit. You'd still use an async middleware (typically redux-thunk), fetch data, and dispatch actions with the results.

      Redux Toolkit作者说了,RTK并没有改变任何异步操作的调用。还是可以使用中间件(象redux-thunk)获取数据和分发结果动作。

    1. Taro 的组件编译后就是小程序的自定义组件,而小程序的自定义组件的初始化时是可以指定 data 来让组件拥有初始化数据的。开发者一般会在组件的 constructor 中设置一些初始化的 state,同时也可能会在 render 中处理 state 与 props 产生新的数据,在 Taro 中多出的这一次提前调用,就是为了收集组件的初始化数据,给自定义组件提前生成 data ,以保证组件初始化时能带有数据,让组件初次渲染正常。

      Taro在初始化时会多一次渲染过程,并且第一次调用会因数据没有还出错。这种情况也出现在我的策略井字棋项目中。

    1. For example, noImplicitAny is a recommended option that triggers the compiler to error on expressions and declarations with an implied any type

      开启类型检查

  5. redux.js.org redux.js.org
    1. reducer: any function with the signature (state, action) -> newState (ie, any function that could be used as an argument to Array.prototype.reduce)root reducer: the reducer function that is actually passed as the first argument to createStore. This is the only part of the reducer logic that must have the (state, action) -> newState signature.slice reducer: a reducer that is being used to handle updates to one specific slice of the state tree, usually done by passing it to combineReducerscase function: a function that is being used to handle the update logic for a specific action. This may actually be a reducer function, or it may require other parameters to do its work properly.higher-order reducer: a function that takes a reducer function as an argument, and/or returns a new reducer function as a result (such as combineReducers, or redux-undo)

      不同类型的函数。

    2. irst and foremost, combineReducers is simply a utility function to simplify the most common use case when writing Redux reducers.

      comineReucers只是简化通用案例的应用函数。

    3. functions should be relatively short and ideally only do one specific thing

      函数最好是单一职责

    1. The current answers and the official documentation are outdated. And for those new to TypeScript, the terminology used isn't clear without examples. Below is a list of up-to-date differences.

      关于接口和类型别名,更新的内容

    2. Both can be extended, but again, the syntax differs. Additionally, note that an interface and type alias are not mutually exclusive. An interface can extend a type alias, and vice versa

      接口和类型别名并不互斥,还可以相互扩展。

    1. 应用风格指南,值得参考的部分

    2. Redux itself does not care about how your application's folders and files are structured. However, co-locating logic for a given feature in one place typically makes it easier to maintain that code.Because of this, we recommend that most applications should structure files using a "feature folder" approach (all files for a feature in the same folder) or the "ducks" pattern (all Redux logic for a feature in a single file), rather than splitting logic across separate folders by "type" of code (reducers, actions, etc).

      强烈建议,应用将文件夹结构按照功能特性划分

    1. 组件命名: 与文件名(除中缀外)完全一致。如果组件单独放置在目录中,则目录名也一致

      考虑目录名称

    2. 。如果同一个文件夹下有同名而不同作用的js文件,则通过中缀(小写)进一步区分

      考虑使用中缀

    1. Any JavaScript style guide that is up-to-date for ES6 is going to cover nearly all TypeScript constructs except for type annotations, so I would start with your favorite JS style and decide on what you want the rules for type annotations to be

      可惜这个问题被关了。因此显得有点老。不过他的建议也不错。使用用JS的风格。

    1. JSX 的属性都采用双引号

      这规则跟Taro冲突

    2. 属性名称始终使用驼峰命名法。

      属性名以小写开头

    3. 扩展名:React 组件使用.jsx扩展名;文件名:文件名使用帕斯卡命名。 例如: ReservationCard.jsx。引用命名:React 组件使用帕斯卡命名,引用实例采用驼峰命名

      React组件命名以大写字母开头。

    1. 基于这个原因,我们推荐根据文件的上下文来命名文件,

      这个命名方式值得参考

  6. Mar 2020
    1. you can make the component a container component by wrapping it in a higher-order component returned by connect().

      从示例看出来,connect可以连接函数式组件,不仅仅是类组件。

    2. react-redux包很简单,暴露了两个东西:Provider和connnect

    1. wrapping your entire application in a <Provider> component

      还是需要Provider哦

    2. React Redux now offers a set of hook APIs as an alternative to the existing connect() Higher Order Component. These APIs allow you to subscribe to the Redux store and dispatch actions, without having to wrap your components in connect()

      React Redux提供的一些hook api可以用来替代connect高阶组件。用来订阅Redux Store和分发动作,而无需connect()

    1. Notice that none of these changed anything about how Redux works. We're still creating a Redux store, dispatching action objects that describe "what happened", and returning updated state using a reducer function. Also, notice that the Redux Toolkit functions can be used no matter what approach was used to build the UI, since they just handle the "plain Redux store" part of the code. Our example used the store with a "vanilla JS" UI, but we could use this same store with React, Angular, Vue, or any other UI layer.

      Redux Toolkit并没有侵入Redux。可以用在React,Angular,Vue和其它UI层。所以,我想,应该也可以用在Taro上面!

    1. A slice automatically generates reducers, action types, and action creators. As such, you'll only have to create one folder - slices

      切片自动生成了reducer,动作类型和动作创建器。这样需要创建一个文件夹:slices

    2. And no longer requires you to install the redux-thunk or redux-devtools-extension dependencies.

      Redux-Toolkit不再需要安装redux-thunk和redux-devtools-extension。

    3. The ability to use direct state mutation, since RTK uses immer under the hood. This means you no longer need to return { ...state } with every reducer.

      使用了immer

    1. the final source code structure looks like this

      有个疑问,这样的文件夹结构好吗?需要再进一步改进吗?

    2. The Redux Toolkit package is intended to be the standard way to write Redux logic. It was originally created to help address three common concerns about Redux:"Configuring a Redux store is too complicated""I have to add a lot of packages to get Redux to do anything useful""Redux requires too much boilerplate code"

      Redux Toolkit的用意是以标准方式编写Redux逻辑,帮助解决下面三个问题:

      • 配置store太复杂
      • 需要添加太多的包
      • 需要很多模板代码
    1. TS 采用结构子类型。其含义是:两个类型,即使表示的业务含义大相径庭,只要结构上有从属关系,就是兼容的。(“等同”也是从属关系的一种)

      TS用结构子类型。不同于C#的名义子类型。

    1. To do that, the react-redux library comes with 2 things: a component called Provider, and a function called connect.

      react-redux带来两样东西: 一个叫Provider的组件 一个叫connect的函数

    2. Changes happen one way, and one way only: dispatch(action) -> reducer -> new state.

      改变是单向的: 分发动作->reducer->新状态

    3. Reducer Rule #2: Reducers must be pure functions.

      Reducer规则2:必须是纯函数,不能用副作用。

    1. Redux has changed a lot. Redux toolkit has become the recommended way to use Redux and new codebases based on Redux toolkit will differ a lot from what you'll find in this tutorial. However the fundamental building blocks of Redux are still action, reducers, middleware, and the store. A good knowledge of these building blocks is required to be proficient with Redux and Redux toolkit. After reading this tutorial you can tune on this free Redux course of mine where I'll cover Redux toolkit in the near future.

      在这个教程里面没有教到比较新的Redux-Toolkit。但是基本是相通的。在其视频教程的第四节是介绍toolkit的。

    1. useEffect serves the same purpose as componentDidMount, componentDidUpdate, and componentWillUnmount in React classes, but unified into a single API

      useEffect将几个功能给统一在一起了。

    1. This means you can write code that "mutates" the state inside the reducer, and Immer will safely return a correct immutably updated result.

      使用了Immer库,意味着可以安全的返回不变的更新结果。

    2. automatically handle all other action types by returning the current state

      默认为返回当前状态。

    3. in most apps, you won't need to use them yourself - createSlice is all you need.

      所以说,有时候使用createSlice就同时有了createReducer和createActions.

    4. The first big step for rewriting the app is to convert the todos logic into a new "slice".

      将todo逻辑转为切片

    1. return a function instead of an action

      返回的是函数,可被延迟执行

    1. { subscribe, dispatch, getState }.

      创建一个store用来保存状态,api中有 { subscribe, dispatch, getState }

    2. The shape of the state is up to you: it can be a primitive, an array, an object, * or even an Immutable.js data structure. The only important part is that you should * not mutate the state object, but return a new object if the state changes

      状态改变,可以返回一个新对象。

    3. The whole state of your app is stored in an object tree inside a single store. The only way to change the state tree is to emit an action, an object describing what happened. To specify how the actions transform the state tree, you write pure reducers.

      整个App状态存在单个Store对象树。改变状态的只有action,一个描述发生个么的对象。然后reducer负责状态改变。

    1. Newer versions of TypeScript can now infer types based on your React.PropTypes (PropTypes.InferProps), but the resulting types can be difficult to use or refer to elsewhere in your code.

      新版TS能通过PropTypes推断类型,但是结果类型不大好用。

    2. There's usually not much value to maintaining both your component props as TypeScript types and React.PropTypes at the same time.

      同时使用Typescript类型和React.PropTypes没有多大价值。

    1. Source files that contain no module importor exportdeclarations are classified as scripts

      源文件中不含模块导入和导出声明的叫脚本。

    2. no output is generated from declaration source files

      声明文件不会生成代码的。

    3. A parameterof a ConstructorImplementationmay be prefixed with a public,private, or protectedmodifier. This is called a parameter property declarationand is shorthand for declaring a property with the same name as the parameter and initializing it with the value of the parameter.For example, the declaration

      构造函数实现里的参数可以加上public private或protected修饰符。这叫做参数属性声明,声明了同名属性。

    4. A parameter property declaration may declare an optional parameter (by including a question markor a default value), but the property introduced by such a declaration is always considered a required property

      构造函数的参数成为类的属性。

    5. An interface can be named in an extends or implementsclause, but a type aliasfor an object type literal cannot.An interface can havemultiple merged declarations, but a type aliasfor an object type literal cannot

      类型别名和接口的区别: 接口可被继承和实现而类型别名不行。 接口可以有多个合并声明而类型别名不行。

    6. typeObjectStatics = typeofObject

      typeof Object得到的是字符串!但是前面加的是type时它得到的不再是字符串了,而是类型,这个typeof有双关性!

    7. Object types are composed from properties, call signatures, construct signatures, and index signatures, collectively called members.

      对象由属性,函数,构造函数和索引组成。

    8. Instance and static membersin a classare in separate declaration spaces.

      实例和静态变量可以同名,因为它们在不同的声明空间。

    9. n TypeScripttype names and variable names do not conflict: each lexical scope contains a variable declaration space and type declaration space

      在TS中,类型名和变量名不会冲突:每个词法作用域包含变量声明空间和类型声明空间。

    10. Below are some examples of declarations that introduce multiple meanings for a name

      名字可能有多种意义。

    11. A variable, parameter,function, generator, member variable, memberfunction, member accessor, orenum memberdeclaration introduces a value meaning.An interface, type alias, or type parameter declaration introduces a type meaning.A class declaration introduces a value meaning (the constructor function) and a type meaning (the class type).An enum declaration introduces a value meaning (the enum instance) and a type meaning (the enum type).A namespace declaration introduces a namespace meaning (the type and namespace container) and, if the namespace is instantiated (section 10.1), a value meaning(the namespace instance).An import or export declaration introduces the meaning(s) of the imported or exported entity

      声明引入名字的意思。

    12. The example also illustrates thatan object type can match the type inferred from an object literal, as long as the object literal supplies all of the required members

      该示例还说明,对象类型可以匹配从对象字面量推断出的类型,只要该对象字面量能提供了所有必需的成员

    13. Programmers can give names to object types; we call named object types interfaces

      给对象类型名字,就叫接口。 也可以通过对象类型字面量方式指定。

    14. All types in TypeScriptare subtypes of a single top typecalled the Any type.

      所有TS的类型都是Any类型的子类型。

    Annotators

    1. A Promise is an object that is used as a placeholder for the eventual results of a deferred (and possibly asynchronous) computation.

      Promise是个内置对象。

    2. As described above, semicolons are not inserted at every newline, and automatic semicolon insertion can depend on multiple tokens across line terminators.

      不一定每个新行都给你自动插入分号。

    3. is not intended to be used with the new operator

      Symbol不适用于new操作符。

    4. The assign function is used to copy the values of all of the enumerable own properties from one or more source objects to a target object. When the assign function is called, the following steps are taken:

      注意用它来浅复制一个对象。

    5. in single or double quotes

      单引号或双引号。说明两者没有什么区别。

    6. awaitbreakcasecatchclassconstcontinuedebuggerdefaultdeletedoelseenumexportextendsfalsefinallyforfunctionifimportininstanceofnewnullreturnsuperswitchthisthrowtruetrytypeofvarvoidwhilewithyield

      在键字并不多,注意下面的三个注还有一些保留字。

    7. All ECMAScript function objects have the [[Call]] internal method defined here. ECMAScript functions that are also constructors in addition have the [[Construct]] internal method.

      函数对象有个[[Call]]内部方法。还有内部构造函数。

    8. Even though ECMAScript includes syntax for class definitions, ECMAScript objects are not fundamentally class-based such as those in C++, Smalltalk, or Java.

      虽然有类(class)的定义,ECMAScript对象并不是像c++那样基于类的!

    9. An Object is logically a collection of properties. Each property is either a data property, or an accessor property

      对象逻辑上是属性的集合。每个属性要么是数据属性,要么是存取属性。

    10. Properties are identified using key values. A property key value is either an ECMAScript String value or a Symbol value. All String and Symbol values, including the empty String, are valid as property keys. A property name is a property key that is a String value

      属性由键值标识。一个属性键值可以是字符串值或Symbol值。所有了字符串和Symbol值,包括空字串,都是有效的属性值。

    1. Explore Dash Platform Name Service (DPNS)

      可以在测试网上申请注册名字。试了一下,好象没有什么约束,到时候名字怎么注册呢?会不会象EOS那样?没有找到相关资料。

    2. Phase 4: Prepare for Mainnet

      Dash等主网发布还需要些时间。属第四阶段,并且在主网发布前还有三个阶段。

  7. Jan 2020
    1. 会不会出中文版呢? 会不会被中国墙掉呢?

  8. Apr 2019
    1. 可以随时打开侧边栏,对本站的内容进行加亮标注或者对某些内容进行留言。

    Annotators

    URL

    1. 我觉得 Hypothes的确很不错。可是为什么国内几乎很少有人在用呢?相关的文章也不多。

    1. From comments to annotations

      从评论到标注: Hypotheis已经超越评论系统。

      • 同步同一文章的不同拷贝。
      • 定位到特定的文本,而不是滚到底部。
      • 提供按组和私密标记。
      • 通过链接ORCID允许作者获得标注的信用值。
      • 允许匿名和笔名
      • 开放标准,框平台
    1. a specific segment of the resource

      我很好奇是如何确定资源的一小部分的。

    1. Annotations can be considered an additional layer with respect to comments. Comments are published by the same publisher who hosts the original document. Annotations are added on top of that, but may eventually become comments which, in turn, may be integrated in a further version of the document itself

      comments(评论)能否是Annotation(注解)呢?

  9. Oct 2018
    1. 你执行的 Git 操作,几乎只往 Git 数据库中增加数据。 很难让 Git 执行任何不可逆操作,或者让它以任何方式清除数据。 同别的 VCS 一样,未提交更新时有可能丢失或弄乱修改的内容;但是一旦你提交快照到 Git 中,就难以再丢失数据,特别是如果你定期的推送数据库到其它仓库的话。

      这么说起来,git里的内容是不是只会越来越多。如果我想将git目录重置到之前的某个状态,是不是不可能?

    2. 开头还有一空行

      在这里输入内容

    3. 现在

      这个现在指的是2018年9月本书发布的时候吗?

    Annotators

    1. 经典博客

      这些内容都好老旧,并且这些人我也不怎么认识