04 2023 档案

摘要:Principle 1 Write clear and specific instructions clear !== short Clear and specific instructions for a model will guide it towards the desired output 阅读全文
posted @ 2023-04-28 14:07 Zhentiw 阅读(70) 评论(0) 推荐(0) 编辑
摘要:logger.ts // .env LOGGER_LEVEL=debug // logger.ts import * as winston from "winston"; export const logger = winston.createLogger({ level: process.env. 阅读全文
posted @ 2023-04-26 15:47 Zhentiw 阅读(11) 评论(0) 推荐(0) 编辑
摘要:import * as dotenv from "dotenv"; const result = dotenv.config(); if (result.error) { console.log('Error loading environment variables, aborting.') pr 阅读全文
posted @ 2023-04-26 15:35 Zhentiw 阅读(14) 评论(0) 推荐(0) 编辑
摘要:Check the adapter pattern https://www.tutorialspoint.com/design_pattern/adapter_pattern.htm Client: Call the common entry public class AdapterPatternD 阅读全文
posted @ 2023-04-26 02:38 Zhentiw 阅读(12) 评论(0) 推荐(0) 编辑
摘要:Both JSON.parse(JSON,strigify())& structuredClone doesn't work with Dateand function. var foo = {name: 'foo', bar: () => 'bar'} var foo2 = structuredC 阅读全文
posted @ 2023-04-18 13:36 Zhentiw 阅读(39) 评论(0) 推荐(0) 编辑
摘要:Original code: import { CSSProperties } from "react"; const useStyled = <TTheme = {}>(func: (theme: TTheme) => CSSProperties) => { // Imagine that thi 阅读全文
posted @ 2023-04-17 14:45 Zhentiw 阅读(15) 评论(0) 推荐(0) 编辑
摘要:Service: fromObservable & fromSignalcan transform observable to and from signals. import { HttpClient, HttpErrorResponse } from '@angular/common/http' 阅读全文
posted @ 2023-04-13 13:56 Zhentiw 阅读(100) 评论(0) 推荐(0) 编辑
摘要:This the following code example, test have passed for both run time and compile time: import { expect, it } from 'vitest'; import { Equal, Expect } fr 阅读全文
posted @ 2023-04-11 21:09 Zhentiw 阅读(8) 评论(0) 推荐(0) 编辑
摘要:export const inferItemLiteral = <T>(t: T) => { return { output: t, }; }; const result1 = inferItemLiteral("a"); // ? {output: string} /* vs */ export 阅读全文
posted @ 2023-04-10 21:31 Zhentiw 阅读(12) 评论(0) 推荐(0) 编辑
摘要:There are two options doing the same things. const makeSafe = <TParams extends any[], TReturn>(func: (...args: TParams) => TReturn) => ( ...args: TPar 阅读全文
posted @ 2023-04-10 21:16 Zhentiw 阅读(12) 评论(0) 推荐(0) 编辑
摘要:Compare two code snippet const people = [ {id: 1,name: 'John', age: 45}, {id: 2,name: "Op", age: 32}, {id: 3, name: "Wade",age: 39 } ] // option 1 con 阅读全文
posted @ 2023-04-07 19:58 Zhentiw 阅读(16) 评论(0) 推荐(0) 编辑
摘要:Write a function that takes in an array of positive integers and returns the maximum sum of non-adjacent elements in the array. If the input array is 阅读全文
posted @ 2023-04-05 02:43 Zhentiw 阅读(10) 评论(0) 推荐(0) 编辑
摘要:The transpose of a matrix is an operator which flips a matrix over its diagonal; that is, it switches the row and column indices of the matrix A by pr 阅读全文
posted @ 2023-04-04 01:49 Zhentiw 阅读(20) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示