.net dataexcel 脚本公式 函数源码

示例如:

ScriptExec(""sum(1, 2, 3, 4)"") 结果等于10

using Feng.Excel.Builder;
using Feng.Excel.Collections;
using Feng.Excel.Interfaces;
using Feng.Script.CBEexpress;
using Feng.Script.Method;
using System;
using System.Collections.Generic;
using System.Drawing;

namespace Feng.Excel.Script
{
    [Serializable]
    public class ScriptFunctionContainer : DataExcelMethodContainer
    {

        public const string Function_Name = "DataExcelScript";
        public const string Function_Description = "脚本函数";
        public override string Name
        {
            get { return Function_Name; }

        }
        public override string Description
        {
            get { return Function_Description; }
        }

        public ScriptFunctionContainer()
        {
            BaseMethod model = null;

            model = new BaseMethod();
            model.Name = "ScriptExec";
            model.Description = "执行脚本";
            model.Eg = @"=ScriptExec(""sum(1, 2, 3, 4)"") 结果等于10";
            model.Function = ScriptExec;
            MethodList.Add(model);

            model = new BaseMethod();
            model.Name = "ScriptIF";
            model.Description = "第一参数为True返回第二个参数,否则返加第三个参数";
            model.Eg = @"ScriptIF(1>2,10,30)结果等于30";
            model.Function = ScriptIF;
            MethodList.Add(model);

            model = new BaseMethod();
            model.Name = "ScriptIsNull";
            model.Description = "第一参数为null返回第二个参数,否则返加第一个参数";
            model.Eg = @"ScriptIsNull(null,1)";
            model.Function = ScriptIsNull;
            MethodList.Add(model);


            model = new BaseMethod();
            model.Name = "ScriptArg";
            model.Description = @"获取或设置参数 ScriptArg(""argname"")";
            model.Eg = @"ScriptArg(""argname"")";
            model.Function = ScriptArg;
            MethodList.Add(model);

            model = new BaseMethod();
            model.Name = "ScriptExecG";
            model.Description = @"在传第一个参数表格上执行脚本 ScriptExecG(grid)";
            model.Eg = @"ScriptExecG(grid)";
            model.Function = ScriptExecG;
            MethodList.Add(model);


            model = new BaseMethod();
            model.Name = "ScriptSaveContext";
            model.Description = @"保存当前执行上下文 ScriptSaveContext()";
            model.Eg = @"var context=ScriptSaveContext()";
            model.Function = ScriptSaveContext;
            MethodList.Add(model);


            model = new BaseMethod();
            model.Name = "ScriptReStoreContext";
            model.Description = @"还原当前上下文 ScriptReStoreContext(context)";
            model.Eg = @"ScriptReStoreContext(context)";
            model.Function = ScriptReStoreContext;
            MethodList.Add(model);


            model = new BaseMethod();
            model.Name = "ScriptSwitchContext";
            model.Description = @"切换当前上下文 ScriptSwitchContext(grid,cell)";
            model.Eg = @"ScriptSwitchContext(grid,cell)";
            model.Function = ScriptSwitchContext;
            MethodList.Add(model);


            model = new BaseMethod();
            model.Name = "ScriptCellValueChanged";
            model.Description = @"获取或设置单元格值变化时脚本 ScriptCellValueChanged(cell,script)";
            model.Eg = @"ScriptCellValueChanged(cell,script)";
            model.Function = ScriptCellValueChanged;
            MethodList.Add(model);

            model = new BaseMethod();
            model.Name = "ScriptCellClick";
            model.Description = @"获取或设置单元格单击时脚本 ScriptCellClick(cell,script)";
            model.Eg = @"ScriptCellClick(cell,script)";
            model.Function = ScriptCellClick;
            MethodList.Add(model);


            model = new BaseMethod();
            model.Name = "ScriptCellDoubleClick";
            model.Description = @"获取或设置单元格双击时脚本 ScriptCellDoubleClick(cell,script)";
            model.Eg = @"ScriptCellDoubleClick(cell,script)";
            model.Function = ScriptCellDoubleClick;
            MethodList.Add(model);

            model = new BaseMethod();
            model.Name = "ScriptCellKeyDown";
            model.Description = @"获取或设置单元格键盘按下时脚本 ScriptCellKeyDown(cell,script)";
            model.Eg = @"ScriptCellKeyDown(cell,script)";
            model.Function = ScriptCellKeyDown;
            MethodList.Add(model);


            model = new BaseMethod();
            model.Name = "ScriptCellKeyUp";
            model.Description = @"获取或设置单元格键盘抬起时脚本 ScriptCellKeyUp(cell,script)";
            model.Eg = @"ScriptCellKeyUp(cell,script)";
            model.Function = ScriptCellKeyUp;
            MethodList.Add(model);
 
            model = new BaseMethod();
            model.Name = "ScriptGridEndEdit";
            model.Description = @"获取或设置表格结束编辑时脚本 ScriptGridEndEdit(grid,script)";
            model.Eg = @"ScriptGridEndEdit(grid,script)";
            model.Function = ScriptGridEndEdit;
            MethodList.Add(model);

            model = new BaseMethod();
            model.Name = "ScriptGridLoadCompleted";
            model.Description = @"获取或设置表格加载结束时脚本 ScriptGridLoadCompleted(grid,script)";
            model.Eg = @"ScriptGridLoadCompleted(grid,script)";
            model.Function = ScriptGridLoadCompleted;
            MethodList.Add(model);


            model = new BaseMethod();
            model.Name = "ScriptGridClick";
            model.Description = @"获取或设置表格单击脚本 ScriptGridClick(grid,script)";
            model.Eg = @"ScriptGridClick(grid,script)";
            model.Function = ScriptGridClick;
            MethodList.Add(model);


            model = new BaseMethod();
            model.Name = "ScriptGridDoubleClick";
            model.Description = @"获取或设置表格双击脚本 ScriptGridDoubleClick(grid,script)";
            model.Eg = @"ScriptGridDoubleClick(grid,script)";
            model.Function = ScriptGridDoubleClick;
            MethodList.Add(model);


            model = new BaseMethod();
            model.Name = "ScriptGridValueChanged";
            model.Description = @"获取或设置表格值改变时脚本 ScriptGridValueChanged(grid,script)";
            model.Eg = @"ScriptGridValueChanged(grid,script)";
            model.Function = ScriptGridValueChanged;
            MethodList.Add(model);


            model = new BaseMethod();
            model.Name = "ScriptGridKeyDown";
            model.Description = @"获取或设置表格键按下时脚本 ScriptGridKeyDown(grid,script)";
            model.Eg = @"ScriptGridKeyDown(grid,script)";
            model.Function = ScriptGridKeyDown;
            MethodList.Add(model);

            model = new BaseMethod();
            model.Name = "ScriptGridKeyUp";
            model.Description = @"获取或设置表格键抬起时脚本 ScriptGridKeyUp(grid,script)";
            model.Eg = @"ScriptGridKeyUp(grid,script)";
            model.Function = ScriptGridKeyUp;
            MethodList.Add(model);
        }
        public virtual object ScriptGridKeyUp(params object[] args)
        {
            Feng.Excel.Script.DataExcelScriptStmtProxy proxy = args[0] as Feng.Excel.Script.DataExcelScriptStmtProxy;
            if (proxy != null)
            {
                DataExcel cell = base.GetArgIndex(1, args) as DataExcel;
                if (cell == null)
                {
                    return Feng.Utils.Constants.Fail;
                }
                if (args.Length == 2)
                {
                    return cell.PropertyKeyUp;
                }
                string script = base.GetTextValue(2, args);
                cell.PropertyKeyUp = script;
                return Feng.Utils.Constants.OK;
            }
            return null;
        }

        public virtual object ScriptGridKeyDown(params object[] args)
        {
            Feng.Excel.Script.DataExcelScriptStmtProxy proxy = args[0] as Feng.Excel.Script.DataExcelScriptStmtProxy;
            if (proxy != null)
            {
                DataExcel cell = base.GetArgIndex(1, args) as DataExcel;
                if (cell == null)
                {
                    return Feng.Utils.Constants.Fail;
                }
                if (args.Length == 2)
                {
                    return cell.PropertyKeyDown;
                }
                string script = base.GetTextValue(2, args);
                cell.PropertyKeyDown = script;
                return Feng.Utils.Constants.OK;
            }
            return null;
        }

        public virtual object ScriptGridValueChanged(params object[] args)
        {
            Feng.Excel.Script.DataExcelScriptStmtProxy proxy = args[0] as Feng.Excel.Script.DataExcelScriptStmtProxy;
            if (proxy != null)
            {
                DataExcel cell = base.GetArgIndex(1, args) as DataExcel;
                if (cell == null)
                {
                    return Feng.Utils.Constants.Fail;
                }
                if (args.Length == 2)
                {
                    return cell.PropertyValueChanged;
                }
                string script = base.GetTextValue(2, args);
                cell.PropertyValueChanged = script;
                return Feng.Utils.Constants.OK;
            }
            return null;
        }

        public virtual object ScriptGridDoubleClick(params object[] args)
        {
            Feng.Excel.Script.DataExcelScriptStmtProxy proxy = args[0] as Feng.Excel.Script.DataExcelScriptStmtProxy;
            if (proxy != null)
            {
                DataExcel cell = base.GetArgIndex(1, args) as DataExcel;
                if (cell == null)
                {
                    return Feng.Utils.Constants.Fail;
                }
                if (args.Length == 2)
                {
                    return cell.PropertyDoubleClick;
                }
                string script = base.GetTextValue(2, args);
                cell.PropertyDoubleClick = script;
                return Feng.Utils.Constants.OK;
            }
            return null;
        }

        public virtual object ScriptGridClick(params object[] args)
        {
            Feng.Excel.Script.DataExcelScriptStmtProxy proxy = args[0] as Feng.Excel.Script.DataExcelScriptStmtProxy;
            if (proxy != null)
            {
                DataExcel cell = base.GetArgIndex(1, args) as DataExcel;
                if (cell == null)
                {
                    return Feng.Utils.Constants.Fail;
                }
                if (args.Length == 2)
                {
                    return cell.PropertyClick;
                }
                string script = base.GetTextValue(2, args);
                cell.PropertyClick = script;
                return Feng.Utils.Constants.OK;
            }
            return null;
        }

        public virtual object ScriptGridLoadCompleted(params object[] args)
        {
            Feng.Excel.Script.DataExcelScriptStmtProxy proxy = args[0] as Feng.Excel.Script.DataExcelScriptStmtProxy;
            if (proxy != null)
            {
                DataExcel cell = base.GetArgIndex(1, args) as DataExcel;
                if (cell == null)
                {
                    return Feng.Utils.Constants.Fail;
                }
                if (args.Length == 2)
                {
                    return cell.PropertyDataLoadCompleted;
                }
                string script = base.GetTextValue(2, args);
                cell.PropertyDataLoadCompleted = script;
                return Feng.Utils.Constants.OK;
            }
            return null;
        }

        public virtual object ScriptFormClosing(params object[] args)
        {
            Feng.Excel.Script.DataExcelScriptStmtProxy proxy = args[0] as Feng.Excel.Script.DataExcelScriptStmtProxy;
            if (proxy != null)
            {
                DataExcel cell = base.GetArgIndex(1, args) as DataExcel;
                if (cell == null)
                {
                    return Feng.Utils.Constants.Fail;
                }
                if (args.Length == 2)
                {
                    return cell.PropertyFormClosing;
                }
                string script = base.GetTextValue(2, args);
                cell.PropertyFormClosing = script;
                return Feng.Utils.Constants.OK;
            }
            return null;
        }

        public virtual object ScriptGridEndEdit(params object[] args)
        {
            Feng.Excel.Script.DataExcelScriptStmtProxy proxy = args[0] as Feng.Excel.Script.DataExcelScriptStmtProxy;
            if (proxy != null)
            {
                DataExcel cell = base.GetArgIndex(1, args) as DataExcel;
                if (cell == null)
                {
                    return Feng.Utils.Constants.Fail;
                }
                if (args.Length == 2)
                {
                    return cell.PropertyEndEdit;
                }
                string script = base.GetTextValue(2, args);
                cell.PropertyEndEdit = script;
                return Feng.Utils.Constants.OK;
            }
            return null;
        }

        public virtual object ScriptCellKeyUp(params object[] args)
        {
            Feng.Excel.Script.DataExcelScriptStmtProxy proxy = args[0] as Feng.Excel.Script.DataExcelScriptStmtProxy;
            if (proxy != null)
            {
                ICell cell = base.GetCell(1, args);
                if (cell == null)
                {
                    return Feng.Utils.Constants.Fail;
                }
                if (args.Length == 2)
                {
                    return cell.PropertyOnKeyUp;
                }
                string script = base.GetTextValue(2, args);
                cell.PropertyOnKeyUp = script;
                return Feng.Utils.Constants.OK;
            }
            return null;
        }

        public virtual object ScriptCellKeyDown(params object[] args)
        {
            Feng.Excel.Script.DataExcelScriptStmtProxy proxy = args[0] as Feng.Excel.Script.DataExcelScriptStmtProxy;
            if (proxy != null)
            {
                ICell cell = base.GetCell(1, args);
                if (cell == null)
                {
                    return Feng.Utils.Constants.Fail;
                }
                if (args.Length == 2)
                {
                    return cell.PropertyOnKeyDown;
                }
                string script = base.GetTextValue(2, args);
                cell.PropertyOnKeyDown = script;
                return Feng.Utils.Constants.OK;
            }
            return null;
        }

        public virtual object ScriptCellDoubleClick(params object[] args)
        {
            Feng.Excel.Script.DataExcelScriptStmtProxy proxy = args[0] as Feng.Excel.Script.DataExcelScriptStmtProxy;
            if (proxy != null)
            {
                ICell cell = base.GetCell(1, args);
                if (cell == null)
                {
                    return Feng.Utils.Constants.Fail;
                }
                if (args.Length == 2)
                {
                    return cell.PropertyOnDoubleClick;
                }
                string script = base.GetTextValue(2, args);
                cell.PropertyOnDoubleClick = script;
                return Feng.Utils.Constants.OK;
            }
            return null;
        }

        public virtual object ScriptCellClick(params object[] args)
        {  
            Feng.Excel.Script.DataExcelScriptStmtProxy proxy = args[0] as Feng.Excel.Script.DataExcelScriptStmtProxy;
            if (proxy != null)
            {
                ICell cell = base.GetCell(1, args);
                if (cell == null)
                {
                    return Feng.Utils.Constants.Fail;
                }
                if (args.Length == 2)
                {
                    return cell.PropertyOnClick;
                }
                string script = base.GetTextValue(2, args);
                cell.PropertyOnClick = script;
                return Feng.Utils.Constants.OK;
            }
            return null;
        }

        public virtual object ScriptCellValueChanged(params object[] args)
        {
            Feng.Excel.Script.DataExcelScriptStmtProxy proxy = args[0] as Feng.Excel.Script.DataExcelScriptStmtProxy;
            if (proxy != null)
            {
                ICell cell = base.GetCell(1, args);
                if (cell == null)
                {
                    return Feng.Utils.Constants.Fail;
                }
                if (args.Length == 2)
                {
                    return cell.PropertyOnCellValueChanged;
                }
                string script = base.GetTextValue(2, args);
                cell.PropertyOnCellValueChanged = script;
                return Feng.Utils.Constants.OK;
            }
            return null;
        }

        public virtual object ScriptArg(params object[] args)
        {
            Feng.Excel.Script.DataExcelScriptStmtProxy proxy = args[0] as Feng.Excel.Script.DataExcelScriptStmtProxy;
            if (proxy != null)
            {
                string key = base.GetTextValue(1, args);
                if (args.Length == 3)
                {
                    object value = base.GetArgIndex(2, args);
                    proxy.SetKeyValue(key, value);
                    return Feng.Utils.Constants.OK;
                }
                return proxy.GetKeyValue(key);
            }
            return null;
        }

        public virtual object ScriptIsNull(params object[] args)
        {
            if (args.Length > 1)
            {
                object value1 = args[1];
                object value2 = args[2];
                if (value1 == null)
                {
                    return value2;
                }
                else
                {
                    return value1;
                }
            }
            return null;
        }

        public virtual object ScriptIF(params object[] args)
        {
            if (args.Length > 2)
            {
                object value1 = args[1];
                object value2 = args[2];
                object value3 = args[3];
                bool res = Feng.Utils.ConvertHelper.ToBoolean(value1);
                if (res)
                {
                    return value2;
                }
                else
                {
                    return value3;
                }
            }
            return null;
        }

        public virtual object ScriptExec(params object[] args)
        {
            Feng.Excel.Script.DataExcelScriptStmtProxy proxy = args[0] as Feng.Excel.Script.DataExcelScriptStmtProxy;
            if (proxy != null)
            {
                string txt = base.GetTextValue(1, args);
                int len = args.Length - 2;
                if (len > 0)
                {
                    object[] values = new object[len];
                    for (int i = 0; i < len; i++)
                    {
                        values[i] = args[i + 2];
                    }
                    return ScriptBuilder.Exec(proxy.Grid, proxy.CurrentCell, txt, values);
                }
                return ScriptBuilder.Exec(proxy.Grid, proxy.CurrentCell, txt);
            }
            return null;
        }

        public virtual object ScriptExecG(params object[] args)
        {
            DataExcel grid = base.GetArgIndex(1, args) as DataExcel;
            string txt = base.GetTextValue(2, args);
            int len = args.Length - 3;
            if (len > 0)
            {
                object[] values = new object[len];
                for (int i = 0; i < len; i++)
                {
                    values[i] = args[i + 3];
                }
                return ScriptBuilder.Exec(grid, null, txt, values);
            }
            return ScriptBuilder.Exec(grid, null, txt);

        }

        public virtual object ScriptSaveContext(params object[] args)
        {
            Feng.Excel.Script.DataExcelScriptStmtProxy proxy = args[0] as Feng.Excel.Script.DataExcelScriptStmtProxy;
            if (proxy != null)
            {
                Feng.Collections.HashtableEx scriptContext = new Feng.Collections.HashtableEx();
                scriptContext.Add("Grid", proxy.Grid);
                scriptContext.Add("Cell", proxy.CurrentCell);
                return scriptContext;
            }
            return null;
        }

        public virtual object ScriptReStoreContext(params object[] args)
        {
            Feng.Excel.Script.DataExcelScriptStmtProxy proxy = args[0] as Feng.Excel.Script.DataExcelScriptStmtProxy;
            if (proxy != null)
            {
                Feng.Collections.HashtableEx scriptContext = base.GetArgIndex(1, args) as Feng.Collections.HashtableEx;
                if (scriptContext != null)
                {
                    proxy.Grid = scriptContext["Grid"] as DataExcel;
                    proxy.CurrentCell= scriptContext["Cell"] as ICell;
                    return Feng.Utils.Constants.OK;
                }
            }
            return Feng.Utils.Constants.Fail;
        }

        public virtual object ScriptSwitchContext(params object[] args)
        {
            Feng.Excel.Script.DataExcelScriptStmtProxy proxy = args[0] as Feng.Excel.Script.DataExcelScriptStmtProxy;
            if (proxy != null)
            {
                proxy.Grid = base.GetArgIndex(1, args) as DataExcel;
                proxy.CurrentCell = base.GetArgIndex(2, args) as ICell;
                return Feng.Utils.Constants.OK; 
            }
            return Feng.Utils.Constants.Fail;
        }
    }
}

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

js执行机制----事件循环

前言 问题 一般情况下,我们都认为js是顺序执行的 但是遇到下列情况 setTimeout(function(){console.log(定时器开始啦) });new Promise(function(resolve){console.log(马上执行for循环啦);for(var i 0; i < 10000; i){i 99 && resolve();} }).then(function(…

Hadoop-32 ZooKeeper 分布式锁问题 分布式锁Java实现 附带案例和实现思路代码

章节内容 上节我们完成了&#xff1a; ZooKeeper的Leader选举机制ZooKeeper的选举过程ZooKeeper的ZAB协议 背景介绍 这里是三台公网云服务器&#xff0c;每台 2C4G&#xff0c;搭建一个Hadoop的学习环境&#xff0c;供我学习。 之前已经在 VM 虚拟机上搭建过一次&#xff0…

如何让LabVIEW程序框图的图标简化,从而节省空间?

再点击选项 取消掉箭头所示的√即可。 这样就可以将生成的图标从下面所示&#xff1a; 变成简化的图标&#xff0c;如下所示&#xff1a;

QT实现滑动页面组件,多页面动态切换

这篇文章主要介绍了Qt实现界面滑动切换效果&#xff0c;对大家的学习或工作具有一定的参考借鉴价值&#xff0c;需要的朋友可以参考下。 一、简述 一个基于Qt的动态滑动页面组件。 二、 设计思路 1、自定义StackWidget类&#xff0c;继承自QWidget&#xff0c;实现一个堆叠…

持续集成04--Jenkins结合Gitee创建项目

前言 在持续集成/持续部署&#xff08;CI/CD&#xff09;的旅途中&#xff0c;Jenkins与版本控制系统的紧密集成是不可或缺的一环。本篇“持续集成03--Jenkins结合Gitee创建项目”将引导如何将Jenkins与Gitee&#xff08;一个流行的Git代码托管平台&#xff09;相结合&#xff…

SpringBoot使用本地缓存——Caffeine

SpringBoot使用本地缓存——Caffeine 缓存&#xff0c;想必大家都用过&#xff0c;将常用的数据存储在缓存上能在一定程度上提升数据存取的速度。这正是局部性原理的应用。之前用的缓存大多是分布式的&#xff0c;比如Redis。使用Redis作为缓存虽然是大多数系统的选择&#xf…

vue2学习笔记7 - Vue中的MVVM模型

MVVM Model-View-viewModel是一种软件架构模式&#xff0c;用于将用户界面&#xff08;View&#xff09;与业务逻辑&#xff08;Model&#xff09;分离&#xff0c;并通过ViewModel进行连接和协调。MVVM模式的目标是实现视图与模型的解耦&#xff0c;提高代码的可读性、可维护…

力扣Hot100之两数之和

解法一&#xff1a; 双层循环暴力求解&#xff0c;先在数组的一个位置定住然后在这个位置的后续位置进行判断&#xff0c;如果两个数加起来等于目标和那么就返回 class Solution:def twoSum(self, nums: List[int], target: int) -> List[int]:for i,num in enumerate(num…

react Jsx基础概念和本质

什么是jsx jsx是JavaScript和XML(HTML)的缩写&#xff0c;表示在js代码中编写HTML模板结构&#xff0c;它是react中编写UI模板的方式 const message this is message function App(){return (<div><h1>this is title</h1>{message}</div>) } jsx优…

js补环境系列之剖析:原型、原型对象、实例对象三者互相转化(不讲废话、全是干货)

【作者主页】&#xff1a;小鱼神1024 【擅长领域】&#xff1a;JS逆向、小程序逆向、AST还原、验证码突防、Python开发、浏览器插件开发、React前端开发、NestJS后端开发等等 思考下&#xff1a;js补环境中&#xff0c;什么场景会用到原型、原型对象、实例对象&#xff1f; 举…

通过docker构建基于LNMP的WordPress项目

目录 1.准备nginx 2.准备mysql 3.准备php 4.构建各镜像 5.运行wordpress 1、项目环境&#xff1a; 1.1 &#xff08;1&#xff09;公司在实际的生产环境中&#xff0c;需要使用Docker 技术在一台主机上创建LNMP服务并运行Wordpress网站平台。然后对此服务进行相关的性能…

《昇思25天学习打卡营第07天|qingyun201003》

日期 心得 越往后&#xff0c;越看不懂&#xff0c;只能说是有了解到如何去训练模型代码&#xff0c;对于模型代码该如何去保存&#xff0c;如何通过网络模型去训练。只能一步步来&#xff0c;目前来说是推进度&#xff0c;等后面全部有了认知&#xff0c;再回来重新学习 昇思…

防火墙NAT地址转换和智能选举综合实验

一、实验拓扑 目录 一、实验拓扑 二、实验要求&#xff08;接上一个实验要求后&#xff09; 三、实验步骤 3.1办公区设备可以通过电信链路和移动链路上网(多对多的NAT&#xff0c;并且需要保留一个公网IP不能用来转换) 3.2分公司设备可以通过总公司的移动链路和电信链路访…

网易天音:网易云音乐推出的一站式AI音乐创作工具

网易天音是一款由网易云音乐推出的AI音乐创作工具&#xff0c;它为音乐爱好者和专业歌手提供了一个便捷高效的创作平台。用户可以通过输入灵感&#xff0c;利用AI技术辅助完成作词、作曲、编曲和演唱&#xff0c;生成初稿后还可以进行词曲协同调整&#xff0c;以满足个性化的音…

MySQL 执行引擎 事务 锁 日志

MySQL 执行引擎 事务 锁 日志 一、执行引擎二、事务三、锁四、日志 一、执行引擎 1、查询设置引擎 -- 查询当前数据库支持的存储引擎&#xff1a;默认的执行引擎是innoDB 支持事务&#xff0c;行级锁定和外键 show engines;-- 查看当前的默认存储引擎&#xff1a; show var…

5.串口通信

文章目录 串口的介绍TTLRS-232RS-485 分类方式串口并口同步异步 相关寄存器SCONPCONTMODSBUFIE 中断处理函数代码编写main.cdelay.cdelay.hUart.cUart.hmain.h回环 继电器ESP8266AT指令代码编写main.cdefine.cdefine.hsend.csend.hreceive.cdelay.cdelay.h 串口的介绍 UART&am…

Sentinel限流算法:滑动时间窗算法、漏桶算法、令牌桶算法。拦截器定义资源实现原理

文章目录 滑动时间窗算法基本知识源码算法分析 漏桶算法令牌桶算法拦截器处理web请求 滑动时间窗算法 基本知识 限流算法最简单的实现就是使用一个计数器法。比如对于A接口来说&#xff0c;我要求一分钟之内访问量不能超过100&#xff0c;那么我们就可以这样来实现&#xff1…

Java面试八股之Redis Stream的实现原理及应用场景

Redis Stream的实现原理及应用场景 Redis Stream是一种在Redis 5.0版本中引入的数据结构&#xff0c;它主要用于实现高效的消息队列服务。下面我将详细解释其实现原理以及一些常见的应用场景。 实现原理 1. 结构组成&#xff1a; - Redis Stream由一个或多个消息组成&#xf…

链接追踪系列-00.es设置日志保存7天-番外篇

索引生命周期策略 ELK日志我们一般都是按天存储&#xff0c;例如索引名为"zipkin-span-2023-03-24"&#xff0c;因为日志量所占的存储是非常大的&#xff0c;我们不能一直保存&#xff0c;而是要定期清理旧的&#xff0c;这里就以保留7天日志为例。 自动清理7天以前…

.NET MAUI开源架构_2.什么是 .NET MAUI?

1.什么是.NET MAUI&#xff1f; .NET 多平台应用 UI (.NET MAUI) 是一个跨平台框架&#xff0c;用于使用 C# 和 XAML 创建本机移动和桌面应用。使用 .NET MAUI&#xff0c;可从单个共享代码库开发可在 Android、iOS、macOS 和 Windows 上运行的应用。 .NET MAUI 是一款…