Silverlight 样式的灵活使用
众所周知,Silverlight将界面设计与代码实现分开。即便如此,如果不能灵活地运用样式Style,开发的效率依然会比较低。比如,针对类似的TextBlock,你可能需要反复地在设计器xaml中复制粘贴很多行设计器代码。但如果开发人员掌握了样式的使用,可以一次设计,到处使用。
(一)获取一个控件的样式Style文件
这里以FloatableWindow控件为例
(1)打开一个继承自FloatableWindow的控件OverlapControl的设计器文件OverlapControl.xaml,在菜单栏中点击”视图->在Blend中打开“(View->Open in Blend),如下如所示
(2)打开Blend之后,在Object and Timeline视图中,右键"FloatableWindow",并选择“Edit Template->Create Empty”,创建新一个新的资源字典ResourceDictionary.xaml:
(3)假如该控件没有与任何ResourceDictionary文件关联,则需要新建一个资源字典文件ResourceDictionary:
(4)修改资源字典文件的名称,点击“确定”(OK),如此,就可以在当前目录看到创建的资源字典文件FloatableWindowStyle.xaml
此时,在OverlapControl.xaml设计器文件中,会多上几行引用的代码:
(二)调整或设置控件的样式Style文件
此时,重新再Blend中打开OverlapControl.xaml或者打开FloatableWindowStyle.xaml,可以对FloatableWindow的样式进行调整,或者设置其对应的参数:
(1)打开编辑样式资源的开关:
(2)随后,在视图区中,可以看到FloatableWindow的简单视图:
(3)选中“属性”(Properties)选项卡,可以非常方便地设置该控件的参数:
(4)当然,开发人员也可以在设计器文件中直接调整参数的值,一下代码本人调整好后的代码:
- <ResourceDictionary
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:windows="clr-namespace:System.Windows.Controls;assembly=FloatableWindow">
- <!-- Resource dictionary entries should be defined here. -->
- <LinearGradientBrush x:Key="HeaderBackgroundBrush" EndPoint="0,0" StartPoint="0,1">
- <GradientStop Offset="0.0" Color="#92bfbe"/>
- <GradientStop Offset="0.2" Color="#8dc5c4"/>
- <GradientStop Offset="0.8" Color="#8dc5c4"/>
- <GradientStop Offset="1.0" Color="#92bfbe"/>
- </LinearGradientBrush>
- <SolidColorBrush x:Key="HeaderBorderBrush" Color="#ff9bb6b5" />
- <Style x:Key="FloatableWindowStyle1" TargetType="windows:FloatableWindow">
- <Setter Property="IsTabStop" Value="false"/>
- <Setter Property="TabNavigation" Value="Cycle"/>
- <Setter Property="HorizontalAlignment" Value="Center"/>
- <Setter Property="VerticalAlignment" Value="Center"/>
- <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
- <Setter Property="VerticalContentAlignment" Value="Stretch"/>
- <Setter Property="BorderThickness" Value="1"/>
- <Setter Property="BorderBrush">
- <Setter.Value>
- <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
- <GradientStop Color="#FFA3AEB9" Offset="0"/>
- <GradientStop Color="#FF8399A9" Offset="0.375"/>
- <GradientStop Color="#FF718597" Offset="0.375"/>
- <GradientStop Color="#FF617584" Offset="1"/>
- </LinearGradientBrush>
- </Setter.Value>
- </Setter>
- <Setter Property="OverlayBrush" Value="#7F000000"/>
- <Setter Property="OverlayOpacity" Value="1"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="windows:FloatableWindow">
- <Grid x:Name="Root">
- <Grid.Resources>
- <Style x:Key="ButtonStyle" TargetType="Button">
- <Setter Property="Background" Value="#FF1F3B53"/>
- <Setter Property="Foreground" Value="#FF000000"/>
- <Setter Property="Padding" Value="3"/>
- <Setter Property="BorderThickness" Value="1"/>
- <Setter Property="BorderBrush">
- <Setter.Value>
- <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
- <GradientStop Color="#FFA3AEB9" Offset="0"/>
- <GradientStop Color="#FF8399A9" Offset="0.375"/>
- <GradientStop Color="#FF718597" Offset="0.375"/>
- <GradientStop Color="#FF617584" Offset="1"/>
- </LinearGradientBrush>
- </Setter.Value>
- </Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Button">
- <Grid x:Name="grid" Background="#02FFFFFF" HorizontalAlignment="Center" Height="14" VerticalAlignment="Center" Width="15">
- <VisualStateManager.VisualStateGroups>
- <VisualStateGroup x:Name="CommonStates">
- <VisualState x:Name="Normal"/>
- <VisualState x:Name="MouseOver">
- <Storyboard>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="X_Fuzz2">
- <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
- </ObjectAnimationUsingKeyFrames>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="X_Fuzz1">
- <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
- </ObjectAnimationUsingKeyFrames>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="X_Fuzz0">
- <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
- </ObjectAnimationUsingKeyFrames>
- <DoubleAnimation Duration="0" To="0.95" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="X"/>
- </Storyboard>
- </VisualState>
- <VisualState x:Name="Pressed">
- <Storyboard>
- <DoubleAnimation Duration="0" To="0.85" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="X"/>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="X_Fuzz2">
- <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
- </ObjectAnimationUsingKeyFrames>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="X_Fuzz1">
- <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
- </ObjectAnimationUsingKeyFrames>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="X_Fuzz0">
- <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
- </ObjectAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- <VisualState x:Name="Disabled">
- <Storyboard>
- <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="X"/>
- </Storyboard>
- </VisualState>
- </VisualStateGroup>
- </VisualStateManager.VisualStateGroups>
- <Path x:Name="X_Fuzz2" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z" Fill="#14C51900" HorizontalAlignment="Center" Height="8" Margin="0,-1,0,0" Opacity="1" RenderTransformOrigin="0.5,0.5" Stretch="Fill" Stroke="#14C51900" Visibility="Collapsed" VerticalAlignment="Center" Width="9">
- <Path.RenderTransform>
- <TransformGroup>
- <ScaleTransform ScaleY="1.3" ScaleX="1.3"/>
- </TransformGroup>
- </Path.RenderTransform>
- </Path>
- <Path x:Name="X_Fuzz1" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z" Fill="#1EC51900" HorizontalAlignment="Center" Height="8" Margin="0,-1,0,0" Opacity="1" RenderTransformOrigin="0.5,0.5" Stretch="Fill" Stroke="#1EC51900" Visibility="Collapsed" VerticalAlignment="Center" Width="9">
- <Path.RenderTransform>
- <TransformGroup>
- <ScaleTransform ScaleY="1.1" ScaleX="1.1"/>
- </TransformGroup>
- </Path.RenderTransform>
- </Path>
- <Path x:Name="X_Fuzz0" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z" Fill="#FFC51900" HorizontalAlignment="Center" Height="8" Margin="0,-1,0,0" Opacity="1" Stretch="Fill" Stroke="#FFC51900" Visibility="Collapsed" VerticalAlignment="Center" Width="9"/>
- <Path x:Name="X" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z" Fill="#FFFFFFFF" HorizontalAlignment="Center" Height="8" Margin="0,-1,0,0" Opacity="0.7" Stretch="Fill" VerticalAlignment="Center" Width="9">
- <Path.Stroke>
- <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
- <GradientStop Color="#FF313131" Offset="1"/>
- <GradientStop Color="#FF8E9092" Offset="0"/>
- </LinearGradientBrush>
- </Path.Stroke>
- </Path>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Grid.Resources>
- <VisualStateManager.VisualStateGroups>
- <VisualStateGroup x:Name="WindowStates">
- <VisualState x:Name="Open">
- <Storyboard>
- <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Overlay">
- <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
- <EasingDoubleKeyFrame KeyTime="00:00:00.3" Value="1"/>
- </DoubleAnimationUsingKeyFrames>
- <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleX" Storyboard.TargetName="ContentRoot">
- <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
- <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="0"/>
- <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1"/>
- <SplineDoubleKeyFrame KeySpline="0,0,0.5,1" KeyTime="00:00:00.45" Value="1.05"/>
- <SplineDoubleKeyFrame KeyTime="00:00:00.55" Value="1"/>
- </DoubleAnimationUsingKeyFrames>
- <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleY" Storyboard.TargetName="ContentRoot">
- <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
- <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="0"/>
- <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1"/>
- <SplineDoubleKeyFrame KeySpline="0,0,0.5,1" KeyTime="00:00:00.45" Value="1.05"/>
- <SplineDoubleKeyFrame KeyTime="00:00:00.55" Value="1"/>
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- <VisualState x:Name="Closed">
- <Storyboard>
- <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Overlay">
- <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
- <EasingDoubleKeyFrame KeyTime="00:00:00.3" Value="0"/>
- </DoubleAnimationUsingKeyFrames>
- <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleX" Storyboard.TargetName="ContentRoot">
- <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="1"/>
- <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1.05"/>
- <SplineDoubleKeyFrame KeyTime="00:00:00.45" Value="0"/>
- </DoubleAnimationUsingKeyFrames>
- <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleY" Storyboard.TargetName="ContentRoot">
- <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="1"/>
- <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1.05"/>
- <SplineDoubleKeyFrame KeyTime="00:00:00.45" Value="0"/>
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- </VisualStateGroup>
- </VisualStateManager.VisualStateGroups>
- <Grid x:Name="Overlay" Background="{TemplateBinding OverlayBrush}" HorizontalAlignment="Stretch" Margin="0" Opacity="{TemplateBinding OverlayOpacity}" VerticalAlignment="Top"/>
- <Grid x:Name="ContentRoot" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Height="{TemplateBinding Height}" RenderTransformOrigin="0.5,0.5"
- VerticalAlignment="{TemplateBinding VerticalAlignment}" Width="{TemplateBinding Width}">
- <Grid.RenderTransform>
- <TransformGroup>
- <ScaleTransform/>
- <SkewTransform/>
- <RotateTransform/>
- <TranslateTransform/>
- </TransformGroup>
- </Grid.RenderTransform>
- <Border BorderBrush="#14000000" BorderThickness="1" Background="#14000000" CornerRadius="2" HorizontalAlignment="Stretch" Margin="-1" VerticalAlignment="Stretch"/>
- <Border BorderBrush="#0F000000" BorderThickness="1" Background="#0F000000" CornerRadius="2.25" HorizontalAlignment="Stretch" Margin="-2" VerticalAlignment="Stretch"/>
- <Border BorderBrush="#0C000000" BorderThickness="1" Background="#0C000000" CornerRadius="2.5" HorizontalAlignment="Stretch" Margin="-3" VerticalAlignment="Stretch"/>
- <Border BorderBrush="#0A000000" BorderThickness="1" Background="#0A000000" CornerRadius="2.75" HorizontalAlignment="Stretch" Margin="-4" VerticalAlignment="Stretch"/>
- <!--*********************************整个面板的边框***********************************-->
- <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="#FFFFFFFF" CornerRadius="5">
- <Border CornerRadius="1.5" Margin="0">
- <Border.Background><!--面板背景色-->
- <!--
- <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
- <GradientStop Color="#FFE5E8EB" Offset="1"/>
- <GradientStop Color="#FFF6F8F9" Offset="0"/>
- </LinearGradientBrush>
- -->
- <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
- <GradientStop Offset="0" Color="#FFffffff"/>
- <GradientStop Offset="1.0" Color="#FFffffff"/>
- </LinearGradientBrush>
- </Border.Background>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <!--*********************************标题框……边框***********************************-->
- <Border x:Name="Chrome" BorderBrush="{StaticResource HeaderBorderBrush}" BorderThickness="1,1,1,1" Width="Auto" Background="{StaticResource HeaderBackgroundBrush}">
- <Grid Height="Auto" Width="Auto">
- <Grid.ColumnDefinitions>
- <ColumnDefinition/>
- <ColumnDefinition Width="30"/>
- </Grid.ColumnDefinitions>
- <!--******************************************************标题***************************************-->
- <ContentControl Content="{TemplateBinding Title}" FontWeight="Bold" HorizontalAlignment="Stretch" IsTabStop="False"
- Margin="6,3,6,3" VerticalAlignment="Center"/>
- <!--******************************************************关闭按钮***************************************-->
- <Button x:Name="CloseButton" Grid.Column="1" HorizontalAlignment="Center" Height="14" IsTabStop="False" Cursor="Hand"
- Style="{StaticResource ButtonStyle}" VerticalAlignment="Center" Width="15"/>
- </Grid>
- </Border>
- <!--******************************************************主要内容区域***************************************-->
- <Border Background="{TemplateBinding Background}" Margin="7" Grid.Row="1">
- <ContentPresenter x:Name="ContentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
- </Border>
- <!--******************************************************右下角 的透明三角形,控制伸缩***************************************-->
- <Path x:Name="Resizer" Data="M15.499995,0.5 L15.499995,15.5 L0.5,15.5 z" Fill="#FFB1B1B1"
- HorizontalAlignment="Right" Height="20" Opacity=".25" Grid.Row="1" Stretch="Fill" UseLayoutRounding="False"
- VerticalAlignment="Bottom" Width="20"/>
- </Grid>
- </Border>
- </Border>
- </Grid>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
FloatableWindowStyle.xaml
(5)简单地介绍一下如何设置一个控件的样式Style
首先设置一个标签<Style ></Style>,并设置一个x:Key,以作为引用的依据,并设置目标空间类型:TargetType。
利用如下的语句可以设置属性类型和属性值:
- <Setter Property="HorizontalContentAlignment" Value="Center"/>
通过自己的观察,可以研究其他类型的样式设计,比如色刷、渐变色等。
(三)引用控件的样式Style或样式文件
在“(一)(4)”中已经提到了资源字典文件ResourceDictionary的引用。此类文件,其实也是一种资源,与图片等资源的引用有些类似。
(1)比如,你在某一个工程下面设置了一个资源字典文件DropDownMenu.xaml,假如要在整个解决方案solution中引用,可以在App.xaml中做如下的引用
(2)如果开发者想在某一个控件中引用一个样式,可参考如下语句:
- <TextBlock x:Name="tbkNews" Style="{StaticResource menuTextBlockStyle}"
- MouseLeftButtonDown="tbkNews_MouseLeftButtonDown">
(3)如果给某一个窗口控件定义了样式,可参照如下的样式引用:
- <controls:ChildWindow.Style>
- <StaticResource ResourceKey="ChildWindowStyle"/>
- </controls:ChildWindow.Style>
小结一下,Silverlight支持界面的灵活设计,其与底层逻辑剥离,比较容易实现。同时资源字典文件和样式的使用可以大大提高已有界面的重用行,进而提高开发效率。而要获取某一个空间的资源文件,Blend会是一个很好的工具。所以,将Blend与资源字典文件结合使用,一定可以大大丰富界面,提升开发的进度。
Silverlight 样式的灵活使用的更多相关文章
- yii2的form表单样式怎么灵活控制呢?
<?php $form = ActiveForm::begin(['id' => 'login-form', 'fieldConfig'=>[ 'template'=> &qu ...
- (转) silverlight 样式学习
原文地址:http://www.cnblogs.com/Joetao/articles/2074727.html <UserControl x:Class="StyleDemo.Mai ...
- Silverlight样式定义
方法一.定义在控件内部 <Canvas Background="Red" Height="100" HorizontalAlignment="L ...
- Word样式教程
目录 写在前面 样式可以解决什么问题? 本文适合于 快速入门 一切皆样式 样式与格式的关系 如何修改样式 建立新的样式 样式的匹配和更新 根据样式更新所选段落 根据所选段落更新样式 小结 进一步了解 ...
- C# 6 与 .NET Core 1.0 高级编程 - 40 ASP.NET Core(上)
译文,个人原创,转载请注明出处(C# 6 与 .NET Core 1.0 高级编程 - 40 章 ASP.NET Core(上)),不对的地方欢迎指出与交流. 章节出自<Professiona ...
- Prism 4 文档 ---第8章 导航
作为同用户具有丰富的交互的客户端应用程序,它的用户界面(UI)将会持续不断的更新来反映用户工作的当前的任务和数据.用户界面可以进行一段时间相当大的变化作为用户交互的应用程序中完成各种任务.通过 ...
- AlloyRenderingEngine燃烧的进度条
写在前面 Github: https://github.com/AlloyTeam/AlloyGameEngine HTML 5新增了progress标签,那么再去使用AlloyRenderingEn ...
- CSS系列——前端进阶之路:初涉Less
前言:最近帮一个朋友解决点问题,在查看组件源码的时候涉及到了less语法,这可难倒博主了.没办法,既然用到就要学呗,谁让咱是无所不能的程序猿呢!所以今天来学习下Less,算是笔记,也希望给初学less ...
- java-excel导出
java excel导出分为两种2003年的格式和2007年的格式. 2003年的xls一个sheet限制65536. 2007年的xlsx限制为1048576. jxl导入2003 gradle j ...
随机推荐
- BZOJ 2521: [Shoi2010]最小生成树(最小割)
题意 对于某一条无向图中的指定边 \((a, b)\) , 求出至少需要多少次操作.可以保证 \((a, b)\) 边在这个无向图的最小生成树中. 一次操作指: 先选择一条图中的边 \((u, v)\ ...
- Netty如何实现Reactor模式
在前面的文章中(Reactor模型详解),我们讲解了Reactor模式的各种演变形式,本文主要讲解的则是Netty是如何实现Reactor模式的.这里关于Netty实现的Reactor模式,需要说明的 ...
- python3 fileinput模块
模块fileinput可以对一个或多个文件的内容所有行进行迭代.遍历等操作: 常用方法: fileinput.input(files=None, inplace=False, backup='', b ...
- 【CTSC2018】暴力写挂(边分治,虚树)
[CTSC2018]暴力写挂(边分治,虚树) 题面 UOJ BZOJ 洛谷 题解 发现第二棵树上的\(LCA\)的深度这玩意没法搞,那么枚举在第二棵树上的\(LCA\). 然后剩下的部分就是\(dep ...
- 「SPOJ6340」「BZOJ1939」ZUMA - ZUMA【记忆化搜索】
题目链接 [洛谷传送门] 题解 \(f[i][j][k]\)表示在消除了\((i,j)\),在后面加上了\(k\)个珠子的总的珠子数. 考虑三种决策:(题目给出的\(k\)在下文表示成\(K\)) 决 ...
- python 去重
List: listA = ['python','python','言','是','一','门','动','态','语','言'] print sorted(set(listA), key = lis ...
- VS编译LESS插件
1. LESS 用LESS写CSS可以用写程序代码的习惯写CSS.用了之后写CSS的效率会提高很多. 2.解释LESS 写出来的文件扩展名是.less,要运行的话,先解释成正常的CSS文件. 3. ...
- LaTex in Markdown
上次写了Markdown,这次用到了LaTex,也出一期(吐槽,工作量比Markdown高太多...) Markdown基础:https://www.cnblogs.com/dotnetcrazy ...
- 全文检索 -- Solr从概念到实战(一)
全文检索: 将整个文本进行“分词”处理,在索引库中为分词得到的每一个词都建立索引,和用户搜索的关键词进行匹配.实现快速查找效果. 传统sql语句实现的局限性: select song_id,song_ ...
- 《Java程序设计》 第一周学习总结
20175313 <Java程序设计>第一周学习总结 教材学习内容总结 了解Java的四个特点 学习JDK的安装以及系统环境变量的设置 掌握Java源文件命名.编译.运行 熟悉git的常用 ...