`
文章列表
Java 5 并发学习 在Java5之后,并发线程这块发生了根本的变化,最重要的莫过于新的启动、调度、管理线程的一大堆API了。在Java5以后,通过Executor来启动线程比用Thread的start()更好。在新特征中,可以很容易控制线程的启动、执行和关闭过程,还可以很容易使用线程池的特性 一、创建任务 任务就是一个实现了Runnable接口的类。 创建的时候实run方法即可。 二、执行任务 通过java.util.concurrent.ExecutorService接口对象来执行任务,该接口对象通过工具类java.util.concurrent.Executors的静态方法来 ...

in 和 exist 区别

http://blog.csdn.net/lick4050312/article/details/4476333 select * from A where id in(select id from B) 以上查询使用了in语句,in()只执行一次,它查出B表中的所有id字段并缓存起来.之后,检查A表的id是否与B表中的id相等,如果相等则将A表的记录加入结果集中,直到遍历完A表的所有记录. 它的查询过程类似于以下过程 List resultSet=[]; Array A=(select * from A); Array B=(select id from B); for(int i= ...
BigDecimal abs()           返回BigDecimal,其值为此BigDecimal的绝对值,其标度为this.scale()。 BigDecimal abs(MathContext mc)          返回其值为此BigDecimal绝对值的BigDecimal(根据上下文设置进行舍入)。 BigDecimal add(BigDecimal augend)           返回一个BigDecimal,其值为(this + augend),其标度为max(this.scale(), augend.scale())。 BigDecimal add( ...
Here's an ordinary object, defined with an object literal, and unaware of the fact that it is soon going to fall victim to parasitism: var twoD = { name: '2D shape', dimensions: 2 }; A function that creates triangle objects could: 1.Clone the twoD object into an object called that. This can be do ...
Let's create a multi() function that accepts any number of input objects. You can wrap the loop that copies properties in another loop that goes through all the objects passed as arguments to the function. function multi() { var n = {}, stuff, j = 0, len = arguments.length; for (j = 0; j < len ...
You can: Use prototypal inheritance to clone an existing object Copy all of the properties of another object function objectPlus(o, stuff) { var n; function F() {} F.prototype = o; n = new F(); n.uber = o; for (var i in stuff) { n[i] = stuff[i]; } return n; } Start with the base shape obj ...

Object的copy

the use of an object() function that accepts an object and returns a new one that has the parent as a prototype. function object(o) { function F() {} F.prototype = o; return new F(); } If you need access to an uber property, you can modify the object() function like so: function object(o) { var ...

DeepCopy LightCopy

2、浅拷贝 除了使用”prototype链”以外,还有另一种思路:把父对象的属性,全部拷贝给子对象,也能实现继承。 下面这个函数,就是在做拷贝: function LightCopy(p) { var c = {}; for (var i in p) { c[i] = p[i]; } //c.uber = p; return c; } 使用的时候,这样写: var WD = LightCopy(MED); WD.aim = '前端开发'; 但是,这样的拷贝有一个问题。那就是,如果父对象的属性等于数组或另一个对象,那么实际上,子对象获得的只是一个内存地址,而不是真正拷贝 ...

prototype模式

http://www.ruanyifeng.com/blog/2010/05/object-oriented_javascript_inheritance_continued.html Javascript 面向对象编程(一):封装 Javascript是一种基于对象(object-based)的语言,你遇到的所有东西几乎都是对象。但是,它又不是一种真正的面向对象编 ...
如果没接触过动态语言,以编译型语言的思维方式去理解javaScript将会有种神奇而怪异的感觉,因为意识上往往不可能的事偏偏就发生了,甚至觉得不可理喻.如果在学JavaScript这自由而变幻无穷的语言过程中遇到这种感觉,那么就从现在形始,请放下的您的”偏见”,因为这对您来说绝对是一片新大陆,让JavaScrip 好,言归正传,先理解JavaScrtipt动态变换运行时上下文特性,这种特性主要就体现在apply, call两个方法的运用上. 区分apply,call就一句话, foo.call(this, arg1,arg2,arg3) == foo.apply(this, argumen ...

Read OO JS

Most values convert to true with the exception of the following (which convert to false): 1. The empty string "" 2. null 3. undefined 4. The number 0 5. The number NaN 6. The boolean false These six values are sometimes referred to as being falsy, while all others are truthy This example ...

jQuery基础(二)

jQuery 元素选择器 jQuery 使用 CSS 选择器来选取 HTML 元素。 $("p") 选取 <p> 元素。 $("p.intro") 选取所有 class="intro" 的 <p> 元素。 $("p#demo") 选取 id="demo" 的第一个 <p> 元素。 选择器         实例         选取 *         $("*")        所有元素 #id         $("#lastn ...

Ajax基础

var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } open(method,url,async); send(string); Method Description open(method,u ...

Extjs基础

底层API(core):底层API 中提供了对DOM 操作、查询的封装、事件处理、DOM 查询 器等基础的功能。其它控件都是建立在这些底层api 的基础上,底层api 位于源代码目录的 core 子目录中,包括DomHelper.js、Element.js 等文件,如图xx 所示。 控件(widgets):控件是指可以直接在页面中创建的可视化组件,比如面板、选项板、 表格、树、窗口、菜单、工具栏、按钮等等,在我们的应用程序中可以直接通过应用这些控 件来实现友好、交互性强的应用程序的UI。控件位于源代码目录的widgets 子目录中,包含 如图xx 所示。 实用工具Utils:Ext 提供了 ...

jQuery基础

jQuery: The Basics This is a basic tutorial, designed to help you get started using jQuery. If you don't have a test page setup yet, start by creating a new HTML page with the following contents: <!doctype html> <html> <head> <meta charset="utf-8"> &l ...
Global site tag (gtag.js) - Google Analytics