Look at the sky, it's so beautiful ...

首页登录之前的表单只包含user,password两个input

更新后加了一个验证码<input name='code'>

此时IE不再提示以前记住的密码,导致部分靠浏览器记忆密码的用户无法登录。

解决的办法就是去掉验证码的input。当需要显示验证码输入框时再动态创建

IE实现自动完成的策略可能是实现一个

hash(url,form-name,form-inputs) => user,password 的映射

参考:

http://www.watchingthenet.com/enable-internet-explorer-prompting-to-save-passwords.html 

文章图片

Handler of input/textarea's blur/focus event will be called multiple times when browser window lost/get focus.

Use flag variable to keep track of focus-state of elements. Just return if extra unwanted focus/blur event happened.

setTimeout/setInterval without clear timer in onfocus/onblur is dangerous

cause you may start redundant timer and it's hard to debug.

reference:

http://www.quirksmode.org/dom/events/blurfocus.html#t00

http://stackoverflow.com/questions/9649966/chrome-maybe-safari-fires-blur-twice-on-input-fields-when-browser-loses-foc

文章图片

http://blog.cyplo.net/2011/01/01/compiling-ruby-1-9-2-windows/

按上面blog描述,下载并编译一下ruby192

* download ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p136.tar.gz

* depack

* launch visual studio command prompt

C:\dev\ruby-1.9.2-p136>ruby --version

'ruby' is not recognized as an internal or external command

operable program or batch file.

C:\dev\ruby-1.9.2-p136> cd win32

C:\dev\ruby-1.9.2-p136\win32>

C:\dev\ruby-1.9.2-p136\win32> configure.bat

cl -nologo -MD rtname.c user32.lib -link > nul

Checking unicows.lib

Creating Makefile.new

type `nmake' to make ruby

C:\dev\ruby-1.9.2-p136\win32> nmake

在Visual Studio中建立一个空白解决方案,将编译好的ruby.exe加入到解决方案中。

将main.c拖放到VS中。在main函数中断点。然后调试ruby.exe

Anwsers of an Advanced Javascript Quiz

问题在 : http://perfectionkills.com/understanding-delete/

JavaScript规范: ECMA262-3d

Q#1

(function(){ return 

    typeof arguments;

     //"object" 

})();

//查看valueOf

(function(){ 

    alert(arguments.valueOf());

    //"[object Arguments]" in chrome and firefox

    //"[object Object]" in IE6 }

)();

A#1

详见 ECMA262-3e 11.4.3 typeof operator

Q#2 var f = function g(){ return 23; }; typeof g();A#2

g是'命名函数表达式'(Named Function Expression)。g只在其函数体内可见。 typeof g()在执行g的时候报错:g没有定义

参考:

https://developer.mozilla.org/en/JavaScript/Reference/Operators/function

http://kangax.github.com/nfe/

Q#3

(function(x){

    delete x;

  &nbs

嵌套类(也叫member class)分为两种:

static nested classes (static member classes)

不能引用enclosing class的非静态变量和方法

OuterClass.StaticNestedClass k = new ...

inner class ( non-static member classes)

不能定义任何静态成员

内部类的示例只能存在于enclosing class的某个实例中。并可以访问该实例的变量和方法,包括私有的

OuterClass.InnerClass k = outerClass.new InnerClass();

并不是所有内部类都有enclosing class instance,比如静态初始化块中的匿名内部类

local classes 和 anonymouse classes(unnamed local classes)也是内部类

在non-static context 下声明的内部类会被编译器安插一个 final OuterClass this$0的属性。在构造函数第一个参数前安插一个

OuterClass  param参数,在调用构造函数时将this$0 = param( 在invokespecial之前)。然后在引用OuterClass属性和方法的

地方换成 this$0.property 和 this$0.method。

getEnclosingClass

getEnclosingConstructor

getEnclosingMethod

isAnonymousClass

isLocalClass

isMemberClass

参考:

http://docs.oracle.com/javase/tutorial/java/javaOO/nested.html

http://blogs.oracle.com/darcy/ent

文章图片

Java中的枚举类型会被翻译成final class。

这也是为什么同一个作用域中不能有同名的enum和class

如果enum类型被用在switch语句中,那么这个类型中会有一个$swich_table$Day函数返回

每个类型对应的ordial。每次switch都会生成一个临时的int[]

参考:http://docs.oracle.com/javase/tutorial/java/javaOO/enum.html

另: 

public class  K

public enum Enumeration -> public final class E extends Enum

public interface I

public @interface A -> public interface A extends Annotation