ES6可以使用“箭头”(=>)定义函数,注意是函数,不要使用这种方式定义类(构造器)。一、语法1.具有一个参数的简单函数var single = a => asingle('hello, world') // 'hello, world' 2.没有参数的需要用在箭头前加上小括号var log = ....
分类:
其他好文 时间:
2015-04-08 19:34:30
阅读次数:
129
一·单一职责原则(Single-ResponsibilityPrinciple) 定义:一个对象应该只包含单一的职责,并且该职责被完整地封装在一个类中。 宿舍里并不能好好学习,自习还是得去图书馆。这是一条颠扑不破的真理!被无数学子千百次的实践所证明!我就想不通了,宿舍里有桌有椅,能上床小睡...
分类:
其他好文 时间:
2015-04-08 12:44:13
阅读次数:
165
异或满足交换律,结合律任何数X^X=0,X^0=X自反性 A XOR B XOR B = A xor 0 = A设有A,B两个变量,存储的值分别为a,b,则以下三行表达式将互换他们的值 表达式 (值) :A=A XOR B (a XOR b)B=B XOR A (b XOR a XOR b = a)...
分类:
其他好文 时间:
2015-04-08 10:51:53
阅读次数:
138
Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (including th...
分类:
其他好文 时间:
2015-04-08 06:33:45
阅读次数:
123
S.O.L.I.D是面向对象设计和编程(OOD&OOP)中几个重要编码原则(Programming Priciple)的首字母缩写。SRPThe Single Responsibility Principle单一责任原则OCPThe Open Closed Principle开放封闭原则LSPThe...
分类:
其他好文 时间:
2015-04-07 23:15:39
阅读次数:
250
设计模式:解决某一类问题最行之有效的方法,java中有23种设计模式一、单例设计模式概述: 1、解决一个类在内存中只有一个对象(保证一个类仅有一个实例,并提供一个访问他的全局访问点) 2、要保证对象的唯一: 1.为了避免其他程序过多的建立该类对象,先禁制其他程序建立该类对象 ...
分类:
编程语言 时间:
2015-04-07 23:05:05
阅读次数:
252
从今天模仿《从零单排》系列,菜鸡单刷LeetCode!...
分类:
其他好文 时间:
2015-04-07 19:44:12
阅读次数:
100
Implement wildcard pattern matching with support for'?'and'*'.'?' Matches any single character.'*' Matches any sequence of characters (including the e...
分类:
其他好文 时间:
2015-04-07 07:09:42
阅读次数:
441
一些初学者经常在使用autoLayout时,做得效果不太理想,经常会出现界面错乱的情况。本文章用一个小实例说明autoLayout的使用非常的简单,只要记住 规则就可以使界面适屏布局,适配各种iphone手机的屏幕1.新建一个swift项目(以Single View Application模板新建项...
分类:
编程语言 时间:
2015-04-06 23:12:01
阅读次数:
237
题目:
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it ...
分类:
其他好文 时间:
2015-04-06 15:42:46
阅读次数:
108