components typescript arguments passing
typescript: Template Method pattern
/** * Template Method pattern 模版方法是一种行为设计模式, 它在基类中定义了一个算法的框架, 允许子类在不修改结构的情况下重写算法的特定步骤。 * file: Templatets.ts * The Abstract Class defines a template m ......
typescript: State Pattern
/** * State Pattern 状态是一种行为设计模式, 让你能在一个对象的内部状态变化时改变其行为。 * The Context defines the interface of interest to clients. It also maintains a * reference to ......
typescript: Iterator Pattern
/** * Iterator Pattern 迭代器是一种行为设计模式, 让你能在不暴露复杂数据结构内部细节的情况下遍历其中所有的元素 * file: Iteratorts.ts npm install -g babel-cli * Intent: Lets you traverse element ......
typescript: Memento Pattern
/** * Memento Pattern 备忘录是一种行为设计模式, 允许生成对象状态的快照并在以后将其还原。 * The Originator holds some important state that may change over time. It also * defines a me ......
ERROR Error: No component factory found for Edit2Component. Did you add it to @NgModule.entryComponents?at noComponentFactoryError (core.js:9877:1)
原文链接:https://www.longkui.site/error/no-component/4843/ angular项目调用组件的时候开始报这个错误,大概的意思是NgModule中没有Edit2Component这个组件。 解决方法: 我们找到组件的xxxx.module.ts。在entry ......
typescript: Chain of Responsibility Pattern
/** * Chain of Responsibility Pattern 责任链是一种行为设计模式, 允许你将请求沿着处理者链进行发送, 直至其中一个处理者对其进行处理。 * file: Chaints.ts * The Handler interface declares a method fo ......
typescript: Proxy Pattern
/** * Proxy Pattern 代理是一种结构型设计模式, 让你能提供真实服务对象的替代品给客户端使用。 代理接收客户端的请求并进行一些处理 (访问控制和缓存等), 然后再将请求传递给服务对象。 * The Subject interface declares common operatio ......
[CF1508D] Swap Pass
D - Swap Pass 先将所有\(a_i==i\)的点都直接去掉 考虑将\(i\)向\(a_i\)连边,那么就会形成一个个的环 考虑只有一个环的情况,那么我们任意固定一个点\(x\),一直交换\(a_x\)与\(a_{a_x}\)直到\(a_x==x\),因为所有所有边都交于一点,所以这肯定是 ......
[Typescript] Type and Interface for performance
Let's say you're creating a component that has all the props of input but needs to add a label prop. You'll need to extend from the ComponentProps typ ......
typescript: Flyweight Pattern
/** * Flyweight Pattern 享元是一种结构型设计模式, 它允许你在消耗少量内存的情况下支持大量对象。 * https://refactoringguru.cn/design-patterns/flyweight/typescript/example#lang-features * ......
TypeError: compute_class_weight() takes 1 positional argument but 3 were given
TypeError Traceback (most recent call last) /tmp/ipykernel_14395/3700018132.py in <module> 5 class_weights = class_weight.compute_class_weight('balanc ......
TypeScript基础
基础类型:":"后面为变量的数据类型 布尔值:boolean let isDone:boolean=false 数字:number TypeScript中的所有数字类型都是浮点数,类型统一都是number,支持十进制,二进制,八进制,十六进制。 let count:number=100 字符串:st ......
typescript: Facade Pattern
/** * Facade pattern 外观是一种结构型设计模式, 能为复杂系统、 程序库或框架提供一个简单 (但有限) 的接口。 * The Facade class provides a simple interface to the complex logic of one or * sev ......
C# Dx截图初始化报错“SharpDX.SharpDXException: HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: 参数错误。
最近发现Dx截图创建输出设备时output.QueryInterface<Output1>().DuplicateOutput 报错:“SharpDX.SharpDXException: HRESULT: [0x80070057], Module: [General], ApiCode: [E_IN ......
TypeScript入门到精通——TypeScript类型系统基础——元组类型
TypeScript类型系统基础——元组类型 元组(Tuple)表示由有限元素构成的有序列表。在 JavaScript 中,没有提供原生的元组数据类型。TypeScript 对此进行了补充,提供了元组数据类型。由于元组数组之间存在很多共性,因此 TypeScript 使用数组来表示元组。 在 Typ ......
typescript: Decorator Pattern
/** * Decorator Pattern 装饰是一种结构设计模式, 允许你通过将对象放入特殊封装对象中来为原对象增加新的行为。 * The base Component interface defines operations that can be altered by * decorato ......
typescript: Bridge Pattern
/** * Bridge Pattern 桥接是一种结构型设计模式, 可将业务逻辑或一个大类拆分为不同的层次结构, 从而能独立地进行开发。 * https://dev.to/takaakit/uml-diagram-for-gof-design-pattern-examples-in-typescr ......
TypeScript入门到精通——TypeScript类型系统基础——数组类型
数组类型 数组是十分常用的数据结构,它表示一组有序元素的集合。在 TypeScript中,数组值的数据类型为数组类型。 一、数组类型定义 TypeScript 提供了以下两种方式来定义数组类型: 简单数组类型表示法 泛型数组类型表示法 1.1、简单数组类型表示法 在TypeScript中,你可以使用 ......
typescript: Adapter pattern
/** * Adapter pattern 适配器是一种结构型设计模式, 它能使不兼容的对象能够相互合作。 * file: Adapterts.ts * * */ /** * The Target defines the domain-specific interface used by the c ......
typescript: Singleton Pattern
/** * file: Singletonts.ts * Singleton Pattern 单例是一种创建型设计模式, 让你能够保证一个类只有一个实例, 并提供一个访问该实例的全局节点。 * The Singleton class defines the `getInstance` method ......
webpack - 构建支持TypeScript的React应用
1. 初始化package.json 创建项目文件夹 mkdir webpack-react-ts cd webpack-react-ts 初始化项目package.json yarn init -y { "name": "webpack-react-ts", "version": "1.0.0", ......
styled-components & CSS pseudo classes All In One
styled-components & CSS pseudo classes All In One
::after & ::before CSS 伪元素
......
【图论】【寻找性质】CF1151E Number of Components 题解
CF1151E 发现每一个 \(f(l, r)\) 中的连通块总是一条链(一棵树)。 那么此时连通块的数量就等于点的数量减去边的数量。 先考虑点的总数,一个价值为 \(a_i\) 的点一定是在 \(l \leqslant a_i\) 且 \(r\geqslant a_i\) 的 \(f(l, r)\ ......
QT5.14: 打开文件出错warning: format '%s' expects argument of type 'char*'
错误提示信息: D:\Demo\QT5.14\CH5\CH501\imgprocessor.cpp:158: warning: format '%s' expects argument of type 'char*', but argument 2 has type 'QChar*' [-Wform ......
typescript: Prototype Pattern
/** * Prototype Pattern 原型是一种创建型设计模式, 使你能够复制对象, 甚至是复杂对象, 而又无需使代码依赖它们所属的类。 * The example class that has cloning ability. We'll see how the values of fi ......
typescript: Builder Pattern
/** * TypeScript 实体类 Model * Builder Pattern * 生成器是一种创建型设计模式, 使你能够分步骤创建复杂对象。 * https://stackoverflow.com/questions/12827266/get-and-set-in-typescript ......
typescript: model
/** * TypeScript 实体类 Model geovindu,Geovin Du * https://stackoverflow.com/questions/12827266/get-and-set-in-typescript * https://github.com/Microsoft/ ......
TypeScript入门到精通——TypeScript类型系统基础——单元类型、顶端类型、尾端类型
单元类型 单元类型(Unit Type)也叫作单例类型(Singleton Type),指的是仅包含一个可能值的类型。由于这个特殊的性质,编译器在处理单元类型时甚至不需要关注单元类型表示的具体值。 TypeScript 中的单元类型有以下几种: undefined 类型 null 类型 unique ......
TypeScript入门到精通——TypeScript类型系统基础——字面量类型
字面量类型 TypeScript 支持将字面量作为类型使用,我们称之为字面量类型。每一个字面量类型都只有一个可能的值,即字面量本身。 1、boolean 字面量类型 boolean 字面量类型只有以下两种: true 字面量类型 false 字面量类型 原始类型 boolean 等同于由 true ......
什么是 TypeScript 的类型增强功能
TypeScript 的类型增强(Type Augmentation)是一种功能,它允许您扩展现有类型的成员,以添加新的属性或方法,以及修改已有属性或方法的类型定义。这个功能让您可以更好地适应第三方库或原始代码,以便在不修改源代码的情况下添加自定义的类型信息。在本文中,我将详细介绍 TypeScri ......