.net dataexcel 脚本公式 函数源码

news2024/11/14 13:55:56

示例如:

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;
        }
    }
}

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

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

相关文章

场景分析法挖掘需求的常见4大步骤

场景分析方法&#xff0c;有助于精确定位需求&#xff0c;优化产品设计&#xff0c;促进团队协同&#xff0c;减少项目风险&#xff0c;提升用户满意度与市场竞争力。若场景分析不足&#xff0c;产品可能偏离用户需求&#xff0c;导致功能冗余或缺失&#xff0c;用户体验差&…

java中传引用问题

在 Java 中&#xff0c;所有对象都是通过引用传递的&#xff0c;而基本数据类型是通过值传递的。 引用传递&#xff1a; 当一个对象作为参数传递给方法时&#xff0c;传递的是对象的引用。对这个对象引用进行的修改会影响到原始对象。例如&#xff1a; public class Test {p…

Designing Data-Intensive Applications数据密集型应用系统设计-读书笔记

目录 第一部分可靠性、可扩展性、可维护性硬件故障描述负载 吞吐与延迟可维护性 第二章 数据模型与查询语言第三章索引哈希索引B-tree事务 第三章 编码第二部分、分布式数据系统第五章 数据复制单主从复制节点失效日志实现复制滞后问题 多主节点复制 第六章、数据分区3 第一部分…

10个常见的电缆载流表,值得收藏!

众所周知,电线电缆的载流是所有电工、电气人员都必须具备的基本储备,但是如果要将那么多的“数字”都记得清清楚楚,还是有一点困难的!今天咱们就做了一个电力电缆载流量对照表,速度收藏!下次参考不迷路! 1、0.6/1KV聚氯乙烯绝缘电力电缆载流量 以上电缆载流量计算条件:…

世界启动Ⅳ--利用AI和费曼技巧学习一切

前言 有无数的学习技巧可以帮助你消化复杂的概念&#xff0c;并有信心记住它们。如果你像我一样是一个不断学习的学生&#xff0c;你就会明白有效学习方法的重要性。其中最简单的一种就是费曼技巧。 在本文中&#xff0c;我将解释如何有效地应用费曼学习方法&#xff0c;以及…

应用最优化方法及MATLAB实现——第5章代码实现

一、概述 继上一章代码后&#xff0c;这篇主要是针对于第5章代码的实现。部分代码有更改&#xff0c;会在下面说明&#xff0c;程序运行结果跟书中不完全一样&#xff0c;因为部分参数&#xff0c;书中并没有给出其在运行时设置的值&#xff0c;所以我根据我自己的调试进行了设…

迁移学习在乳腺浸润性导管癌病理图像分类中的应用

1. 引言 乳腺癌主要有两种类型:原位癌:原位癌是非常早期的癌症&#xff0c;开始在乳管中扩散&#xff0c;但没有扩散到乳房组织的其他部分。这也称为导管原位癌(DCIS)。浸润性乳腺癌:浸润性乳腺癌已经扩散(侵入)到周围的乳腺组织。侵袭性癌症比原位癌更难治愈。将乳汁输送到乳…

C++中的new和模版

前言 随着C的学习&#xff0c;讲了C的发展过程、流插入、流提取、函数缺省值、类与构造等等。接下来学习C很方便的 玩意&#xff0c;函数模版。函数模版就像是模具一样&#xff0c;C会自动用模版编译出合适的函数供程序员使用。以前不同类型相同操作的函数都能通过函数模版&…

【iOS】——内存对齐

内存对齐是什么 内存对齐指的是数据在内存中的布局方式&#xff0c;它确保每个数据类型的起始地址能够满足该类型对齐的要求。这是因为现代处理器在访问内存时&#xff0c;如果数据的起始地址能够对齐到一定的边界&#xff0c;那么访问速度会更快。这种对齐通常是基于数据类型…

客户中心应急管理的作用和特征

近些年作为事故、灾难等风险的预防主体和第一响应者&#xff0c;客户中心的应急管理取得了较大进展&#xff0c;但总体上仍存在很多薄弱环节&#xff0c;如安全事故频发&#xff0c;自然灾害、公共卫生、社会安全事件等给运营机构带来了多方面的不利影响。从信息角度看&#xf…

20240720 每日AI必读资讯

OpenAI 推出GPT-4o mini取代 GPT 3.5&#xff01; - 性能超越 GPT 4&#xff0c;而且更快更便宜 - 该模型在MMLU上得分为82%&#xff0c;在LMSYS排行榜上的聊天偏好测试中表现优于GPT-4。 - GPT-4o mini的定价为每百万输入标记15美分和每百万输出标记60美分&#xff0c;比之…

【golang-ent】go-zero框架 整合 ent orm框架 | 解决left join未关联报错的问题

一、场景 1、子表&#xff1a;cp_member_point_history cp_member_point_history表中字段&#xff1a;cp_point_reward_id 是cp_point_reward的主键id 当本表中的cp_point_reward_id字段为0&#xff08;即&#xff1a;没有可关联主表的&#xff09; CREATE TABLE cp_member_poi…

项目开发之文件上传 (秒传、断点续传、分片上传)(看这一篇就懂了)

目录&#xff1a; 前言秒传什么是秒传核心逻辑代码实现 小文件上传什么是小文件上传核心逻辑代码实现 分片上传什么是分片上传核心逻辑代码实现 断点续传什么是断点续传核心代码实现 前言 文件上传在项目开发中再常见不过了&#xff0c;大多项目都会涉及到图片、音频、视频、文…

npm安装依赖包报错,npm ERR! code ENOTFOUND

一、报错现象&#xff1a; npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning ETIMEDOUT: request to https://registry.npmjs.org/vue failed, reason: connect ETIMEDOUT 104.16.23.35:443 npm WARN registry Using stale data…

Python | Leetcode Python题解之第235题二叉搜索树的最近公共祖先

题目&#xff1a; 题解&#xff1a; class Solution:def lowestCommonAncestor(self, root: TreeNode, p: TreeNode, q: TreeNode) -> TreeNode:ancestor rootwhile True:if p.val < ancestor.val and q.val < ancestor.val:ancestor ancestor.leftelif p.val >…

【力扣】最小栈

&#x1f525;博客主页&#xff1a; 我要成为C领域大神&#x1f3a5;系列专栏&#xff1a;【C核心编程】 【计算机网络】 【Linux编程】 【操作系统】 ❤️感谢大家点赞&#x1f44d;收藏⭐评论✍️ 本博客致力于知识分享&#xff0c;与更多的人进行学习交流 设计一个支持 push…

object-C 解答算法:合并两个有序数组(leetCode-88)

合并两个有序数组(leetCode-88) 题目如下图:(也可以到leetCode上看完整题目,题号88) 首先搞懂,什么叫“非递减顺序” 非递减顺序,是指一个序列中的元素从前往后&#xff08;或从左到右&#xff09;保持不减少或相等。 这意味着序列中的元素可以保持相同的值&#xff0c;但不会…

c++ pc输入法例子

1、微软开源demo Windows-classic-samples/Samples/IME at master jiangdon2007/Windows-classic-samples (github.com) 2、打开SampleIME.sln 编译【32位或者64位】 3、将SampleIME.dll 和SampleIMESimplifiedQuanPin.txt 放在同一个目录 4、注册 regsvr32 SampleIME.dl…

spring 5.3.x 、6.1.x、6.0.x 源码本地编译运行

参考大佬文章&#xff0c;完美完成本地idea spring源码编译和demo测试 参考链接&#xff08;spring5.3.x&#xff09; spring5.3.x源码阅读环境搭建 下面是spring6.0.x参考 spring6.0.x jdk调成17 idea 2022.2.4版本本地编译spring源码项目 spring6.0.x 分支 gradle-8…

小程序-4(自定义组件:数据、属性、数据监听器、生命周期函数、插槽、父子通信、behaviors)

目录 1.组件的创建和引用 局部引用组件 全局引用组件 组件和页面的区别 组件样式隔离 ​编辑 组件样式隔离的注意点 修改组件的样式隔离选项 data数据 methods方法 properties属性 data和properties属性的区别 使用setData修改properties的值 2.数据监听器 什么…