Jump to content
php.lv forumi

mefisto

Reģistrētie lietotāji
  • Posts

    810
  • Joined

  • Last visited

Posts posted by mefisto

  1. @briedis

    Apmēram 25% .. tieši tik lat daudz laika cik koda dokumentēšana , debug'ošana un rakstīšana.

    Pats fakts, ka tu raksti unit-testus, liek plānot koda struktūru daudz uzmanīgāk.

     

     

    @euphoric

    Pats lietoju PHPunit + Eclipse , bet rīki ir daudz un dikti.

  2. Kaut kā apmēram šitā :

     

    (function(){
    
    function in_array( what, where ){
    	var a=false;
    	for( var i=0; i<where.length; i++ ){
    		if( what == where[i] ){
    			a=true;
    			break;
    		}
    	}
    	return a;
    }
    
    
    function validate( e ) {
    	var e = e || window.event;
    	var keycode = e.keyCode || e.which;
    	key = String.fromCharCode( keycode );
    	var regex = /[0-9]|\./;
    	if( !regex.test(key) && ( !in_array( keycode ,  [ 8 , 9, 35, 36, 37, 38, 39, 40, 45, 46]  ))) {
    		e.returnValue = false;
    		e.preventDefault();
    	}
    }
    
    docuemnt.getElementById( 'digital' ).onkeypress = validate;
    
    })();
    

     

    Neesmu notestējis.

×
×
  • Create New...