<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[diandiwang的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/foreverwy</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; foreverwy]]></copyright><item><title><![CDATA[css在不同设备上实现实现border-1px]]></title><link>https://blog.youkuaiyun.com/foreverwy/article/details/82251055</link><guid>https://blog.youkuaiyun.com/foreverwy/article/details/82251055</guid><author>foreverwy</author><pubDate>Fri, 31 Aug 2018 09:19:05 +0800</pubDate><description><![CDATA[
border-1px($color)
	position: relative
	&amp;amp;:after
		display: block
		position: absolute
		left: 0
		bottom: 0
		width: 100%
		border-top: 1px solid $color
		content: ' '
@media (-webkit-min-device-...]]></description><category></category></item><item><title><![CDATA[css生成三角]]></title><link>https://blog.youkuaiyun.com/foreverwy/article/details/82221892</link><guid>https://blog.youkuaiyun.com/foreverwy/article/details/82221892</guid><author>foreverwy</author><pubDate>Thu, 30 Aug 2018 15:16:36 +0800</pubDate><description><![CDATA[
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang=&quot;en&quot;&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta charset=&quot;UTF-8&quot; /&amp;gt;
&amp;lt;title&amp;gt;css生成三角&amp;lt;/title&amp;gt;
&amp;lt;style&amp;gt;
	body {
		background: #efefef;
	}
	.box {]]></description><category></category></item><item><title><![CDATA[0-1背包问题]]></title><link>https://blog.youkuaiyun.com/foreverwy/article/details/78206897</link><guid>https://blog.youkuaiyun.com/foreverwy/article/details/78206897</guid><author>foreverwy</author><pubDate>Wed, 11 Oct 2017 18:39:55 +0800</pubDate><description><![CDATA[给定容量为c的背包和n个物品，每个物品的重量为wi,每个物品的价值为vi。
应该如何选择装入背包的物品,让背包所能获得最大价值。
0-1背包问题的状态转移方程为f[i][j]=max{ f[i-1][j] , f[i-1][j-w[i]]+v[i]}

声明一个大小为f[n][c]的二维数组,f[i][j]表示在面对物品i时，前i-1件物品，在容量为j的背包里，所能获得的最大价值
二维数]]></description><category></category></item><item><title><![CDATA[js-es6-Map数据结构]]></title><link>https://blog.youkuaiyun.com/foreverwy/article/details/78157695</link><guid>https://blog.youkuaiyun.com/foreverwy/article/details/78157695</guid><author>foreverwy</author><pubDate>Wed, 04 Oct 2017 11:41:09 +0800</pubDate><description><![CDATA[字典：是用来存储不重复key的Hash结构。不同于集合(Set)的是，字典使用的是[键，值]的形式来储存数据的。 * 
JavaScript 的对象（Object:{}）只能用字符串当作键。这给它的使用带来了很大的限制。为了解决这个问题，ES6提供了Map数据结构。它类似于对象，也是键值对的集合，但是“键”的范围不限于字符串，各种类型的值（包括对象）都可以当作键。也就是说，Object结构提供了]]></description><category></category></item><item><title><![CDATA[js-es6-set数据结构]]></title><link>https://blog.youkuaiyun.com/foreverwy/article/details/78157613</link><guid>https://blog.youkuaiyun.com/foreverwy/article/details/78157613</guid><author>foreverwy</author><pubDate>Wed, 04 Oct 2017 11:15:38 +0800</pubDate><description><![CDATA[集合的基本概念：集合是由一组无序且唯一（即不能重复）的项组成的。这个数据结构使用了与有限集合相同的数学概念，应用在计算机的数据结构中。
特点：key 和 value 相同，没有重复的 value。
数据结构 Set,它类似于数组，但是成员的值都是唯一的，没有重复的值。

1.创建Set  传入的参数放在数组里
let s1=new Set();
let s2=new Set([1,2,3]]></description><category></category></item><item><title><![CDATA[js-es6-Symbol新增的数据类型]]></title><link>https://blog.youkuaiyun.com/foreverwy/article/details/78157482</link><guid>https://blog.youkuaiyun.com/foreverwy/article/details/78157482</guid><author>foreverwy</author><pubDate>Wed, 04 Oct 2017 10:36:05 +0800</pubDate><description><![CDATA[1 什么是 Symbol ? Symbol，表示独一无二的值。它是 JS 中的第七种数据类型

let s1 = Symbol();
let s2 = Symbol();
console.log(s1===s2);//false
注意
Symbol 函数前不能使用 new 否则会报错，原因在于Symbol 是一个原始类型的值，不是对象。
Symbol 可以接收一个字符串作为参数，表示对S]]></description><category></category></item><item><title><![CDATA[js-es6-变量的解构赋值]]></title><link>https://blog.youkuaiyun.com/foreverwy/article/details/78156776</link><guid>https://blog.youkuaiyun.com/foreverwy/article/details/78156776</guid><author>foreverwy</author><pubDate>Tue, 03 Oct 2017 23:00:35 +0800</pubDate><description><![CDATA[本质上就是一种匹配模式，只要等号两边的模式相同，那么左边的变量就可以 被赋予对应的值。
 结构赋值主要分为：
    1 数组的解构赋值
    2 对象的结构赋值
    3 基本类型的解构赋值
数组的结构赋值

let [a, b, c] = [1, 2, 3];
console.log(a, b, c);//1,2,3let [a, [[b], c]] = [1, [[2],]]></description><category></category></item><item><title><![CDATA[js-es6-对象扩展]]></title><link>https://blog.youkuaiyun.com/foreverwy/article/details/78156680</link><guid>https://blog.youkuaiyun.com/foreverwy/article/details/78156680</guid><author>foreverwy</author><pubDate>Tue, 03 Oct 2017 22:36:58 +0800</pubDate><description><![CDATA[更简洁的表示法

let a=1;
let obj={a};
console.log(obj)//{a: 1}const obj={
	fn:function(){
		console.log('old');
	},
	fn2(){
		console.log('new');
	}
}
obj.fn();//old
obj.fn2();//new

属性表达式

let a='b';]]></description><category></category></item><item><title><![CDATA[js-es6-函数扩展]]></title><link>https://blog.youkuaiyun.com/foreverwy/article/details/78156482</link><guid>https://blog.youkuaiyun.com/foreverwy/article/details/78156482</guid><author>foreverwy</author><pubDate>Tue, 03 Oct 2017 21:47:45 +0800</pubDate><description><![CDATA[参数默认值
function foo(x=2,y=5){
	console.log('x :'+x,'y :'+y);
}
foo();//x :2 y :5
foo(3);//x :3 y :5
foo(3,4);//x :3 y :4注意默认值后面不可以再有不是默认值的变量，前面可以有不是默认值的变量
function foo(x,y=5){
	console.log('x :'+x,'y]]></description><category></category></item><item><title><![CDATA[js-es6-数组扩展]]></title><link>https://blog.youkuaiyun.com/foreverwy/article/details/78156219</link><guid>https://blog.youkuaiyun.com/foreverwy/article/details/78156219</guid><author>foreverwy</author><pubDate>Tue, 03 Oct 2017 20:47:48 +0800</pubDate><description><![CDATA[Array.of()  创建数组
let arr=Array.of(3,4,5);
console.log(arr);//[3, 4, 5]
let empty=Array.of();
console.log(empty);//[]


Array.from()  把伪数组或者集合转换成数组

var aLi=document.getElementsByTagName('li');
c]]></description><category></category></item><item><title><![CDATA[js-es6-数值扩展]]></title><link>https://blog.youkuaiyun.com/foreverwy/article/details/78156072</link><guid>https://blog.youkuaiyun.com/foreverwy/article/details/78156072</guid><author>foreverwy</author><pubDate>Tue, 03 Oct 2017 20:16:41 +0800</pubDate><description><![CDATA[二进制以0b开头，b可小写也可以大写
console.log(0b1111);//15
八进制以0o开头，o字母可小写也可大写
console.log(0o10);//16
Number.isFinite() 判断一个数是不是有尽的，若是有尽的返回true，否则返回false
console.log(Number.isFinite(15));//true
console.log(Numb]]></description><category></category></item><item><title><![CDATA[js-字符串扩展]]></title><link>https://blog.youkuaiyun.com/foreverwy/article/details/78155908</link><guid>https://blog.youkuaiyun.com/foreverwy/article/details/78155908</guid><author>foreverwy</author><pubDate>Tue, 03 Oct 2017 19:35:08 +0800</pubDate><description><![CDATA[一般方法
includes()   判断字符串是否包含指定的字符或字符串  返回布尔值
let str='string';
console.log(str.includes('str'));//true
console.log(str.includes('sr'));//false




startsWith()  判断字符串是否已指定的字符串开始，返回布尔值
let str=']]></description><category></category></item><item><title><![CDATA[css-响应式布局]]></title><link>https://blog.youkuaiyun.com/foreverwy/article/details/78151189</link><guid>https://blog.youkuaiyun.com/foreverwy/article/details/78151189</guid><author>foreverwy</author><pubDate>Mon, 02 Oct 2017 15:24:23 +0800</pubDate><description><![CDATA[响应式媒体类型
                   all所有媒体
                   braille盲文触觉设备
                   embossed盲文打印机
                   print手持设备
                   projection打印预览
                   screen彩屏设备]]></description><category></category></item><item><title><![CDATA[css-弹性盒模型]]></title><link>https://blog.youkuaiyun.com/foreverwy/article/details/78151174</link><guid>https://blog.youkuaiyun.com/foreverwy/article/details/78151174</guid><author>foreverwy</author><pubDate>Mon, 02 Oct 2017 15:21:13 +0800</pubDate><description><![CDATA[新版盒模型
作用于父元素
display:box
flex-direction:（主轴方向设置）
    row 设置主轴方向为水平方向
   column 设置主轴方向为为垂直方向
主轴元素上元素的排列顺序
row-reverse  设置主轴方向为水平方向，元素排列为反向
column-reverse 设置主轴方向为垂直方向，元素排列为反向
justify-content:主轴]]></description><category></category></item><item><title><![CDATA[js直接插入排序]]></title><link>https://blog.youkuaiyun.com/foreverwy/article/details/78151108</link><guid>https://blog.youkuaiyun.com/foreverwy/article/details/78151108</guid><author>foreverwy</author><pubDate>Mon, 02 Oct 2017 15:10:47 +0800</pubDate><description><![CDATA[function insertSort(arr){
	for(var i=1;i<arr.length;i++){
		var j=i;
		while(j>0&&arr[j]<arr[j-1]){
			var t=arr[j];
			arr[j]=arr[j-1];
			arr[j-1]=t;
			j--;
		}
	}
	return arr;
}]]></description><category></category></item><item><title><![CDATA[js冒泡排序]]></title><link>https://blog.youkuaiyun.com/foreverwy/article/details/78151084</link><guid>https://blog.youkuaiyun.com/foreverwy/article/details/78151084</guid><author>foreverwy</author><pubDate>Mon, 02 Oct 2017 15:05:57 +0800</pubDate><description><![CDATA[function bubbleSort(arr){
	for(var i=0;i<arr.length;i++){
		var flag=true;
		for(var j=0;j<arr.length-i-1;j++){
			if(arr[j]>arr[j+1]){
				var t=arr[j];
				arr[j]=arr[j+1];
				arr[j+1]=t;
				flag=]]></description><category></category></item><item><title><![CDATA[js选择排序]]></title><link>https://blog.youkuaiyun.com/foreverwy/article/details/78151065</link><guid>https://blog.youkuaiyun.com/foreverwy/article/details/78151065</guid><author>foreverwy</author><pubDate>Mon, 02 Oct 2017 15:00:47 +0800</pubDate><description><![CDATA[function selectSort(arr){
	for(var i=0;i<arr.length;i++){
		var min=i;
		for(var j=i+1;j<arr.length;j++){
			if(arr[j]<arr[min]){
				min=j;
			}
		}
		if(min!=i){
			var t=arr[min];
			arr[min]=arr[i]]></description><category></category></item><item><title><![CDATA[js统计字符串出现的频率]]></title><link>https://blog.youkuaiyun.com/foreverwy/article/details/78151033</link><guid>https://blog.youkuaiyun.com/foreverwy/article/details/78151033</guid><author>foreverwy</author><pubDate>Mon, 02 Oct 2017 14:51:51 +0800</pubDate><description><![CDATA[var str='asiisaosdissaidisdhfui';
var arr=str.split('');
str=arr.sort().join('');
var value=[];
var index=0;
var re=/(\w)\1*/g;
str.replace(re,function($0,$1){
	// alert($0);
	// alert($1);
	if(index<]]></description><category></category></item><item><title><![CDATA[js数组去重]]></title><link>https://blog.youkuaiyun.com/foreverwy/article/details/78151021</link><guid>https://blog.youkuaiyun.com/foreverwy/article/details/78151021</guid><author>foreverwy</author><pubDate>Mon, 02 Oct 2017 14:48:18 +0800</pubDate><description><![CDATA[function removeSame(arr){
	var arr2=[arr[0]];
	for(var i=1;i<arr.length;i++){
		if(arr2.indexOf(arr[i])==-1){
			arr2.push(arr[i]);
		}
	}
	return arr2;
}function removeSame(arr){
	var obj={};
	for(va]]></description><category></category></item><item><title><![CDATA[js表单序列化]]></title><link>https://blog.youkuaiyun.com/foreverwy/article/details/78151011</link><guid>https://blog.youkuaiyun.com/foreverwy/article/details/78151011</guid><author>foreverwy</author><pubDate>Mon, 02 Oct 2017 14:46:19 +0800</pubDate><description><![CDATA[function serialize(form){
	var parts=[],
		field=null,
		i,len,j,optLen,option,optValue;
	for(i=0,len=form.elements.length;i<len;i++){
		field=form.elements[i];
		switch(field.type){
			case :'select-]]></description><category></category></item></channel></rss>