[Aaronyang] 写给自己的WPF4.5 笔记15[AyArc诞生-WPF版本绚丽的环状图,Ay制作,AyWindow强势预览]
原文:[Aaronyang] 写给自己的WPF4.5 笔记15[AyArc诞生-WPF版本绚丽的环状图,Ay制作,AyWindow强势预览]
我的文章一定要做到对读者负责,否则就是失败的文章 --------- www.ayjs.net aaronyang技术分享
Ay.Framework.WPF-AyWindow强势预览,点击前往
1. AyArcChart效果图:DEMO下载
2. 使用用法:
新建一个WPF项目AyArcChartDemo,并拷贝AyArcChart用户控件xaml,由于我使用的是Arc控件,所以我们还需要引入Expression的部分dll
2.1 绝佳第一次使用
讲解几个ayarc重要的属性
ArcSource指定一个 ObservableCollection<AyArcModel>的数据源
ArcThickness指定环形的宽度,默认为16。double类型
ArcMarginLeft指定环形的间距,建议最大值为5,默认值等于1。double类型
ArcWidth指定环形的宽度和高度,环形宽度是等于高度的,默认等于200。 double类型
TipFontSize内部提示的字体大小 FontSize类型
TipFontWeight内部提示的字体厚度 FontWeight类型
我们在后台创建一个数据源,指定在窗体加载时候Loaded
using Ay.Framework.WPF.Controls;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes; namespace AyArcChartDemo
{
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
} List<string> co = new List<string> { "#7EDD7A", "#23E3FD", "#F16A6A", "#F98F56", "#888788" };
List<string> names = new List<string> { "偏冷", "舒适", "偏热", "很好" };
List<double> values = new List<double> { , , , , };
BrushConverter converter = new BrushConverter();
ObservableCollection<AyArcModel> a = new ObservableCollection<AyArcModel>();
private void Window_Loaded(object sender, RoutedEventArgs e)
{
for (int i = ; i < ; i++)
{
AyArcModel m = new AyArcModel();
m.NameValue = values[i];
m.Color = (Brush)converter.ConvertFromString(co[i]);
m.Name = names[i];
a.Add(m);
}
arc.ArcSource = a; }
}
}
前台代码(www.ayjs.net):
<Window x:Class="AyArcChartDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Ay 环形图DEMO www.ayjs.net" Height="450" Width="650"
xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
xmlns:us="clr-namespace:Ay.Framework.WPF.Controls" Loaded="Window_Loaded" WindowStartupLocation="CenterScreen"
>
<Grid x:Name="LayoutRoot">
<Grid Width="220" Height="220">
<us:AyArcChart x:Name="arc" ArcThickness="18" ArcMarginLeft="1" ArcWidth="200" TipFontSize="16" TipFontWeight="Bold"> </us:AyArcChart>
</Grid>
</Grid>
</Window>
效果图:
OK到目前为止,你已经会基本使用AyArcChart了
接下来,我们来看看实时更新集合中的value值,看看AyArcChart有什么变化
我们增加一个定时器,1秒一次更新集合中对象的NameValue值
前台增加一个自动更新按钮btnUpdateAuto,添加单击事件btnUpdateAuto_Click
<Window x:Class="AyArcChartDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Ay 环形图DEMO www.ayjs.net" Height="450" Width="650"
xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
xmlns:us="clr-namespace:Ay.Framework.WPF.Controls" Loaded="Window_Loaded" WindowStartupLocation="CenterScreen"
>
<Grid x:Name="LayoutRoot">
<Grid Width="220" Height="220">
<us:AyArcChart x:Name="arc" ArcThickness="18" ArcMarginLeft="1" ArcWidth="200" TipFontSize="16" TipFontWeight="Bold"> </us:AyArcChart>
</Grid>
<StackPanel>
<StackPanel Orientation="Horizontal">
<Button Content="自动更新" HorizontalAlignment="Left" VerticalAlignment="Top" Width="100" Height="25" Click="btnUpdateAuto_Click" x:Name="btnUpdateAuto"/>
</StackPanel>
</StackPanel> </Grid>
</Window>
后台:
private void Window_Loaded(object sender, RoutedEventArgs e)
{
for (int i = ; i < ; i++)
{
AyArcModel m = new AyArcModel();
m.NameValue = values[i];
m.Color = (Brush)converter.ConvertFromString(co[i]);
m.Name = names[i];
a.Add(m);
}
arc.ArcSource = a;
UpdateDataTimer = new System.Windows.Threading.DispatcherTimer();
UpdateDataTimer.Tick += new EventHandler(UpdateDataTime);//起个Timer一直获取当前时间
UpdateDataTimer.Interval = new TimeSpan(, , , , );
} private void UpdateDataTime(object sender, EventArgs e)
{
Random suiji = new Random();
a[].NameValue = suiji.Next(, );
a[].NameValue = suiji.Next(, );
a[].NameValue = suiji.Next(, );
a[].NameValue = suiji.Next(, );
} private void btnUpdateAuto_Click(object sender, EventArgs e)
{
if (UpdateDataTimer.IsEnabled)
{
UpdateDataTimer.Stop();
btnUpdateAuto.Content = "自动更新";
}
else
{ UpdateDataTimer.Start();
btnUpdateAuto.Content = "取消自动更新";
}
}
现在1秒1次更新集合中4个对象的namevalue中,界面上arc自动就动画方式的调节百分比比例了。
接下来,我们增加随机颜色,前台增加一个按钮btnColorChanged,并增加一个单击事件
<Button Content="随机颜色" HorizontalAlignment="Left" VerticalAlignment="Top" Width="100" Height="25" x:Name="btnColorChanged" Click="btnColorChanged_Click"/>
后台
private void btnColorChanged_Click(object sender, RoutedEventArgs e)
{
Random rd = new Random();
for (int i = ; i < ; i++)
{
//byte aa = (byte)rd.Next(256);
byte r = (byte)rd.Next();
byte g = (byte)rd.Next();
byte b = (byte)rd.Next();
//Color cr = Color.FromArgb(aa, r, g, b);
Color cr = Color.FromRgb(r, g, b);
var brush = new SolidColorBrush(cr);
a[i].Color = brush;
} }
效果图:
OK,到目前你就心动了,你就out了,还有,我增加了环形宽度变化的动画
接下来,我们再增加几个文本框,来调整AyArcChart的属性
<StackPanel>
<StackPanel Orientation="Horizontal">
<Button Content="自动更新" HorizontalAlignment="Left" VerticalAlignment="Top" Width="100" Height="25" Click="btnUpdateAuto_Click" x:Name="btnUpdateAuto"/>
<Button Content="随机颜色" HorizontalAlignment="Left" VerticalAlignment="Top" Width="100" Height="25" x:Name="btnColorChanged" Click="btnColorChanged_Click"/>
</StackPanel> <StackPanel Orientation="Horizontal" Height="40" >
<Label Content="环形宽度:" VerticalAlignment="Center"/>
<TextBox VerticalContentAlignment="Center" Height="24" TextWrapping="Wrap" Text="{Binding ArcThickness,ElementName=arc,Mode=TwoWay}" VerticalAlignment="Center" Width="43"/>
<Label Content="边框间距:" VerticalAlignment="Center"/>
<TextBox VerticalContentAlignment="Center" Height="24" TextWrapping="Wrap" Text="{Binding ArcMarginLeft,ElementName=arc,Mode=TwoWay}" VerticalAlignment="Center" Width="32"/>
<Label Content="中间字号:" VerticalAlignment="Center"/>
<TextBox VerticalContentAlignment="Center" Height="24" TextWrapping="Wrap" Text="{Binding TipFontSize, ElementName=arc, Mode=TwoWay}" VerticalAlignment="Center" Width="32"/>
<Label Content="中间粗细:" VerticalAlignment="Center"/>
<ComboBox x:Name="cboFontWeights" Height="22" Width="83" VerticalAlignment="Center"/>
</StackPanel>
</StackPanel>
接下来,后台的窗体的Loaded事件时候绑定cboFontWeights的下拉值
cboFontWeights.Items.Add(FontWeights.Black);
cboFontWeights.Items.Add(FontWeights.Bold);
cboFontWeights.Items.Add(FontWeights.DemiBold);
cboFontWeights.Items.Add(FontWeights.ExtraBlack);
cboFontWeights.Items.Add(FontWeights.ExtraBold);
cboFontWeights.Items.Add(FontWeights.ExtraLight);
cboFontWeights.Items.Add(FontWeights.Heavy);
cboFontWeights.Items.Add(FontWeights.Light);
cboFontWeights.Items.Add(FontWeights.Medium);
cboFontWeights.Items.Add(FontWeights.Regular);
cboFontWeights.Items.Add(FontWeights.SemiBold);
cboFontWeights.Items.Add(FontWeights.Thin);
cboFontWeights.Items.Add(FontWeights.UltraBlack);
cboFontWeights.Items.Add(FontWeights.UltraBold);
cboFontWeights.Items.Add(FontWeights.Normal);
cboFontWeights.Items.Add(FontWeights.UltraLight);
cboFontWeights.SelectedItem = FontWeights.Normal;
修改AyArcChart的TipFontWeight属性,绑定这个下拉框
<us:AyArcChart x:Name="arc" ArcThickness="30" ArcMarginLeft="1" ArcWidth="200" TipFontSize="16" TipFontWeight="{Binding ElementName=cboFontWeights,Path=SelectedValue,Mode=TwoWay}"> </us:AyArcChart>
效果图:
OK,现在我说下,我AyArcChart诞生的过程
1.当时我借用Arc这个控件,试图调整StartAngle,EndAngle的属性,OK,指定弧度的环就出来了,我使用了ArcThickness控制了每个环的宽度
2.第一步,我是用了Grid,然后Grid中放置了4个Arc,分别调整了颜色Arc的Fill属性,厚度,重点要设置 Stretch="None"
<ed:Arc ArcThickness="{Binding ArcThickness,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl}}"
StartAngle="{Binding StartAngle}" x:Name="ayarc"
EndAngle="{Binding EndAngle}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Stretch="None"
Fill="{Binding Color}"
>
首先我们就因此手动尝试做一个静态的ArcChart,但是如何让每个Arc都动画的方式过渡StartAngle,EndAngle值呢,以及如何计算百分比,我当然喜欢用户提供一个数据集合,例如a,b,c 那么先求和,然后每个数除以和再乘以360就得到最终的角度。ok,我设置了起始度数为10,所以第一个arc的StartAngle就是10,假如EndAngle是70,那么常规,下一个arc的起始角度就是 70,然后EndAngle假如是180,那么下一个角度就是180到370(算出来的度数+起始度数)
ok有人问我间距怎么出来了,我设置了一个变量ArcMarginLeft,我只要算出起始角度,然后 ArcMarginLeft+起始角度+算出来的起始角度,就是新的起始角度,但是结束角度应该是起始角度(不包含ArcMarginLeft的值),这是每个arc的起始角度就会少了一点,出现了间距。
=============潇洒的版权线==========www.ayjs.net===== Aaronyang ========= AY =========== 安徽 六安 杨洋 ========== 未经允许不许转载 =========
ok,为了使用户可以提供ObservableCollection<AyArcModel>,我肯定前台要使用能有指定集合数据的ItemsControl的控件,我选择了Listbox,接着我将容器设置成了Grid
<ListBox Name="arcContainer" Background="Transparent" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<Grid Background="Transparent" x:Name="mainLayout" Width="{Binding ArcWidth,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl}}" Height="{Binding ArcWidth,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl}}"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
并绑定了宽高,这里有个技巧,我设置了背景色为transparent,因为grid后,所有的item都会叠在一个层次上面,盖在了一起,为了让里面的内容可以单击,我必须设置成transparent,接着一个技巧,使用DataTemplate指定数据类型,如此绑定后,只要是这个类型的,就会应用模板
<ListBox.Resources>
<DataTemplate DataType="{x:Type arc:AyArcModel}">
<Grid>
<ed:Arc ArcThickness="{Binding ArcThickness,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl}}"
StartAngle="{Binding StartAngle}" x:Name="ayarc"
EndAngle="{Binding EndAngle}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Stretch="None"
Fill="{Binding Color}"
>
<ed:Arc.ToolTip>
<ToolTip>
<Border Background="White" Margin="-6,-4" Padding="10">
<StackPanel Orientation="Horizontal">
<TextBlock Foreground="{Binding Color}" FontWeight="{Binding TipFontWeight,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl}}" HorizontalAlignment="Right" FontSize="20" Text="{Binding Name}">
</TextBlock>
<TextBlock Grid.Column="1" FontWeight="{Binding TipFontWeight,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl}}" FontSize="20">
<TextBlock.Text>
<MultiBinding StringFormat=":{0}%">
<Binding Path="Percent"></Binding>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</StackPanel>
</Border>
</ToolTip>
</ed:Arc.ToolTip>
</ed:Arc> </Grid>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor,
AncestorType={x:Type ListBoxItem}}, Path=IsMouseOver}" Value="True">
<DataTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource ArcHoverOn}"/>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource ArcHoverOff}"/>
</DataTrigger.ExitActions>
</DataTrigger> </DataTemplate.Triggers>
</DataTemplate>
</ListBox.Resources>
还有个技巧,如何在DataTemplate中知道item的鼠标移入了,我是用了DataTrigger的Binding,找到父节点,找到ListBoxItem,然后判断属性,接着执行透明度的过渡动画,并且提示,我是用了ToolTip,中嵌套了Border,设置margin,覆盖原来的tooltip的背景色,然后padding,给内容设置边距。这里ToolTip的颜色改变没啥好讲的。
接着如何让Item有动画效果?
我在用户控件的loaded事件中。
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
arcContainer.ItemsSource = ArcSource;
arcContainerTip.ItemsSource = ArcSource;
base.UpdateLayout();
ExecuteDataChangedAnimation();
}
private void ExecuteDataChangedAnimation()
{
CircleEase ce = new CircleEase();
ce.EasingMode = EasingMode.EaseOut;
for (int i = ; i < arcContainer.Items.Count; i++)
{
ListBoxItem listitem = (ListBoxItem)(arcContainer.ItemContainerGenerator.ContainerFromItem(arcContainer.Items[i]));
AyArcModel am = ArcSource[i];
Arc myarc = GetChild<Arc>(listitem); DoubleAnimationUsingKeyFrames dakeyframe1 = new DoubleAnimationUsingKeyFrames();
Storyboard.SetTarget(dakeyframe1, myarc);
Storyboard.SetTargetProperty(dakeyframe1, new PropertyPath("StartAngle"));
EasingDoubleKeyFrame ed1 = new EasingDoubleKeyFrame(am.StartAnimationAngle, KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds()), ce);
dakeyframe1.KeyFrames.Add(ed1);
DoubleAnimationUsingKeyFrames dakeyframe = new DoubleAnimationUsingKeyFrames();
Storyboard.SetTarget(dakeyframe, myarc);
Storyboard.SetTargetProperty(dakeyframe, new PropertyPath("EndAngle"));
EasingDoubleKeyFrame ed = new EasingDoubleKeyFrame(am.EndAnimationAngle, KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds()), ce);
dakeyframe.KeyFrames.Add(ed);
sbLoad.Children.Add(dakeyframe1);
sbLoad.Children.Add(dakeyframe);
}
sbLoad.Begin();
}
=============潇洒的版权线==========www.ayjs.net===== Aaronyang ========= AY =========== 安徽 六安 杨洋 ========== 未经允许不许转载 =========
读取ListBox的Item,由于默认Item是拿不到的,我们使用base.UpdateLayout();先强制绘制,然后Item就可以拿到了,接着找到Arc,并绑定动画就Ok了,所以动画绑定完成后,故事版Begin一下,就会出现Arc的角度的过渡动画了。
还有个技巧,依赖属性的值变化回调函数
public static readonly DependencyProperty ArcThicknessProperty =
DependencyProperty.Register("ArcThickness", typeof(double), typeof(AyArcChart), new PropertyMetadata(16.00, BindArcThicknessAnimation)); public static bool IsArcFirst = true;
private static void BindArcThicknessAnimation(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (!IsArcFirst)
{
AyArcChart aychart = (AyArcChart)d;
double newArcThickness = (double)e.NewValue;
aychart.StoryWhenArcThickChanged((double)e.OldValue, newArcThickness);
}
else
{
IsArcFirst = false;
}
例如宽度变化后,触发了BindArcThicknessAnimation回调函数,这里我没有直接写故事版,应为这里的回调函数是个static的方法
所以如果在这里写动画代码,就会很累,索性我就重新写了个方法,然后将d转换成控件,然后调用d的那个新定义的方法就OK了。避免了静态方法的问题。
最后一个问题是
BrushConverter converter = new BrushConverter();
可以通过这个自带的转换器,转换十六进制的颜色为color对象
Color = (Brush)converter.ConvertFromString("#000000");
=============潇洒的版权线==========www.ayjs.net===== Aaronyang ========= AY =========== 安徽 六安 杨洋 ========== 未经允许不许转载 =========
-------------------小小的推荐,作者的肯定,读者的支持。推不推荐不重要,重要的是希望大家能把WPF推广出去,别让这么好的技术消失了,求求了,让我们为WPF技术做一份贡献。--------------------
关于AyArcChart的控件,我已经封装到Ay.Framework.WPF类库中,Ay.Framework.WPF我已经做出了很多优秀的封装
我来秀秀我的AyWindow控件,AyPopUpWindow
AyContextMenu
AyMenu
AyFontRadioButton
AyButton,支持图标指定,位置指定,使用的FontAwesome第三方字体
高清图片
支持全系统换主题,支持全系统所有打开窗口动画方式过渡背景,过渡窗体内容,支持24种过渡动画,支持窗体出场和入场动画,所有控件样式和颜色分离
支持多屏幕拓展,一键方法绑定。可投影到指定屏幕。
支持时间自定义控件,支持多种格式,是否显示周几。
排版支持多种控件。还有一些未完成控件,先写到这里,祝大家晚安。
[Aaronyang] 写给自己的WPF4.5 笔记15[AyArc诞生-WPF版本绚丽的环状图,Ay制作,AyWindow强势预览]的更多相关文章
- [Aaronyang] 写给自己的WPF4.5 笔记13[二维自定义控件技巧-可视化状态实战,自定义容器,注册类命令,用户控件补充]
我的文章一定要做到对读者负责,否则就是失败的文章 --------- www.ayjs.net aaronyang技术分享 博文摘要:欢迎大家来支持我的<2013-2015 Aar ...
- [Aaronyang] 写给自己的WPF4.5 笔记19[Visual类图文并茂讲解]
文章虽小,内容还好,且看且珍惜. aaronyang版权所有,不许转载,违者必究 当界面上使用数千个矢量图形,例如实时统计图,粒子碰撞,比如超级玛丽游戏,图像一直在绘,过量的使用WPF的元素系统和Sh ...
- [Aaronyang] 写给自己的WPF4.5 笔记23 [3d交互与动画 4/4]
效果图预览: 1. 3d中的命中测试 我新建了一个空的窗口,用zam做了一个长方体,深度很小.然后导出xaml <Viewport3D x:Name="ZAM3DViewport3D& ...
- [Aaronyang] 写给自己的WPF4.5 笔记[2依赖属性]
人生的意义不在于拿一手好牌,而在于打好一手坏牌 --Aaronyang的博客(www.ayjs.net)-www.8mi.me =============时隔两年后再看WPF========== 因为 ...
- [Aaronyang] 写给自己的WPF4.5 笔记24 [与winform交互-flash-DEMO-收尾篇1/6]
=====潇洒的版权线======www.ayjs.net===== Aaronyang ===== AY ====== 安徽 六安 杨洋 ====== 未经允许不许转载 ====== 1.新 ...
- [Aaronyang] 写给自己的WPF4.5 笔记[3MenuItem中的icon]
敢于尝试,就等于你已经向成功迈出了第一步 --Aaronyang的博客(www.ayjs.net)-www.8mi.me =============时隔两年后再看WPF========== 因为以前的 ...
- [Aaronyang] 写给自己的WPF4.5 笔记[1布局]
挫折时,要像大树一样,被砍了,还能再长:也要像杂草一样,虽让人践踏,但还能勇敢地活下去 --Aaronyang的博客(www.ayjs.net)-www.8mi.me =============时隔两 ...
- [Aaronyang] 写给自己的WPF4.5 笔记9[复杂数据处理三步曲,数据展示ListView泪奔2/3]
我的文章一定要做到对读者负责,否则就是失败的文章 --------- www.ayjs.net aaronyang技术分享 作者留言: 小小的推荐,作者的肯定,读者的支持. ...
- [Aaronyang] 写给自己的WPF4.5 笔记8[复杂数据处理三步曲,数据视图精讲1/3]
真的好累了 ,笑了.做回自己吧 ------------- Aaronyang技术分享 www.ayjs.net 博文摘要: 详细介绍了WPF中视图的种类和开始学之前的准备工作 ...
随机推荐
- 关于静态与动态编译arm平台程序的比較
因为近期弄个console程序,调用了readline,ncurses库,这两个动态库加起来有四百多k.而程序事实上非常小,其它地方也没使用到这两个库 所以想静态编译看看console程序有多大. # ...
- 淘宝分布式 key/value 存储引擎Tair安装部署过程及Javaclient測试一例
文件夹 1. 简单介绍 2. 安装步骤及问题小记 3. 部署配置 4. Javaclient測试 5. 參考资料 声明 1. 以下的安装部署基于Linux系统环境:centos 6(64位),其他Li ...
- Cocos2d-X研究之v3.x瓦片地图具体解释
在游戏开发过程中,我们会遇到超过屏幕大小的地图,比如即时战略游戏,使得玩家能够在地图中滚动游戏画面.这类游戏一般会有丰富的背景元素,假设直接使用背景图切换的方式,须要为每一个不同的场景准备一张背景图, ...
- 程序猿进化 - 在拉钩子1024对APE节讲座计划
注意:下面这篇文章来自于我在网上拉勾1024对APE节现场演示程序. 我是蒋宇捷,信天创投的合伙人.之前是百度魔图的联合创始人. 我先做个自我介绍,事实上每次介绍自己事实上是非常痛苦的事情,由于我前不 ...
- 关于LIST.Select().ToList()慢的问题
var sendlist = emailList.Select(email => new MailMessage { MailServer = SMTPServer, UserName = Se ...
- 转载:PHP时间戳 strtotime()使用方法和技巧
在php中我想要获取时间戳有多种方法,最常用的就是使用time函数与strtotime()函数把日期转换成时间戳了 获取指定的年月日转化为时间戳:pHP时间戳函数获取指定日期的unix时间戳 strt ...
- HTML5学习笔记简明版(11):新API
HTMLDocument上的扩展 HTML5在DOM Level 2 HTML上扩展了一些HTMLDocument的接口. 这些接口在全部实现了Document接口的元素对象上进行了实现.HTML5在 ...
- MySQL和Oracle开发差异
1) 数据类型差异 Oracle MySQL 注释 单独创建序列来实现 自动增长的数据类型 varchar2 varchar number tinyint,smallint,mediumint,in ...
- 【JUnit4.10来源分析】0导航
JUnit靠GOF 中的一个Erich Gamma和 Kent Beck 单元测试框架编写一个开源,yqj2065分析JUnit的主要目的是源 中学习对设计模式的运用. JUnit也是一个学习Java ...
- hdu 4268 Alice and Bob(multiset|段树)
Alice and Bob Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) T ...