Posts

Showing posts from January, 2013

tekrarlı harfleri sıkıştırma sorusu

soru "aaaaaaabbbbbbbcccccddddaaaa" gibi bi string gelince "a7b7c5d4a4" şeklinde çıktı üretecek kodu yazınız. cevap public class denemeTest { public static void main(String[] args) { String deneme = "aaaaaaabbbbbbbcccccddddaaaa"; int i = 0; char denemes[] = deneme.toCharArray(); String cikti = ""; char bionceki = '\0'; for (int j = 0; j < denemes.length; j++) { char t = denemes[j]; if (j == 0) { bionceki = t; } if (bionceki == t) i++; else { cikti += bionceki + "" + i; i = 1; bionceki = t; } if (j == denemes.length - 1) { cikti += bionceki + "" + i; } } System.out.println(cikti); } }

google analyticsde saatlik ve günlük toplu rapor

az evel ihtiyacım oldu http://911-need-code-help.blogspot.com/2012/07/analytics-day-of-week-hour-of-day-report.html de güzelce anlatılmış.

log level change on runtime

http://javatoolsforweblogic.googlecode.com/svn/trunk/log4jAdmin/log4jAdmin.jsp that jsp does the change if you need it.

sonar solaris start problem

first I got --- Backtrace Gem::LoadError: Could not find rails (= 2.3.14) amongst [] in the log then I start looking here is the solution open SONAR_HOME/conf/wrapper.conf add wrapper.java.additional.3=-Djruby.native.enabled=false thats it just restart sonar it will start properly :)