hnggg
jimode2013 · 共 49 篇文章
Thinking in java——Generics 产生检查类型的容器类
Dynamic type safety Because you can pass generic containers to pre-Java SE5 code, there's still the possibility that old-style code can corrupt your containers. Java SE5 has a set of utilities in java.util.Collections to solve the type-checking problem in this situation: the static methods checkedC…
2014-04-18 00:28 · 评论(0)
thinking in java Generics Self-bounded
Self-bounded types There's one rather mind-bending(adj. 离奇古怪令人费解的;强烈影响心绪的) idiom that appears periodically in Java generics. Here's what it looks like: class SelfBounded<T extends SelfBounded<T>> { / / .. . This has the dizzying(adj. 令人昏乱的;极快的;灿烂的) effect of two mirrors pointed at each other, a kin…
2014-04-17 23:35 · 评论(0)
JavaScript Scoping and Hoisting
http://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html Do you know what value will be alerted if the following is executed as a JavaScript program? var foo = 1; function bar() { if (!foo) { var foo = 10; } alert(foo); } bar(); If it surprises you that the answer is “10”, then this one w…
2014-04-17 11:55 · 评论(0)
The Secret Life of JavaScript Primitives
You may not know it but, in JavaScript, whenever you interact with string, number or boolean primitives you enter a hidden world of object shadows and coercion. So dust off your Sherlock Holmes outfit and read on… The basics Objects are aggregations of properties. A property can reference an object…
2014-04-15 09:03 · 评论(0)
`instanceof` considered harmful (or how to write a robust `isArray`)
Checking types in Javascript is well known as a pretty unreliable process. Good old typeof operator is often useless when it comes to certain types of values: typeof null; // "object" typeof []; // "object" People often expect to see something like “null” in the former check and something like “arr…
2014-04-15 09:02 · 评论(0) · prototype · JavaScript
Checking Types in Javascript
Have you ever wondered: what is the correct way to check if a Javascript variable is an Array? Do a Google search and you will get a great variety of answers. And, unfortunately, there's is no correct answer. This is one of the sad things about Javascript, not only are there many varying implementa…
2014-04-14 16:07 · 评论(0)
Understanding typeof, instanceof and constructor in JavaScript
They say in JavaScript “everything is an object”. They’re wrong. Some types in JavaScript are so-called “primitive types”, and they don’t act like objects. These types are: Undefined Null Boolean Number String The confusion comes from the fact that the boolean, number and string types can be treate…
2014-04-14 13:18 · 评论(0)
chapter2 JAVASCRIPT: AN OVERVIEW
INTRODUCTION JAVASCRIPT IS A prototype-based, object-oriented, loosely-typed dynamic scripting anguage. It has powerful features from the functional world, such as closures and higher-order functions, that are of special interest here. JavaScript is technically an implementation of the ECMAScript l…
2014-04-14 07:03 · 评论(0)
“'express' 不是内部或外部命令,也不是可运行的程序”
In later versions of express comand line was migrated to a separate module: express-generetor use npm install -g express-generator@3 and could use the express command
2014-04-14 02:48 · 评论(0)
Thinking in java——Generics
The mystery of erasure As you begin to delve more deeply into generics, there are a number of things that won't initially make sense. For example, although you can say ArrayList.class, you cannot say ArrayList<Integer>.class. And consider the following: //: generics/ErasedTypeEquivalence.java impor…
2014-04-12 00:35 · 评论(0)
Dissecting the Disruptor: Why it’s so fast (part one) – Locks Are Bad
Martin Fowler has written a really good article describing not only the Disruptor , but also how it fits into the architecture at LMAX . This gives some of the context that has been missing so far, but the most frequently asked question is still “What is the Disruptor?”. I’m working up to answering…
2014-04-10 13:53 · 评论(0)
Thinking in java——Generics
Ordinary classes and methods work with specific types:either primitives or class types. If you are writing code that might be used across more types, this rigidity can be overconstraining. One way that object-oriented languages allow generalization is through polymorphism. You can write (for examp…
2014-04-08 07:00 · 评论(0)
csdn iteye 51cto博客的对比
csdn csdn会自动产生目录(如果层次更多,产生的目录是错误的),这是我最喜欢的一个功能,很多时候又开始使用CSDN就是因为有目录这个原因 在IE核心的浏览器下会自动保存,在谷歌浏览器不会 有时候会发神经,网站访问不了,博客发布不了,这是干什么?7*24小时无间断服务原来是需要很高技术难度的 Iteye 每个月都有月刊,基本上每一期我都会下载下来浏览一下 界面很丑,感觉没有csdn好看 虽然奇丑无比,但是可以做到0广告,基本上整个博客都没有任何广告 被CSDN收购后沾染了csdn不会做技术的坏毛病,有时候会访问不了,发布不了博客 博客园 最大的好处就是可定制度高,但是是一个除了发表原创的…
2014-04-05 11:10 · 评论(0)
cloudstack如何设置可以重置密码的系统模板
2.13. Adding Password Management to Your Templates CloudStack provides an optional password reset feature that allows users to set a temporary admin or root password as well as reset the existing admin or root password from the CloudStack UI. To enable the Reset Password feature, you will need to d…
2014-04-03 12:26 · 评论(0)