Programming! 썸네일형 리스트형 Ubuntu MySQL 5.5 to 5.6 ubuntu 기본 repository가 5.5에 맞춰져 있어서 그렇게 설치했다가.. datetime과 timestamp의 문제로 인해 5.6으로 업그레이드를 하게되는데....뚜시꿍. 우선 backup 후, 1. http://dev.mysql.com/downloads/mysql/ 에서 repository등록. 2. 기존 mysql 삭제.http://www.cyberciti.biz/faq/uninstall-mysql-ubuntu-linux-command/ 3. 설치https://help.ubuntu.com/12.04/serverguide/mysql.html #] sudo service mysql start 문제는 기존 mysql의 잔재가 조금이라도 남아있을 경우 설치중 오류를 많이 볼 수 있다. 깨끗하게 지.. 더보기 Sonar : Performance - Inefficient use of keySet iterator instead of entrySet iterator 가끔 소나 누님이 내뱉는 크리티컬 문제이다. 예전( 1.5 이전?)에 Map을 KeySet에 의해 루프를 돌던 형태인데, 이경우 key에 의한 룩업 과정을 한번 더 거치게 되므로 성능상 불이익이 있다는 얘기란다. 사실 얼마나? 로 물어보면 딱히... 여튼 소스는 이렇게 수정했다. 이전 코드Set optionKeySet = optionsMap.keySet();for (Long optionKey : optionKeySet) { options.add(optionsMap.get(optionKey));}return options; 이후코드 for (Entry entry : optionsMap.entrySet()) {options.add(entry.getValue());}return options; 근데, 담겨지는.. 더보기 BigDecimal 의 divide 결과 java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result 아무리 BigDecimal이라고 해도 제한없는 숫자를 다룰 수는 없는 거지. divide시 필히 자리수와 결과셋을 지정해줘야 한다. bigDecimal.divide(bd, 2, BigDecimal.ROUND_CEILING); 요로코롬 더보기 리스트에서 Entity의 id를 Key로 갖는 Map으로 전환 public class Employee {..private Integer age;private String name; List employees = Lists.ne...;.... JSDK 7 Guava 위의 리스트에서 Entity의 id를 Key로 갖는 Map으로 전환 하고 싶다면 guava에서 다음과 같이 하자. Map employeeMap = Maps.uniqueIndex(employees, new Function() {public Integer apply(Employee employee) {return employee.getAge;}}); JSDK 8 Lamda// 중복의 경우 Map employeeMap = employees.stream().collect(Collectors.groupingBy(E.. 더보기 Guava Cache 10초 유지 LoadingCache private LoadingCache loadingCache = CacheBuilder.newBuilder().maximumSize(20).expireAfterAccess(10, TimeUnit.SECONDS).build(new CacheLoader() {public Optional load(Long key) {return Optional.fromNullable(get반환메소드(key));}}); public Integer getLoadingCache(final Long key) {try {return loadingCache.get(key).or(DEFAULT_QUANTITY);} catch (ExecutionException e) {...}return DEFAULT_.. 더보기 이전 1 ··· 26 27 28 29 30 31 32 ··· 56 다음