自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(35)
  • 收藏
  • 关注

转载 正则表达式中括号的用法

var reg = /d[*]/;//中括号中的*不用转义console.log(reg.exec("d"));//nullconsole.log(reg.exec("d*"));//["d*", index: 0, input: "d*"]

2014-12-31 10:18:18 1027

转载 jQuery源码剖析(七)——Sizzle选择器引擎之词法分析

CSS选择器我们知道浏览器最终会将HTML文档(或者说页面)解析成一棵DOM树,如下代码将会翻译成以下的DOM树。javascriptdiv> p> input type="text" /> p> div class="clr"> input type="checkbox" name="readme" /> p>Hello Wor

2014-12-31 09:47:52 644

转载 sizzle分析记录:词法分析器(tokenize)

词法分析器(tokenize)?词法分析器又称扫描器。词法分析是指将我们编写的文本代码流解析为一个一个的记号,分析得到的记号以供后续语法分析使用。 sizzle引入了tokenize这个概念,意义?jQuery的选择器,实现了css1-css3的API,但是ECMAScript低版本的API中本身没有针对这种CSS的处理API,在IE8以上就引入了querySelectorAll

2014-12-30 16:53:26 507

转载 JavaScript slice() 方法

一、字符串中的slice()定义和用法slice() 方法可提取字符串的某个部分,并以新的字符串返回被提取的部分。语法stringObject.slice(start,end)参数描述start要抽取的片断的起始下标。如果是负数,则该参数规定的是从字符串的尾部开始算起的位置。也就是说,-1 指字符串的最后一个字符,-2 指倒数第二个字符,以此类推

2014-12-30 15:56:48 685

转载 jQuery的缓存函数

/** * Create key-value caches of limited size * @returns {Function(string, Object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the c

2014-12-30 15:53:37 620

转载 JavaScript shift() 方法

定义和用法shift() 方法用于把数组的第一个元素从其中删除,并返回第一个元素的值。语法arrayObject.shift()返回值数组原来的第一个元素的值。说明如果数组是空的,那么 shift() 方法将不进行任何操作,返回 undefined 值。请注意,该方法不创建新数组,而是直接修改原有的 arrayObject。提示和注释注释:该方法会改变数

2014-12-30 15:48:30 663

转载 JavaScript push() 方法

定义和用法push() 方法可向数组的末尾添加一个或多个元素,并返回新的长度。语法arrayObject.push(newelement1,newelement2,....,newelementX)参数描述newelement1必需。要添加到数组的第一个元素。newelement2可选。要添加到数组的第二个元素。newel

2014-12-30 15:32:51 539

转载 HTTPS连接的前几毫秒发生了什么

提示:英文原文写于2009年,当时的Firefox和最新版的Firefox,界面也有很大改动。以下是正文。花了数小时阅读了如潮的好评,Bob最终迫不及待为他购买的托斯卡纳全脂牛奶点击了“进行结算”,然后……哇!刚刚发生了什么?在点击按钮过后的220毫秒时间内,发生了一系列有趣的事情,火狐浏览器(Firefox)不仅改变了地址栏颜色,而且在浏览器的右下角出现了一个小锁头的标志。在我最

2014-12-30 11:30:45 652

转载 JavaScript splice() 方法

定义和用法splice() 方法向/从数组中添加/删除项目,然后返回被删除的项目。注释:该方法会改变原始数组。语法arrayObject.splice(index,howmany,item1,.....,itemX)参数描述index必需。整数,规定添加/删除项目的位置,使用负数可从数组结尾处规定位置。howmany必需。要删除的

2014-12-30 10:33:31 589

转载 js正则函数match、exec、test、search、replace、split使用介绍集合

match 方法 使用正则表达式模式对字符串执行查找,并将包含查找的结果作为数组返回。 stringObj.match(rgExp) 参数 stringObj 必选项。对其进行查找的 String 对象或字符串文字。 rgExp 必选项。为包含正则表达式模式和可用标志的正则表达式对象。也可以是包含正则表达式模式和可用标志的变量名或字符串文字。 其余说明与exec一样,不

2014-12-30 09:44:36 531

转载 深入了解javascript中的exec与match方法

这是我在csdn上的一篇文章,今天又忘记match的特性了,发现知识还得温故而知新啊。         一直以来对exec和match方法的区别有些混淆,今天重看帮助文档(帮助文档中主要依据一些晦涩的例子佐证,无助于理解),然后在百度搜集了下一些介绍文章,其中下面一篇文章(楼兰之风...的《彻底领悟javascript中的exec与match方法》)被多次检索,并在百度搜索第一条。但是看完

2014-12-30 09:35:21 592

转载 String.prototype.match()

SummaryThe match() method retrieves the matches when matching astring against a regular expression.Syntaxstr.match(regexp)ParametersregexpA regular expression object. If a non-RegExp objec

2014-12-30 09:31:48 892

转载 为什么 goroutine 的栈内存无穷大?

一些 Go 语言的新学习者总是会对 goroutine 栈内存占用大小感到非常好奇。这一般是由于程序员进行无限的函数循环调用导致的。为了说明这个问题,请思考以下代码示例(为使问题更加清晰而使用相对刻意的写法):?1234567891011121314151617package mai

2014-12-29 15:41:44 1109

转载 进程、线程和协程的理解

进程、线程和协程之间的关系和区别也困扰我一阵子了,最近有一些心得,写一下。进程拥有自己独立的堆和栈,既不共享堆,亦不共享栈,进程由操作系统调度。线程拥有自己独立的栈和共享的堆,共享堆,不共享栈,线程亦由操作系统调度(标准线程是的)。协程和线程一样共享堆,不共享栈,协程由程序员在协程的代码里显示调度。进程和其他两个的区别还是很明显的。协程和线程的区别是:协程避免了无意义的调度,由

2014-12-29 15:33:34 692

转载 为什么 goroutine 的栈内存无穷大?

我们在设计一个服务器的软件架构的时候,通常会考虑几种架构:多进程,多线程,非阻塞/异步IO(callback) 以及Coroutine模型。多进程这种模型在linux下面的服务程序广泛采用,比如大名鼎鼎的apache。主进程负责监听和管理连接,而具体的业务处理都会交给子进程来处理。这里有一篇我以前写的文章具体的解释这种架构的实现。这种架构的最大的好处是隔离性,子进程万一cras

2014-12-29 15:28:41 742

转载 How ECMAScript 5 still does not allow to subclass array

Subclassing an array in Javascript has never been a trivial task. At least for a certain meaning of “subclassing an array”. Curiously(好奇地), new edition of the language — ECMAScript 5 — still does not

2014-12-25 14:07:02 897

转载 jQuery选择器大全

选择器是jQuery最基础的东西,本文中列举的选择器基本上囊括了所有的jQuery选择器,也许各位通过这篇文章能够加深对jQuery选择器的理解,它们本身用法就非常简单,我更希望的是它能够提升个人编写jQuery代码的效率。本文配合截图、代码和简单的概括对所有jQuery选择器进行了介绍,也列举出了一些需要注意和区分的地方。一、基本选择器1. id选择器(指定id元素)将i

2014-12-25 13:39:41 489

转载 持续集成工具hudson

一.什么是持续集成持续集成的核心概念CI 过程会经常构建软件组件;在许多情况下,每当源代码存储库(比如 Subversion 或 ClearCase)中的代码发生变化时,都要构建软件组件。CI 的好处是:经常构建软件可以确保尽早遇到问题(比如代码缺陷),避免问题在软件开发周期晚期变复杂时才被发现。工具与过程尽管 CI 实际上是一个过程,但是持续集成 这个词常常与一个或多个工具相

2014-12-22 16:55:46 598

转载 Maven by Example 3.5. Core Concepts

Having just run Maven for the first time, it is a good time to introduce a few of the core concepts of Maven. In the previous example, you generated a project which consisted of a POM and some code as

2014-12-22 16:16:04 1015

转载 Maven实战(三)——多模块项目的POM重构

在本专栏的上一篇文章POM重构之增还是删中,我们讨论了一些简单实用的POM重构技巧,包括重构的前提——持续集成,以及如何通过添加或者删除内容来提高POM的可读性和构建的稳定性。但在实际的项目中,这些技巧还是不够的,特别值得一提的是,实际的Maven项目基本都是多模块的,如果仅仅重构单个POM而不考虑模块之间的关系,那就会造成无谓的重复。本文就讨论一些基于多模块的POM重构技巧。重复,还是重

2014-12-22 15:17:40 655

转载 Maven实战(二)——POM重构之增还是删

重构是广大开发者再熟悉不过的技术,在Martin Fowler的《重构——改善既有代码的设计》一书中,其定义为“重构(名词):对软件内部结构的一种调整,目的是在不改变软件之可察行为前提下,提高其可理解性,降低其修改成本.”以及“重构(动词):使用一系列重构准则(手法),在不改变软件之可察行为前提下,调整其结构.”。重构能够改善软件设计,使代码更易读,更容易找出bug,并帮助你更快速地编码。较之于一

2014-12-22 14:43:38 580

转载 Maven实战(一)——坐标规划

坐标是什么?为什么要规划?坐标是Maven最基本的概念,它就像每个构件的身份证号码,有了它我们就可以在数以千万计的构件中定位任何一个我们感兴趣的构件。举个最简单的例子,如果没有坐标,使用JUnit的时候,用户就需要去下载依赖jar包,用依赖的方式,简单配置使用如junit:junit:4.8.2就可以了。这里第一个junit是groupId,第二个junit是artifactId,4.8.2是

2014-12-22 14:34:59 730

转载 Maven实战(七)——常用Maven插件介绍(上)

我们都知道Maven本质上是一个插件框架,它的核心并不执行任何具体的构建任务,所有这些任务都交给插件来完成,例如编译源代码是由maven-compiler-plugin完成的。进一步说,每个任务对应了一个插件目标(goal),每个插件会有一个或者多个目标,例如maven-compiler-plugin的compile目标用来编译位于src/main/java/目录下的主源码,testCompile

2014-12-22 14:09:09 647

转载 Maven by Example 3.1. Introduction

In this chapter, we introduce a simple project created from scratch using the Maven Archetype plugin. This elementary(基本的;初级的;[化学] 元素的) application provides us with the opportunity to discuss some cor

2014-12-22 13:29:58 1043

转载 archetype:generate

Full name:org.apache.maven.plugins:maven-archetype-plugin:2.2:generateDescription:Generates a new project from an archetype, or updated the actual project if using a partial archetype. If the pr

2014-12-22 13:16:59 625

转载 Maven Archetype Plugin

The Archetype Plugin allows the user to create a Maven project from an existing template called an archetype.It also allows the user to create an archetype from an existing project.UsageInst

2014-12-22 13:10:50 625

转载 Maven by Example 2.2. Downloading Maven

You can download Maven from the Apache Maven project website athttp://maven.apache.org/download.html.When downloading Maven, make sure you choose the latest version of Apache Maven from the Maven we

2014-12-22 11:06:33 1083

转载 Maven by Example 2.1. Verify your Java Installation

While Maven can run on Java 1.4, this book assumes that you arerunning at least Java 5. Go with the most recent stable JavaDevelopment Kit (JDK) available for your operating system. Either Java5 or Ja

2014-12-22 10:47:58 703

转载 Maven by Example Chapter 2. Installing Maven

Java Development Kit (JDK). If you are just interested in installation, you can move on to the rest of the book after reading throughSection 2.2, “Downloading Maven” and Section 2.3, “Installing M

2014-12-22 10:45:58 540

转载 Maven by Example 1.7. Comparing Maven with Ant

The authors of this book have no interest in creating a feud(不和;争执;封地) between Apache Ant and Apache Maven, but we are also cognizant(审理的;已认知的) of the fact that most organizations have to make a decis

2014-12-22 10:12:22 698

转载 Maven by Example 1.4. Universal Reuse through Maven Plugins

Plugins are more than just a trick to minimize the download size of the Maven distribution.(插件不只只是减少要下载的maven安装包的大小的诡计) Plugins add new behavior to your project’s build.Maven retrieves both dependenci

2014-12-22 09:41:53 638

转载 Maven by Example 1.3. A Common Interface

Before Maven provided a common interface for building software, every single project had someone dedicated to managing a fully customized build system. Developers had to take time away from developing

2014-12-22 09:31:45 621

转载 Maven by Example 1.2. Convention Over Configuration

Convention(大会;[法] 惯例;[计] 约定;[法] 协定;习俗) over configuration is a simple concept. Systems, libraries,and frameworks should assume reasonable defaults. Without requiring unnecessary configuration, systems

2014-12-22 09:23:53 769

转载 Maven by Example 1.1. Maven… What is it?

The answer to this question depends on your own perspective. The great majority of Maven users are going to call Maven a “build tool”: a tool used to build deployable artifacts from source code. Build

2014-12-22 09:13:14 586

转载 Maven by Example

As developers, we understand that you don't want to spend years reading documentation about your build tool. We get it. You just want to get to work. On the other hand, if you don't take a little bit

2014-12-22 09:07:38 813

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除