1 function createCORSRequest(method, url){ 2 var xhr = new XMLHttpRequest(); 3 4 if("withCredentials" in xhr){ 5 xhr.open(me...
分类:
其他好文 时间:
2014-06-27 22:02:10
阅读次数:
159
在算法分析中,当一个算法中包含递归调用时,其时间复杂度的分析会转化为一个递归方程求解。实际上,这个问题是数学上求解渐近阶的问题,而递归方程的形式多种多样,其求解方法也是不一而足,比较常用的有以下四种方法: (1)代入法(Substitution Method) 代入法的基本步骤是先推测递归方程的显式...
分类:
其他好文 时间:
2014-06-26 23:45:39
阅读次数:
282
This post introduces how to limit the access scope of the field and method of the object.
分类:
编程语言 时间:
2014-06-26 23:10:37
阅读次数:
418
1)最基本的,方法级别上应用,例如: Java代码 @RequestMapping(value="/departments") public String simplePattern(){ System.out.println("simplePattern method was called");....
分类:
移动开发 时间:
2014-06-26 20:56:51
阅读次数:
246
1.Method definition for 'xxx' not foundxxx的方法没有实现出现原因.h声明了xxx方法但是.m没有实现xxx方法解决方法:在类的.m文件实现xxx方法2. Instance variable ‘xxx' accessed in class method在类方法...
分类:
其他好文 时间:
2014-06-26 20:43:13
阅读次数:
212
背景在一个服务实现内,有很多结构相似,略微不同的函数。Martin大师的谆谆告诫我们,可以使用Extract Method的方式进行重构。本次练习的内容主要是使用反射。以零散知识点的形式记录每一天的工作。内容1. 获取Type一般有两种方式获取类型:1.1 typeof方式var entityTyp...
分类:
其他好文 时间:
2014-06-26 17:09:27
阅读次数:
209
创建型: 1. 单件模式(SingletonPattern) 2. 抽象工厂(AbstractFactory) 3. 建造者模式(Builder) 4. 工厂方法模式(Factory Method) 5. 原型模式(Prototype)结构型: 6. 适配器模式(AdapterPattern)...
分类:
其他好文 时间:
2014-06-25 18:16:08
阅读次数:
148
<body
<formaction=""method="post"
name="form1">
<inputtype="text"id="id"/>
</form>
</body>
<script>functionmyfocus(){
document.getElementById(‘id‘).focus();}</script>
分类:
Web程序 时间:
2014-06-25 10:11:17
阅读次数:
181
/**
* Method 1: Delete the input element x
* and meanwhile keep the length of array after deleted n
* @param a the array
* @param n the length of array after deleted.
* @param x the element t...
分类:
其他好文 时间:
2014-06-25 08:27:27
阅读次数:
171
attribute method:
#include
struct packed
{
char a;
int b;
} __attribute__((packed));
struct not_packed
{
char a;
int b;
};
int main(void)
{
printf("Packed: %zu\n", sizeof(...
分类:
其他好文 时间:
2014-06-25 07:29:49
阅读次数:
155