当前位置: 首页 > news >正文

如何将数据库字符集改为中文,让今后所有的数据库都支持中文

最后一行有我自己的my.ini文件

数据库输入中文数据时会变为乱码,

这个时候,我们为每个数据库设置字符集,太过于麻烦,为数据库单独设置重启后又会消失

Set character_set_database=’utf8’;
Set character_set_server=’utf8’;

先查看当前数据库参数

输入代码:

Show variables like ‘char%’;

set character_set_database='utf8';

Show variables like ‘char%’;

为了确保新创建的数据库和表默认使用UTF-8编码,可以在MySQL的配置文件my.cnfmy.ini中添加或修改以下参数:

这样的方式可以让今后所有的数据库新建时默认utf-8

[client]
default-character-set=utf8mb4[mysql]
default-character-set=utf8mb4[mysqld]
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci

 目前只能针对某一数据库来进行,所以直接使用就行

ALTER DATABASE your_database_name CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

通过以上步骤就可以将整个数据库都改为UTF-8支持中文

 my.ini(在Unix/Linux系统中通常称为my.cnf)是MySQL数据库的配置文件,用于指定MySQL服务器的各种设置,包括字符集、端口、数据目录等。根据操作系统和安装方式的不同,这个文件可能位于不同的位置。以下是寻找my.inimy.cnf文件的一些常见位置:

Windows 系统

  1. 默认安装路径

    • C:\ProgramData\MySQL\MySQL Server X.Y\my.ini 或
    • C:\Program Files\MySQL\MySQL Server X.Y\my.ini

    其中X.Y代表您的MySQL版本号。

  2. 通过MySQL Installer安装:如果您使用的是MySQL Installer来安装MySQL,那么配置文件可能会被放置在上述默认位置之一。

  3. 自定义路径:如果在安装过程中指定了不同的配置文件路径,则需要参考当时的安装记录或文档。

  4. 查看当前使用的配置文件路径:您可以通过以下命令查看MySQL正在使用的配置文件的位置。

    mysql> SHOW VARIABLES LIKE 'explicit_defaults_for_timestamp';

    但是更直接的方式是在命令行下运行:

    mysqld --verbose --help | findstr "Default options" -A 10

Unix/Linux 系统

  1. 标准位置

    • /etc/my.cnf
    • /etc/mysql/my.cnf
    • ~/.my.cnf(用户特定配置)
  2. 其他可能位置:MySQL服务启动时会按照特定顺序查找配置文件,您可以使用以下命令找到MySQL实际加载的配置文件:

    mysqld --verbose --help | grep -A 1 "Default options"

    这个命令将列出MySQL搜索配置文件的顺序和位置。

  3. Docker容器内:如果MySQL是在Docker容器中运行,配置文件可能是通过挂载卷的方式提供的,或者是在容器内部的一个自定义位置。您可以进入容器检查:

    docker exec -it container_name bash

查找配置文件的具体步骤

  • Windows:

    1. 打开文件资源管理器。
    2. 导航至上述提到的可能位置之一。
    3. 如果找不到,请尝试使用搜索功能查找my.inimy.cnf文件。
  • Linux/Unix:

    1. 打开终端。
    2. 使用locatefind命令查找配置文件:
      sudo updatedb  # 更新数据库以确保locate能找到最新的文件
      locate my.cnf
      或者
      find / -name my.cnf 2>/dev/null

一旦找到了正确的配置文件,就可以按照之前提供的指南进行编辑以修改字符集设置。记得在修改后重启MySQL服务使更改生效。

以下为我的my.ini全文

原文链接各个系统如何寻找数据库的my.ini并进行修改-CSDN博客

# Other default tuning values
# MySQL Server Instance Configuration File
# ----------------------------------------------------------------------
# Generated by the MySQL Server Instance Configuration Wizard
#
#
# Installation Instructions
# ----------------------------------------------------------------------
#
# On Linux you can copy this file to /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options
# (@localstatedir@ for this installation) or to
# ~/.my.cnf to set user-specific options.
#
# On Windows, when MySQL has been installed using MySQL Installer you
# should keep this file in the ProgramData directory of your server
# (e.g. C:\ProgramData\MySQL\MySQL Server X.Y). To make sure the server
# reads the config file, use the startup option "--defaults-file".
#
# To run the server from the command line, execute this in a 
# command line shell, e.g.
# mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"
#
# To install the server as a Windows service manually, execute this in a 
# command line shell, e.g.
# mysqld --install MySQLXY --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"
#
# And then execute this in a command line shell to start the server, e.g.
# net start MySQLXY
#
#
# Guidelines for editing this file
# ----------------------------------------------------------------------
#
# In this file, you can use all long options that the program supports.
# If you want to know the options a program supports, start the program
# with the "--help" option.
#
# More detailed information about the individual options can also be
# found in the manual.
#
# For advice on how to change settings please see
# https://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
#
#
# CLIENT SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by MySQL client applications.
# Note that only client applications shipped by MySQL are guaranteed
# to read this section. If you want your own MySQL client program to
# honor these values, you need to specify it as an option during the
# MySQL client library initialization.
#
[client]default_character-set=utf8mb4# pipe=# socket=MYSQLport=3306[mysql]
no-beepdefault-character-set=utf8mb4# SERVER SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this 
# file.
#
# server_type=3
[mysqld]
character_set_server=utf8mb4
collation_server=utf8mb4_unicode_ci # The next three options are mutually exclusive to SERVER_PORT below.
# skip-networking
# enable-named-pipe
# shared-memory# shared-memory-base-name=MYSQL# The Pipe the MySQL Server will use
# socket=MYSQL# The access control granted to clients on the named pipe created by the MySQL Server.
# named-pipe-full-access-group=# The TCP/IP Port the MySQL Server will listen on
port=3306# Path to installation directory. All paths are usually resolved relative to this.
# basedir="C:/Program Files/MySQL/MySQL Server 5.7/"# Path to the database root
datadir=C:/ProgramData/MySQL/MySQL Server 5.7/Data# The default character set that will be used when a new schema or table is
# created and no character set is defined
# character-set-server=# The default storage engine that will be used when create new tables when
default-storage-engine=INNODB# The current server SQL mode, which can be set dynamically.
# Modes affect the SQL syntax MySQL supports and the data validation checks it performs. This 
# makes it easier to use MySQL in different environments and to use MySQL together with other 
# database servers.
sql-mode="ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"# General and Slow logging.
log-output=FILEgeneral-log=0general_log_file="DESKTOP-QNC8DKQ.log"slow-query-log=1slow_query_log_file="DESKTOP-QNC8DKQ-slow.log"long_query_time=10# Error Logging.
log-error="DESKTOP-QNC8DKQ.err"# ***** Group Replication Related *****
# Specifies the base name to use for binary log files. With binary logging
# enabled, the server logs all statements that change data to the binary
# log, which is used for backup and replication.
# log-bin# ***** Group Replication Related *****
# Specifies the server ID. For servers that are used in a replication topology,
# you must specify a unique server ID for each replication server, in the
# range from 1 to 2^32 − 1. "Unique" means that each ID must be different
# from every other ID in use by any other replication source or replica.
server-id=1# ***** Group Replication Related *****
# Indicates how table and database names are stored on disk and used in MySQL.
# Value 0 = Table and database names are stored on disk using the lettercase specified in the CREATE 
#           TABLE or CREATE DATABASE statement. Name comparisons are case-sensitive. You should not 
#           set this variable to 0 if you are running MySQL on a system that has case-insensitive file 
#           names (such as Windows or macOS). If you force this variable to 0 with 
#           --lower-case-table-names=0 on a case-insensitive file system and access MyISAM tablenames 
#           using different lettercases, index corruption may result.
# Value 1 = Table names are stored in lowercase on disk and name comparisons are not case-sensitive. 
#           MySQL converts all table names to lowercase on storage and lookup. This behavior also applies 
#           to database names and table aliases.
# Value 2 = Table and database names are stored on disk using the lettercase specified in the CREATE TABLE 
#           or CREATE DATABASE statement, but MySQL converts them to lowercase on lookup. Name comparisons 
#           are not case-sensitive. This works only on file systems that are not case-sensitive! InnoDB 
#           table names and view names are stored in lowercase, as for lower_case_table_names=1.
lower_case_table_names=1# This variable is used to limit the effect of data import and export operations, such as 
# those performed by the LOAD DATA and SELECT ... INTO OUTFILE statements and the 
# LOAD_FILE() function. These operations are permitted only to users who have the FILE privilege.
secure-file-priv="C:/ProgramData/MySQL/MySQL Server 5.7/Uploads"# The maximum amount of concurrent sessions the MySQL server will
# allow. One of these connections will be reserved for a user with
# SUPER privileges to allow the administrator to login even if the
# connection limit has been reached.
max_connections=151# The number of open tables for all threads. Increasing this value
# increases the number of file descriptors that mysqld requires.
# Therefore you have to make sure to set the amount of open files
# allowed to at least 4096 in the variable "open-files-limit" in
# section [mysqld_safe]
table_open_cache=2000# Defines the maximum size of internal in-memory temporary tables created 
# by the MEMORY storage engine and, as of MySQL 8.0.28, the TempTable storage 
# engine. If an internal in-memory temporary table exceeds this size, it is 
# automatically converted to an on-disk internal temporary table.
tmp_table_size=51M#*** MyISAM Specific options
# The maximum size of the temporary file that MySQL is permitted to use while re-creating a 
# MyISAM index (during REPAIR TABLE, ALTER TABLE, or LOAD DATA). If the file size would be 
# larger than this value, the index is created using the key cache instead, which is slower. 
# The value is given in bytes.
myisam_max_sort_file_size=2146435072# The size of the buffer that is allocated when sorting MyISAM indexes during a REPAIR TABLE 
# or when creating indexes with CREATE INDEX or ALTER TABLE.
myisam_sort_buffer_size=92M# Size of the Key Buffer, used to cache index blocks for MyISAM tables.
# Do not set it larger than 30% of your available memory, as some memory
# is also required by the OS to cache rows. Even if you're not using
# MyISAM tables, you should still set it to 8-64M as it will also be
# used for internal temporary disk tables.
key_buffer_size=8M# Each thread that does a sequential scan for a MyISAM table allocates a buffer 
# of this size (in bytes) for each table it scans. If you do many sequential 
# scans, you might want to increase this value, which defaults to 131072. The 
# value of this variable should be a multiple of 4KB. If it is set to a value 
# that is not a multiple of 4KB, its value is rounded down to the nearest multiple 
# of 4KB.
read_buffer_size=128K# This variable is used for reads from MyISAM tables, and, for any storage engine, 
# for Multi-Range Read optimization.
read_rnd_buffer_size=256K#*** INNODB Specific options ***
# innodb_data_home_dir=# Use this option if you have a MySQL server with InnoDB support enabled
# but you do not plan to use it. This will save memory and disk space
# and speed up some things.
# skip-innodb# If set to 1, InnoDB will flush (fsync) the transaction logs to the
# disk at each commit, which offers full ACID behavior. If you are
# willing to compromise this safety, and you are running small
# transactions, you may set this to 0 or 2 to reduce disk I/O to the
# logs. Value 0 means that the log is only written to the log file and
# the log file flushed to disk approximately once per second. Value 2
# means the log is written to the log file at each commit, but the log
# file is only flushed to disk approximately once per second.
innodb_flush_log_at_trx_commit=1# The size in bytes of the buffer that InnoDB uses to write to the log files on 
# disk. The default value changed from 8MB to 16MB with the introduction of 32KB 
# and 64KB innodb_page_size values. A large log buffer enables large transactions 
# to run without the need to write the log to disk before the transactions commit. 
# Thus, if you have transactions that update, insert, or delete many rows, making 
# the log buffer larger saves disk I/O.
innodb_log_buffer_size=16M# The size in bytes of the buffer pool, the memory area where InnoDB caches table 
# and index data. The default value is 134217728 bytes (128MB). The maximum value 
# depends on the CPU architecture; the maximum is 4294967295 (232-1) on 32-bit systems 
# and 18446744073709551615 (264-1) on 64-bit systems. On 32-bit systems, the CPU 
# architecture and operating system may impose a lower practical maximum size than the 
# stated maximum. When the size of the buffer pool is greater than 1GB, setting 
# innodb_buffer_pool_instances to a value greater than 1 can improve the scalability on 
# a busy server.
innodb_buffer_pool_size=128M# Size of each log file in a log group. You should set the combined size
# of log files to about 25%-100% of your buffer pool size to avoid
# unneeded buffer pool flush activity on log file overwrite. However,
# note that a larger logfile size will increase the time needed for the
# recovery process.
innodb_log_file_size=48M# Defines the maximum number of threads permitted inside of InnoDB. A value 
# of 0 (the default) is interpreted as infinite concurrency (no limit). This 
# variable is intended for performance tuning on high concurrency systems.
# InnoDB tries to keep the number of threads inside InnoDB less than or equal to 
# the innodb_thread_concurrency limit. Once the limit is reached, additional threads 
# are placed into a "First In, First Out" (FIFO) queue for waiting threads. Threads 
# waiting for locks are not counted in the number of concurrently executing threads.
innodb_thread_concurrency=17# The increment size (in MB) for extending the size of an auto-extend InnoDB system tablespace file when it becomes full.
innodb_autoextend_increment=64# The number of regions that the InnoDB buffer pool is divided into.
# For systems with buffer pools in the multi-gigabyte range, dividing the buffer pool into separate instances can improve concurrency,
# by reducing contention as different threads read and write to cached pages.
innodb_buffer_pool_instances=8# Determines the number of threads that can enter InnoDB concurrently.
innodb_concurrency_tickets=5000# Specifies how long in milliseconds (ms) a block inserted into the old sublist must stay there after its first access before
# it can be moved to the new sublist.
innodb_old_blocks_time=1000# When this variable is enabled, InnoDB updates statistics during metadata statements.
innodb_stats_on_metadata=0# When innodb_file_per_table is enabled (the default in 5.6.6 and higher), InnoDB stores the data and indexes for each newly created table
# in a separate .ibd file, rather than in the system tablespace.
innodb_file_per_table=1# Use the following list of values: 0 for crc32, 1 for strict_crc32, 2 for innodb, 3 for strict_innodb, 4 for none, 5 for strict_none.
innodb_checksum_algorithm=0# If this is set to a nonzero value, all tables are closed every flush_time seconds to free up resources and
# synchronize unflushed data to disk.
# This option is best used only on systems with minimal resources.
flush_time=0# The minimum size of the buffer that is used for plain index scans, range index scans, and joins that do not use
# indexes and thus perform full table scans.
join_buffer_size=256K# The maximum size of one packet or any generated or intermediate string, or any parameter sent by the
# mysql_stmt_send_long_data() C API function.
max_allowed_packet=4M# If more than this many successive connection requests from a host are interrupted without a successful connection,
# the server blocks that host from performing further connections.
max_connect_errors=100# Changes the number of file descriptors available to mysqld.
# You should try increasing the value of this option if mysqld gives you the error "Too many open files".
open_files_limit=4161# If you see many sort_merge_passes per second in SHOW GLOBAL STATUS output, you can consider increasing the
# sort_buffer_size value to speed up ORDER BY or GROUP BY operations that cannot be improved with query optimization
# or improved indexing.
sort_buffer_size=256K# Specify the maximum size of a row-based binary log event, in bytes.
# Rows are grouped into events smaller than this size if possible. The value should be a multiple of 256.
binlog_row_event_max_size=8K# If the value of this variable is greater than 0, a replica synchronizes its master.info file to disk.
# (using fdatasync()) after every sync_master_info events.
sync_master_info=10000# If the value of this variable is greater than 0, the MySQL server synchronizes its relay log to disk.
# (using fdatasync()) after every sync_relay_log writes to the relay log.
sync_relay_log=10000# If the value of this variable is greater than 0, a replica synchronizes its relay-log.info file to disk.
# (using fdatasync()) after every sync_relay_log_info transactions.
sync_relay_log_info=10000# Load mysql plugins at start."plugin_x ; plugin_y".
# plugin_load# The TCP/IP Port the MySQL Server X Protocol will listen on.
# loose_mysqlx_port=33060

Windows 如何重启数据库

原文链接 Windows 如何重启数据库-CSDN博客

在Windows操作系统上重启MySQL数据库服务可以通过多种方式进行,包括使用命令行工具和服务管理控制台。以下是具体步骤:

方法一:通过命令提示符(CMD)重启MySQL服务
打开命令提示符:

按 Win + R 键,输入 cmd,然后按 Enter 键打开命令提示符窗口。
停止MySQL服务: 在命令提示符中输入以下命令以停止MySQL服务。请注意,您可能需要管理员权限来执行这些命令。

net stop MySQLX.Y
其中 MySQLX.Y 应替换为您的MySQL服务名称。默认情况下,这可能是 MySQL57, MySQL80 等,取决于您的安装版本。

启动MySQL服务: 输入以下命令以启动MySQL服务:

net start MySQLX.Y


方法二:通过服务管理控制台重启MySQL服务
打开服务管理控制台:

按 Win + R 键,输入 services.msc,然后按 Enter 键打开服务管理控制台。
找到MySQL服务:

在服务列表中向下滚动,直到找到与MySQL相关的服务项,例如 MySQL57, MySQL80 或者您自定义的服务名。
重启MySQL服务:

右键点击MySQL服务项,选择 重启(Restart)。如果服务当前正在运行,此操作将首先停止服务,然后立即重新启动它。
方法三:通过MySQL Workbench重启服务(如果有安装)
如果您安装了MySQL Workbench,也可以通过图形界面来重启MySQL服务:

打开MySQL Workbench。
在左侧的导航栏中,找到并点击 Instance 下的 Startup / Shutdown。
如果服务器当前正在运行,您可以点击 Shutdown 来停止服务,之后再点击 Startup 来启动服务。
注意事项
管理员权限:确保以管理员身份运行命令提示符或服务管理控制台,特别是在执行停止和启动服务的操作时。
确认服务名称:如果不确定MySQL服务的确切名称,可以打开服务管理控制台 (services.msc) 查看所有服务,并找到正确的MySQL服务名称。
等待完成:服务停止和启动过程可能需要一些时间,请耐心等待直至操作完成。
通过以上任意一种方法都可以实现MySQL数据库服务的重启,以便让配置更改生效。

相关文章:

如何将数据库字符集改为中文,让今后所有的数据库都支持中文

最后一行有我自己的my.ini文件 数据库输入中文数据时会变为乱码, 这个时候,我们为每个数据库设置字符集,太过于麻烦,为数据库单独设置重启后又会消失 Set character_set_database’utf8’; Set character_set_server’utf8’; …...

Low-Level 大一统:如何使用Diffusion Models完成视频超分、去雨、去雾、降噪等所有Low-Level 任务?

Diffusion Models专栏文章汇总:入门与实战 前言:视频在传输过程中常常因为各种因素(如恶劣天气、噪声、压缩和传感器分辨率限制)而出现质量下降,这会严重影响计算机视觉任务(如目标检测和视频监控)的性能。现有的视频修复方法虽然取得了一些进展,但通常只能针对特定的退…...

EAMM: 通过基于音频的情感感知运动模型实现的一次性情感对话人脸合成

EAMM: 通过基于音频的情感感知运动模型实现的一次性情感对话人脸合成 1所有的材料都可以在EAMM: One-Shot Emotional Talking Face via Audio-Based Emotion-Aware Motion Model网站上找到。 摘要 尽管音频驱动的对话人脸生成技术已取得显著进展,但现有方法要么忽…...

Docker Compose的使用

文章首发于我的博客:https://blog.liuzijian.com/post/docker-compose.html 目录 Docker Compose是什么Docker Compose安装Docker Compose文件Docker Compose常用命令案例:部署WordPress博客系统 Docker Compose是什么 Docker Compose是Docker官方的开源…...

[STM32 HAL库]串口空闲中断+DMA接收不定长数据

一、空闲中断 STM32的串口具有空闲中断,什么叫做空闲呢?如何触发空闲中断呢? 空闲:串口发送的两个字符之间间隔非常短,所以在两个字符之间不叫空闲。空闲的定义是总线上在一个字节的时间内没有再接收到数据。触发条件…...

三、华为交换机 Hybrid

一、Hybrid功能 Hybrid口既可以连接普通终端的接入链路(类似于Access接口),又可以连接交换机间的干道链路(类似于Trunk接口)。它允许多个VLAN的帧通过,并可以在出接口方向将某些VLAN帧的标签剥掉&#xff0…...

如何通过 Apache Airflow 将数据导入 Elasticsearch

作者:来自 Elastic Andre Luiz 了解如何通过 Apache Airflow 将数据导入 Elasticsearch。 Apache Airflow Apache Airflow 是一个旨在创建、安排(schedule)和监控工作流的平台。它用于编排 ETL(Extract-Transform-Load&#xff0…...

Android Studio:Linux环境下安装与配置

更多内容:XiaoJ的知识星球 Android Studio:Linux环境下安装与配置 1.安装JDK2.安装Android Studio2.1 获取安装包2.2 安装(1)配置环境变量:(2)运行安装:(3)配…...

token是用来鉴权的,那session是用来干什么的?

在Web应用和API设计中,鉴权与会话管理是两个核心概念,它们对于确保用户身份的安全性和维护用户会话状态至关重要。Token和Session是两种常用的鉴权与会话管理机制,它们各自具有独特的工作原理和适用场景。下面是对Token和Session的详细解析及…...

基于 WEB 开发的二手车辆销售管理系统设计与实现

标题:基于 WEB 开发的二手车辆销售管理系统设计与实现 内容:1.摘要 摘要:随着互联网技术的不断发展,电子商务在各个领域得到了广泛的应用。本文以二手车辆销售管理系统为例,探讨了基于 WEB 开发的销售管理系统的设计与实现。通过对系统需求的…...

wordpress的火车头商品发布接口

<?php require ../wp-load.php; ini_set(memory_limit, 1024M); set_time_limit(180);$top_cat ; # 图片链接域名替换 $image_host ;$start_time microtime(true);$counter 0; // 临时缓存 $products $skus $categories []; $var_sku_index 1;$rowData$_POST;// if…...

浙江安吉成新照明电器:Acrel-1000DP 分布式光伏监控系统应用探索

安科瑞吕梦怡 18706162527 摘 要&#xff1a;分布式光伏发电站是指将光伏发电组件安装在用户的建筑物屋顶、空地或其他适合的场地上&#xff0c;利用太阳能进行发电的一种可再生能源利用方式&#xff0c;与传统的大型集中式光伏电站相比&#xff0c;分布式光伏发电具有更灵活…...

总结3..

#include<stdio.h> int n,m; int a[1002][1002]; int b[1002][1002];//判断该空的八连通图是否被走过 int gg0; int dd0; int xz[8]{-1,-1,-1,0,0,1,1,1},yz[8]{-1,0,1,-1,1,-1,0,1};//八个方向 void dfs(int x,int y) { int dx,dy; for(int i0;i<8;i) { …...

信息奥赛一本通 1168:大整数加法

这道题是一道大整数加法&#xff0c;涉及到高精度的算法&#xff0c;比如说有两个数要进行相加&#xff0c;1111111111111111111111111111111111111112222222222222222222222222222222&#xff0c;那么如果这两个数很大的话我们常用的数据类型是不能进行计算的&#xff0c;那么…...

3.3 OpenAI GPT-4, GPT-3.5, GPT-3 模型调用:开发者指南

OpenAI GPT-4, GPT-3.5, GPT-3 模型调用:开发者指南 OpenAI 的 GPT 系列语言模型,包括 GPT-4、GPT-3.5 和 GPT-3,已经成为自然语言处理领域的标杆。无论是文本生成、对话系统,还是自动化任务,开发者都可以通过 API 调用这些强大的模型来增强他们的应用。本文将为您详细介…...

横盘出击的三种经典走势形态,买点以及需要注意的问题技术详解

龙头股在横盘整理过程中&#xff0c;也会出现几种不同的形态&#xff0c;比如矩形整理形态&#xff0c;或者在某一趋势线下方运行。 第一种形态&#xff1a;突破横盘趋势线 突破横盘趋势线时识别横盘龙头启动的关键点位。股价经过一段时间的横盘后&#xff0c;突然出现快速上…...

处理没有提示的字符串、计算相隔天数应用题

正常情况下&#xff0c;小云每天跑 1 千米。如果某天是周一或者月初&#xff08;1 日&#xff09;&#xff0c;为了激励自己&#xff0c;小云要跑 2 千米。如果同时是周一或月初&#xff0c;小云也是跑 2 千米。 小云跑步已经坚持了很长时间&#xff0c;从 1990 年 1 月 1 日周…...

【LeetCode】力扣刷题热题100道(31-35题)附源码 搜索二维矩阵 岛屿数量 腐烂的橙子 课程表 实现 Trie (前缀树)(C++)

一、搜索二维矩阵 编写一个高效的算法来搜索 m x n 矩阵 matrix 中的一个目标值 target 。该矩阵具有以下特性&#xff1a; 每行的元素从左到右升序排列。每列的元素从上到下升序排列。 可以使用 从右上角开始搜索 的方法来有效地找到目标值。 选择起始位置&#xff1a; 从矩…...

react使用react-redux状态管理

1、安装 npm install react-redux2、创建store.js import { createStore } from redux;// 定义初始状态 const initialState {counter: 888 };// 定义 reducer 函数&#xff0c;根据 action 类型更新状态 function reducer(state initialState, action) {switch (action.ty…...

04_角色创建窗口

将上文的登录窗口隐藏 创建空节点 作为创建角色窗口 命名为CreateWnd 创建输入的名字的输入框 再创建一个按钮用来随机角色名字 创建开始游戏按钮 End....

基于距离变化能量开销动态调整的WSN低功耗拓扑控制开销算法matlab仿真

目录 1.程序功能描述 2.测试软件版本以及运行结果展示 3.核心程序 4.算法仿真参数 5.算法理论概述 6.参考文献 7.完整程序 1.程序功能描述 通过动态调整节点通信的能量开销&#xff0c;平衡网络负载&#xff0c;延长WSN生命周期。具体通过建立基于距离的能量消耗模型&am…...

《Qt C++ 与 OpenCV:解锁视频播放程序设计的奥秘》

引言:探索视频播放程序设计之旅 在当今数字化时代,多媒体应用已渗透到我们生活的方方面面,从日常的视频娱乐到专业的视频监控、视频会议系统,视频播放程序作为多媒体应用的核心组成部分,扮演着至关重要的角色。无论是在个人电脑、移动设备还是智能电视等平台上,用户都期望…...

【机器视觉】单目测距——运动结构恢复

ps&#xff1a;图是随便找的&#xff0c;为了凑个封面 前言 在前面对光流法进行进一步改进&#xff0c;希望将2D光流推广至3D场景流时&#xff0c;发现2D转3D过程中存在尺度歧义问题&#xff0c;需要补全摄像头拍摄图像中缺失的深度信息&#xff0c;否则解空间不收敛&#xf…...

Web 架构之 CDN 加速原理与落地实践

文章目录 一、思维导图二、正文内容&#xff08;一&#xff09;CDN 基础概念1. 定义2. 组成部分 &#xff08;二&#xff09;CDN 加速原理1. 请求路由2. 内容缓存3. 内容更新 &#xff08;三&#xff09;CDN 落地实践1. 选择 CDN 服务商2. 配置 CDN3. 集成到 Web 架构 &#xf…...

Reasoning over Uncertain Text by Generative Large Language Models

https://ojs.aaai.org/index.php/AAAI/article/view/34674/36829https://ojs.aaai.org/index.php/AAAI/article/view/34674/36829 1. 概述 文本中的不确定性在许多语境中传达,从日常对话到特定领域的文档(例如医学文档)(Heritage 2013;Landmark、Gulbrandsen 和 Svenevei…...

Hive 存储格式深度解析:从 TextFile 到 ORC,如何选对数据存储方案?

在大数据处理领域&#xff0c;Hive 作为 Hadoop 生态中重要的数据仓库工具&#xff0c;其存储格式的选择直接影响数据存储成本、查询效率和计算资源消耗。面对 TextFile、SequenceFile、Parquet、RCFile、ORC 等多种存储格式&#xff0c;很多开发者常常陷入选择困境。本文将从底…...

音视频——I2S 协议详解

I2S 协议详解 I2S (Inter-IC Sound) 协议是一种串行总线协议&#xff0c;专门用于在数字音频设备之间传输数字音频数据。它由飞利浦&#xff08;Philips&#xff09;公司开发&#xff0c;以其简单、高效和广泛的兼容性而闻名。 1. 信号线 I2S 协议通常使用三根或四根信号线&a…...

CSS | transition 和 transform的用处和区别

省流总结&#xff1a; transform用于变换/变形&#xff0c;transition是动画控制器 transform 用来对元素进行变形&#xff0c;常见的操作如下&#xff0c;它是立即生效的样式变形属性。 旋转 rotate(角度deg)、平移 translateX(像素px)、缩放 scale(倍数)、倾斜 skewX(角度…...

【Linux系统】Linux环境变量:系统配置的隐形指挥官

。# Linux系列 文章目录 前言一、环境变量的概念二、常见的环境变量三、环境变量特点及其相关指令3.1 环境变量的全局性3.2、环境变量的生命周期 四、环境变量的组织方式五、C语言对环境变量的操作5.1 设置环境变量&#xff1a;setenv5.2 删除环境变量:unsetenv5.3 遍历所有环境…...

pycharm 设置环境出错

pycharm 设置环境出错 pycharm 新建项目&#xff0c;设置虚拟环境&#xff0c;出错 pycharm 出错 Cannot open Local Failed to start [powershell.exe, -NoExit, -ExecutionPolicy, Bypass, -File, C:\Program Files\JetBrains\PyCharm 2024.1.3\plugins\terminal\shell-int…...