Skip to content

Instantly share code, notes, and snippets.

View simonwoo's full-sized avatar
💭
I may be slow to respond.

Chong WU simonwoo

💭
I may be slow to respond.
View GitHub Profile

Design Pattern

  • Creational design pattern - These design patterns are all about class instantiation. This pattern can be further divided into class-creation patterns and object-creational patterns. While class-creation patterns use inheritance effectively in the instantiation process, object-creation patterns use delegation effectively to get the job done.
  • Structural design pattern - These design patterns are all about Class and Object composition. Structural class-creation patterns use inheritance to compose interfaces. Structural object-patterns define ways to compose objects to obtain new functionality.
  • Behavioural design pattern - These design patterns are all about Class's objects communication. Behavioral patterns are those patterns that are most specifically concerned with communication between objects.

Creational design pattern

  • Abstract Factory - Creates an instance of several families of classes
  • Builder - Separates object construction from its representation
  • Factory Method - Creates
@simonwoo
simonwoo / karma.md
Last active October 22, 2016 20:15

前端测试: 单元测试和集成测试。 单元测试的难点如何在多个浏览器中确保同一段JS代码正确。 e2e或者端到端(end-to-end)或者UI测试是一种测试方法,它用来测试一个应用从头到尾的流程是否和设计时候所想的一样。简而言之,它从一个用户的角度出发,认为整个系统都是一个黑箱,只有UI会暴露给用户。 Protractor是一个又AngularJS团队编写的库,它是一个队WebDriverJS的包装,同时Jasmine在这里被指定用来测试,真是太爽了。

Reference:

TODO:

并发编程的两个关键问题:

  • 线程之间通信
  • 线程之间同步

线程通信通常有两种方式:共享内存和消息传递。 线程同步是指程序用于控制不同线程之间操作发生的相对顺序。 共享内存模型中,需显示指定某个方法或某段代码需要在线程之间互斥执行。Java并发采用的是共享内存模型。

Java内存模型(JMM)

在Java中,所有的实例域,静态域和数组元素存储在堆内存中,堆内存在线程之间共享。局部变量,方法参数和异常处理器参数不在内存之间共享,因此不受内存模型影响。

Yeman

Yeoman是Google的团队和外部贡献者团队合作开发的,他的目标是通过Grunt(一个用于开发任务自动化的命令行工具)和Bower(一个HTML、CSS、Javascript和图片等前端资源的包管理器)的包装为开发者创建一个易用的工作流。它是一个构建漂亮Web应用的工具和框架。Yeoman用于把各种不同的工具整合起来,形成一套完整的前端开发的工作流程。

Yeoman主要有三部分组成:yo(脚手架工具)、grunt(构建工具)、bower(包管理器)。

  • Yo 是一个 Web 应用的架构(scaffolding)工具。它提供了非常多的模板,用来生成不同类型的 Web 应用。这些模板称为生成器(generator)。社区也贡献了非常多的生成器,适应于各种不同的场景。通过 Yo 生成的应用使用 Grunt 来进行构建,使用 Bower 进行依赖管理。
  • grunt基于Node.js创建,Grunt是一个基于任务的命令行工具,它能够同构减少减少预先需要准备的资源来加速工作流。它将工作包裹进入任务之中,任务会随着你的工作进程自动编译。基本来说,你可以在任何你觉得可以使用grunt的项目以及那些需要你手动配置并运行的项目中使用Grunt。
  • bower作为一个js依赖管理的工具,提供一种理想包管理方式,借助了npm的一些思想,为我们提供一个舒服的开发环境。

但是grunt存在一些缺陷,它正在被gulp取代。和grunt类似,它是一个基于流的构建工具,把源文件倒入一个处理容器1(任务1),再倒入处理容器2(任务2),最后倒入最终的容器(目标文件)。

数据结构的本质就在于:如何将现实世界中各种各样的数据放入到内存中,并且如何在内存中操作这些数据,如何评价这些存储方案和操作方法。 在内存当中放置数据,也有两种方案,连续地放置数据,或者不连续地放置数据。 物理存储结构:连续的和不连续. 第1步是将现实世界的数据组织成为逻辑结构,第2步再把逻辑结构的数据映射到物理结构中。 在第1步中,我们抛去数据的其它属性,只留下数据的两个属性就可以了:一个属性是数据的值,另一个属性就是数据之间的关系。例如图。在第2步中,我们要做的事情,把这个graph映射到物理存储结构中,这就是数据结构要做的事情了。显然,我们可以用数组来存储,也可以用链表来存储,

  • 简单数据结构
    • 链表
    • 队列
  • SET

认证(HTTP Authentication)

  • verify the identity of the remote user.
  • It is a prerequisite for authorization, it consists of making and enforcing an authorizaiton decision depending on authentication information.
  • most often synonymous with challenge authentication, which means that the server first specifies the type of credentials that it is expecting from the client in order to successfully authenticate subsequent requests. then the client can respond by providing the proper credentials to the server.

授权(HTTP Authorization)

Its function is to grant or deny the request access to the next resource it protects depending on their authentication status and on the action they wish to perform.

title date description categories tags
我的学习、归纳方法(以学习 Maven 为例)
2016-03-07 12:50:25 -0800
以我的个人角度来看待学习这件长久的事,希望对你有帮助,也希望你能提一下你的意见
学习方法
Java
学习方法
Maven
Java

函数接口

java8中共提供一下几类函数接口:

  • Function: To represent a function that takes an argument of type T and returns a result of type R.
public interface Function<T,R>{
   ...
   public R apply(T t);
   ...
}

Cassandra:

  • data model
  • node cumunication with gossip protocol
  • writing and reading
  • data distribution and replication(keyspace)
  • CAS and AID(transaction management)