| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
- 특수문자 치환
- springboot+redis
- 리눅스
- mysql
- aws elasticache 활용
- js
- redis + spring boot 함께
- insert
- 엔티티 코드 치환
- architecture
- docker 컨테이너로 띄우기
- sftp
- jQuery
- 톰캣
- 제이쿼리
- javascript
- Java
- Entity Code 치환
- for문
- Tomcat
- Linux
- 만들면서 배우는 클린 아키텍처
- select
- Docker Compose
- 자바스크립트
- 초단위
- 자바
- feignClient
- catalina.out
- 정규식
- Today
- Total
목록전체 글 (74)
꾸준하게, 차근차근
1. nohup 명령어 명령의 정지나 로그아웃에 영향을 받지 않는 명령으로 유닉스 시스템의 접두부(다른 명령의 앞에 오는 명령) 명령의 하나이다. 따라서 해당 명령을 지속적으로 실행하고자 할 때 사용된다. 2. nohup 실행 nohup [실행파일명] & 위와 같이 명령어를 실행하면 위 실행파일이 백그라운드에서 실행된다. ‼️ 주의 nohup으로 실행할 쉘스크립트 파일(*.sh)은 퍼미션이 755 이상이어야 한다. 3. 로그파일 남기지 않도록 nohup 실행 nohup [실행파일명] 1>/dev/null 2>&1 & 1>/dev/null 이 표현은 1의 결과를 /dev/null 이라는 파일 속에 넣는다 라는 의미이다. /dev/null로 보내버리면 모든 출력을 없애버린다. 2>&1 이 표현은 2번 파일 ..
function timeDifference(startDate, endDate) { var start = new Date(startDate); var end = new Date(endDate); var difference = end.getTime() - start.getTime(); var result = (difference / (1000*60*60*24)) + 1; return result; } 날짜를 millisecond 단위로 변환 후 두 날짜를 빼 남은 값을 계산하는 로직이다. 위 차이 일수에는 두 날짜를 포함하고 있지 않음을 유의해야 한다.
1. copyOfRange() Arrays.copyOfRange(arr, i, j) arr 배열을 i부터 j까지 자르려면 위와 같은 방법을 사용할 수 있다. public class Code { public static void main(String[] args) { int[] array = {1, 5, 2, 6, 3, 7, 4}; int[][] commands ={{2, 5, 3} ,{4, 4, 1} ,{1, 7, 3}}; System.out.println(Arrays.toString(solution(array, commands))); System.out.println(Arrays.toString(solution1(array, commands))); System.out.println(Arrays.toSt..
1. Collections.sort() import java.util.ArrayList; import java.util.Collections; public class Test { public static void main(String[] args) { ArrayList list = new ArrayList(); list.add("A"); list.add("B"); list.add("C"); list.add("a"); list.add("b"); list.add("c"); // 오름차순 Collections.sort(list); System.out.println("오름차순 : " + list); // 내림차순 Collections.sort(list, Collections.reverseOrder()); Sys..
1. For문 public class Test { public static void main(String[] args) { int[] arr = {1,2,3,4,5,6,7,8,9}; int sum = 0; for( int i=0; i a+b); System.out.println(sum); } } 3. reduce() public class Test { public static void main(String[] args) { int[] arr = {1,2,3,4,5,6,7,8,9}; int sum = Arrays.stream(arr).reduce(0, (a,b) -> a+b); System.out.println(sum); } } 4. sum() public class Test { public static ..
1. 일반적인 커널에 대한 정보 [root@idcserver ~]$ uname -a Linux idcserver 3.10.0-1160.62.1.el7.x86_64 #1 SMP Tue Apr 5 16:57:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux 2. OS버전에 대한 정보 1 [root@idcserver ~]$ cat /etc/issue \S Kernel \r on an \m 3. OS버전에 대한 정보 2 [root@idcserver ~]$ cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core) 4. OS버전에 대한 정보 3 [root@idcserver ~]$ cat /etc/*release* CentOS Linux ..
1. new JSONObject(hashmap) import java.util.HashMap; import java.util.Map; import org.json.simple.JSONObject; public class Test { public static void main(String[] args) { Map map = new HashMap(); map.put("key1", "value1"); map.put("key2", "value2"); JSONObject jsonObj = new JSONObject(map); } } 2. Jackson 라이브러리 import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.core.Jso..
1. maven dependency 설정 com.fasterxml.jackson.core jackson-core 2.3.0 com.fasterxml.jackson.core jackson-databind 2.3.0 2. JsonString To Map import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; public static void main(String[] args) { String dataStr = (String) jsonObj.get("data"); HashMap dataMap = new ObjectMapper() .readValue(dataStr, new Typ..