1 2 3
def rot_encode(s, offset=2) s.split('').map{ |char| (char.ord + offset).chr }.join end
Ruby rot encode
1 2 3 4
package engine; import junit.framework.Assert; ...
Java Refactor, fix and optimize ...
by programmer-offsite,
April 20, 2009 14:15,
3 refactorings, tagged with optimize, strings, refactor, java, character
While tuning the applicatio...
1 2 3 4
char **split (char *string, char sep, char escape) { char **ret = NULL; ...
C A Java-like function split
This function splits a stri...
1 2 3 4
data = data.gsub("\xA0", " ") data = data.gsub("\x99", "(TM)") data = data.gsub("\x97", "-") ...
Ruby simplify multiple gsub
I could put the search/repl...
Rotation encoding with vari...