`
wenbois2000
  • 浏览: 44661 次
  • 性别: Icon_minigender_1
  • 来自: 湖南
社区版块
存档分类
最新评论
文章列表
    计算机科学中一个经典的问题是决定如何存储数据,以便进行快速的读取和写入操作。 在代码执行期间,数据如何存储将会关系到它们的检索速度。在Javascript中,由于只存在少数的操作来进行数据存储, 这个问题似乎 变得 ...
最近阅读了InfoQ上的电子书<<Java Transaction Strategy>>之后受益匪浅, 单独花了两周时间将其翻译了一下. 由于英语只是四级水准, 所以翻译内容中的不足之处也请见谅. 附件里第一份是翻译后的文档, 第二份是英文原文. 原文地址:http://www.infoq.com/minibooks/JTDS 下面列出文中映象深刻的几点: 事务模型的分类: 本地事务模式, 管理连接 编程式事务模式, 编程管理JTA事务 声明式事务模式, 以方法为单位,让容器使用配置信息来进行事务管理 最佳实践: 当为方法分配事务属性的时候,把类中对大部分方法最 ...
foobar    不同的字典对其解释相去甚远,一说来自中国“福”字的发音,又有解释为二战时期的一种武器。然而若把众多的解释放在编程领域,关于 foobar的说法是我认为最为贴切的解释。foobar又为foo-bar,其中bar是beyond all recognition的缩写,通俗点就是无法识别,一塌糊涂的意思。而foo是fu的变体,fu是英语习语fuck-up的缩写,同样是一团糟的意思。于是,若你有些编程经验,我想你应该已经明白了为何如今许多编程实例所涉及的事物均被冠名为foo. 1. 介绍     至今约有212 个RFC, 或者约7%的RFC, 从[RFC26 ...
五.Strings and Regular Expressions   Practically all JavaScript programs are intimately tied to strings. For example, many applications use Ajax to fetch strings from a server, convert those strings into more easily usable JavaScript objects, and then generate strings of HTML from the data. A typical ...
六.Responsive Interfaces   There’s nothing more frustrating than clicking something on a web page and having nothing happen. This problem goes back to the origin of transactional web applications and resulted in the now-ubiquitous “please click only once” message that accompanies most form submissions ...
四.Algorithms and Flow Control    The overall structure of your code is one of the main determinants as to how fast it will execute. Having a very small amount of code doesn’t necessarily mean that it will run quickly, and having a large amount of code doesn’t necessarily mean that it will run slowly. ...
三.DOM Scripting   DOM scripting is expensive, and it’s a common performance bottleneck in rich web applications. This chapter discusses the areas of DOM scripting that can have a negative effect on an application’s responsiveness and gives recommendations on how to improve response time. The three ca ...
一.Loading and Execution   JavaScript performance in the browser is arguably the most important usability issue facing developers. The problem is complex because of the blocking nature of JavaScript, which is to say that nothing else can happen while JavaScript code is being executed.     In fact, mo ...
7.Client Pattern DOM Access   DOM access is expensive; it’s the most common bottleneck when it comes to JavaScript performance. This is because the DOM is usually implemented separately from the JavaScript engine. From a browser’s perspective, it makes sense to take this approach, because a JavaScr ...
6.Design Pattern Singleton    The idea of the singleton pattern is to have only one instance of a specific class. This means that the second time you use the same class to create a new object, you should get the same object that was created the first time.    And how does this apply to JavaScript? ...
5.Inheritance Pattern Classical Pattern #1—The Default Pattern     The default method most commonly used is to create an object using the Parent() constructor and assign this object to the Child()’s prototype. Here’s the first implementation of the reusable inherit() function:function inherit(C, P ...
4.Function Pattern Namespace Pattern    Namespaces help reduce the number of globals required by our programs and at the same time also help avoid naming collisions or excessive name prefixing. JavaScript doesn’t have namespaces built into the language syntax, but this is a feature that is quite e ...
二.Object Object Constructor Catch   You have no reason to use the new Object() constructor when you can use an object literal, but you might be inheriting legacy code written by others, so you should be aware of one “feature” of this constructor (or yet another reason not to use it). The feature in ...
三.Function Background     There are two main features of the functions in JavaScript that make them special—the first is that functions are first-class objects and the second is that they provide scope.Functions are objects that: Can be created dynamically at runtime, during the execution of the p ...
一.Global 全局域中的this = window.myglobal = "hello"; // antipattern console.log(myglobal); // "hello" console.log(window.myglobal); // "hello" console.log(window["myglobal"]); // "hello" console.log(this.myglobal); // "hello", 全局域中的this = w ...
Global site tag (gtag.js) - Google Analytics