c# 动态lambda实现二级过滤(多种参数类型)

效果

调用方法

实体类(可以根据需求更换)

public class ToolStr50
{public bool isSelected { get; set; }public string toolStr1 { get; set; }public string toolStr2 { get; set; }public string toolStr3 { get; set; }public string toolStr4 { get; set; }public string toolStr5 { get; set; }public string toolStr6 { get; set; }public string toolStr7 { get; set; }public string toolStr8 { get; set; }public string toolStr9 { get; set; }public string toolStr10 { get; set; }public int toolInt1 { get; set; }public int toolInt2 { get; set; }public int toolInt3 { get; set; }public int toolInt4 { get; set; }public int toolInt5 { get; set; }public int toolInt6 { get; set; }public int toolInt7 { get; set; }public int toolInt8 { get; set; }public int toolInt9 { get; set; }public int toolInt10 { get; set; }public double toolDouble1 { get; set; }public double toolDouble2 { get; set; }public double toolDouble3 { get; set; }public double toolDouble4 { get; set; }public double toolDouble5 { get; set; }public double toolDouble6 { get; set; }public double toolDouble7 { get; set; }public double toolDouble8 { get; set; }public double toolDouble9 { get; set; }public double toolDouble10 { get; set; }public DateTime toolDate1 { get; set; }public DateTime toolDate2 { get; set; }public DateTime toolDate3 { get; set; }public DateTime toolDate4 { get; set; }public DateTime toolDate5 { get; set; }public DateTime toolDate6 { get; set; }public DateTime toolDate7 { get; set; }public DateTime toolDate8 { get; set; }public DateTime toolDate9 { get; set; }public DateTime toolDate10 { get; set; }
}

传入需要二级过滤的数据

 public void ShowSecondaryFiltration(){var columnMappings = new Dictionary<string, string>{{ "采购日期", "toolStr26" },{ "采购周期", "toolInt10" },{ "采购回复交期", "toolStr31" },{ "采购说明", "toolStr53" },{ "生产订单号", "toolStr1" },{ "来源单号", "toolStr2" },{ "采购订单号", "toolStr3" },{ "行号", "toolInt1" },{ "料号", "toolStr4" },{ "品名", "toolStr5" },{ "规格描述", "toolStr6" },{ "现存量", "toolInt2" },{ "单位", "toolStr11" },{ "采购数量(计量)", "toolInt3" },{ "收货数量(计量)", "toolInt4" },{ "已退货数(计量)", "toolInt5" },{ "实际入库数(计量)", "toolInt6" },{ "入库单号", "toolStr16" },{ "已暂收数量(计量)", "toolInt7" },{ "最后交货日期", "toolStr18" },{ "逾期天数(负数未到期)", "toolInt8" },{ "品质异常报告日期", "toolStr19" },{ "品质问题描述", "toolStr20" },{ "处理结论", "toolStr21" },{ "未交数量(计量)", "toolInt9" },{ "交货结案日期", "toolStr23" },{ "请购日期", "toolStr24" },{ "PMC交单日期", "toolStr25" },{ "理论交期", "toolStr28" },{ "要求交期", "toolStr29" },{ "订单回传日期", "toolStr30" },{ "色板_模板_图纸提供情况", "toolStr32" },{ "异常反馈", "toolStr33" },{ "预付款比例", "toolInt11" },{ "预付款支付日期", "toolStr35" },{ "尾款比例", "toolInt12" },{ "尾款支付日期", "toolStr39" },{ "采购员", "toolStr44" },{ "请购制单人", "toolStr40" },{ "供应商名称", "toolStr46" },{ "请购单备注", "toolStr42" },{ "采购单备注", "toolStr45" },{ "可用量", "toolStr8" },{ "含税单价", "toolDouble1" },{ "含税金额", "toolDouble2" },{ "采购到货日期", "toolStr37" },{ "财务交单日期", "toolStr38" },{ "请购人", "toolStr41" },{ "采购制单人", "toolStr43" },{ "采购订单结案状态", "toolStr48" },{ "修改日期_请购", "toolStr50" },{ "修改日期_采购", "toolStr51" },{ "PMC要求交货日期", "toolStr52" }};var traceWindow = new TraceTableSecondaryFiltration(columnMappings, OdlIbo);traceWindow.QueryConditions = _queryConditions;if (traceWindow.ShowDialog() == true) // 检查对话框的结果{var filteredIbo = traceWindow.FilteredData;_queryConditions = traceWindow.QueryConditions;Ibo = filteredIbo;// 使用 filteredIbo 进行后续处理}if (_queryConditions.Count == 0){SelectInfo();}//更新总条数和总金额InfoCount = "数据汇总:" + Ibo.Count.ToString() + "条";decimal total = Ibo.Sum(x => Convert.ToDecimal(x.toolStr10)); // 假设 TaxInclusiveSum 是 double 类型  total = decimal.Round(total, 4);//TaxinclusiveSum = "合计含税金额:" + total.ToString();}

窗体页面TraceTableSecondaryFiltration.xaml

<Window x:Class="GMWPF.Views.ModuleMenu.Purchase.PurchaseModle1.ChildWindow.TraceTableSecondaryFiltration"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:local="clr-namespace:GMWPF.Views.ModuleMenu.Purchase.PurchaseModle1.ChildWindow"mc:Ignorable="d"Title="TraceTableSecondaryFiltration" Height="450" Width="800"WindowStartupLocation="CenterScreen"><Grid Margin="10" Name="myDynamicGrid"><Grid.RowDefinitions><RowDefinition Height="Auto"/><RowDefinition Height="Auto"/><RowDefinition Height="Auto"/><RowDefinition Height="Auto"/><RowDefinition Height="Auto"/><RowDefinition Height="*"/><!-- 让表格占用剩余空间 --></Grid.RowDefinitions><TextBlock Text="字段名称" Margin="49,34,655,0" VerticalAlignment="Top" Grid.Row="0"/><ComboBox Name="FieldNameComboBox" Margin="25,5,640,0" VerticalAlignment="Top" ItemsSource="{Binding FieldNames}" SelectedItem="{Binding SelectedFieldName, Mode=TwoWay}" SelectionChanged="FieldNameComboBox_SelectionChanged"Grid.Row="1"/><TextBlock Text="条件" Margin="227,34,495,0" VerticalAlignment="Top" Grid.Row="0"/><ComboBox Name="ConditionComboBox" Margin="184,5,471,0" VerticalAlignment="Top" ItemsSource="{Binding Conditions}" SelectedItem="{Binding SelectedCondition}" Grid.Row="1"/><TextBlock Text="条件值" Margin="402,34,320,0" VerticalAlignment="Top" Grid.Row="0"/><ComboBox Name="ValueComboBox" Margin="357,5,275,0" VerticalAlignment="Top" ItemsSource="{Binding ConditionValues}" SelectedItem="{Binding SelectedConditionValue}" Grid.Row="1"/><TextBlock Text="关系" Margin="564,34,168,0" VerticalAlignment="Top" Grid.Row="0"/><ComboBox Name="RelationComboBox" Margin="532,5,154,0" VerticalAlignment="Top" ItemsSource="{Binding RelationValues}" SelectedItem="{Binding SelectedRelationValue}" Grid.Row="1"/><Button Content="添加" Command="{Binding AddQueryConditionCommand}" Margin="637,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Height="27" Grid.Row="1"/><Button Content="查询" Command="{Binding QueryCommand}" Margin="697,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Height="27" Grid.Row="1"/><DataGrid Name="ConditionDataGrid" Grid.Row="2" Margin="10,10,10,0" BorderThickness="1"Height="300"AutoGenerateColumns="False" ItemsSource="{Binding QueryConditions}"><DataGrid.Columns><DataGridTextColumn Width="200" Header="字段名称" Binding="{Binding FieldName}"><DataGridTextColumn.ElementStyle><Style TargetType="TextBlock"><Setter Property="HorizontalAlignment" Value="Center"/><Setter Property="VerticalAlignment" Value="Center"/></Style></DataGridTextColumn.ElementStyle><DataGridTextColumn.HeaderStyle><Style TargetType="DataGridColumnHeader"><Setter Property="HorizontalContentAlignment" Value="Center"/></Style></DataGridTextColumn.HeaderStyle></DataGridTextColumn><DataGridTextColumn Width="100" Header="条件" Binding="{Binding Condition}"><DataGridTextColumn.ElementStyle><Style TargetType="TextBlock"><Setter Property="HorizontalAlignment" Value="Center"/><Setter Property="VerticalAlignment" Value="Center"/></Style></DataGridTextColumn.ElementStyle><DataGridTextColumn.HeaderStyle><Style TargetType="DataGridColumnHeader"><Setter Property="HorizontalContentAlignment" Value="Center"/></Style></DataGridTextColumn.HeaderStyle></DataGridTextColumn><DataGridTextColumn Width="200" Header="条件值" Binding="{Binding ConditionValue}"><DataGridTextColumn.ElementStyle><Style TargetType="TextBlock"><Setter Property="HorizontalAlignment" Value="Center"/><Setter Property="VerticalAlignment" Value="Center"/></Style></DataGridTextColumn.ElementStyle><DataGridTextColumn.HeaderStyle><Style TargetType="DataGridColumnHeader"><Setter Property="HorizontalContentAlignment" Value="Center"/></Style></DataGridTextColumn.HeaderStyle></DataGridTextColumn><DataGridTextColumn Width="100" Header="关系" Binding="{Binding RelationValue}"><DataGridTextColumn.ElementStyle><Style TargetType="TextBlock"><Setter Property="HorizontalAlignment" Value="Center"/><Setter Property="VerticalAlignment" Value="Center"/></Style></DataGridTextColumn.ElementStyle><DataGridTextColumn.HeaderStyle><Style TargetType="DataGridColumnHeader"><Setter Property="HorizontalContentAlignment" Value="Center"/></Style></DataGridTextColumn.HeaderStyle></DataGridTextColumn><DataGridTemplateColumn Width="200" Header="操作"><DataGridTemplateColumn.CellTemplate><DataTemplate><Button Content="删除" Width="80" Command="{Binding DataContext.DeleteConditionCommand, RelativeSource={RelativeSource AncestorType={x:Type Window}}}"CommandParameter="{Binding}"/></DataTemplate></DataGridTemplateColumn.CellTemplate><DataGridTemplateColumn.HeaderStyle><Style TargetType="DataGridColumnHeader"><Setter Property="HorizontalContentAlignment" Value="Center"/></Style></DataGridTemplateColumn.HeaderStyle></DataGridTemplateColumn></DataGrid.Columns></DataGrid></Grid>
</Window>

窗体实现类TraceTableSecondaryFiltration.xaml.cs

这里在进行数据对比时对数据进行了类型转换,因为string类型的对比会出现

“4”>“20”的情况

using CommunityToolkit.Mvvm.Input;
using SQLSugarDB.Model.Public;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using Expression = System.Linq.Expressions.Expression;
namespace GMWPF.Views.ModuleMenu.Purchase.PurchaseModle1.ChildWindow
{public partial class TraceTableSecondaryFiltration : Window{public List<ToolStr50> FilteredData { get; private set; }private Dictionary<string, string> _columnMappings;//所有的列和对应Toolstr属性的映射关系private List<ToolStr50> _Ibo;//所有的数据private List<string> _fieldNames = new List<string>(); // 字段名public List<string> FieldNames{get { return _fieldNames; }set{_fieldNames = value;}}private string _selectedFieldName;public string SelectedFieldName{get { return _selectedFieldName; }set{_selectedFieldName = value;}}private ObservableCollection<string> _conditions = new ObservableCollection<string>(); // 条件public ObservableCollection<string> Conditions{get { return _conditions; }set{_conditions = value;}}private string _selectedCondition;public string SelectedCondition{get { return _selectedCondition; }set{_selectedCondition = value;}}private ObservableCollection<string> _conditionValues = new ObservableCollection<string>(); // 条件值public ObservableCollection<string> ConditionValues{get { return _conditionValues; }set{_conditions = value;}}private string _selectedConditionValue;public string SelectedConditionValue{get { return _selectedConditionValue; }set{_selectedConditionValue = value;}}private ObservableCollection<string> _relationValues = new ObservableCollection<string>(); // 关系public ObservableCollection<string> RelationValues{get { return _relationValues; }set{_relationValues = value;}}private string _selectedRelationValue;public string SelectedRelationValue{get { return _selectedRelationValue; }set{_selectedRelationValue = value;}}private ObservableCollection<SecondQueryCondition> _queryConditions = new ObservableCollection<SecondQueryCondition>();public ObservableCollection<SecondQueryCondition> QueryConditions{get => _queryConditions;set{_queryConditions = value;}}public TraceTableSecondaryFiltration(Dictionary<string, string> columnMappings, List<ToolStr50> Ibo){_columnMappings = columnMappings;_Ibo = Ibo;InitializeComponent();DataContext = this; // 设置数据上下文为当前窗口//将columnMappings所有的key拿出来放进List<string> _fieldNames中_fieldNames = new List<string>(_columnMappings.Keys);Conditions.Add("大于");Conditions.Add("大于等于");Conditions.Add("小于");Conditions.Add("小于等于");Conditions.Add("等于");Conditions.Add("不等于");RelationValues.Add("并且");RelationValues.Add("或者");//设定个默认值SelectedRelationValue = "并且";}[RelayCommand]public void AddQueryCondition(){// 检查是否有空值或空字符串if (string.IsNullOrEmpty(_selectedFieldName) ||string.IsNullOrEmpty(_selectedCondition) ||string.IsNullOrEmpty(_selectedConditionValue) ||string.IsNullOrEmpty(_selectedRelationValue)){return; // 如果有空值,直接返回}// 创建并添加 SecondQueryCondition 对象到 QueryConditions 列表QueryConditions.Add(new SecondQueryCondition(QueryConditions.Count + 1, _selectedFieldName, _selectedCondition, _selectedConditionValue, _selectedRelationValue));}private void FieldNameComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e){ConditionValues.Clear();_columnMappings.TryGetValue(_selectedFieldName, out string property);if (_Ibo == null){return;}foreach (var item in _Ibo){string propertyValue = item.GetType().GetProperty(property)?.GetValue(item)?.ToString();if (!string.IsNullOrEmpty(propertyValue) && !ConditionValues.Contains(propertyValue)){ConditionValues.Add(propertyValue);}}}[RelayCommand]public void DeleteCondition(SecondQueryCondition secondQueryCondition){QueryConditions.Remove(secondQueryCondition);}[RelayCommand]public void Query(){var parameter = Expression.Parameter(typeof(ToolStr50), "p");Expression finalExpression = null;foreach (var queryCondition in QueryConditions){if (_columnMappings.TryGetValue(queryCondition.FieldName, out string property)){var member = Expression.Property(parameter, property);var conditionValue = Expression.Constant(queryCondition.ConditionValue, typeof(string));Expression comparison;// 尝试解析为 int, double, DateTimeif (int.TryParse(queryCondition.ConditionValue, out int intValue)){var intMember = Expression.Convert(member, typeof(int));var intConditionValue = Expression.Constant(intValue, typeof(int));comparison = GetIntegerComparison(queryCondition.Condition, intMember, intConditionValue);}else if (double.TryParse(queryCondition.ConditionValue, out double doubleValue)){var doubleMember = Expression.Convert(member, typeof(double));var doubleConditionValue = Expression.Constant(doubleValue, typeof(double));comparison = GetDoubleComparison(queryCondition.Condition, doubleMember, doubleConditionValue);}//如果日期类型无法对比直接注释掉,按照string类型对比//else if (DateTime.TryParse(queryCondition.ConditionValue, out DateTime dateTimeValue))//{//    var dateTimeMember = Expression.Convert(member, typeof(DateTime));//    var dateTimeConditionValue = Expression.Constant(dateTimeValue, typeof(DateTime));//    comparison = GetDateTimeComparison(queryCondition.Condition, dateTimeMember, dateTimeConditionValue);//}else{// 如果无法转换,继续使用字符串比较comparison = GetStringComparison(queryCondition.Condition, member, conditionValue);}// 组合条件if (finalExpression == null){finalExpression = comparison;}else{if (queryCondition.RelationValue.Equals("并且")){finalExpression = Expression.AndAlso(finalExpression, comparison); // 使用 AndAlso 组合条件}if (queryCondition.RelationValue.Equals("或者")){finalExpression = Expression.Or(finalExpression, comparison); // 使用 Or 组合条件}}}}// 生成最终的 Lambda 表达式if (finalExpression != null){var lambda = Expression.Lambda<Func<ToolStr50, bool>>(finalExpression, parameter);FilteredData = _Ibo.Where(lambda.Compile()).ToList();this.DialogResult = true; // 可选: 设置窗口的结果this.Close(); // 关闭窗口}else //没有查询条件查全部{FilteredData = _Ibo;this.DialogResult = true; // 可选: 设置窗口的结果this.Close(); // 关闭窗口}}private Expression GetIntegerComparison(string condition, Expression member, Expression conditionValue){return condition switch{"大于" => Expression.GreaterThan(member, conditionValue),"大于等于" => Expression.GreaterThanOrEqual(member, conditionValue),"小于" => Expression.LessThan(member, conditionValue),"小于等于" => Expression.LessThanOrEqual(member, conditionValue),"等于" => Expression.Equal(member, conditionValue),"不等于" => Expression.NotEqual(member, conditionValue),_ => throw new NotSupportedException($"不支持的条件: {condition}")};}private Expression GetDoubleComparison(string condition, Expression member, Expression conditionValue){return condition switch{"大于" => Expression.GreaterThan(member, conditionValue),"大于等于" => Expression.GreaterThanOrEqual(member, conditionValue),"小于" => Expression.LessThan(member, conditionValue),"小于等于" => Expression.LessThanOrEqual(member, conditionValue),"等于" => Expression.Equal(member, conditionValue),"不等于" => Expression.NotEqual(member, conditionValue),_ => throw new NotSupportedException($"不支持的条件: {condition}")};}private Expression GetDateTimeComparison(string condition, Expression member, Expression conditionValue){return condition switch{"大于" => Expression.GreaterThan(member, conditionValue),"大于等于" => Expression.GreaterThanOrEqual(member, conditionValue),"小于" => Expression.LessThan(member, conditionValue),"小于等于" => Expression.LessThanOrEqual(member, conditionValue),"等于" => Expression.Equal(member, conditionValue),"不等于" => Expression.NotEqual(member, conditionValue),_ => throw new NotSupportedException($"不支持的条件: {condition}")};}private Expression GetStringComparison(string condition, Expression member, Expression conditionValue){// 比较两个字符串时,我们需要使用 string.Compare 方法var compareMethod = typeof(string).GetMethod("Compare", new[] { typeof(string), typeof(string) });return condition switch{// 等于"等于" => Expression.Equal(member, conditionValue),// 不等于"不等于" => Expression.NotEqual(member, conditionValue),// 大于"大于" => Expression.GreaterThan(Expression.Call(null, compareMethod, member, conditionValue),Expression.Constant(0)),// 小于"小于" => Expression.LessThan(Expression.Call(null, compareMethod, member, conditionValue),Expression.Constant(0)),// 大于等于"大于等于" => Expression.GreaterThanOrEqual(Expression.Call(null, compareMethod, member, conditionValue),Expression.Constant(0)),// 小于等于"小于等于" => Expression.LessThanOrEqual(Expression.Call(null, compareMethod, member, conditionValue),Expression.Constant(0)),_ => throw new NotSupportedException($"不支持的条件: {condition}")};}}
}

动态生成的lambda表达式:

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

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

相关文章

5万加购上线即断货,双11洗衣机品类打破增长难关

距离2024年双11结束仅剩最后几天。据网经社报告&#xff0c;目前各电商平台累计销售额已超8000亿元。 其中&#xff0c;家电品类已超1000亿元的销额位居前列&#xff0c;市场占有率达15.7%。天猫平台数据显示&#xff0c;预售日开售后1小时&#xff0c;大家电整体成交同比增长7…

[全网最细数据结构完整版]第六篇:3分钟带你吃透栈并模拟实现

目录 1->栈的概念和结构 1.1栈的概念 1.2栈的结构 2->栈的实现 2.1定义关于栈的结构体和各种函数 2.2栈的初始化 STInit 函数 2.3栈的销毁 STDestroy 函数 2.4栈的插入操作 STPush 函数 2.5栈的判断是否为空操作 STEmpty 函数 2.6栈的删除操作 STPop 函数 2.7…

Xfce桌面设置右键菜单:用右键打开VSCode

前言 AlmaLinux安装VSCode之后始终没有找到如何用右键菜单打开VSCode&#xff0c;比Windows麻烦多了。每次都需要先找到文件夹&#xff0c;然后用系统自带的Open In Terminal打开终端&#xff0c;再输入code .&#xff0c;才能够在当前文件夹中快速打开VSCode。那么&#xff0…

使用docker形式部署jumpserver

文章目录 前言一、背景二、使用步骤1.基础环境准备2.拉取镜像3.进行部署4.备份记录启动命令 前言 记录一下使用docker形式部署jumpserver服务的 一、背景 搭建一个jumpserver的堡垒机&#xff0c;但是发现之前是二进制文件部署的&#xff0c;会在物理机上部署污染环境&#x…

我谈正态分布——正态偏态

目录 pdf和cdf参数 标准正态分布期望和方差分布形态 3 σ 3\sigma 3σ原则 正态和偏态正态偏态瑞利分布偏度 (Skewness)峰度 (Kurtosis) 比较 正态分布的英文是Normal Distribution&#xff0c;normal是“正常”或“标准”的意思&#xff0c;中文翻译是正态&#xff0c;多完美的…

【嵌入式】STM32中的SPI通信

SPI是由摩托罗拉公司开发的一种通用数据总线&#xff0c;其中由四根通信线&#xff0c;支持总线挂载多设备&#xff08;一主多从&#xff09;&#xff0c;是一种同步全双工的协议。主要是实现主控芯片和外挂芯片之间的交流。这样可以使得STM32可以访问并控制各种外部芯片。本文…

大A终究是逃不过高开低走的魔咒

大A终究是逃不过高开低走的魔咒&#xff0c;早盘高开太多&#xff0c;周末休市&#xff0c;今天会议结束&#xff0c;各种不确定因素增加等原因导致午盘普跌。其实还是那句话&#xff0c;股市嘛&#xff0c;涨多了会跌&#xff0c;跌多了会涨&#xff0c;别急也别慌。 周末&…

知识付费小程序搭建,线上网课平台开发

我是【码云数智】平台的黄导&#xff0c;今天分享&#xff1a;知识付费小程序搭建&#xff0c;线上网课平台开发 在线网校小程序开发&#xff0c;在线教育小程序还不断优化界面设计&#xff0c;确保操作简便直观&#xff0c;无论是老人还是小孩都能轻松上手。​​ 01、小程序…

Python | Leetcode Python题解之第543题二叉树的直径

题目&#xff1a; 题解&#xff1a; class Solution:def diameterOfBinaryTree(self, root: TreeNode) -> int:self.ans 1def depth(node):# 访问到空节点了&#xff0c;返回0if not node:return 0# 左儿子为根的子树的深度L depth(node.left)# 右儿子为根的子树的深度R …

无代码开发平台smardaten R5C50 新版本更新!都做了哪些改变?

数睿数据为此次新版本做了7项体验优化、8项功能增补、1项性能优化&#xff0c;总计16个功能点。快来看看&#xff0c;哪个功能戳中你的心~ 一、体验优化 围绕smardaten搭建第一个原型并完成发布主链路&#xff0c;进行了体验优化&#xff0c;解决新手门槛高、模板使用路径长、…

175页PPTBCG某企业健康智能制造与供应链战略规划建议书

智能制造与供应链战略规划方法论是一个系统性、科学性的框架&#xff0c;旨在指导企业实现智能制造转型和供应链优化。以下是对这一方法论的核心内容的归纳和阐述&#xff1a; 一、智能制造的目标与原则 明确智能制造目标&#xff1a; 提高生产效率&#xff1a;通过引入自动…

DICOM标准:深入详解DICOM医学影像中的传输语法

引言 DICOM&#xff08;数字成像和通信医学&#xff09;标准在医学影像数据交换中扮演着至关重要的角色。其中&#xff0c;*传输语法&#xff08;Transfer Syntax&#xff09;是DICOM标准中定义数据编码和传输方式的核心部分。理解传输语法对于确保不同设备和系统之间的互操作性…

爱普生SG-8201CG可编程晶振智能门锁的核心驱动

在智能家居蓬勃发展的时代浪潮中&#xff0c;智能门锁作为智能家居的第一道防线&#xff0c;其安全性与便捷性至关重要。爱普生 SG - 8201CG 可编程晶振犹如一颗隐藏在幕后却发挥着关键作用的智慧芯片&#xff0c;为智能家居系统的高效、稳定运行提供了不可或缺的精准时钟信号。…

LLM大模型微调(lora原理)

一、微调方法介绍 1.1 Lora原理 通过低秩矩阵来降低模型训练的参数量&#xff0c;有点‘给我一个支点&#xff0c;就可以撬动地球’的感觉&#xff0c;其中矩阵的秩&#xff08;rank&#xff09;就有点像这个‘支点’的意思&#xff0c;大致原理如下&#xff1a; LoRA 的核心…

协议(OSI-tcp-udp)

目录 OSI七层协议模型 TCP/IP协议 3次握手 4次挥手 TCP VS UDP TCP和UDP分别对应的常见应用层协议 Tcp 状态机 TCP/ UDP /socket /http /webSocket 区别 RPC 和 RMI RPC与RMI的区别 Web Service SOAP&#xff08;Simple Object Access Protocol&#xff1a;简单对…

源代码防泄密管理分享

随着信息技术的快速发展&#xff0c;软件已成为现代企业不可或缺的核心资产之一。然而&#xff0c;源代码作为软件的心脏&#xff0c;其安全性直接关系到企业的核心竞争力。为了有效防止源代码泄露&#xff0c;构建一套全面且高效的源代码安全管理体系显得尤为重要。以下是六个…

2024/11/3 随笔笔记

[NOIP2001 提高组] Car 的旅行路线 题目描述 又到暑假了&#xff0c;住在城市 A 的 Car 想和朋友一起去城市旅游。 她知道每个城市都有 4 4 4 个飞机场&#xff0c;分别位于一个矩形的 4 4 4 个顶点上&#xff0c;同一个城市中两个机场之间有一条笔直的高速铁路&#xff0c…

【学习AI-相关路程-mnist手写数字分类-win-硬件:windows-自我学习AI-实验步骤-全连接神经网络(BPnetwork)-操作流程(3) 】

【学习AI-相关路程-mnist手写数字分类-win-硬件&#xff1a;windows-自我学习AI-实验步骤-全连接神经网络&#xff08;BPnetwork&#xff09;-操作流程&#xff08;3&#xff09; 】 1、前言2、前置学习&#xff08;1&#xff09;window和Linux中python寻找目录的方式。&#x…

Shortcut Learning in In-Context Learning: A Survey

为我们的综述打一打广告&#xff0c;目前是初级版本&#xff0c;欢迎各位批评指正&#xff01;后续的论文列表、测评基准会在Github更新[/(ㄒoㄒ)/~~最近比较忙容许我拖一拖] 这里是arxiv链接&#xff1a;Linking!!! Abstract&#xff1a;捷径学习是指模型在实际任务中使用简单…

ZDS 数字股票 布局全球视野,开启智能金融新篇章

在全球金融市场蓬勃发展的背景下&#xff0c;Zeal Digital Shares&#xff08;ZDS&#xff09;正迈向一个全新的发展阶段。通过采用先进技术与深度融合人工智能&#xff08;AI&#xff09;&#xff0c;ZDS 吸引了各类顶尖人才&#xff0c;不仅推动了创新金融服务的建设&#xf…