WPF实战项目十八(客户端):添加新增、查询、编辑功能

1、ToDoView.xmal添加引用,添加微软的行为类

 xmlns:i="http://schemas.microsoft.com/xaml/behaviors"

2、给项目添加行为

<i:Interaction.Triggers><i:EventTrigger EventName="MouseLeftButtonUp"><i:InvokeCommandAction Command="{Binding DataContext.SelectedCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}" CommandParameter="{Binding}" /></i:EventTrigger></i:Interaction.Triggers>

3、ToDoViewModel.cs新建查询SelectedCommand

public DelegateCommand<ToDoDto> SelectedCommand { get;private set; }public ToDoViewModel(IToDoService toDoService, IContainerProvider provider) : base(provider){ToDoDtos = new ObservableCollection<ToDoDto>();AddCommand = new DelegateCommand(Add);SelectedCommand = new DelegateCommand<ToDoDto>(Selected);this.toDoService = toDoService;}
private async void Selected(ToDoDto obj){try{UpdateLoading(true);var todoResult = await toDoService.GetFirstOfDefaultAsync(obj.Id);if (todoResult.Status){IsIsRightDrawerOpens = true;CurrentDto = todoResult.Result;}}catch (Exception){throw;}finally{UpdateLoading(false);}}

4、新建属性编辑选中/新增时的对象

private ToDoDto currentDto;/// <summary>/// 编辑选中/新增时的对象/// </summary>public ToDoDto CurrentDto{get { return currentDto; }set { currentDto = value; RaisePropertyChanged(); }}

5、前台绑定文本标题、内容、状态

                    <StackPanelMargin="20"DockPanel.Dock="Top"Orientation="Horizontal"><TextBlock VerticalAlignment="Center" Text="状态:" /><ComboBox SelectedIndex="{Binding CurrentDto.Status}"><ComboBoxItem>待办</ComboBoxItem><ComboBoxItem>已完成</ComboBoxItem></ComboBox></StackPanel><TextBoxMargin="20,5"md:HintAssist.Hint="请输入待办概要"DockPanel.Dock="Top"Text="{Binding CurrentDto.Title}" /><TextBoxMinHeight="100"Margin="20,10"md:HintAssist.Hint="请输入待办事项内容"DockPanel.Dock="Top"Text="{Binding CurrentDto.Content}" />

6、F5运行项目,点击待办事项能在右侧显示信息

7、绑定搜索输入框,首先定义一个属性,前台绑定输入框的值Search,给输入框添加回车事件

        private string search;/// <summary>/// 搜索条件/// </summary>public string Search{get { return search; }set { search = value; RaisePropertyChanged(); }}
<TextBoxWidth="250"md:HintAssist.Hint="查找待办事项..."md:TextFieldAssist.HasClearButton="True"Text="{Binding Search, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"><TextBox.InputBindings><KeyBinding Key="Enter" Command="{Binding SearchCommand}" /></TextBox.InputBindings></TextBox>

8、SearchCommand搜索事件可以和上面AddCommand合并到一起,【添加待办】按钮设置事件:ExecuteCommand,参数设置="新增",查找框设置成ExecuteCommand,参数设置="查询"

public DelegateCommand<string> ExecuteCommand { get; private set; }public ToDoViewModel(IToDoService toDoService, IContainerProvider provider) : base(provider){ToDoDtos = new ObservableCollection<ToDoDto>();ExecuteCommand = new DelegateCommand<string>(Execute);SelectedCommand = new DelegateCommand<ToDoDto>(Selected);this.toDoService = toDoService;}
                <ButtonMargin="10,0"HorizontalAlignment="Right"Command="{Binding ExecuteCommand}"CommandParameter="新增"Content="+ 添加待办" />
<TextBoxWidth="250"md:HintAssist.Hint="查找待办事项..."md:TextFieldAssist.HasClearButton="True"Text="{Binding Search, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"><TextBox.InputBindings><KeyBindingKey="Enter"Command="{Binding ExecuteCommand}"CommandParameter="查询" /></TextBox.InputBindings></TextBox>

9、获取数据的函数里面把Search属性传进去

/// <summary>/// 获取数据/// </summary>private async void GetDataAsync(){UpdateLoading(true);var todoResult = await toDoService.GetAllPageListAsync(new WPFProjectShared.Parameters.QueryParameter{PageIndex = 0,PageSize = 100,Search = Search});if (todoResult.Status){toDoDtos.Clear();foreach (var item in todoResult.Result.Items){toDoDtos.Add(item);}}UpdateLoading(false);}

10、新增Excute方法和Query方法

private void Execute(string obj){switch (obj){case "新增":Add();break;case "查询":Query();break;}}private void Query(){GetDataAsync();}

11、F5运行项目,在搜索框里面查询显示12、【保存】事件,按钮添加绑定事件,修改Excute方法、新增Add方法和Save方法

                    <ButtonMargin="20,0"Command="{Binding ExecuteCommand}"CommandParameter="保存"Content="添加到待办"DockPanel.Dock="Top" />
        private void Execute(string obj){switch (obj){case "新增":Add();break;case "查询":Query();break;case "保存":Save();break;}}/// <summary>/// 添加待办/// </summary>/// <exception cref="NotImplementedException"></exception>private void Add(){CurrentDto = new ToDoDto();IsIsRightDrawerOpens = true;}
private async void Save(){if (string.IsNullOrWhiteSpace(CurrentDto.Title) || string.IsNullOrWhiteSpace(CurrentDto.Content)){return;}else{UpdateLoading(true);try{if (CurrentDto.Id > 0)//update{var updateResult = await toDoService.UpdateAsync(CurrentDto);if (updateResult.Status){var todo = ToDoDtos.FirstOrDefault(t => t.Id == CurrentDto.Id);if (todo != null){todo.Title = CurrentDto.Title;todo.Content = CurrentDto.Content;todo.Status = CurrentDto.Status;}}IsIsRightDrawerOpens = false;}else//add{var addResult = await toDoService.AddAsync(CurrentDto);if (addResult.Status){ToDoDtos.Add(addResult.Result);IsIsRightDrawerOpens = false;}}}catch (Exception){throw;}finally { UpdateLoading(false); }}}

修改API中TodoController的代码

        [HttpPost]public async Task<ApiResponse> Update(TodoDto toDo){return await toDoService.UpdateEntityAsync(toDo);}

13、F5运行项目,测试修改待办

保存的时候报错:

{"type":"https://tools.ietf.org/html/rfc7231#section-6.5.1","title":"One or more validation errors occurred.","status":400,"traceId":"00-40d7073ee1cf77c77875996f55f65034-4888403c8bef54ca-00","errors":{"toDo":["The toDo field is required."],"$.Status":["The JSON value could not be converted to System.String. Path: $.Status | LineNumber: 0 | BytePositionInLine: 59."]}}

后来发现是实体类引用错误导致,重新引用WPFProjectShared.Dtos.TodoDto,

另外一个报错:

{"type":"https://tools.ietf.org/html/rfc7231#section-6.5.1","title":"One or more validation errors occurred.","status":400,"traceId":"00-25e255d827e2947f869ccba30a1714e4-b2423a142252e535-00","errors":{"$":["'-' is invalid within a number, immediately after a sign character ('+' or '-'). Expected a digit ('0'-'9'). Path: $ | LineNumber: 0 | BytePositionInLine: 1."],"toDo":["The toDo field is required."]}}

修改请求参数的格式application/json

ToDoView.xmal完整代码:

<UserControlx:Class="WPFProject.Views.ToDoView"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:i="http://schemas.microsoft.com/xaml/behaviors"xmlns:local="clr-namespace:WPFProject.Views"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"d:DesignHeight="450"d:DesignWidth="800"mc:Ignorable="d"><md:DialogHost><md:DrawerHost IsRightDrawerOpen="{Binding IsIsRightDrawerOpens}"><md:DrawerHost.RightDrawerContent><DockPanel Width="300" LastChildFill="False"><TextBlockPadding="20,10"DockPanel.Dock="Top"FontSize="20"FontWeight="Bold"Text="添加待办" /><StackPanelMargin="20"DockPanel.Dock="Top"Orientation="Horizontal"><TextBlock VerticalAlignment="Center" Text="状态:" /><ComboBox SelectedIndex="{Binding CurrentDto.Status}"><ComboBoxItem>待办</ComboBoxItem><ComboBoxItem>已完成</ComboBoxItem></ComboBox></StackPanel><TextBoxMargin="20,5"md:HintAssist.Hint="请输入待办概要"DockPanel.Dock="Top"Text="{Binding CurrentDto.Title}" /><TextBoxMinHeight="100"Margin="20,10"md:HintAssist.Hint="请输入待办事项内容"DockPanel.Dock="Top"Text="{Binding CurrentDto.Content}" /><ButtonMargin="20,0"Command="{Binding ExecuteCommand}"CommandParameter="保存"Content="添加到待办"DockPanel.Dock="Top" /></DockPanel></md:DrawerHost.RightDrawerContent><Grid><Grid.RowDefinitions><RowDefinition Height="auto" /><RowDefinition /></Grid.RowDefinitions><StackPanelMargin="15,15,0,0"VerticalAlignment="Center"Orientation="Horizontal"><TextBoxWidth="250"md:HintAssist.Hint="查找待办事项..."md:TextFieldAssist.HasClearButton="True"Text="{Binding Search, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"><TextBox.InputBindings><KeyBindingKey="Enter"Command="{Binding ExecuteCommand}"CommandParameter="查询" /></TextBox.InputBindings></TextBox><TextBlockMargin="10,0,5,0"VerticalAlignment="Center"Text="筛选:" /><ComboBox Width="80" SelectedIndex="0"><ComboBoxItem>全部</ComboBoxItem><ComboBoxItem>待办</ComboBoxItem><ComboBoxItem>已完成</ComboBoxItem></ComboBox></StackPanel><ButtonMargin="10,0"HorizontalAlignment="Right"Command="{Binding ExecuteCommand}"CommandParameter="新增"Content="+ 添加待办" /><ScrollViewer Grid.Row="1"><ItemsControlGrid.Row="1"Margin="0,20"HorizontalAlignment="Center"ItemsSource="{Binding ToDoDtos}"><ItemsControl.ItemsPanel><ItemsPanelTemplate><WrapPanel /></ItemsPanelTemplate></ItemsControl.ItemsPanel><ItemsControl.ItemTemplate><DataTemplate><md:TransitioningContent OpeningEffect="{md:TransitionEffect Kind=ExpandIn}"><GridWidth="220"MinHeight="180"MaxHeight="250"Margin="8"><i:Interaction.Triggers><i:EventTrigger EventName="MouseLeftButtonUp"><i:InvokeCommandAction Command="{Binding DataContext.SelectedCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}" CommandParameter="{Binding}" /></i:EventTrigger></i:Interaction.Triggers><Grid.RowDefinitions><RowDefinition Height="auto" /><RowDefinition /></Grid.RowDefinitions><md:PopupBox HorizontalAlignment="Right" Panel.ZIndex="1"><Button Content="删除" /></md:PopupBox><BorderGrid.RowSpan="2"Background="#10B136"CornerRadius="5" /><TextBlockPadding="10,5"FontWeight="Bold"Text="{Binding Title}" /><TextBlockGrid.Row="1"Padding="10,5"Text="{Binding Content}" /><Canvas Grid.RowSpan="2" ClipToBounds="True"><!--  切割  --><BorderCanvas.Top="20"Canvas.Right="-80"Width="120"Height="120"Background="#FFFFFF"CornerRadius="60"Opacity="0.1" /><BorderCanvas.Top="100"Canvas.Right="-40"Width="140"Height="140"Background="#FFFFFF"CornerRadius="70"Opacity="0.1" /></Canvas></Grid></md:TransitioningContent></DataTemplate></ItemsControl.ItemTemplate></ItemsControl></ScrollViewer></Grid></md:DrawerHost></md:DialogHost>
</UserControl>

 ToDoViewModel.cs完整代码

using Prism.Commands;
using Prism.Ioc;
using Prism.Mvvm;
using Prism.Regions;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WPFProject.Common.Models;
using WPFProject.Service;
using WPFProjectShared.Dtos;namespace WPFProject.ViewModels
{public class ToDoViewModel : NavigationViewModel{private readonly IToDoService toDoService;public ToDoViewModel(IToDoService toDoService, IContainerProvider provider) : base(provider){ToDoDtos = new ObservableCollection<TodoDto>();ExecuteCommand = new DelegateCommand<string>(Execute);SelectedCommand = new DelegateCommand<TodoDto>(Selected);this.toDoService = toDoService;}private void Execute(string obj){switch (obj){case "新增":Add();break;case "查询":Query();break;case "保存":Save();break;}}private async void Save(){if (string.IsNullOrWhiteSpace(CurrentDto.Title) || string.IsNullOrWhiteSpace(CurrentDto.Content)){return;}else{UpdateLoading(true);try{if (CurrentDto.Id > 0)//update{var updateResult = await toDoService.UpdateAsync(CurrentDto);if (updateResult.Status){var todo = ToDoDtos.FirstOrDefault(t => t.Id == CurrentDto.Id);if (todo != null){todo.Title = CurrentDto.Title;todo.Content = CurrentDto.Content;todo.Status = CurrentDto.Status;}}IsIsRightDrawerOpens = false;}else//add{var addResult = await toDoService.AddAsync(CurrentDto);if (addResult.Status){ToDoDtos.Add(addResult.Result);IsIsRightDrawerOpens = false;}}}catch (Exception){throw;}finally { UpdateLoading(false); }}}private void Query(){GetDataAsync();}/// <summary>/// 添加待办/// </summary>/// <exception cref="NotImplementedException"></exception>private void Add(){CurrentDto = new TodoDto();IsIsRightDrawerOpens = true;}private async void Selected(TodoDto obj){try{UpdateLoading(true);var todoResult = await toDoService.GetFirstOfDefaultAsync(obj.Id);if (todoResult.Status){IsIsRightDrawerOpens = true;CurrentDto = todoResult.Result;}}catch (Exception){throw;}finally{UpdateLoading(false);}}public DelegateCommand<string> ExecuteCommand { get; private set; }public DelegateCommand<TodoDto> SelectedCommand { get;private set; }private bool isIsRightDrawerOpens;/// <summary>/// 右侧新增窗口是否打开/// </summary>public bool IsIsRightDrawerOpens{get { return isIsRightDrawerOpens; }set { isIsRightDrawerOpens = value; RaisePropertyChanged(); }}private TodoDto currentDto;/// <summary>/// 编辑选中/新增时的对象/// </summary>public TodoDto CurrentDto{get { return currentDto; }set { currentDto = value; RaisePropertyChanged(); }}private string search;/// <summary>/// 搜索条件/// </summary>public string Search{get { return search; }set { search = value; RaisePropertyChanged(); }}private ObservableCollection<TodoDto> toDoDtos;public ObservableCollection<TodoDto> ToDoDtos{get { return toDoDtos; }set { toDoDtos = value; }}/// <summary>/// 获取数据/// </summary>private async void GetDataAsync(){UpdateLoading(true);var todoResult = await toDoService.GetAllPageListAsync(new WPFProjectShared.Parameters.QueryParameter{PageIndex = 0,PageSize = 100,Search = Search});if (todoResult.Status){toDoDtos.Clear();foreach (var item in todoResult.Result.Items){toDoDtos.Add(item);}}UpdateLoading(false);}public override void OnNavigatedTo(NavigationContext navigationContext){base.OnNavigatedTo(navigationContext);GetDataAsync();}}
}

备忘录也相应修改,完整代码如下:

MemoView.xmal

<UserControlx:Class="WPFProject.Views.MemoView"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:i="http://schemas.microsoft.com/xaml/behaviors"xmlns:local="clr-namespace:WPFProject.Views"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"d:DesignHeight="450"d:DesignWidth="800"mc:Ignorable="d"><md:DialogHost><md:DrawerHost IsRightDrawerOpen="{Binding IsIsRightDrawerOpens}"><md:DrawerHost.RightDrawerContent><DockPanel Width="300" LastChildFill="False"><TextBlockPadding="20,10"DockPanel.Dock="Top"FontSize="20"FontWeight="Bold"Text="添加备忘录" /><TextBoxMargin="20,5"md:HintAssist.Hint="请输入备忘录概要"DockPanel.Dock="Top"Text="{Binding CurrentDto.Title}" /><TextBoxMinHeight="100"Margin="20,10"md:HintAssist.Hint="请输入备忘录内容"DockPanel.Dock="Top"Text="{Binding CurrentDto.Content}" /><ButtonMargin="20,0"Command="{Binding ExecuteCommand}"CommandParameter="保存"Content="添加到备忘录"DockPanel.Dock="Top" /></DockPanel></md:DrawerHost.RightDrawerContent><Grid><Grid.RowDefinitions><RowDefinition Height="auto" /><RowDefinition /></Grid.RowDefinitions><StackPanelMargin="15,15,0,0"VerticalAlignment="Center"Orientation="Horizontal"><TextBoxWidth="250"md:HintAssist.Hint="查找备忘录..."md:TextFieldAssist.HasClearButton="True"Text="{Binding Search, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"><TextBox.InputBindings><KeyBindingKey="Enter"Command="{Binding ExecuteCommand}"CommandParameter="查询" /></TextBox.InputBindings></TextBox></StackPanel><ButtonMargin="10,0"HorizontalAlignment="Right"Command="{Binding ExecuteCommand}"CommandParameter="新增"Content="+ 添加备忘录" /><ScrollViewer Grid.Row="1"><ItemsControlMargin="0,20"HorizontalAlignment="Center"ItemsSource="{Binding MemoDtos}"><ItemsControl.ItemsPanel><ItemsPanelTemplate><WrapPanel /></ItemsPanelTemplate></ItemsControl.ItemsPanel><ItemsControl.ItemTemplate><DataTemplate><md:TransitioningContent OpeningEffect="{md:TransitionEffect Kind=ExpandIn}"><GridWidth="220"MinHeight="180"MaxHeight="250"Margin="8"><i:Interaction.Triggers><i:EventTrigger EventName="MouseLeftButtonUp"><i:InvokeCommandAction Command="{Binding DataContext.SelectedCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}" CommandParameter="{Binding}" /></i:EventTrigger></i:Interaction.Triggers><Grid.RowDefinitions><RowDefinition Height="auto" /><RowDefinition /></Grid.RowDefinitions><md:PopupBox HorizontalAlignment="Right" Panel.ZIndex="1"><Button Content="删除" /></md:PopupBox><BorderGrid.RowSpan="2"Background="#10B136"CornerRadius="5" /><TextBlockPadding="10,5"FontWeight="Bold"Text="{Binding Title}" /><TextBlockGrid.Row="1"Padding="10,5"Text="{Binding Content}" /><Canvas Grid.RowSpan="2" ClipToBounds="True"><!--  切割  --><BorderCanvas.Top="20"Canvas.Right="-80"Width="120"Height="120"Background="#FFFFFF"CornerRadius="60"Opacity="0.1" /><BorderCanvas.Top="100"Canvas.Right="-40"Width="140"Height="140"Background="#FFFFFF"CornerRadius="70"Opacity="0.1" /></Canvas></Grid></md:TransitioningContent></DataTemplate></ItemsControl.ItemTemplate></ItemsControl></ScrollViewer></Grid></md:DrawerHost></md:DialogHost>
</UserControl>

 MemoViewModel.cs

using Prism.Commands;
using Prism.Ioc;
using Prism.Regions;
using System;
using System.Collections.ObjectModel;
using System.Linq;
using WPFProject.Common.Models;
using WPFProject.Service;
using WPFProjectShared.Dtos;namespace WPFProject.ViewModels
{public class MemoViewModel : NavigationViewModel{private readonly IMemoService memoService;public MemoViewModel(IMemoService memoService, IContainerProvider provider) : base(provider){MemoDtos = new ObservableCollection<MemoDto>();ExecuteCommand = new DelegateCommand<string>(Execute);SelectedCommand = new DelegateCommand<MemoDto>(Selected);this.memoService = memoService;}private void Execute(string obj){switch (obj){case "新增":Add();break;case "查询":Query();break;case "保存":Save();break;}}private async void Save(){if (string.IsNullOrWhiteSpace(CurrentDto.Title) || string.IsNullOrWhiteSpace(CurrentDto.Content)){return;}else{UpdateLoading(true);try{if (CurrentDto.Id > 0)//update{var updateResult = await memoService.UpdateAsync(CurrentDto);if (updateResult.Status){var todo = MemoDtos.FirstOrDefault(t => t.Id == CurrentDto.Id);if (todo != null){todo.Title = CurrentDto.Title;todo.Content = CurrentDto.Content;}}IsIsRightDrawerOpens = false;}else//add{var addResult = await memoService.AddAsync(CurrentDto);if (addResult.Status){MemoDtos.Add(addResult.Result);IsIsRightDrawerOpens = false;}}}catch (Exception){throw;}finally { UpdateLoading(false); }}}private void Query(){GetDataAsync();}private async void Selected(MemoDto obj){try{UpdateLoading(true);var memoResult = await memoService.GetFirstOfDefaultAsync(obj.Id);if (memoResult.Status){IsIsRightDrawerOpens = true;CurrentDto = memoResult.Result;}}catch (Exception){throw;}finally{UpdateLoading(false);}}private void Add(){CurrentDto = new MemoDto();IsIsRightDrawerOpens = true;}public DelegateCommand AddCommand { get; private set; }public DelegateCommand<MemoDto> SelectedCommand { get; private set; }public DelegateCommand<string> ExecuteCommand { get; private set; }private bool isIsRightDrawerOpens;public bool IsIsRightDrawerOpens{get { return isIsRightDrawerOpens; }set { isIsRightDrawerOpens = value; RaisePropertyChanged(); }}private ObservableCollection<MemoDto> memoDtos;public ObservableCollection<MemoDto> MemoDtos{get { return memoDtos; }set { memoDtos = value; RaisePropertyChanged(); }}private MemoDto currentDto;/// <summary>/// 新增/编辑 选中数据/// </summary>public MemoDto CurrentDto{get { return currentDto; }set { currentDto = value; RaisePropertyChanged(); }}private string search;/// <summary>/// 搜索条件/// </summary>public string Search{get { return search; }set { search = value; RaisePropertyChanged(); }}private async void GetDataAsync(){UpdateLoading(true);var memoResult = await memoService.GetAllPageListAsync(new WPFProjectShared.Parameters.QueryParameter{PageIndex = 0,PageSize = 100,Search = Search});if (memoResult.Status){memoDtos.Clear();foreach (var item in memoResult.Result.Items){memoDtos.Add(item);}}UpdateLoading(false);}public override void OnNavigatedTo(NavigationContext navigationContext){base.OnNavigatedTo(navigationContext);GetDataAsync();}}
}

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

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

相关文章

单车模型及其线性化

文章目录 1 单车模型2 线性化3 实现效果4 参考资料 1 单车模型 这里讨论的是以后轴为中心的单车运动学模型&#xff0c;由下式表达&#xff1a; S ˙ [ x ˙ y ˙ ψ ˙ ] [ v c o s ( ψ ) v s i n ( ψ ) v t a n ( ψ ) L ] \dot S \begin{bmatrix} \dot x\\ \dot y\\ \d…

【C++】异常抛出变量的生命周期

欢迎关注博主 Mindtechnist 或加入【智能科技社区】一起学习和分享Linux、C、C、Python、Matlab&#xff0c;机器人运动控制、多机器人协作&#xff0c;智能优化算法&#xff0c;滤波估计、多传感器信息融合&#xff0c;机器学习&#xff0c;人工智能等相关领域的知识和技术。搜…

代码随想录算法训练营第三十七天 _ 贪心算法_738.单调自增的数字、968.监督二叉树

学习目标&#xff1a; 60天训练营打卡计划&#xff01; 学习内容&#xff1a; 738.单调自增的数字 听不懂的时候就到该动手了。必须要从后向前操作&#xff0c;才能把压力逐级传给最前面的这一位。入如&#xff1a;322 class Solution {// java中的String不能修改&#xf…

Web3 开发者集结赢积分顺利闭幕!全程回顾一起来看

由 TinTinLand 联合 Dataverse 、Web3Go 、Subquery 、Cregis 、Litentry、Aspecta、SpaceID、ANOME、VARA&Gear、Moonbeam、Mantle、Obelisk 等 10 余家 Web3 项目共同举办的 Web3 开发者赢积分活动已于 11 月 26 日顺利落下帷幕&#xff0c;三周精彩纷呈的活动吸引了一众…

uniapp微信小程序地图实现绘制polygon(保姆级教程 全网最全!!!)

用户需求&#xff1a;需要在填写表单信息时&#xff0c;在地图上标绘自己房屋的位置信息。 这个问题处理了很久&#xff0c;在网上也没有找到全面的相关案例&#xff0c;所以我将我的思路分享给大家&#xff0c;希望可以解决大家遇到的问题。如果大家有更好的思路&#xff0c;…

中职组网络安全-PYsystem003.img(环境+解析)

​ web安全渗透 1.通过URL访问http://靶机IP/1&#xff0c;对该页面进行渗透测试&#xff0c;将完成后返回的结果内容作为flag值提交&#xff1b; 访问该网页后发现F12被禁用&#xff0c;使用ctrlshifti查看 ctrlshifti 等效于 F12 flag{fc35fdc70d5fc69d269883a822c7a53e} …

⭐ Unity + ARKIT ARFace脸部追踪

相比之前的图像物体检测&#xff0c;这脸部检测实现起来会更加的简单。 &#xff08;1&#xff09;首先我们先在场景中的物体上添加一个AR Face Mananger组件&#xff1a; &#xff08;2&#xff09;以上組件的 Face Prefab所代表的就是脸部的模型也就是覆盖在脸部上面的投影模…

通过PS导出样条线到3DMax挤出模型

1、PS制作样条线 PS用钢笔做出路径&#xff0c;导出 把.ai文件拖入3dmax中 2、挤出模型 调整模型在中心点位置&#xff0c;导出

SCT2432QSTER,可替代LMR14030-Q1;3.8V-40V输入、3.5A、高效率同步降压型DCDC转换器、具有内部补偿功能

描述&#xff1a; SCT2432Q是3.5A的同步降压转换器&#xff0c;具有宽输入电压&#xff0c;范围从3.8V到40V&#xff0c;它集成了一个80mΩ的高压侧MOSFET和一个50mQ的低压侧MOSFET&#xff0c;SCT2432Q采用峰值电流模式控制&#xff0c;支持脉冲跳过调制(PSM)&#xff0c;具有…

0基础学习VR全景平台篇第123篇:VR视频航拍补天 - PR软件教程

上课&#xff01;全体起立~ 大家好&#xff0c;欢迎观看蛙色官方系列全景摄影课程&#xff01; 嗨&#xff0c;大家好&#xff0c;今天我们来介绍【航拍VR视频补天】。之前已经教给了大家如何处理航拍图片的补天&#xff0c;肯定有很多小伙伴也在好奇&#xff0c;航拍的VR视频…

深度学习(一):Pytorch之YOLOv8目标检测

1.YOLOv8 2.模型详解 2.1模型结构设计 和YOLOv5对比&#xff1a; 主要的模块&#xff1a; ConvSPPFBottleneckConcatUpsampleC2f Backbone ----->Neck------>head Backdone 1.第一个卷积层的 kernel 从 6x6 变成了 3x3 2. 所有的 C3 模块换成 C2f&#xff0c;可以发现…

UniPro集成华为云WeLink 为企业客户构建互为联接的协作平台

华为云WeLink是华为开启数字化办公体验、帮助企业实现数字化转型的实践&#xff0c;类似钉钉。UniPro的客户企业中&#xff0c;有使用WeLink作为协作工具的&#xff0c;基于客户的实际业务需求&#xff0c;UniPro实现了与WeLink集成的能力&#xff0c;以帮助客户企业丰富和扩展…

软文营销助力品牌打开市场,提升内在竞争力

当今环境下&#xff0c;企业想要通过传统营销方式打开市场可以说是难度较大&#xff0c;用户如今更偏向于好的内容&#xff0c;而软文营销正是通过好内容吸引用户&#xff0c;助力品牌打开市场&#xff0c;提升内在竞争力&#xff0c;接下来媒介盒子就从以下几个方面和大家聊聊…

库位角点检测之Centernet/CornerNet算法

1.CornerNet CornerNet 那么我们从bounding box左上角(top-left corner)看物体。视线横着的话&#xff0c;物体就在视线的下面&#xff08;那么视线所在位置为the topmost boundary of an object&#xff09;。视线竖着的话&#xff0c;物体就在视线的右边&#xff0c;那么视线…

美团20k软件测试工程师的经验分享

前言 时间真是快&#xff0c;转眼间变成打工人也有三年的时间了&#xff0c;最近几天朋友圈被各个同学的答辩刷屏了。去年自己过年回到家里&#xff0c;再回母学校就是走走瞧瞧&#xff0c;经历了可能是唯一一年的云答辩。学生时代对未来的工作充满了想象&#xff0c;一直想知…

SQL面试题,判断if的实战应用

有如下表&#xff0c;请对这张表显示那些学生的成绩为及格&#xff0c;那些为不及格 1、创建表&#xff0c;插入数据 CREATE TABLE chapter8 (id VARCHAR(255) NULL,name VARCHAR(255) NULL,class VARCHAR(255) NULL,score VARCHAR(255) NULL );INSERT INTO chapter8 (id, n…

测试面试:不明白什么是质量保障

这是我面试经常问的一个问题&#xff0c;很多人并不明白其中的区别。 如上图&#xff0c;整体的质量体系架构图相对简单&#xff0c;主要包含三个部分&#xff1a;愿景&#xff08;高质量交付&#xff0d;快、好&#xff09;、能力&#xff08;中间三层不同的能力&#xff09;和…

如何管理施工现场?一招轻松搞定

随着科技的快速发展&#xff0c;建筑行业正迎来一场革命性的变革&#xff0c;智慧工地成为引领这一变革的关键力量。传统的建筑方式正在被智能化、数字化的解决方案所取代&#xff0c;为项目管理、安全性和效率带来了全新的可能性。 客户案例 建筑公司 山东某建筑公司通过引入…

数据结构算法-选择排序算法

引言 说起排序算法&#xff0c;那可就多了去&#xff0c;首先了解什么叫排序 以B站为例&#xff1a; 蔡徐坤在B站很受欢迎呀&#xff0c;先来看一下综合排序 就是播放量和弹幕量&#xff0c;收藏量 一键三连 都很高这是通过一些排序算法 才能体现出综合排序 蔡徐坤鬼畜 按照播…

map()的用法

JavaScript Array map() 方法 先说说这个方法浏览器的支持&#xff1a; 支持五大主流的浏览器&#xff0c; 特别注意&#xff1a;IE 9 以下的浏览器不支持&#xff0c;只支持IE 9以上的版本的浏览器 特别注意&#xff1a;IE 9 以下的浏览器不支持&#xff0c;只支持IE 9以上的…