본문 바로가기

전체 글163

[Java]프로그래머스 스킬트리 ``` class Solution { public int solution(String skill, String[] skill_trees) { int answer = 0; for(int i=0; i 2019. 4. 15.
[Java] 프로그래머스 주식가격 ``` import java.util.*; class Solution { public int[] solution(int[] prices) { int len = prices.length; int[] answer = new int[len]; for(int start = 0; start 2019. 4. 15.
[Java] 프로그래머스 기능개발 나의 풀이 import java.util.*; class Solution { public int[] solution(int[] progresses, int[] speeds) { int[] answer = {}; int[] daysrequired = { progresses.length }; Stack st = new Stack(); Queue q = new LinkedList(); for (int i = 0; i < progresses.length; i++) { q.add((100 - progresses[i]) / speeds[i]); } int cnt = 1; int minday = q.poll(); List list = new ArrayList(); while (!q.isEmpty()) { int nu.. 2019. 4. 15.
우아한 테크코스 7번 문제 Cryptogram 암호문을 좋아하는 괴짜 개발자 브라운이 이번에는 중복 문자를 이용한 새로운 암호를 만들었습니다. 예를 들어 browoanoommnaon이라는 암호문은 다음과 같은 순서로 해독할 수 있습니다. 1. "browoanoommnaon" 2. "browoannaon" 3. "browoaaon" 4. "browoon" 5. "brown" 임의의 문자열 cryptogram이 매개변수로 주어질 때, 연속하는 중복 문자들을 삭제한 결과를 return 하도록 solution 메서드를 완성해주세요. ----- 어찌저찌 풀었는데 이게 효율적인지 아닌지는 모르겠다. ----- import java.util.*; public class Main3 {public static String check(StringBuilder str2.. 2019. 3. 19.
객체지향 프로그래밍이란? 객체지향 프로그래밍 Object Oriented Programming 객체지향 프로그래밍이란 무엇인가? 우선 객체란 무엇인가? 객관적으로 존재하는 실체 객체란 물리적, 추상적인것들 중 자신의 속성을 가지고 식별 가능한 것들. - 과일, 수학… 객체는 속성과 동작으로 구성 - 속성 – Field - 동작 – Method 객체를 만드는 설계도, 틀 = 클래스(Class) - 참조자료형 - 추상적 - 표현 대상들의 공통적인 특징을 서술 - 객체를 생성하기 위한 필드와 클래스가 정의 되어있다. - 하나의 클래스로부터 여러 인스턴스를 만들 수 있다. - 클래스가 실체로 만들어진 것이 바로 Object 객체 클래스를 통해 만들어진 객체(Object)를 해당 클래스의 인스턴스(Instance)라 한다. Car(클래스.. 2019. 3. 7.
Windows 7이상에서 Docker Toolbox 사용시 https://localhost:4000으로 접속 불가 해결 윈도우 7 이상에서 Docker Toolbox를 사용해 실행을 한 뒤 localhost:4000 으로 접속하면 오류페이지가 나온다. Docker Hub에서는 이와 같은 에러가 나오는 경우에 $docker-machine ip 로 Docker Machine IP를 확인 뒤 htt://Docker Machine IP:4000 으로 접속하라고 나와있다. Note: If you are using Docker Toolbox on Windows 7, use the Docker Machine IP instead of localhost. For example, http://192.168.99.100:4000/. To find the IP address, use the command docker-machine ip. 2019. 2. 21.
java.lang.NoClassDefFoundError: Could not initialize class 해결 Servlet + JSP 를 사용하여 게시판을 만들던 중에 java.lang.NoClassDefFoundError: Could not initialize class 오류가 발생하여 이를 해결 한 과정을 적습니다. Apache tomcat 8.5.34 버전Hikaricp 3.3.0버전 사용 서버를 돌리면 java.lang.NoClassDefFoundError: Could not initialize class 오류가 발생. Intellij 콘솔에서 Failed to load class "org.slf4j.impl.StaticLoggerBinder".오류가 발생하는 것을 발견 pom.xml에 다음을 추가 org.slf4j slf4j-api 1.7.5 org.slf4j slf4j-log4j12 1.7.5 해결이.. 2019. 1. 16.
JDBC MySQL 5.1.23 이상 사용시 time zone 관련 에러 발생 시 해결 방법 MySQL 8.0.13을 설치해서 JDBC 실습을 하던 중에 다음과 같은 에러가 발생했다. java.sql.SQLException: The server time zone value '´ëÇѹα¹ Ç¥ÁؽÃ' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support. 구글링을 해보니 MySQL 버전 5.1.23보다 높은 버전을 사용하면 MySQL.. 2019. 1. 12.
forward redirect web container 차원에서의 페이지 이동, 실제로 웹 브라우저는 다른 페이지로 이동했는지 알 수 없다. 웹 브라우저에는 최초 호출한 URL만 표시되고, 이동한 페이지의 URL정보는 볼수가 없다. 동일한 web container에 있는 페이지로만 이동이 가능하다. 현재 실행중인 페이지와 forward에 의해 호출될 페이지는 request, response 객체를 공유한다. forwar방식은 다음 이동한 URL로 요청정보를 그대로 전달한다. 말 그대로 forward(건네주기)하는 것이다. 그렇기 때문에 사용자가 최초로 요청한 요청정보는 다음 URL에서도 유효하다. web container는 redirect 명령이 들어오면 웹 브라우저에게 다른 페이지로 이동하라는 명령을 내린다. 웹 브라우저는 URL을.. 2019. 1. 10.
728x90