应用程序使用统计信息 – .NET CORE(C#) WPF界面设计

本文首发地址:https://dotnet9.com/10546.html

关键功能点

  1. 抽屉式菜单

  2. 圆形进度条

Demo演示:

1. 新建项目

使用 VS 2019 的 .NET Core 3.1 WPF 项目模板,创建名为 “MobileAppUsageDashboardCore” 的项目,NuGet 引入 MaterialDesign 的两个库 MaterialDesignThemes 和 MaterialDesignColors,整个项目工程文件如下:

<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"><PropertyGroup><OutputType>WinExe</OutputType><TargetFramework>netcoreapp3.1</TargetFramework><UseWPF>true</UseWPF></PropertyGroup><ItemGroup><PackageReference Include="MaterialDesignColors" Version="1.2.2" /><PackageReference Include="MaterialDesignThemes" Version="3.0.1" /></ItemGroup></Project>

2.抽屉式菜单

前面发过不少抽屉式菜单的Demo文章,套路都是一个竖直菜单隐藏在界面左边边界之外,左边边界留一个菜单按钮,点击该按钮呼出竖直菜单,即达到抽屉式菜单效果。

本文介绍的抽屉式菜单也不外如是,VS设计界面见上图,使用的MD控件的DrawerHost.LeftDrawerContent组件,换一种方式实现,下面是抽屉菜单布局代码:

<materialDesign:DrawerHost.LeftDrawerContent><StackPanel Orientation="Vertical"><StackPanel Margin="10" VerticalAlignment="Top" Orientation="Horizontal"><TextBlockVerticalAlignment="Center"Margin="0,0,10,0">Dashboard</TextBlock><Button Style="{StaticResource MaterialDesignFlatButton}"Command="{x:Static materialDesign:DrawerHost.CloseDrawerCommand}"><materialDesign:PackIcon Kind="HamburgerMenuBack"></materialDesign:PackIcon></Button></StackPanel><StackPanel Orientation="Vertical"><Button Style="{StaticResource MaterialDesignFlatButton}" Click="todayBtnClicked">今天</Button><Button Style="{StaticResource MaterialDesignFlatButton}" Click="weekBtnClicked">本周</Button><Button Style="{StaticResource MaterialDesignFlatButton}" Click="monthBtnClicked">本月</Button></StackPanel></StackPanel>
</materialDesign:DrawerHost.LeftDrawerContent>

跟随菜单隐藏的还有一个菜单关闭按钮,见上面代码中的第一个按钮,点击按钮触发 “DrawerHost.CloseDrawerCommand” 命令可关闭抽屉式菜单。

下面的是窗体边界之内的菜单按钮,点击则展开抽屉式菜单,触发的命令是“DrawerHost.OpenDrawerCommand”:

<Button Style="{StaticResource MaterialDesignFlatButton}" Command="{x:Static materialDesign:DrawerHost.OpenDrawerCommand}"HorizontalAlignment="Left"VerticalAlignment="Top"><materialDesign:PackIcon Kind="HamburgerMenu"></materialDesign:PackIcon></Button>

3.圆形进度条

使用MD控件库实现圆形进度条,效果如下:

圆形进度条代码如下,使用的还是 ProgressBar 控件,样式使用了MD控件库的“MaterialDesignCircularProgressBar” 样式,组件加载时(Loaded事件),使用了双精度动画:

<ProgressBar Height="100"Width="100"
Value="40" Foreground="#FF68E843"x:Name="firstProgress"><ProgressBar.Style><Style TargetType="ProgressBar" BasedOn="{StaticResource MaterialDesignCircularProgressBar}"><Style.Triggers><EventTrigger RoutedEvent="Loaded"><BeginStoryboard><Storyboard><DoubleAnimation Storyboard.TargetProperty="Value" From="0" To="40"Duration="0:0:0.5"></DoubleAnimation></Storyboard></BeginStoryboard></EventTrigger></Style.Triggers></Style></ProgressBar.Style>
</ProgressBar>

4. Demo源码

整个Demo也不难,除了上面两个小功能单独简单说说外,其他的就是一般的布局代码了,主界面XAML代码如下:

<Window x:Class="MobileAppUsageDashboardCore.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"mc:Ignorable="d"TextElement.Foreground="{DynamicResource MaterialDesignBody}"TextElement.FontWeight="Regular"TextElement.FontSize="13"TextOptions.TextFormattingMode="Ideal"TextOptions.TextRenderingMode="Auto"Background="{DynamicResource MaterialDesignPaper}"FontFamily="{DynamicResource MaterialDesignFont}"Title="应用程序使用统计信息" Height="450" Width="800" WindowStartupLocation="CenterScreen" AllowsTransparency="True" WindowStyle="None" MouseLeftButtonDown="dragME"><materialDesign:DrawerHost x:Name="mainDrawer"><materialDesign:DrawerHost.LeftDrawerContent><StackPanel Orientation="Vertical"><StackPanel Margin="10" VerticalAlignment="Top" Orientation="Horizontal"><TextBlockVerticalAlignment="Center"Margin="0,0,10,0">Dashboard</TextBlock><Button Style="{StaticResource MaterialDesignFlatButton}"Command="{x:Static materialDesign:DrawerHost.CloseDrawerCommand}"><materialDesign:PackIcon Kind="HamburgerMenuBack"></materialDesign:PackIcon></Button></StackPanel><StackPanel Orientation="Vertical"><Button Style="{StaticResource MaterialDesignFlatButton}" Click="todayBtnClicked">今天</Button><Button Style="{StaticResource MaterialDesignFlatButton}" Click="weekBtnClicked">本周</Button><Button Style="{StaticResource MaterialDesignFlatButton}" Click="monthBtnClicked">本月</Button></StackPanel></StackPanel></materialDesign:DrawerHost.LeftDrawerContent><materialDesign:Card HorizontalAlignment="Stretch" VerticalAlignment="Stretch"><materialDesign:Card.Background><LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"><GradientStop Color="Black" Offset="1"/><GradientStop Color="#FF474747"/></LinearGradientBrush></materialDesign:Card.Background><Grid><Grid.ColumnDefinitions><ColumnDefinition Width="2*"></ColumnDefinition><ColumnDefinition Width="*"></ColumnDefinition><ColumnDefinition Width="*"></ColumnDefinition></Grid.ColumnDefinitions><StackPanel Grid.Column="0" Orientation="Vertical" Margin="10"><StackPanel Orientation="Horizontal"><Button Style="{StaticResource MaterialDesignFlatButton}" Command="{x:Static materialDesign:DrawerHost.OpenDrawerCommand}"HorizontalAlignment="Left"VerticalAlignment="Top"><materialDesign:PackIcon Kind="HamburgerMenu"></materialDesign:PackIcon></Button><TextBlock VerticalAlignment="Center" Text="移动应用使用仪表板"></TextBlock></StackPanel><StackPanel Orientation="Horizontal"><TextBlock Text="时间段" VerticalAlignment="Center"></TextBlock><StackPanel Orientation="Horizontal" Margin="4"><RadioButton x:Name="todayRadio" Style="{StaticResource MaterialDesignTabRadioButton}"Margin="4"IsChecked="True"Content="今天"></RadioButton><RadioButton x:Name="weekRadio" Style="{StaticResource MaterialDesignTabRadioButton}"Margin="4"IsChecked="False"Content="本周"></RadioButton><RadioButton x:Name="monthRadio" Style="{StaticResource MaterialDesignTabRadioButton}"Margin="4"IsChecked="False"Content="本月"></RadioButton></StackPanel></StackPanel><UniformGrid Columns="3" Margin="0,10,0,0"><materialDesign:TransitioningContent OpeningEffect="{materialDesign:TransitionEffect Kind=ExpandIn}"><Grid><Grid.RowDefinitions><RowDefinition Height="2*"></RowDefinition><RowDefinition Height="*"></RowDefinition></Grid.RowDefinitions><ProgressBar Height="100"Width="100"Value="40" Foreground="#FF68E843"x:Name="firstProgress"><ProgressBar.Style><Style TargetType="ProgressBar" BasedOn="{StaticResource MaterialDesignCircularProgressBar}"><Style.Triggers><EventTrigger RoutedEvent="Loaded"><BeginStoryboard><Storyboard><DoubleAnimation Storyboard.TargetProperty="Value" From="0" To="40"Duration="0:0:0.5"></DoubleAnimation></Storyboard></BeginStoryboard></EventTrigger></Style.Triggers></Style></ProgressBar.Style></ProgressBar><TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="2 小时 / 5 小时"></TextBlock><TextBlock Grid.Row="1" Text="百度" HorizontalAlignment="Center" Margin="0,5,0,0"></TextBlock></Grid></materialDesign:TransitioningContent><materialDesign:TransitioningContent OpeningEffect="{materialDesign:TransitionEffect Kind=ExpandIn}"><Grid><Grid.RowDefinitions><RowDefinition Height="2*"></RowDefinition><RowDefinition Height="*"></RowDefinition></Grid.RowDefinitions><ProgressBar Height="100"Width="100"Value="70" Foreground="#FFE84343"x:Name="secondProgress" Margin="14,-1,13,1"><ProgressBar.Style><Style TargetType="ProgressBar" BasedOn="{StaticResource MaterialDesignCircularProgressBar}"><Style.Triggers><EventTrigger RoutedEvent="Loaded"><BeginStoryboard><Storyboard><DoubleAnimation Storyboard.TargetProperty="Value" From="0" To="70"Duration="0:0:0.5"></DoubleAnimation></Storyboard></BeginStoryboard></EventTrigger></Style.Triggers></Style></ProgressBar.Style></ProgressBar><TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="2 小时 / 3 小时"></TextBlock><TextBlock Grid.Row="1" Text="阿里巴巴" HorizontalAlignment="Center" Margin="0,5,0,0"></TextBlock></Grid></materialDesign:TransitioningContent><materialDesign:TransitioningContent OpeningEffect="{materialDesign:TransitionEffect Kind=ExpandIn}"><Grid><Grid.RowDefinitions><RowDefinition Height="2*"></RowDefinition><RowDefinition Height="*"></RowDefinition></Grid.RowDefinitions><ProgressBar Height="100"Width="100"Value="30" Foreground="#FFE8E843"x:Name="thirdProgress"><ProgressBar.Style><Style TargetType="ProgressBar" BasedOn="{StaticResource MaterialDesignCircularProgressBar}"><Style.Triggers><EventTrigger RoutedEvent="Loaded"><BeginStoryboard><Storyboard><DoubleAnimation Storyboard.TargetProperty="Value" From="0" To="30"Duration="0:0:0.5"></DoubleAnimation></Storyboard></BeginStoryboard></EventTrigger></Style.Triggers></Style></ProgressBar.Style></ProgressBar><TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="1 小时 / 4 小时"></TextBlock><TextBlock Grid.Row="1" Text="腾讯" HorizontalAlignment="Center" Margin="0,5,0,0"></TextBlock></Grid></materialDesign:TransitioningContent></UniformGrid><materialDesign:TransitioningContent OpeningEffect="{materialDesign:TransitionEffect Kind=ExpandIn,Duration=0:0:1}"><StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,80,0,0"><TextBlock Text="订阅到 " VerticalAlignment="Center"></TextBlock><materialDesign:PackIcon Kind="DotNet" Foreground="#DDFF1212" Width="100" Height="100"></materialDesign:PackIcon><TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}" Text="www.dotnet9.com" VerticalAlignment="Center"></TextBlock></StackPanel></materialDesign:TransitioningContent></StackPanel><materialDesign:TransitioningContent OpeningEffect="{materialDesign:TransitionEffect Kind=SlideInFromTop}" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"><materialDesign:Card VerticalAlignment="Stretch"><materialDesign:Card.Background><LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"><GradientStop Color="#FF09A6A6" Offset="0"/><GradientStop Color="#FF044D4D" Offset="1"/></LinearGradientBrush></materialDesign:Card.Background><Grid ><Grid.RowDefinitions><RowDefinition></RowDefinition><RowDefinition></RowDefinition></Grid.RowDefinitions><Grid Grid.Row="0" Margin="5,15,5,5"><Grid.ColumnDefinitions><ColumnDefinition Width="*"></ColumnDefinition><ColumnDefinition Width="*"></ColumnDefinition></Grid.ColumnDefinitions><StackPanel Grid.Column="0"><TextBlock Text="充电" HorizontalAlignment="Center"></TextBlock><materialDesign:TransitioningContent OpeningEffect="{materialDesign:TransitionEffect Kind=FadeIn, Duration=0:0:2}"><StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,10,0,0"><TextBlock Style="{StaticResource MaterialDesignCaptionTextBlock}" Text="4" HorizontalAlignment="Center"></TextBlock><TextBlock Text=" 次" VerticalAlignment="Center"></TextBlock></StackPanel></materialDesign:TransitioningContent><TextBlock Text="最高温度" HorizontalAlignment="Center" Margin="0,25,0,0"></TextBlock><materialDesign:TransitioningContent OpeningEffect="{materialDesign:TransitionEffect Kind=FadeIn, Duration=0:0:2}"><StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,10,0,0"><TextBlock Style="{StaticResource MaterialDesignCaptionTextBlock}" Text="40" HorizontalAlignment="Center"></TextBlock><TextBlock Text=" ℃" VerticalAlignment="Center"></TextBlock></StackPanel></materialDesign:TransitioningContent><TextBlock Text="解锁" HorizontalAlignment="Center" Margin="0,25,0,0"></TextBlock><materialDesign:TransitioningContent OpeningEffect="{materialDesign:TransitionEffect Kind=FadeIn,Duration=0:0:2}"><TextBlock Style="{StaticResource MaterialDesignCaptionTextBlock}"  Text="75" HorizontalAlignment="Center" Margin="0,10,0,0"></TextBlock></materialDesign:TransitioningContent></StackPanel><StackPanel Grid.Column="1"><TextBlock Text="开机" HorizontalAlignment="Center"></TextBlock><materialDesign:TransitioningContent OpeningEffect="{materialDesign:TransitionEffect Kind=FadeIn, Duration=0:0:2}"><StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,10,0,0"><TextBlock Style="{StaticResource MaterialDesignCaptionTextBlock}" Text="6" HorizontalAlignment="Center"></TextBlock><TextBlock Text=" 小时" VerticalAlignment="Center"></TextBlock></StackPanel></materialDesign:TransitioningContent><TextBlock Text="最后一次充电" HorizontalAlignment="Center" Margin="0,25,0,0"></TextBlock><materialDesign:TransitioningContent OpeningEffect="{materialDesign:TransitionEffect Kind=FadeIn, Duration=0:0:2}"><StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,10,0,0"><TextBlock Style="{StaticResource MaterialDesignCaptionTextBlock}" Text="4" HorizontalAlignment="Center"></TextBlock><TextBlock Text=" 小时以前" VerticalAlignment="Center"></TextBlock></StackPanel></materialDesign:TransitioningContent><TextBlock Text="通知" HorizontalAlignment="Center" Margin="0,25,0,0"></TextBlock><materialDesign:TransitioningContent OpeningEffect="{materialDesign:TransitionEffect Kind=FadeIn,Duration=0:0:2}"><TextBlock Style="{StaticResource MaterialDesignCaptionTextBlock}"  Text="350" HorizontalAlignment="Center" Margin="0,10,0,0"></TextBlock></materialDesign:TransitioningContent></StackPanel></Grid><Grid Grid.Row="1" Background="#FF086666"><Grid.RowDefinitions><RowDefinition></RowDefinition><RowDefinition></RowDefinition><RowDefinition></RowDefinition></Grid.RowDefinitions><StackPanel Orientation="Vertical" Grid.Row="0" Margin="5,15,5,5"><Grid><TextBlock Style="{StaticResource MaterialDesignCaptionTextBlock}" Text="存储" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock><TextBlock Text="19.88 GB / 40 GB" HorizontalAlignment="Right" VerticalAlignment="Center"></TextBlock></Grid><ProgressBar Height="10" Value="19.88" Maximum="40" Margin="0,10,0,0" Foreground="#FF1E1E1E"></ProgressBar></StackPanel><StackPanel Orientation="Vertical" Grid.Row="1" Margin="5,15,5,5"><Grid><TextBlock Style="{StaticResource MaterialDesignCaptionTextBlock}" Text="相册" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock><TextBlock Text="3 GB" HorizontalAlignment="Right" VerticalAlignment="Center"></TextBlock></Grid><ProgressBar Height="10" Value="3" Maximum="40" Margin="0,10,0,0" Foreground="#FF1E1E1E"></ProgressBar></StackPanel><StackPanel Orientation="Vertical" Grid.Row="2" Margin="5,15,5,5"><Grid><TextBlock Style="{StaticResource MaterialDesignCaptionTextBlock}" Text="视频" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock><TextBlock Text="4 GB" HorizontalAlignment="Right" VerticalAlignment="Center"></TextBlock></Grid><ProgressBar Height="10" Value="4" Maximum="40" Margin="0,10,0,0" Foreground="#FF1E1E1E"></ProgressBar></StackPanel></Grid></Grid></materialDesign:Card></materialDesign:TransitioningContent><!--<TextBlock Style="{DynamicResource MaterialDesignTitleTextBlock}">My First Material Design App</TextBlock>--><materialDesign:TransitioningContent Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Top" OpeningEffect="{materialDesign:TransitionEffect Kind=SlideInFromTop}"><TextBlock Style="{StaticResource MaterialDesignCaptionTextBlock}" Text="最常用的应用程序" Margin="0,15,0,0"></TextBlock></materialDesign:TransitioningContent><materialDesign:TransitioningContent Grid.Column="2"OpeningEffect="{materialDesign:TransitionEffect Kind=FadeIn}" Margin="0,40,0,0"><ItemsControl><ItemsControl.ItemsPanel><ItemsPanelTemplate><UniformGrid Columns="2"></UniformGrid></ItemsPanelTemplate></ItemsControl.ItemsPanel><materialDesign:TransitioningContent OpeningEffectsOffset="{materialDesign:IndexedItemOffsetMultiplier 0:0:0.05}" OpeningEffect="{materialDesign:TransitionEffect Kind=ExpandIn}"><Button Style="{StaticResource MaterialDesignIconButton}" ToolTip="Google Chrome"><materialDesign:PackIcon Kind="GoogleChrome" Height="24" Width="24" ></materialDesign:PackIcon></Button></materialDesign:TransitioningContent><materialDesign:TransitioningContent OpeningEffectsOffset="{materialDesign:IndexedItemOffsetMultiplier 0:0:0.05}" OpeningEffect="{materialDesign:TransitionEffect Kind=ExpandIn}"><Button Style="{StaticResource MaterialDesignIconButton}" ToolTip="YouTube"><materialDesign:PackIcon Kind="Youtube" Height="24" Width="24"></materialDesign:PackIcon></Button></materialDesign:TransitioningContent><materialDesign:TransitioningContent OpeningEffectsOffset="{materialDesign:IndexedItemOffsetMultiplier 0:0:0.05}" OpeningEffect="{materialDesign:TransitionEffect Kind=ExpandIn}"><Button Style="{StaticResource MaterialDesignIconButton}" ToolTip="Instagram"><materialDesign:PackIcon Kind="Instagram" Height="24" Width="24"></materialDesign:PackIcon></Button></materialDesign:TransitioningContent><materialDesign:TransitioningContent OpeningEffectsOffset="{materialDesign:IndexedItemOffsetMultiplier 0:0:0.05}" OpeningEffect="{materialDesign:TransitionEffect Kind=ExpandIn}"><Button Style="{StaticResource MaterialDesignIconButton}" ToolTip="Facebook"><materialDesign:PackIcon Kind="Facebook" Height="24" Width="24"></materialDesign:PackIcon></Button></materialDesign:TransitioningContent><materialDesign:TransitioningContent OpeningEffectsOffset="{materialDesign:IndexedItemOffsetMultiplier 0:0:0.05}" OpeningEffect="{materialDesign:TransitionEffect Kind=ExpandIn}"><Button Style="{StaticResource MaterialDesignIconButton}" ToolTip="Twitter"><materialDesign:PackIcon Kind="Twitter" Height="24" Width="24"></materialDesign:PackIcon></Button></materialDesign:TransitioningContent><materialDesign:TransitioningContent OpeningEffectsOffset="{materialDesign:IndexedItemOffsetMultiplier 0:0:0.05}" OpeningEffect="{materialDesign:TransitionEffect Kind=ExpandIn}"><Button Style="{StaticResource MaterialDesignIconButton}" ToolTip="YouTube Creator Studio"><materialDesign:PackIcon Kind="YoutubeCreatorStudio" Height="24" Width="24"></materialDesign:PackIcon></Button></materialDesign:TransitioningContent><materialDesign:TransitioningContent OpeningEffectsOffset="{materialDesign:IndexedItemOffsetMultiplier 0:0:0.05}" OpeningEffect="{materialDesign:TransitionEffect Kind=ExpandIn}"><Button Style="{StaticResource MaterialDesignIconButton}" ToolTip="Adobe Reader"><materialDesign:PackIcon Kind="Adobe" Height="24" Width="24"></materialDesign:PackIcon></Button></materialDesign:TransitioningContent><materialDesign:TransitioningContent OpeningEffectsOffset="{materialDesign:IndexedItemOffsetMultiplier 0:0:0.05}" OpeningEffect="{materialDesign:TransitionEffect Kind=ExpandIn}"><Button Style="{StaticResource MaterialDesignIconButton}" ToolTip="Camera"><materialDesign:PackIcon Kind="Camera" Height="24" Width="24"></materialDesign:PackIcon></Button></materialDesign:TransitioningContent></ItemsControl></materialDesign:TransitioningContent></Grid></materialDesign:Card></materialDesign:DrawerHost>
</Window>

5. 主界面后台代码

代码不多,比较简单,源码如下:

using System;
using System.Windows;
using System.Windows.Input;namespace MobileAppUsageDashboardCore
{/// <summary>/// Interaction logic for MainWindow.xaml/// </summary>public partial class MainWindow : Window{public MainWindow(){InitializeComponent();}private void todayBtnClicked(object sender, RoutedEventArgs e){mainDrawer.IsLeftDrawerOpen = false;todayRadio.IsChecked = true;monthRadio.IsChecked = false;weekRadio.IsChecked = false;}private void weekBtnClicked(object sender, RoutedEventArgs e){mainDrawer.IsLeftDrawerOpen = false;todayRadio.IsChecked = false;weekRadio.IsChecked = true;monthRadio.IsChecked = false;}private void monthBtnClicked(object sender, RoutedEventArgs e){mainDrawer.IsLeftDrawerOpen = false;todayRadio.IsChecked = false;weekRadio.IsChecked = false;monthRadio.IsChecked = true;}private void dragME(object sender, MouseButtonEventArgs e){try{DragMove();}catch (Exception){//throw;}}}
}

3. Demo展示、源码下载

前面演示的Demo源码已经全部贴上。

参考视频:WPF Dashboard UI - Material Design [Speed Design]

参考源码:WPF-Dashboard-UI-Material-Design-Concept

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

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

相关文章

iso qemu 安装ubuntu_基于libvirt 和QEMU在macOS安装Ubuntu

在流行的虚拟架构体系中&#xff0c;最重要的技术当然要数libvirt和QEMU了。包括Linux虚拟化技术中KVM和xen都使用了QEMU。关于Xen和KVM进行虚拟化&#xff0c;以及在Window下使用Vmware&#xff0c;VirtualBox和hyper-v构建虚拟机&#xff0c;可能大家都有过很多的尝试。今天我…

在Ocelot中使用自定义的中间件(一)

Ocelot是ASP.NET Core下的API网关的一种实现&#xff0c;在微服务架构领域发挥了非常重要的作用。本文不会从整个微服务架构的角度来介绍Ocelot&#xff0c;而是介绍一下最近在学习过程中遇到的一个问题&#xff0c;以及如何使用中间件&#xff08;Middleware&#xff09;来解决…

多队列 部分队列没有包_记一次TCP全队列溢出问题排查过程

简介&#xff1a;记一次TCP全队列溢出问题排查过程1. 前言本文排查的问题是经典的TCP队列溢出问题&#xff0c;因TCP队列问题在操作系统层面没有明显的指标异常&#xff0c;容易被忽略&#xff0c;故把排查过程分享给大家。2. 问题描述A服务调用B服务接口超时&#xff0c;B服务…

[蓝桥杯2015决赛]完美正方形-dfs

题目描述 如果一些边长互不相同的正方形&#xff0c;可以恰好拼出一个更大的正方形&#xff0c;则称其为完美正方形。 历史上&#xff0c;人们花了很久才找到了若干完美正方形。 比如&#xff1a;如下边长的22个正方形 2 3 4 6 7 8 12 13 14 15 16 17 18 21 22 23 24 26 27 28 …

销量预测设计

目录一、算法计算逻辑举个直观的例子销量预测二、项目背景三、算法与业务的关系四、关于业务人员对未来外部变量“打标签”&#xff1a;五、关于预测颗粒度&#xff1a;六、关于预测准确率和影响准确率的因素&#xff1a;一、算法计算逻辑 销量预测算法建模要用到的数据&#…

.NET Core开发实战(第23课:静态文件中间件:前后端分离开发合并部署骚操作)--学习笔记(下)...

23 | 静态文件中间件&#xff1a;前后端分离开发合并部署骚操作这里还有一个比较特殊的用法一般情况下&#xff0c;我们前后端分离的架构&#xff0c;前端会编译成一个 index.html 文件和若干个 CSS 文件和 JavaScript 和图片文件CSS 文件和 JavaScript 和图片文件一般会部署在…

springboot 历史版本文档_乘风破浪,SpringBoot入门

SpringBoot入门篇前言在普通的java项目中&#xff0c;大量的xml文件配置起来相当繁琐&#xff0c;导致了开发效率非常低下&#xff0c;整合第三方框架的配置可能会存在冲突问题导致部署效率低&#xff0c;打包方式是将项目打成一个war包放入到tomactwebapps目录下执行。简单来说…

简洁直观解释精确率、召回率、F1 值、ROC、AUC

混淆矩阵 当我们在做二分类预测时&#xff0c;把预测情况与实际情况的所有结果两两混合&#xff0c;结果就会出现以下4种情况&#xff0c;就组成了混淆矩阵。 P&#xff08;Positive&#xff09;&#xff1a;代表正样本N&#xff08;Negative&#xff09;&#xff1a;代表负样…

基于Tensorflow搭建卷积神经网络CNN(水果识别)保姆及级教程

项目介绍 TensorFlow2.X 搭建卷积神经网络&#xff08;CNN&#xff09;&#xff0c;实现水果识别。搭建的卷积神经网络是类似VGG的结构(卷积层与池化层反复堆叠&#xff0c;然后经过全连接层&#xff0c;最后用softmax映射为每个类别的概率&#xff0c;概率最大的即为识别结果…

如何编写高性能的C#代码(四)字符串的另类骚操作

原文来自互联网&#xff0c;由长沙DotNET技术社区编译。如译文侵犯您的署名权或版权&#xff0c;请联系小编&#xff0c;小编将在24小时内删除。作者介绍&#xff1a;史蒂夫戈登&#xff08;Steve Gordon&#xff09;是Microsoft MVP&#xff0c;Pluralsight的作者&#xff0c;…

statusbar 尺寸 显示图标_移动端页面设计规范尺寸大起底 - 椰树飘香

移动端尺寸繁多&#xff0c;包括IOS和安卓&#xff0c;尺寸多达十余种&#xff0c;所以移动页面尺寸的适配一直是前端和设计的头疼。今天来总结一下当前市场上的一些移动端尺寸&#xff0c;方便设计师和前端去考虑适配。但是最好还是针对自己的产品做调查&#xff0c;根据数据去…

新建项目上传gitee(码云)教程

登录码云 新建一个仓库后&#xff0c;复制HTTPS地址&#xff1a; 本地项目操作 打开需要上传gitee的项目文件夹&#xff0c;并打开Git Bash窗口 本地仓库初始化&#xff1a; git init添加到暂存区 git add .提交到本地仓库 git commit -m "first commit"关联到…

OpenSilver: 通过WebAssembly 复活Silverlight

本月早些时候&#xff0c;Userware发布了第一个版本的OpenSilver&#xff0c;微软Silverlight 的开源重新实现。OpenSilver 通过WebAssembly 实现无需任何其他插件在 浏览器上运行。OpenSilver 的当前版本可作为"技术预览"版本提供&#xff0c;它涵盖了大约 60% 的原…

db2有主键时默认hash分区_MySQL分区表最佳实践

前言&#xff1a;分区是一种表的设计模式&#xff0c;通俗地讲表分区是将一大表&#xff0c;根据条件分割成若干个小表。但是对于应用程序来讲&#xff0c;分区的表和没有分区的表是一样的。换句话来讲&#xff0c;分区对于应用是透明的&#xff0c;只是数据库对于数据的重新整…

程序员过关斩将-- 喷一喷坑爹的面向UI编程

点击上方“蓝字”关注我们菜菜哥&#xff0c;求你个事呗&#xff1f;说来听听&#xff0c;假装你男朋友可不干不是哦&#xff0c;是正经事。前几天一个项目UI改了&#xff0c;好多人跟着加班修改&#xff0c;怎么样尽量避免这种情况呢&#xff1f;UI修改顶多和客户端开发人员关…

python二维散点分布图_深入理解皮尔逊相关系数amp;python代码

1.常见理解误区&#xff08;1&#xff09;计算出变量A和变量B的皮尔逊相关系数为0&#xff0c;不代表A和B之间没有相关性&#xff0c;只能说明A和B之间不存在线性相关关系。例&#xff1a;温度和冰淇淋销量之间的散点图像如下&#xff0c;可以发现大致成二次函数图像&#xff0…

hdu4911 Inversion-归并排序

解题思路&#xff1a; 如果原序列的逆序对数大于交换次数&#xff0c;那么最少的逆序对数量就是原序列逆序对-交换次数。 如果原序列的逆序对数小于等于交换次数&#xff0c;那么最少的逆序对数量为0&#xff0c;因为交换次数超过逆序对数&#xff0c;可以把这些逆序对全部消除…

【.net core】电商平台升级之微服务架构应用实战

一、前言这篇文章本来是继续分享IdentityServer4 的相关文章&#xff0c;由于之前有博友问我关于微服务相关的问题&#xff0c;我就先跳过IdentityServer4的分享&#xff0c;进行微服务相关的技术学习和分享。微服务在我的分享目录里面是放到四月份开始系列文章分享的&#xff…

c语言将一个已知头结点的单链表逆序_C语言实现常用数据结构:静态链表数组实现(第5篇)...

「今天是学习C语言第 148 天」纸上学来终觉浅&#xff0c;绝知此事要躬行。—— 陆游「冬夜读书示子聿」# 静态链表使用数组实现&#xff0c;利用数组下标代替指针&#xff0c;从而实现数据结点之间的先后关系。实现要点&#xff1a;1.数组下标为0的位置为头结点&#xff0c;指…

集成平台集群任务动态分派

源宝导读&#xff1a;MIP集成平台是为了解决企业大量异构系统之间快速、稳定集成的需要&#xff0c;助力企业数字化转型&#xff0c;明源云自主研发的平台系统。本文将对"事件任务分派"场景的架构设计以及实践成果进行分享。背景MIP集成平台是为了解决企业大量异构系…