Ana içeriğe atla

Kayıtlar

Şubat, 2011 tarihine ait yayınlar gösteriliyor

Getting along with JQuery,Validation,Masked Input

JQuery is a nice library with whom I havent played till yesterday. Since yesterday I am struggling with this nice library, actually not solely with it but with validation plugin. That plugin is nice too but when it comes to integrating it with another plugin which you guess Masked Input, I was having problems. Because my form is dinamic and I am adding elements whose names are the as previous ones, I have struggled a lot. But at the end I did what I wanted to do. This jQuery.validator.addMethod("acceptreg", function(value, element, param) {   return value.match(new RegExp("^" + param + "$")); }); small code piece helped me a lot when validating text and phone fields and their integration with Masked Input. I know validation plugin normally does validate against phone but my case was different. I declared such a method as described above and used it inside with tel: { required: true, minlength:11, maxlength:11,acceptreg: "[0-9]{3}-[0-9]{7}" }, I d...

Centos mcelog reports incorrect record size

On a centos 5.5 64 bit server I was getting mcelog errors from cron.hourly/mcelog.cron stating "/etc/cron.hourly/mcelog.cron: mcelog: warning: record length longer than expected. Consider update" As a workaround I did add 2>&1 to the last line of /etc/cron.hourly/mcelog.cron file as mentioned in Known Issues in this page http://elrepo.org/tiki/kernel-ml    

An Encryption Method

Lately I have been told to make a new encryption method as an assignment. The method should be not preused and tried before. So it was me who is supposed to invent a new encryption method. I have thought of Rubik's cube and placing the letters of the alphabet on this cube. Then the coordinates of each letter would be send as ciphertext. Thinking on it lead to some diffucilties. So I decided to take another way. I believe that a good  encryption technique is still available by using Rubik's cube but for now I quitted. Instead, I thought of 3x3 or 5x5 squares on which we place the letters beginning from an arbitrary letter but obeying the order. So here is an example with a 3x3 square   2 H I J 1 K L M 0 N O P   0 1 2 With such a layout we represent each letter on this square using the pivot letter (lets say) L H=L02   I=L12   J=L 22   K=L01  L=L11  M=L21 etc.  On a 5x5 square we will have similar representations of letters. Even...