前端技术
HTML
CSS
Javascript
前端框架和UI库
VUE
ReactJS
AngularJS
JQuery
NodeJS
JSON
Element-UI
Bootstrap
Material UI
服务端和客户端
Java
Python
PHP
Golang
Scala
Kotlin
Groovy
Ruby
Lua
.net
c#
c++
后端WEB和工程框架
SpringBoot
SpringCloud
Struts2
MyBatis
Hibernate
Tornado
Beego
Go-Spring
Go Gin
Go Iris
Dubbo
HessianRPC
Maven
Gradle
数据库
MySQL
Oracle
Mongo
中间件与web容器
Redis
MemCache
Etcd
Cassandra
Kafka
RabbitMQ
RocketMQ
ActiveMQ
Nacos
Consul
Tomcat
Nginx
Netty
大数据技术
Hive
Impala
ClickHouse
DorisDB
Greenplum
PostgreSQL
HBase
Kylin
Hadoop
Apache Pig
ZooKeeper
SeaTunnel
Sqoop
Datax
Flink
Spark
Mahout
数据搜索与日志
ElasticSearch
Apache Lucene
Apache Solr
Kibana
Logstash
数据可视化与OLAP
Apache Atlas
Superset
Saiku
Tesseract
系统与容器
Linux
Shell
Docker
Kubernetes
[ __FUNCTION__ 在异常处理中...]的搜索结果
这里是文章列表。热门标签的颜色随机变换,标签颜色没有特殊含义。
点击某个标签可搜索标签相关的文章。
点击某个标签可搜索标签相关的文章。
转载文章
...: true,// 处理 defineProps 报错'vue/setup-compiler-macros': true,},extends: ['eslint:recommended','airbnb-base','prettier','plugin:prettier/recommended','plugin:vue/vue3-recommended','plugin:@typescript-eslint/recommended','plugin:import/recommended','plugin:import/typescript',],parser: 'vue-eslint-parser',parserOptions: {ecmaVersion: 'latest',parser: '@typescript-eslint/parser',sourceType: 'module',},plugins: ['vue', '@typescript-eslint'],rules: {// 防止prettier与eslint冲突'prettier/prettier': 'error',// eslint-plugin-import es module导入eslint规则配置,旨在规避拼写错误问题'import/no-unresolved': 0,'import/extensions': ['error',{js: 'never',jsx: 'never',ts: 'never',tsx: 'never',json: 'always',},],// 使用导出的名称作为默认属性(主要用作导出模块内部有 default, 和直接导出两种并存情况下,会出现default.proptry 这种问题从在的情况)'import/no-named-as-default-member': 0,'import/order': ['error', { 'newlines-between': 'always' }],// 导入确保是否在首位'import/first': 0,// 如果文件只有一个导出,是否开启强制默认导出'import/prefer-default-export': 0,'import/no-extraneous-dependencies': ['error',{devDependencies: [],optionalDependencies: false,},],/ 关于typescript语法校验 参考文档: https://www.npmjs.com/package/@typescript-eslint/eslint-plugin/'@typescript-eslint/no-extra-semi': 0,// 是否禁止使用any类型'@typescript-eslint/no-explicit-any': 0,// 是否对于null情况做非空断言'@typescript-eslint/no-non-null-assertion': 0,// 是否对返回值类型进行定义校验'@typescript-eslint/explicit-function-return-type': 0,'@typescript-eslint/member-delimiter-style': ['error', { multiline: { delimiter: 'none' } }],// 结合eslint 'no-use-before-define': 'off',不然会有报错,需要关闭eslint这个校验,主要是增加了对于type\interface\enum'no-use-before-define': 'off','@typescript-eslint/no-use-before-define': ['error'],'@typescript-eslint/explicit-module-boundary-types': 'off','@typescript-eslint/no-unused-vars': ['error',{ignoreRestSiblings: true,varsIgnorePattern: '^_',argsIgnorePattern: '^_',},],'@typescript-eslint/explicit-member-accessibility': ['error', { overrides: { constructors: 'no-public' } }],'@typescript-eslint/consistent-type-imports': 'error','@typescript-eslint/indent': 0,'@typescript-eslint/naming-convention': ['error',{selector: 'interface',format: ['PascalCase'],},],// 不允许使用 var'no-var': 'error',// 如果没有修改值,有些用const定义'prefer-const': ['error',{destructuring: 'any',ignoreReadBeforeAssign: false,},],// 关于vue3 的一些语法糖校验// 超过 4 个属性换行展示'vue/max-attributes-per-line': ['error',{singleline: 4,},],// setup 语法糖校验'vue/script-setup-uses-vars': 'error',// 关于箭头函数'vue/arrow-spacing': 'error','vue/html-indent': 'off',},} 4、加入单元测试 单元测试,根据自己项目体量及重要性而去考虑是否要增加,当然单测可以反推一些组件 or 方法的设计是否合理,同样如果是一个稳定的功能在加上单元测试,这就是一个很nice的体验; 我们单元测试是基于jest来去做的,具体安装单测的办法如下,跟着我的步骤一步步来; 安装jest单测相关的依赖组件库 pnpm add @testing-library/vue @testing-library/user-event @testing-library/jest-dom @types/jest jest @vue/test-utils -D 安装完成后,发现还需要安装前置依赖 @testing-library/dom @vue/compiler-sfc我们继续补充 安装babel相关工具,用ts写的单元测试需要转义,具体安装工具如下pnpm add @babel/core babel-jest @vue/babel-preset-app -D,最后我们配置babel.config.js module.exports = {presets: ['@vue/app'],} 配置jest.config.js module.exports = {roots: ['<rootDir>/test'],testMatch: [// 这里我们支持src目录里面增加一些单层,事实上我并不喜欢这样做'<rootDir>/src//__tests__//.{js,jsx,ts,tsx}','<rootDir>/src//.{spec,test}.{js,jsx,ts,tsx}',// 这里我习惯将单层文件统一放在test单独目录下,不在项目中使用,降低单测文件与业务组件模块混合在一起'<rootDir>/test//.{spec,test}.{js,jsx,ts,tsx}',],testEnvironment: 'jsdom',transform: {// 此处我们单测没有适用vue-jest方式,项目中我们江永tsx方式来开发,所以我们如果需要加入其它的内容// '^.+\\.(vue)$': '<rootDir>/node_modules/vue-jest','^.+\\.(js|jsx|mjs|cjs|ts|tsx)$': '<rootDir>/node_modules/babel-jest',},transformIgnorePatterns: ['<rootDir>/node_modules/','[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|cjs|ts|tsx)$','^.+\\.module\\.(css|sass|scss|less)$',],moduleFileExtensions: ['ts', 'tsx', 'vue', 'js', 'jsx', 'json', 'node'],resetMocks: true,} 具体写单元测试的方法,可以参考项目模板中的组件单元测试写法,这里不做过多的说明; 5、封装axios请求库 这里呢其实思路有很多种,如果有自己的习惯的封装方式,就按照自己的思路,下面附上我的封装代码,简短的说一下我的封装思路: 1、基础的请求拦截、相应拦截封装,这个是对于一些请求参数格式化处理等,或者返回值情况处理 2、请求异常、错误、接口调用成功返回结果错误这些错误的集中处理,代码中请求就不再做trycatch这些操作 3、请求函数统一封装(代码中的 get、post、axiosHttp) 4、泛型方式定义请求返回参数,定义好类型,让我们可以在不同地方使用有良好的提示 import type { AxiosRequestConfig, AxiosResponse } from 'axios'import axios from 'axios'import { ElNotification } from 'element-plus'import errorHandle from './errorHandle'// 定义数据返回结构体(此处我简单定义一个比较常见的后端数据返回结构体,实际使用我们需要按照自己所在的项目开发)interface ResponseData<T = null> {code: string | numberdata: Tsuccess: booleanmessage?: string[key: string]: any}const axiosInstance = axios.create()// 设定响应超时时间axiosInstance.defaults.timeout = 30000// 可以后续根据自己http请求头特殊邀请设定请求头axiosInstance.interceptors.request.use((req: AxiosRequestConfig<any>) => {// 特殊处理,后续如果项目中有全局通传参数,可以在这儿做一些处理return req},error => Promise.reject(error),)// 响应拦截axiosInstance.interceptors.response.use((res: AxiosResponse<any, any>) => {// 数组处理return res},error => Promise.reject(error),)// 通用的请求方法体const axiosHttp = async <T extends Record<string, any> | null>(config: AxiosRequestConfig,desc: string,): Promise<T> => {try {const { data } = await axiosInstance.request<ResponseData<T>>(config)if (data.success) {return data.data}// 如果请求失败统一做提示(此处我没有安装组件库,我简单写个mock例子)ElNotification({title: desc,message: ${data.message || '请求失败,请检查'},})} catch (e: any) {// 统一的错误处理if (e.response && e.response.status) {errorHandle(e.response.status, desc)} else {ElNotification({title: desc,message: '接口异常,请检查',})} }return null as T}// get请求方法封装export const get = async <T = Record<string, any> | null>(url: string, params: Record<string, any>, desc: string) => {const config: AxiosRequestConfig = {method: 'get',url,params,}const data = await axiosHttp<T>(config, desc)return data}// Post请求方法export const post = async <T = Record<string, any> | null>(url: string, data: Record<string, any>, desc: string) => {const config: AxiosRequestConfig = {method: 'post',url,data,}const info = await axiosHttp<T>(config, desc)return info} 请求错误(状态码错误相关提示) import { ElNotification } from 'element-plus'function notificat(message: string, title: string) {ElNotification({title,message,})}/ @description 获取接口定义 @param status {number} 错误状态码 @param desc {string} 接口描述信息/export default function errorHandle(status: number, desc: string) {switch (status) {case 401:notificat('用户登录失败', desc)breakcase 404:notificat('请求不存在', desc)breakcase 500:notificat('服务器错误,请检查服务器', desc)breakdefault:notificat(其他错误${status}, desc)break} } 6、关于vue-router 及 pinia 这两个相对来讲简单一些,会使用vuex状态管理,上手pinia也是很轻松的事儿,只是更简单化了、更方便了,可以参考模板项目里面的用法example,这里附上router及pinia配置方法,路由守卫,大家可以根据项目的要求再添加 import type { RouteRecordRaw } from 'vue-router'import { createRouter, createWebHistory } from 'vue-router'// 配置路由const routes: Array<RouteRecordRaw> = [{path: '/',redirect: '/home',},{name: 'home',path: '/home',component: () => import('page/Home'),},]const router = createRouter({routes,history: createWebHistory(),})export default router 针对与pinia,参考如下: import { createPinia } from 'pinia'export default createPinia() 在入口文件将router和store注入进去 import { createApp } from 'vue'import App from './App'import store from './store/index'import './style/index.css'import './style/index.scss'import 'element-plus/dist/index.css'import router from './router'// 注入全局的storeconst app = createApp(App).use(store).use(router)app.mount('app') 说这些比较枯燥,建议大家去github参考项目说明文档,下载项目,自己过一遍,喜欢的朋友收藏点赞一下,如果喜欢我构建好的项目给个star不丢失,谢谢各位看官的支持。 本篇文章为转载内容。原文链接:https://blog.csdn.net/weixin_37764929/article/details/124860873。 该文由互联网用户投稿提供,文中观点代表作者本人意见,并不代表本站的立场。 作为信息平台,本站仅提供文章转载服务,并不拥有其所有权,也不对文章内容的真实性、准确性和合法性承担责任。 如发现本文存在侵权、违法、违规或事实不符的情况,请及时联系我们,我们将第一时间进行核实并删除相应内容。
2023-10-05 12:27:41
116
转载
转载文章
...thm. Main Functions Cut The jieba.cut function accepts three input parameters: the first parameter is the string to be cut; the second parameter is cut_all, controlling the cut mode; the third parameter is to control whether to use the Hidden Markov Model. jieba.cut_for_search accepts two parameter: the string to be cut; whether to use the Hidden Markov Model. This will cut the sentence into short words suitable for search engines. The input string can be an unicode/str object, or a str/bytes object which is encoded in UTF-8 or GBK. Note that using GBK encoding is not recommended because it may be unexpectly decoded as UTF-8. jieba.cut and jieba.cut_for_search returns an generator, from which you can use a for loop to get the segmentation result (in unicode). jieba.lcut and jieba.lcut_for_search returns a list. jieba.Tokenizer(dictionary=DEFAULT_DICT) creates a new customized Tokenizer, which enables you to use different dictionaries at the same time. jieba.dt is the default Tokenizer, to which almost all global functions are mapped. Code example: segmentation encoding=utf-8import jiebaseg_list = jieba.cut("我来到北京清华大学", cut_all=True)print("Full Mode: " + "/ ".join(seg_list)) 全模式seg_list = jieba.cut("我来到北京清华大学", cut_all=False)print("Default Mode: " + "/ ".join(seg_list)) 默认模式seg_list = jieba.cut("他来到了网易杭研大厦")print(", ".join(seg_list))seg_list = jieba.cut_for_search("小明硕士毕业于中国科学院计算所,后在日本京都大学深造") 搜索引擎模式print(", ".join(seg_list)) Output: [Full Mode]: 我/ 来到/ 北京/ 清华/ 清华大学/ 华大/ 大学[Accurate Mode]: 我/ 来到/ 北京/ 清华大学[Unknown Words Recognize] 他, 来到, 了, 网易, 杭研, 大厦 (In this case, "杭研" is not in the dictionary, but is identified by the Viterbi algorithm)[Search Engine Mode]: 小明, 硕士, 毕业, 于, 中国, 科学, 学院, 科学院, 中国科学院, 计算, 计算所, 后, 在, 日本, 京都, 大学, 日本京都大学, 深造 Add a custom dictionary Load dictionary Developers can specify their own custom dictionary to be included in the jieba default dictionary. Jieba is able to identify new words, but you can add your own new words can ensure a higher accuracy. Usage: jieba.load_userdict(file_name) file_name is a file-like object or the path of the custom dictionary The dictionary format is the same as that of dict.txt: one word per line; each line is divided into three parts separated by a space: word, word frequency, POS tag. If file_name is a path or a file opened in binary mode, the dictionary must be UTF-8 encoded. The word frequency and POS tag can be omitted respectively. The word frequency will be filled with a suitable value if omitted. For example: 创新办 3 i云计算 5凱特琳 nz台中 Change a Tokenizer’s tmp_dir and cache_file to specify the path of the cache file, for using on a restricted file system. Example: 云计算 5李小福 2创新办 3[Before]: 李小福 / 是 / 创新 / 办 / 主任 / 也 / 是 / 云 / 计算 / 方面 / 的 / 专家 /[After]: 李小福 / 是 / 创新办 / 主任 / 也 / 是 / 云计算 / 方面 / 的 / 专家 / Modify dictionary Use add_word(word, freq=None, tag=None) and del_word(word) to modify the dictionary dynamically in programs. Use suggest_freq(segment, tune=True) to adjust the frequency of a single word so that it can (or cannot) be segmented. Note that HMM may affect the final result. Example: >>> print('/'.join(jieba.cut('如果放到post中将出错。', HMM=False)))如果/放到/post/中将/出错/。>>> jieba.suggest_freq(('中', '将'), True)494>>> print('/'.join(jieba.cut('如果放到post中将出错。', HMM=False)))如果/放到/post/中/将/出错/。>>> print('/'.join(jieba.cut('「台中」正确应该不会被切开', HMM=False)))「/台/中/」/正确/应该/不会/被/切开>>> jieba.suggest_freq('台中', True)69>>> print('/'.join(jieba.cut('「台中」正确应该不会被切开', HMM=False)))「/台中/」/正确/应该/不会/被/切开 Keyword Extraction import jieba.analyse jieba.analyse.extract_tags(sentence, topK=20, withWeight=False, allowPOS=()) sentence: the text to be extracted topK: return how many keywords with the highest TF/IDF weights. The default value is 20 withWeight: whether return TF/IDF weights with the keywords. The default value is False allowPOS: filter words with which POSs are included. Empty for no filtering. jieba.analyse.TFIDF(idf_path=None) creates a new TFIDF instance, idf_path specifies IDF file path. Example (keyword extraction) https://github.com/fxsjy/jieba/blob/master/test/extract_tags.py Developers can specify their own custom IDF corpus in jieba keyword extraction Usage: jieba.analyse.set_idf_path(file_name) file_name is the path for the custom corpus Custom Corpus Sample:https://github.com/fxsjy/jieba/blob/master/extra_dict/idf.txt.big Sample Code:https://github.com/fxsjy/jieba/blob/master/test/extract_tags_idfpath.py Developers can specify their own custom stop words corpus in jieba keyword extraction Usage: jieba.analyse.set_stop_words(file_name) file_name is the path for the custom corpus Custom Corpus Sample:https://github.com/fxsjy/jieba/blob/master/extra_dict/stop_words.txt Sample Code:https://github.com/fxsjy/jieba/blob/master/test/extract_tags_stop_words.py There’s also a TextRank implementation available. Use: jieba.analyse.textrank(sentence, topK=20, withWeight=False, allowPOS=('ns', 'n', 'vn', 'v')) Note that it filters POS by default. jieba.analyse.TextRank() creates a new TextRank instance. Part of Speech Tagging jieba.posseg.POSTokenizer(tokenizer=None) creates a new customized Tokenizer. tokenizer specifies the jieba.Tokenizer to internally use. jieba.posseg.dt is the default POSTokenizer. Tags the POS of each word after segmentation, using labels compatible with ictclas. Example: >>> import jieba.posseg as pseg>>> words = pseg.cut("我爱北京天安门")>>> for w in words:... print('%s %s' % (w.word, w.flag))...我 r爱 v北京 ns天安门 ns Parallel Processing Principle: Split target text by line, assign the lines into multiple Python processes, and then merge the results, which is considerably faster. Based on the multiprocessing module of Python. Usage: jieba.enable_parallel(4) Enable parallel processing. The parameter is the number of processes. jieba.disable_parallel() Disable parallel processing. Example: https://github.com/fxsjy/jieba/blob/master/test/parallel/test_file.py Result: On a four-core 3.4GHz Linux machine, do accurate word segmentation on Complete Works of Jin Yong, and the speed reaches 1MB/s, which is 3.3 times faster than the single-process version. Note that parallel processing supports only default tokenizers, jieba.dt and jieba.posseg.dt. Tokenize: return words with position The input must be unicode Default mode result = jieba.tokenize(u'永和服装饰品有限公司')for tk in result:print("word %s\t\t start: %d \t\t end:%d" % (tk[0],tk[1],tk[2])) word 永和 start: 0 end:2word 服装 start: 2 end:4word 饰品 start: 4 end:6word 有限公司 start: 6 end:10 Search mode result = jieba.tokenize(u'永和服装饰品有限公司',mode='search')for tk in result:print("word %s\t\t start: %d \t\t end:%d" % (tk[0],tk[1],tk[2])) word 永和 start: 0 end:2word 服装 start: 2 end:4word 饰品 start: 4 end:6word 有限 start: 6 end:8word 公司 start: 8 end:10word 有限公司 start: 6 end:10 ChineseAnalyzer for Whoosh from jieba.analyse import ChineseAnalyzer Example: https://github.com/fxsjy/jieba/blob/master/test/test_whoosh.py Command Line Interface $> python -m jieba --helpJieba command line interface.positional arguments:filename input fileoptional arguments:-h, --help show this help message and exit-d [DELIM], --delimiter [DELIM]use DELIM instead of ' / ' for word delimiter; or aspace if it is used without DELIM-p [DELIM], --pos [DELIM]enable POS tagging; if DELIM is specified, use DELIMinstead of '_' for POS delimiter-D DICT, --dict DICT use DICT as dictionary-u USER_DICT, --user-dict USER_DICTuse USER_DICT together with the default dictionary orDICT (if specified)-a, --cut-all full pattern cutting (ignored with POS tagging)-n, --no-hmm don't use the Hidden Markov Model-q, --quiet don't print loading messages to stderr-V, --version show program's version number and exitIf no filename specified, use STDIN instead. Initialization By default, Jieba don’t build the prefix dictionary unless it’s necessary. This takes 1-3 seconds, after which it is not initialized again. If you want to initialize Jieba manually, you can call: import jiebajieba.initialize() (optional) You can also specify the dictionary (not supported before version 0.28) : jieba.set_dictionary('data/dict.txt.big') Using Other Dictionaries It is possible to use your own dictionary with Jieba, and there are also two dictionaries ready for download: A smaller dictionary for a smaller memory footprint: https://github.com/fxsjy/jieba/raw/master/extra_dict/dict.txt.small There is also a bigger dictionary that has better support for traditional Chinese (繁體): https://github.com/fxsjy/jieba/raw/master/extra_dict/dict.txt.big By default, an in-between dictionary is used, called dict.txt and included in the distribution. In either case, download the file you want, and then call jieba.set_dictionary('data/dict.txt.big') or just replace the existing dict.txt. Segmentation speed 1.5 MB / Second in Full Mode 400 KB / Second in Default Mode Test Env: Intel® Core™ i7-2600 CPU @ 3.4GHz;《围城》.txt 本篇文章为转载内容。原文链接:https://blog.csdn.net/yegeli/article/details/107246661。 该文由互联网用户投稿提供,文中观点代表作者本人意见,并不代表本站的立场。 作为信息平台,本站仅提供文章转载服务,并不拥有其所有权,也不对文章内容的真实性、准确性和合法性承担责任。 如发现本文存在侵权、违法、违规或事实不符的情况,请及时联系我们,我们将第一时间进行核实并删除相应内容。
2023-12-02 10:38:37
500
转载
转载文章
...a() C API function. 由mysql_stmt_send_long_data() C API函数发送的一个包或任何生成的或中间字符串或任何参数的最大大小 max_allowed_packet=500M 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". 更改mysqld可用的文件描述符的数量。如果mysqld给您的错误是“打开的文件太多”,您应该尝试增加这个选项的值。 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. 如果在SHOW GLOBAL STATUS输出中每秒看到许多sort_merge_passes,可以考虑增加sort_buffer_size值,以加快ORDER BY或GROUP BY操作的速度,这些操作无法通过查询优化或改进索引来改进。 sort_buffer_size=1M The number of table definitions (from .frm files) that can be stored in the definition cache. If you use a large number of tables, you can create a large table definition cache to speed up opening of tables. The table definition cache takes less space and does not use file descriptors, unlike the normal table cache. The minimum and default values are both 400. 可以存储在定义缓存中的表定义的数量(来自.frm文件)。如果使用大量表,可以创建一个大型表定义缓存来加速表的打开。与普通的表缓存不同,表定义缓存占用更少的空间,并且不使用文件描述符。最小值和默认值都是400。 table_definition_cache=1400 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. 指定基于行的二进制日志事件的最大大小,单位为字节。如果可能,将行分组为小于此大小的事件。这个值应该是256的倍数。 binlog_row_event_max_size=8K If the value of this variable is greater than 0, a replication slave synchronizes its master.info file to disk. (using fdatasync()) after every sync_master_info events. 如果该变量的值大于0,则复制奴隶将其主.info文件同步到磁盘。(在每个sync_master_info事件之后使用fdatasync())。 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. 如果这个变量的值大于0,MySQL服务器将其中继日志同步到磁盘。(在每个sync_relay_log写入到中继日志之后使用fdatasync())。 sync_relay_log=10000 If the value of this variable is greater than 0, a replication slave synchronizes its relay-log.info file to disk. (using fdatasync()) after every sync_relay_log_info transactions. 如果该变量的值大于0,则复制奴隶将其中继日志.info文件同步到磁盘。(在每个sync_relay_log_info事务之后使用fdatasync())。 sync_relay_log_info=10000 Load mysql plugins at start."plugin_x ; plugin_y". 开始时加载mysql插件。“plugin_x;plugin_y” plugin_load The TCP/IP Port the MySQL Server X Protocol will listen on. MySQL服务器X协议将监听TCP/IP端口。 loose_mysqlx_port=33060 本篇文章为转载内容。原文链接:https://blog.csdn.net/mywpython/article/details/89499852。 该文由互联网用户投稿提供,文中观点代表作者本人意见,并不代表本站的立场。 作为信息平台,本站仅提供文章转载服务,并不拥有其所有权,也不对文章内容的真实性、准确性和合法性承担责任。 如发现本文存在侵权、违法、违规或事实不符的情况,请及时联系我们,我们将第一时间进行核实并删除相应内容。
2023-10-08 09:56:02
129
转载
Java
... 同时,针对现代多核处理器环境下的并行计算需求,研究者和工程师们不断探索如何优化Java线程的性能表现。有文章专门探讨了在高并发场景下,合理结合使用join和yield等方法以及锁、信号量等并发工具,以减少上下文切换开销,提升系统整体吞吐量和响应速度。 最后,对于异常处理机制如InterruptedException的研究也不容忽视。在复杂的多线程环境中,如何正确捕获和处理这类异常,确保程序健壮性和一致性,是每个Java开发者需要深入思考的问题。建议阅读相关教程或案例分析,掌握在实际编程中妥善应对中断请求的最佳实践。
2023-03-22 08:55:31
355
键盘勇士
JQuery
...构,可以更方便快速地处理html DOM结构。而连接HTML和关联事件是JQuery中最常用的两个作用之一。 // 运用JQuery连接html代码 var html = ""; $.each(data, function(index, item){ html += " " + item.title + " " + item.content + " "; }); $("container").html(html); 在这个例子中,我们运用JQuery的each方法对数据进行循环,每次循环都会创建一个包含题目和文本的item,并将它们连接到一个大字符串中。最终运用html方法将这个字符串呈现成DOM结构。 // 给动态创建的元素关联事件 $("container").on("click", ".item", function(){ // 点击item时的处理 }); 在这个例子中,我们运用JQuery的on方法给动态创建的元素关联事件。由于item元素是动态创建的,所以我们需要运用事件委托的方式进行关联。这样可以确保关联的元素都可以响应事件。
2023-12-04 09:15:37
395
逻辑鬼才
JSON
... AJAX 请求以及处理 JSON 数据的操作。 在 jQuery 中,我们可以通过几个函数来完成对 JSON 数据的查询操作。 // 一个基础的 JSON 数据例子 var data = { "name": "小明", "age": 18, "hometown": "北京", "hobbies": ["吃饭", "睡觉", "打游戏"], "friend": { "name": "小红", "age": 17 } } 1. $.parseJSON() var jsonStr = '{"name":"小明","age":18,"hometown":"北京"}'; var jsonData = $.parseJSON(jsonStr); console.log(jsonData.name); // 显示:小明 2. $.getJSON() $.getJSON('https://api.github.com/users/octocat', function(data) { console.log(data.name); // 显示:The Octocat }); 3. $.each() $.each(data.hobbies, function(index, value) { console.log(value); // 显示:吃饭、睡觉、打游戏 }); 4. $.map() var hobbiesArr = $.map(data.hobbies, function(value, index) { return value; }); console.log(hobbiesArr); // 显示:["吃饭", "睡觉", "打游戏"] 以上就是 jQuery 中常用的几种 JSON 查询函数,它们可以使我们更便捷地对数据进行操作。
2023-07-24 23:16:09
441
逻辑鬼才
Java
...及其可能引发的运行时异常。针对这些问题,有专家提出使用“类型令牌”(Type Tokens)等技术来增强反射API对泛型类型的识别能力,从而提升框架设计与开发效率。 同时,在响应式编程、函数式编程等新兴编程范式中,Java泛型也在发挥着日益重要的作用。比如Reactive Streams规范下的Publisher、Subscriber接口,它们利用泛型确保了数据流处理过程中的类型一致性与安全性。 不仅如此,一些高性能库如Vavr(原名为Javaslang)引入了更高级的泛型概念,如协变(Covariance)、逆变(Contravariance)以及不变(Invariance),为开发者提供了更加灵活且强大的类型系统工具集。 总的来说,Java泛型作为现代Java编程的核心组成部分,其理论研究和实践应用正不断深化和发展,值得广大开发者持续关注和学习。
2023-01-06 19:10:18
357
码农
Python
...熵在优化模型性能上的作用。2021年的一项研究中,科学家们运用交叉熵作为损失函数改进神经网络模型的分类准确率,特别是在图像识别和自然语言处理任务上,这一策略有效降低了模型过拟合风险并提高了泛化能力。 此外,信息熵还在金融风控、网络流量分析等领域发挥着重要作用。例如,金融机构利用交易数据的信息熵来评估市场风险与不确定性,帮助投资者做出更精准的投资决策。而在网络安全方面,信息熵被用来检测异常网络行为,通过量化网络流量的随机性,可有效发现潜在的攻击行为。 总之,从理论到实践,信息熵无处不在,它不仅是一个强大的数学工具,更是推动各领域技术进步的关键要素。随着算法和计算能力的不断提升,信息熵的应用将更加广泛且深入,值得广大科研工作者和工程师持续关注和研究。
2023-08-02 10:52:00
222
数据库专家
Java
...Error导致的系统异常,但过度增大又可能导致整体内存消耗过大,影响系统的整体并发能力。 另一方面,Java 17版本中对于虚拟机内部栈管理机制进行了进一步优化,使得方法调用栈帧的创建与销毁更为高效,从而在一定程度上降低了栈溢出的风险。此外,堆栈数据结构在现代软件开发中的应用也在持续拓展,如在深度优先搜索算法、回溯法求解问题以及实现表达式求值等场景中发挥着核心作用。 深入理解堆栈与栈的区别,不仅有助于排查实际开发中的各类错误,也有利于我们设计出更高效、健壮的程序结构。同时,参考经典著作《深入理解Java虚拟机:JVM高级特性与最佳实践》等资料,可以帮助开发者从原理层面掌握Java内存模型,包括堆栈在内的各个内存区域的工作原理及其对程序性能的影响,从而更好地进行性能调优和故障排查工作。
2023-11-18 10:54:50
381
键盘勇士
JQuery
...站。其中一个最常用的作用是在网页上的按钮上增加点击选中功能。下面是一个简单的例子: $('button').click(function() { $(this).toggleClass('selected'); }); 上面的代码使用jQuery选择器选择所有的button组件并绑定一个点击事件。当用户点击按钮时,toggleClass()函数会切换给定组件的CSS类。这段代码将选中功能和未选中功能交替应用在按钮上。 接下来我们需要修改CSS来增加风格。下面是一个例子CSS代码块,可以为按钮增加选中功能: button { background-color: DDD; border: none; padding: 10px; } .selected { background-color: 333; color: FFF; } 上面的代码块包含两个风格规则。第一个规则设定按钮的背景色,边框和填充。第二个规则用于按钮具有.selected类的情况下设定新的背景和文本颜色。 在两个代码块一起使用时,我们就能够为按钮增加点击选中功能。当用户点击按钮时,按钮将进行选中状态和非选中状态的切换。
2023-05-17 18:43:07
102
电脑达人
JSON
...// 清除值的方法 function clearValue(obj) { Object.键s(obj).遍历(function(键) { if (typeof obj[键] === 'object') { clearValue(obj[键]); // 递归清除值 } else { obj[键] = null; // 赋值为null } }); } clearValue(person); // 调用清除方法 console.log(person); // 输出 {"name": null, "age": null, "address": {"city": null, "street": null} } 以上代码使用了递归的方式对JSON进行了清除操作,当遇到值为object时,递归调用清除方法,否则直接将值赋值为null。这样就能够简单快速地清除JSON的值了。
2023-10-16 19:41:44
522
码农
JQuery
...,才能对它做出相应的处理。 序号二:jQuery中的get()方法 首先,我们需要了解jQuery中的get()方法是如何工作的。这个方法的基本语法如下: javascript $.get(url, [data], [callback]); 其中,url参数是要获取内容的服务器地址,data参数是一个可选的键值对,用于传递额外的数据给服务器,而callback参数则是在请求完成后被调用的一个函数。 序号三:如何获取当前的URL地址 那么,如何在使用get()方法加载内容的同时,也能够获取当前的URL地址呢?其实这很简单,我们只需要在get()方法中添加一个额外的参数即可。这个参数其实就是$.param()函数啦,它的作用超级实用,就是能把一堆键值对打包整理,然后变成URL那种格式的查询字符串,就像咱们平常上网时在网址后面看到的那种“?”后面跟着一串“key=value&key2=value2”的样子。这样,当我们点击调用get()这个小功能的时候,就能顺道把当前网页的URL地址给轻松拿到手啦!具体的代码如下: javascript var url = $.param({ key1: 'value1', key2: 'value2' }); $.get(url, function(data) { // 处理返回的内容 }, 'json'); 在这个例子中,我们首先定义了一个包含两个键值对的对象,并将其转换成了URL格式的查询字符串。然后,我们将这个查询字符串作为参数传递给了get()方法。最后呢,当请求顺利完成,进入到那个回调函数里头,我们就可以直接用这个data参数,来处理它返回的具体内容哈。 序号四:总结 总的来说,通过使用jQuery的get()方法,我们可以在获取动态内容的同时,也很容易地获取到当前的URL地址。这对我们在进行那些依赖于当前网页链接的操作时,可真是帮了大忙啦!因此,掌握这种技巧对于提高我们的前端开发能力是非常有益的。
2023-09-09 17:20:27
1067
断桥残雪_t
CSS
...能够响应该交互并开始处理的时间间隔。一个较低的FID值意味着用户交互能得到更快的响应,从而提供更流畅、更优质的用户体验。 样式冲突 , 样式冲突在网页开发中指的是当多个CSS规则同时作用于同一HTML元素时,如果这些规则设置了相互矛盾或不一致的样式属性,浏览器需要根据CSS选择器的优先级来决定最终应用哪个样式。若CSS代码加载顺序不当,可能导致预期样式未能正确覆盖原有样式,从而引发界面显示异常的问题。 HTML结构先行渲染策略 , 这是一种优化网页加载速度的方法,通过将CSS文件放置在HTML文档底部,使得浏览器在CSS加载完成前可以先解析和渲染HTML结构,这样用户可以更快地看到网页的基本框架和内容,尽管此时可能尚未应用全部样式。然而,这种方法可能带来样式闪烁、交互延迟等问题,需权衡利弊后酌情采用。
2023-12-20 17:00:57
449
软件工程师
VUE
... { total: function () { var sum = 0; for (var i = 0; i < this.products.length; i++) { sum += this.products[i].price; } return sum.toFixed(2); } } }); </script> 在这个例子中,我们应用了Vue的计算属性特性来计算商品价格总计。计算属性是Vue提供的一种特殊属性,Vue会自动侦听数据变化并重新计算计算属性的值,再将其返回给页面中的绑定元素。在这个例子中,我们定义了一个叫做“total”的计算属性,它是由products数组中每个对象的price属性相加而获取的。为了防止出现过多的十进位,我们应用了toFixed()函数,将结果保留两位小数。 由于计算属性的值是根据Vue响应式系统自动计算获取的,所以我们仅需在模板中应用total即可,而不需要手动更新。
2023-04-27 14:17:40
138
代码侠
Javascript
...情况,比如在一个全局作用域下使用this关键字,那么它指向的就是window对象。这就需要我们深入理解这个概念,才能正确地使用它。 2. this关键字的四种绑定方式 根据this关键字所处的上下文环境不同,它可以分为四种不同的绑定方式。 2.1 原型链绑定 当函数作为对象的一个方法来调用时,此时this关键字指向调用该方法的对象。 javascript function fn() { console.log(this); } const obj = { name: 'Tom', age: 18, fn }; obj.fn(); // 输出 {name: "Tom", age: 18} 2.2 构造函数绑定 当函数被new操作符调用时,此时this关键字指向新创建的对象。 javascript function Person(name, age) { this.name = name; this.age = age; } const person = new Person('Tom', 18); console.log(person.name); // 输出 Tom console.log(person.age); // 输出 18 2.3 自执行函数绑定 当函数作为一个独立的函数体存在时,此时this关键字默认指向全局对象(浏览器环境中为window对象)。 javascript console.log(this === window); // 输出 true 2.4 使用call(), apply(), bind()方法改变this的指向 当函数调用自身或者通过apply(), call()方法被其他对象调用时,此时可以通过这两个方法改变this关键字的指向。 javascript function Person(name, age) { this.name = name; this.age = age; } const person = new Person('Tom', 18); function sayHello() { console.log(Hello, my name is ${this.name}); } sayHello.call(person); // 输出 Hello, my name is Tom 3. 注意事项 在使用this关键字时,需要注意以下几个方面: 3.1 不要滥用箭头函数 箭头函数不能改变this的指向,因此在一些需要动态改变this指向的情况下,应该避免使用箭头函数。 3.2 注意事件监听器中的this关键字 在事件监听器中,如果直接使用this关键字,那么指向的是事件触发时的那个对象,而不是回调函数所在的对象。如果需要改变this的指向,可以使用bind()方法。 3.3 使用模块化开发时的this问题 在模块化开发中,如果一个模块被多个地方引入,那么这个模块内部的this关键字可能就会变得难以控制。在这种情况下,我强烈推荐你用import命令把模块拽进来,而不是纠结于require语句啦。 总结:JavaScript中的this关键字是一个非常重要的概念,我们需要深入了解它的各种绑定方式,以及如何正确地使用它。唯有如此,咱们才能捣鼓出更优美、简练、高效给力的JavaScript代码来。
2023-03-21 11:44:13
284
红尘漫步-t
Python
... def test_function(): print("这是一个本机的Python组件!") 在其他Python文件中载入test_module.py中定义的函数 from test_module import test_function test_function() 上述代码展示了如何在Python文件中载入本机的Python组件。首先,我们在当前目录下建立了一个命名为test_module.py的文件,并在其中定义了一个命名为test_function的函数,函数中会输出一条提示信息。 接下来,我们在其他Python文件中通过from语句载入test_module.py中定义的函数,from语句后面的test_module是文件名(不含.py后缀),后面的test_function则是文件中定义的函数名。最后,我们调用载入的函数并执行,输出了函数中定义的提示信息。 总而言之,载入本机的Python组件可以为我们的开发工作带来很大的便利,让我们可以更加高效地进行代码创作和管理。更多关于Python组件的知识可以查阅Python官方文档。
2024-01-01 21:04:54
96
电脑达人
Shell
...能够帮助我们更顺溜地处理数据,更灵活地掌控程序流程,让一切变得更有条不紊。就像是给我们的工作装上了加速器,让数据处理和程序运行更加得心应手。 二、什么是函数返回值? 在计算机编程中,函数是一段封装了特定功能的可重用代码块。当我们调用一个函数时,它会执行一些特定的操作,并返回一个结果。这个结果通常被称为函数的返回值。返回值是我们根据函数的功能期望得到的结果。 三、如何实现在函数返回值的基础上进行逻辑判断? 假设我们有一个名为is_even()的函数,它的功能是判断输入的数字是否为偶数。该函数的实现如下: bash function is_even { local number=$1 if [ $((number % 2)) -eq 0 ]; then echo "$number 是偶数" else echo "$number 不是偶数" fi } 我们可以使用这个函数并获取其返回值: bash result=$(is_even 5) echo "函数返回值:$result" 在这个例子中,我们通过将函数的返回值赋给变量result,然后打印出这个变量的值来查看函数的输出。 接下来,我们可以基于这个返回值来进行逻辑判断。例如,如果我们想要检查一个数字是否为偶数,我们可以这样做: bash if [ $(is_even $num) == "数字是偶数" ]; then echo "数字$num是偶数" else echo "数字$num不是偶数" fi 在这个例子中,我们首先调用了is_even()函数,并将结果赋给了变量result。接着,咱们把result这个家伙的数值,跟一句“数字是偶数”对对碰一下。如果两者相等,我们就认为数字是偶数,否则就认为数字不是偶数。 四、结论 在Shell编程中,我们可以通过获取函数的返回值,并基于这些返回值进行逻辑判断,来实现更复杂的任务。这需要我们理解函数的工作原理,以及如何正确地使用和操作返回值。总的来说,这个技能真的是超级实用,它能够实实在在地帮我们把代码编写得更溜,管理起来也更加得心应手。
2023-12-12 21:33:31
114
冬日暖阳-t
JQuery
...nt).ready(function() { $("hideDiv").click(function() { $("myDiv").hide(); }); }); 上面的代码中,我们采用了JQuery的$() 方法,这个方法会将网页中的所有组件选择出来。其中hideDiv是为事件关联的组件,采用click() 方法为其关联了一个触击事件。最后采用hide() 方法将另一个组件myDiv 遮蔽起来。 $(document).ready(function() { $("showDiv").click(function() { $("myDiv").show(); }); }); 我们相同地可以采用show() 方法来让组件展现出来。与上面的代码类似,我们将另一个组件myDiv 展现了出来。 $(document).ready(function() { $("toggleDiv").click(function() { $("myDiv").toggle(); }); }); toggle()方法可以同时达成展现和遮蔽的效果。在上面的代码中,我们采用了toggleDiv 组件时为其关联一个触击事件,然后我们对myDiv 组件进行了toggle() 操作,达成了一键切换展现遮蔽状态的效果。 综上所述,我们可以采用JQuery轻松操纵div块的展现与遮蔽,为网页增加更为丰富的动画效果。
2023-01-31 18:25:30
373
软件工程师
PHP
...s; public function __construct($id, $name, $recommendedUsers) { $this->id = $id; $this->name = $name; $this->recommendedUsers = $recommendedUsers; } } 然后,我们可以创建一个函数,接收一个用户列表作为参数,遍历这个列表,统计每个用户的推荐人数,并将结果存储在一个关联数组中。 php function countRecommendedUsers($users) { $countMap = array(); foreach ($users as $user) { if (!isset($countMap[$user->id])) { $countMap[$user->id] = 0; } $countMap[$user->id] += count($user->recommendedUsers); } return $countMap; } 最后,我们可以调用这个函数,获取每个用户的推荐人数,并打印出来。 php $userList = array( new User(1, 'Alice', array('Bob')), new User(2, 'Bob', array('Charlie')), new User(3, 'Charlie', array()) ); $countMap = countRecommendedUsers($userList); foreach ($countMap as $userId => $count) { echo "User ID: {$userId}, Recommended Users: {$count}\n"; } 四、总结 通过上述步骤,我们成功地实现了在输出用户列表的同时,统计并输出每个用户推荐用户的人数的功能。这个过程既涉及到面向对象编程的知识,也涉及到了数组操作的知识。理解这些知识,对于学习和使用PHP都是非常重要的。 在这个过程中,我们还思考了一些问题,比如如何设计和使用类,如何编写高效的代码等。这些可都是我们在实际编程开发过程中,经常会碰到的头疼问题,也是我们不得不持续学习、不断摸索、努力攻破的难关!希望这篇文章能对你有所帮助,也希望你能从中得到一些启发。
2023-06-30 08:23:33
68
素颜如水_t
Java
在深入理解Java异常处理机制后,我们可以进一步关注该领域的一些最新动态和最佳实践。近期,随着Java 17的发布,其对异常处理也带来了一些改进。例如,JEP 408(Records)引入了新的记录类,它们能自动生成equals()、hashCode()等方法,同时也增强了对异常处理的支持,确保在构造期间发生异常时能正确清理资源。 另外,对于大型项目而言,遵循“Fail Fast”原则以及合理使用受检异常与运行时异常是提升代码健壮性和可维护性的重要手段。业界专家提倡尽量减少catch-all(捕获所有异常)的做法,转而精确捕获并针对性地处理特定类型的异常,以提高问题定位效率。 此外,在微服务架构下,异常处理的边界通常扩展到服务间通信层面,如Spring框架中的全局异常处理器可以统一处理来自各个服务接口的异常,并通过HTTP状态码和错误信息为前端或调用方提供清晰的反馈。 同时,Java社区也在探讨如何优化try-with-resources语句在多资源管理场景下的应用,以及如何利用异常链(Exception Chaining)来保留原始异常上下文,以便于排查深层次的程序错误。 综上所述,Java异常处理是一个持续演进和深化实践的主题,开发人员需紧跟技术发展步伐,结合具体业务场景灵活运用异常处理机制,从而构建出更加稳定、可靠的系统。
2024-01-13 22:39:29
335
键盘勇士
HTML
...世界里,我们经常需要处理各种类型的数据。有时候,我们需要遍历数据集合来获取其中的一些特定元素。这就需要用到迭代器的概念。本文将以Java语言为例,详细介绍如何使用迭代器。 二、什么是迭代器? 在计算机科学中,迭代器是一种设计模式,它可以让你遍历任何集合对象。迭代器是实现的接口,它提供了几个主要的方法,如hasNext(),next()和remove()。这些方法使得我们可以按照顺序访问集合中的每一个元素。 三、使用迭代器的过程 1. 创建迭代器 首先,我们需要创建一个迭代器对象。这可以通过调用集合对象的iterator()方法来完成。例如,如果我们有一个ArrayList集合,我们可以这样创建迭代器: java ArrayList list = new ArrayList(); list.add("apple"); list.add("banana"); list.add("cherry"); Iterator iter = list.iterator(); 2. 判断是否有下一个元素 接下来,我们需要判断是否有下一个元素可以被迭代。这可以通过调用迭代器的hasNext()方法来完成。如果有下一个元素,该方法会返回true,否则返回false。例如,我们可以这样判断是否有下一个元素: java if (iter.hasNext()) { System.out.println(iter.next()); } 3. 获取下一个元素 如果hasNext()方法返回true,那么我们可以调用迭代器的next()方法来获取下一个元素。例如,我们可以这样获取下一个元素: java String next = iter.next(); System.out.println(next); 4. 删除当前元素 最后,如果需要,我们可以调用迭代器的remove()方法来删除当前元素。例如,我们可以这样删除当前元素: java iter.remove(); 四、使用迭代器的优点 使用迭代器有许多优点。首先,它可以让我们避免暴露底层数据结构的具体细节。其次,它可以使我们的代码更加简洁和优雅。最后,它可以提高代码的可读性和可维护性。 五、使用迭代器的注意事项 虽然使用迭代器有很多好处,但是我们也需要注意一些事情。首先,迭代器不能保证集合的修改不会影响已经迭代过的元素。所以,如果你想对这个集合动手脚,比如说要改一改,记得先用一下remove()这个方法,把它清理一下,然后再去点一下next()这个按钮,才能接着进行下一步操作。其次,迭代器只能从头开始迭代,不能从中间开始迭代。如果需要从中间开始迭代,应该重新创建一个新的迭代器。 六、总结 总的来说,迭代器是一种非常有用的工具,它可以帮助我们更方便地遍历集合中的元素。掌握了迭代器的使用窍门后,咱们就能写出更短小精悍、流畅顺滑、高效无比的代码啦!同时,我们也需要注意迭代器的一些限制,以免出现错误或者异常。希望这篇文章能对你有所帮助!
2023-03-18 12:14:48
303
梦幻星空_t
AngularJS
...'MyCtrl', function($scope) { $scope.message = "Hello, World!"; }); angular.bootstrap(document, ['myApp']); 在这个例子中,我们定义了一个名为 MyCtrl 的控制器,并将其添加到了名为 myApp 的模块中。接下来,咱们就用 angular.bootstrap 这个神奇的小玩意儿启动咱们的应用程序,同时告诉它我们要用哪个模块来开启这场奇妙的旅程。 如果我们的控制器名称拼写错误或者大小写错误,那么 AngularJS 就无法找到这个控制器,从而抛出上述错误。 五、结论 总的来说,当我们遇到 AngularJS $rootScope 报错:“noctrl Controller '0' not found”的问题时,我们应该仔细检查我们的代码,确保我们的控制器名称正确,以及我们的控制器已经被正确地注册到相应的模块中。另外,咱们还可以琢磨一下用 $controllerProvider 这个家伙来注册咱们的控制器,或者灵活调整路由规则,确保它们能指向正确的控制器。这样理解就更接地气啦! 六、小结 以上就是我对 “AngularJS $rootScope 报错:“noctrl Controller '0' not found”的处理方式和思路的介绍。大家伙儿,我真心希望大家读完这篇文章后,以后在用 AngularJS 进行开发的时候,能绕过那些坑坑洼洼的小路,一路顺风顺水地把项目搞定,顺利完成任务。
2024-01-18 15:53:01
430
春暖花开-t
站内搜索
用于搜索本网站内部文章,支持栏目切换。
知识学习
实践的时候请根据实际情况谨慎操作。
随机学习一条linux命令:
sed -i 's/old_text/new_text/g' file.txt
- 替换文件中所有旧文本为新文本。
推荐内容
推荐本栏目内的其它文章,看看还有哪些文章让你感兴趣。
2023-04-28
2023-08-09
2023-06-18
2023-04-14
2023-02-18
2023-04-17
2024-01-11
2023-10-03
2023-09-09
2023-06-13
2023-08-07
2023-03-11
历史内容
快速导航到对应月份的历史文章列表。
随便看看
拉到页底了吧,随便看看还有哪些文章你可能感兴趣。
时光飞逝
"流光容易把人抛,红了樱桃,绿了芭蕉。"