博文

目前显示的是 二月, 2014的博文

JUnit4

1.javadoc : http://junit.org/javadoc/latest/index.html 2.lib : 2.1.  https://code.google.com/archive/p/hamcrest/downloads  hamcrest-core-xx.jar and hamcrest-library-xx.jar are for the assertThat function. 2.2. https://github.com/junit-team/junit/wiki/Download-and-Install http://search.maven.org/#search|gav|1|g:%22junit%22%20AND%20a:%22junit%22  junit-4.12.jar is for junit. 3.assertThat:         int z = new T1().add(5,3); //        assertEquals(8, z); //        assertTrue(z>3); //       // assertTrue(z>10); //        assertTrue("heeeee",z>10);               assertThat(z, is(8));         assertThat(z,allOf(greaterThan(5),lessThan(10))); /* assertThat(n,allOf(greaterThan(1),lessThan(15))); assertThat(n,anyOf(greaterThan(16),lessThan(8))); assertThat(n,anything()); assertThat(str,is("junit4test")); assertThat(str,not("junit4test")); assertThat(str,containsString("junit4test")); assertThat(str,endsWith("juni

review onkeypress in Html

only number in input 1. <input onkeypress ="return (/[\d]/.test(String.fromCharCode(event.keyCode)))" style=" ime-mode:Disabled ">" The ime-mode CSS property controls the state of the input method editor for text fields.   Ref: https://developer.mozilla.org/en-US/docs/Web/CSS/ime-mode 2. <input type=text onkeypress=" return test();" style=" ime-mode:Disabled " > function test(){    return /[\d]/.test(String.fromCharCode(event.keyCode)); } 3<input type=text onkeypress="test()" style=" ime-mode:Disabled " > function test(){   //if ( isNaN (this.value)){    window.event.returnValue =false;   }    } other: <input name="username" type="text" onkeyup="value=value.replace(/[^\w\.\/]/ig,'')"> only letter, number, &, = and @ <input name="username" type="text" onkeyup="value=value.replace(/[^\w=@&]|_/ig,''

bootstrap

1.Grid  12 columns. 3-6-3 、4-8、3-5-4、2-8-2 < div   class = "row" >     < div   class = "span8" > ... </ div >     < div   class = "span4" > ... </ div >   </ div >  2. Responsive < link   href = "/css/bootstrap-responsive.css"   rel = "stylesheet" > media query  (min-width and max-width) < link   rel = "stylesheet"   href = "base.css"   />   < link   rel = "stylesheet"   media = "(min-width: 1200px)"   href = "large.css"   />   < link   rel = "stylesheet"   media = "(min-width: 768px) and (max-width: 979px)"     href = "tablet.css"   />   < link   rel = "stylesheet"   media = "(max-width: 767px)"   href = "tablet.css"   />   < link   rel = "stylesheet"   media = "(max-width: 480px)"   href = "phone.css"   />