TS项目实战一:流淌的字符动画界面

news2024/9/21 14:53:46

  使用ts实现虚拟世界,创建ts项目,并编写ts代码,使用tsc编译后直接加载到html界面,实现类似黑客帝国中的流淌的代码界面的效果。
源码下载地址:点击下载

  1. 讲解视频

    TS实战项目一:数字流界面项目创建


    TS实战项目三:动画效果优化

    )]

    TS实战项目二:黑客界面组件绘制

  2. B站视频

    TS实战项目一:数字流界面项目创建


    TS实战项目三:动画效果优化

    现)]

    TS实战项目二:数字流界面组件实现

  3. 西瓜视频
    https://www.bilibili.com/video/BV1za4y1k7tz/
    https://www.ixigua.com/7327475844874994227
    https://www.ixigua.com/7327849788131508790

一.预期效果

来自网络

二.知识点

  1. tsc编译
  2. tsconfig.json配置项
  3. 模块定义及导入导出
  4. 类定义
  5. 参数属性
  6. 存取器

三.实现思路

  创建paint创建每个单元格的具体信息,包括要展示的字符、大小、颜色等信息;创建col实现每一列的的内容,列中包含该列中具体的paint信息,可以进行流淌动画的执行及字符的更新等。
自动计算界面大小,动态调整列的数量及字符的尺寸,通过定时动画实现字符颜色的变动及流淌的效果。

四.创建项目

  1. 创建node项目,使用npm init命令,如下:
    在这里插入图片描述

  2. 安装ts库,npm install TypeScript --save:
    在这里插入图片描述

  3. .\node_modules.bin\tsc --init生成ts的项目配置文件,此处注意直接用vscode的powershell运行的时候会保存,请切换到cmd命令窗口执行命令:
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

  4. 安装lite-server库,npm install lite-server,用于提供web服务:
    在这里插入图片描述

    安装完毕后的目录结构如下:
    在这里插入图片描述

抖创建完毕后需要对项目进行初始化配置:

  1. 添加lite-server的启动指令,在package.json中的scripts中添加项目启动指令:“start”: “lite-server”,添加后可以直接使用npm start进行启动,启动后会自动启动一个web服务器,并自动打开默认浏览器,切每次js、css或html文件变动之后会自动刷新网页:
    在这里插入图片描述
    在这里插入图片描述

  2. 将tsconfig.json中的module指定为es6,baseUrl设置为’./’,rootDirs设置为[],inlineSourceMap设置为true,outDir设置为./dist,具体的明细如下:

{
  "compilerOptions": {
    /* Visit https://aka.ms/tsconfig to read more about this file */
    /* Projects */
    // "incremental": true,                              /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
    // "composite": true,                                /* Enable constraints that allow a TypeScript project to be used with project references. */
    // "tsBuildInfoFile": "./.tsbuildinfo",              /* Specify the path to .tsbuildinfo incremental compilation file. */
    // "disableSourceOfProjectReferenceRedirect": true,  /* Disable preferring source files instead of declaration files when referencing composite projects. */
    // "disableSolutionSearching": true,                 /* Opt a project out of multi-project reference checking when editing. */
    // "disableReferencedProjectLoad": true,             /* Reduce the number of projects loaded automatically by TypeScript. */
    /* Language and Environment */
    "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
    // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
    // "jsx": "preserve",                                /* Specify what JSX code is generated. */
    // "experimentalDecorators": true,                   /* Enable experimental support for legacy experimental decorators. */
    // "emitDecoratorMetadata": true,                    /* Emit design-type metadata for decorated declarations in source files. */
    // "jsxFactory": "",                                 /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
    // "jsxFragmentFactory": "",                         /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
    // "jsxImportSource": "",                            /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
    // "reactNamespace": "",                             /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
    // "noLib": true,                                    /* Disable including any library files, including the default lib.d.ts. */
    // "useDefineForClassFields": true,                  /* Emit ECMAScript-standard-compliant class fields. */
    // "moduleDetection": "auto",                        /* Control what method is used to detect module-format JS files. */
    /* Modules */
    "module": "ES6", /* Specify what module code is generated. */
    // "rootDir": "./",                                  /* Specify the root folder within your source files. */
    // "moduleResolution": "node10",                     /* Specify how TypeScript looks up a file from a given module specifier. */
    "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
    // "paths": {},                                      /* Specify a set of entries that re-map imports to additional lookup locations. */
    "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
    // "typeRoots": [],                                  /* Specify multiple folders that act like './node_modules/@types'. */
    // "types": [],                                      /* Specify type package names to be included without being referenced in a source file. */
    // "allowUmdGlobalAccess": true,                     /* Allow accessing UMD globals from modules. */
    // "moduleSuffixes": [],                             /* List of file name suffixes to search when resolving a module. */
    // "allowImportingTsExtensions": true,               /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
    // "resolvePackageJsonExports": true,                /* Use the package.json 'exports' field when resolving package imports. */
    // "resolvePackageJsonImports": true,                /* Use the package.json 'imports' field when resolving imports. */
    // "customConditions": [],                           /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
    // "resolveJsonModule": true,                        /* Enable importing .json files. */
    // "allowArbitraryExtensions": true,                 /* Enable importing files with any extension, provided a declaration file is present. */
    // "noResolve": true,                                /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
    /* JavaScript Support */
    // "allowJs": true,                                  /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
    // "checkJs": true,                                  /* Enable error reporting in type-checked JavaScript files. */
    // "maxNodeModuleJsDepth": 1,                        /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
    /* Emit */
    // "declaration": true,                              /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
    // "declarationMap": true,                           /* Create sourcemaps for d.ts files. */
    // "emitDeclarationOnly": true,                      /* Only output d.ts files and not JavaScript files. */
    // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
    "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
    // "outFile": "./index.js", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
    "outDir": "./dist", /* Specify an output folder for all emitted files. */
    // "removeComments": true,                           /* Disable emitting comments. */
    // "noEmit": true,                                   /* Disable emitting files from a compilation. */
    // "importHelpers": true,                            /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
    // "importsNotUsedAsValues": "remove",               /* Specify emit/checking behavior for imports that are only used for types. */
    // "downlevelIteration": true,                       /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
    // "sourceRoot": "",                                 /* Specify the root path for debuggers to find the reference source code. */
    // "mapRoot": "",                                    /* Specify the location where debugger should locate map files instead of generated locations. */
    // "inlineSources": true,                            /* Include source code in the sourcemaps inside the emitted JavaScript. */
    // "emitBOM": true,                                  /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
    // "newLine": "crlf",                                /* Set the newline character for emitting files. */
    // "stripInternal": true,                            /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
    // "noEmitHelpers": true,                            /* Disable generating custom helper functions like '__extends' in compiled output. */
    // "noEmitOnError": true,                            /* Disable emitting files if any type checking errors are reported. */
    // "preserveConstEnums": true,                       /* Disable erasing 'const enum' declarations in generated code. */
    // "declarationDir": "./",                           /* Specify the output directory for generated declaration files. */
    // "preserveValueImports": true,                     /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
    /* Interop Constraints */
    // "isolatedModules": true,                          /* Ensure that each file can be safely transpiled without relying on other imports. */
    // "verbatimModuleSyntax": true,                     /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
    "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
    "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
    // "preserveSymlinks": true,                         /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
    "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
    /* Type Checking */
    "strict": true, /* Enable all strict type-checking options. */
    // "noImplicitAny": true,                            /* Enable error reporting for expressions and declarations with an implied 'any' type. */
    // "strictNullChecks": true,                         /* When type checking, take into account 'null' and 'undefined'. */
    // "strictFunctionTypes": true,                      /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
    // "strictBindCallApply": true,                      /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
    // "strictPropertyInitialization": true,             /* Check for class properties that are declared but not set in the constructor. */
    // "noImplicitThis": true,                           /* Enable error reporting when 'this' is given the type 'any'. */
    // "useUnknownInCatchVariables": true,               /* Default catch clause variables as 'unknown' instead of 'any'. */
    // "alwaysStrict": true,                             /* Ensure 'use strict' is always emitted. */
    // "noUnusedLocals": true,                           /* Enable error reporting when local variables aren't read. */
    // "noUnusedParameters": true,                       /* Raise an error when a function parameter isn't read. */
    // "exactOptionalPropertyTypes": true,               /* Interpret optional property types as written, rather than adding 'undefined'. */
    // "noImplicitReturns": true,                        /* Enable error reporting for codepaths that do not explicitly return in a function. */
    // "noFallthroughCasesInSwitch": true,               /* Enable error reporting for fallthrough cases in switch statements. */
    // "noUncheckedIndexedAccess": true,                 /* Add 'undefined' to a type when accessed using an index. */
    // "noImplicitOverride": true,                       /* Ensure overriding members in derived classes are marked with an override modifier. */
    // "noPropertyAccessFromIndexSignature": true,       /* Enforces using indexed accessors for keys declared using an indexed type. */
    // "allowUnusedLabels": true,                        /* Disable error reporting for unused labels. */
    // "allowUnreachableCode": true,                     /* Disable error reporting for unreachable code. */
    /* Completeness */
    // "skipDefaultLibCheck": true,                      /* Skip type checking .d.ts files that are included with TypeScript. */
    "skipLibCheck": true /* Skip type checking all .d.ts files. */
  },
  "files": [
    "./src/index.ts",
  ]
}

3.新建src目录及dist目录,src目录中创建index.ts文件,根目录创建index.html文件:
在这里插入图片描述

五.编码实现

  1. index.html
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <link rel="icon" href="/favicon.ico">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>黑客帝国演示</title>
    <style>
        html,
        body {
            width: 100%;
            height: 100%;
            margin: 0px;
            padding: 0px;
            background-color: black;
        }

        #app {
            width: 100%;
            height: 100%;
            color: #fff;
            display: flex;
            overflow: hidden;
        }

        .col {
            flex: 1;
            text-align: center;
            line-height: 30px;
        }

        .point {}
    </style>
</head>

<body>
    <div id="app"></div>
    <script type="module" src="/dist/index.js"></script>
    <script>

    </script>
</body>

</html>
  1. index.ts
import Col from './col';
/**
 * 入口文件,控制字符的内容
 */
import Point from './point';

//列的数量
let colCount: number = 0;
//字符的大小
let charSize: number = 30;
//颜色
let sizes: number[] = [18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30];
//颜色
let colors = ['#00ffd2ef', '#00fb6744', '#00d55777', '#00d50888', '#00ff0a33', '#3efb0266'];
//生成数据
let cols: Array<Col> = new Array<Col>();
//字符集
let chars: string[] = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', ',', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '~', '!', '@', '#', '$', '%', '^', '&', '*', '"', '.', '/', '+', '-'];

/**
 * 动态效果
 */
const animina = () => {
    cols.forEach(col => {
        for (let i = col.points.length - 1; i > 0; i--) {
            col.points[i].char = col.points[i - 1].char;
            col.points[i].div.innerText = col.points[i].char;

            let color = colors[parseInt((Math.random() * 10) + '') % colors.length];
            col.points[i].color = color;
            col.points[i].div.style.color = color;


            let size = sizes[parseInt((Math.random() * 20) + '') % sizes.length];
            col.points[i].size = size;
            col.points[i].div.style.fontSize = col.points[i].size + 'ox';
        }

        let char = chars[parseInt((Math.random() * 100) + '') % chars.length];
        col.points[0].char = char;
        col.points[0].div.innerText = col.points[0].char;

        let color = colors[parseInt((Math.random() * 10) + '') % colors.length];
        col.points[0].color = color;
        col.points[0].div.style.color = color;

        let size = sizes[parseInt((Math.random() * 20) + '') % sizes.length];
        col.points[0].size = size;
        col.points[0].div.style.fontSize = col.points[0].size + 'ox';
    })
    window.requestAnimationFrame(animina);
}

/**
 * 初始化界面
 */
const init = () => {
    //计算列数
    colCount = window.screen.availWidth / (charSize + 8);

    //生成组件
    for (let i = 0; i < colCount; i++) {
        let points: Array<Point> = new Array<Point>();
        let div: HTMLElement = document.createElement('div');
        div.className = "col";

        for (let j = 0; j < 50; j++) {
            let pointdiv: HTMLElement = document.createElement('div');
            pointdiv.className = "point";

            let char = chars[parseInt((Math.random() * 100) + '') % chars.length];
            let color = colors[parseInt((Math.random() * 10) + '') % colors.length];
            let size = sizes[parseInt((Math.random() * 20) + '') % sizes.length];

            let point: Point = new Point(char, size, color, pointdiv);

            pointdiv.innerText = point.char;
            pointdiv.style.fontSize = point.size + 'px';
            // pointdiv.style.fontWeight = '600';
            pointdiv.style.color = point.color;

            points.push(point);
        }

        let col: Col = new Col(points, div);
        cols.push(col);
    }

    //绘制到界面上
    let root: HTMLElement | null = document.getElementById('app');
    root?.remove();
    root = document.createElement('div');
    root.id = 'app';
    document.body.appendChild(root);

    cols.forEach(col => {
        col.points.forEach(point => {
            let pointdiv = point.div;
            col.div.appendChild(pointdiv);
        })
        root?.append(col.div);
    })

    window.requestAnimationFrame(animina);
}

//将内容挂在到界面
window.onload = function (event: any) {
    init();
}
export default init;
  1. col.ts
import Point from './point';

/**
 * 每一列展示的内容
 */
export default class Col {
    constructor(private _points: Array<Point>, private _div: HTMLElement) {
    }

    set points(points: Array<Point>) {
        this._points = points;
    }
    get points(): Array<Point> {
        return this._points;
    }

    set div(points: HTMLElement) {
        this._div = points;
    }
    get div(): HTMLElement {
        return this._div;
    }
}
  1. point.ts
/**
 * 界面中基本元素
 */
export default class Point {
    /**
     * 构造函数
     * @param char  字符
     * @param size 大小
     * @param color 颜色
     */
    constructor(private _char: string, private _size: number, private _color: string, private _div: HTMLElement) { }

    set char(char: string) {
        this._char = char;
    }
    get char(): string {
        return this._char;
    }
    set size(size: number) {
        this._size = size;
    }
    get size(): number {
        return this._size;
    }
    set color(color: string) {
        this._color = color;
    }
    get color(): string {
        return this._color;
    }
    set div(div: HTMLElement) {
        this._div = div;
    }
    get div(): HTMLElement {
        return this._div;
    }
}

六.效果预览

在这里插入图片描述

七.遇到的问题

问题一: 项目创建后无法加载到html界面,需要指定编译输出为es6才可以,使用其它的模块加载器,需要引入对应的模块加载器环境。

问题二: ts中引入的import Point from ‘./Point’,在js中未自动添加.js后缀,导致界面加载时找不到paint文件,加载失败,需要手动将编译后js文件中的import 语句中添加上.js后缀。

问题三: 使用window.onload(()=>{})时报错,传入的回调函数的类型不匹配,因为有可能回调的时候this时null,需要直接使用window.onload = function():any{}的方式进行监听界面加载完毕的事件。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1424198.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

LRU缓存(Leetcode146)

例题&#xff1a; 分析&#xff1a; 题目要求函数get和put要达到O(1)的时间复杂度&#xff0c;可以用 hashMap 来实现&#xff0c;因为要满足逐出最久未使用的元素的一个效果&#xff0c;还需要配合一个双向链表来共同实现。链表中的节点为一组key-value。 我们可以用双向链表来…

前端工程化之:webpack1-9(plugin)

一、plugin loader 的功能定位是转换代码&#xff0c;而一些其他的操作难以使用 loader 完成&#xff0c;比如&#xff1a; 当 webpack 生成文件时&#xff0c;顺便多生成一个说明描述文件&#xff1b;当 webpack 编译启动时&#xff0c;控制台输出一句话表示 webpack 启动了&…

Gas Hero Common Heroes NFT 概览与数据分析

作者&#xff1a;stellafootprint.network 编译&#xff1a;mingfootprint.network 数据源&#xff1a;Gas Hero Common Heroes NFT Collection Dashboard Gas Hero “盖世英雄” 是一个交互式的 Web3 策略游戏&#xff0c;强调社交互动&#xff0c;并与 FSL 生态系统集成…

THREE.JS动态场景开发实战【赛博朋克】

在本教程中&#xff0c;我们将探索如何创建类似 Three.js 的赛博朋克场景&#xff0c;灵感来自 Pipe 网站上的背景动画。 我们将指导你完成使用 Three.js 编码动态场景的过程&#xff0c;包括后处理效果和动态光照&#xff0c;所有这些都不需要任何着色器专业知识。 我用这个场…

自动保存知乎上点赞的内容至本地

背景&#xff1a;知乎上常有非常精彩的回答/文章&#xff0c;必须要点赞收藏&#xff0c;日后回想起该回答/文章时翻看自己的动态和收藏夹却怎么也找不到&#xff0c;即使之前保存了链接网络不好也打不开了&#xff08;。所以我一般碰到好的回答/文章都会想办法保存它的离线版本…

文件上传的另类应用

1.Imagemagick CVE-2016-3714 CVE-2022-44268 CVE-2020-29599可在vulhub靶场进行复现1.1.Imagemagick简介 ImageMagic是一款图片处理工具&#xff0c;当传入一个恶意图片时&#xff0c;就有可能存在命令注入漏洞。 ImageMagick默认支持一种图片格式mvg&#xff0c;而mvg与svg…

USTC ICS(2023Fall) Lab2 The PingPong Sequence

LC-3汇编语言 .ORIG x3000LDI R0,n ;f(n)NOT R0,R0ADD R0,R0,#1 ;取R0补码用于减法AND R1,R1,#0 ;R1记录循环次数,先初始化为0ADD R2,R1,#0 ;R2记录符号&#xff0c;加号为0,减号为-1,f(1)对应加号ADD R3,R1,#3 ;记录f(n),f(1)3AND R5,R5,#0 ;R5存0000 1111 1111 1111…

ubuntu20配置mysql8

首先更新软件包索引运行 sudo apt update命令。然后运行 sudo apt install mysql-server安装MySQL服务器。 安装完成后&#xff0c;MySQL服务将作为systemd服务自动启动。你可以运行 sudo systemctl status mysql命令验证MySQL服务器是否正在运行。 连接MySQL 当MySQL安装…

华为mate60 pro与小米14 pro 的巅峰对决

今天我们换下思路&#xff0c;不讲技术了&#xff01;我们一起讲讲手机&#xff01;小编暂时充当一下业余的数码咖。 今天我们就讲讲华为mate60 pro和小米14pro 这两款手机。这两款手机都是近期新出的发行版本&#xff0c;热度那是一直未减啊。 华为mate60 Pro 我们先说说这个…

gitlab-runner注册到gitlab时报错:ERROR: Registering runner... failed xxxxxxxx

天行健&#xff0c;君子以自强不息&#xff1b;地势坤&#xff0c;君子以厚德载物。 每个人都有惰性&#xff0c;但不断学习是好好生活的根本&#xff0c;共勉&#xff01; 文章均为学习整理笔记&#xff0c;分享记录为主&#xff0c;如有错误请指正&#xff0c;共同学习进步。…

CRG设计之时钟

1. 前言 CRG(Clock and Reset Generation&#xff0c;时钟复位生成模块) 模块扮演着关键角色。这个模块负责为整个系统提供稳定可靠的时钟信号&#xff0c;同时在系统上电或出现故障时生成复位信号&#xff0c;确保各个模块按预期运行。简而言之&#xff0c;CRG模块就像是SoC系…

Advanced CNN

文章目录 回顾Google NetInception1*1卷积Inception模块的实现网络构建完整代码 ResNet残差模块 Resedual Block残差网络的简单应用残差实现的代码 练习 回顾 这是一个简单的线性的卷积神经网络 然而有很多更为复杂的卷积神经网络。 Google Net Google Net 也叫Inception V…

第一集《修道宗范》

当家师父慈悲&#xff0c;诸位法师、诸位新戒、诸位在家菩萨&#xff0c;阿弥陀佛 今天学人跟大家研究的主题是《修道宗范》。很多人都会认为&#xff1a;所有的宗教都是劝人为善&#xff0c;所以佛教的修学跟一般的宗教&#xff0c;完全是一样的。其实&#xff0c;这个观念只…

Centos慢慢长大(一)

1、写在前面 这将是一个系列性的文章。可能更多的是记录我在学习的过程中的一些感悟吧。我想强调的是在这一系列文章里我会从最小化的安装开始&#xff0c;然后逐渐的增加需要安装的软件。就象一个婴儿的诞生&#xff0c;慢慢的学走路、学说话、学使用筷子。。。。。。 这将是一…

离谱题 3236:练39.1 书香阁座位

3236正常写法 #include<bits/stdc.h> using namespace std; int main() {int sum,a,b;a1;b10;sumb;cout<<a<<" "<<b;cout<<" "<<sum<<endl;do{a;b2;sumx;cout<<a<<" "<<b<<&…

升级企业战略,思腾合力布局智能生产基地

一直专注于人工智能领域&#xff0c;提供云计算、AI服务器、AI工作站、系统集成、产品定制、软件开发、边缘计算等产品和整体解决方案&#xff0c;致力于成为行业领先的人工智能基础架构解决方案商。 升级企业战略 布局智能生产基地 “十四五”时期&#xff0c;是乘势而上打造…

力扣hot100 不同路径 多维DP 滚动数组 数论

Problem: 62. 不同路径 文章目录 思路解题方法复杂度朴素DP 思路 讲述看到这一题的思路 解题方法 &#x1f468;‍&#x1f3eb; 卡尔一题三解 复杂度 时间复杂度: &#xff1a; O ( n m ) O(nm) O(nm) 空间复杂度: O ( n m ) O(nm) O(nm) 朴素DP class Solution {p…

【Qt学习笔记】(一)初识Qt

Qt学习笔记 1 使用Qt Creator 新建项目2 项目代码解释3 创建第一个 Hello World 程序4 关于内存泄漏问题5 Qt 中的对象树6 关于 qDebug&#xff08;&#xff09;的使用7 使用其他方式创建一个 Hello World 程序&#xff08;编辑框和按钮方式&#xff09;8 关于 Qt 中的命名规范…

操作系统基础:死锁

&#x1f308;个人主页&#xff1a;godspeed_lucip &#x1f525; 系列专栏&#xff1a;OS从基础到进阶 &#x1f426;1 死锁的概念&#x1f9a2;1.1 总览&#x1f9a2;1.2 什么是死锁&#x1f9a2;1.3 死锁、饥饿、死循环的区别&#x1f427;1.3.1 概念&#x1f427;1.3.2 区别…

#RAG|NLP|Jieba|PDF2WORD# pdf转word-换行问题

文档在生成PDF时,文宁都发生了什么。本文讲解了配置对象、resources对象和content对象的作用,以及字体、宇号、坐标、文本摆放等过程。同时,还解释了为什么PDF转word或转文字都是一行一行的以及为什么页眉页脚的问题会加大识别难度。最后提到了文本的编码和PDF中缺少文档结构标…