Programming/Java(Spring)2020. 1. 15. 10:50

JDK 설치

$ sudo apt install openjdk-8-jdk

[링크 : https://daddyprogrammer.org/post/2062/openjdk-install-update-delete/]

 

예제 spring 프로젝트 다운로드(git)

$ git clone https://github.com/spring-guides/gs-rest-service.git

$ cd gs-rest-service/initial

$ ./gradlew bootRun

[링크 : https://spring.io/guides/gs/rest-service/]

 

http://localhost:8080/greeting

외부에서 접근하려면 ip로 바꾸고 8080 포트로 접속하면 된다.

다만.. 위에서 bootRun으로 했기 수정없이 실행했기에 greeting이 아직 생성되지 않아 접근이 되지 않는다.

gs-rest-service/initial/src/main/java/com/example/restservice/Greeting.java

package com.example.restservice;

public class Greeting {

private final long id;
private final String content;

public Greeting(long id, String content) {
this.id = id;
this.content = content;
}

public long getId() {
return id;
}

public String getContent() {
return content;
}
}

 

gs-rest-service/initial/src/main/java/com/example/restservice/GreetingController.java

package com.example.restservice;

import java.util.concurrent.atomic.AtomicLong;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class GreetingController {

private static final String template = "Hello, %s!";
private final AtomicLong counter = new AtomicLong();

@GetMapping("/greeting")
public Greeting greeting(@RequestParam(value = "name", defaultValue = "World") String name) {
return new Greeting(counter.incrementAndGet(), String.format(template, name));
}
}

+

위에서 GetMapping으로 greeting일 경우에

Parameter 이기에 greeting?name= 형식으로 값을 받되, 값이 없으면 기본값을 World로 지정해 주는 것으로 보인다.

@로 시작하는 annotation들은 조금 공부가 필요 할 듯 하다.

 

 

이렇게 파일 두개 추가해주고 gs-rest-service/initial 디렉토리로 돌아와

gradlew bootRun을 실행후

http://localhost:8080/greeting

http://localhost:8080/greeting?name=User

을 접속하면 15분(?) 강좌 끝

 

+

gradlwe bootRun은

gradle 도움말에 안나오는 걸 봐서는 spring boot 에서 추가된 taskName으로 추정된다.

[링크 : https://docs.gradle.org/current/userguide/command_line_interface.html]

 

+

[링크 : https://spring.io/guides/gs/spring-boot/] spring boot

[링크 : https://spring.io/guides/gs/accessing-data-rest/] JPA

[링크 : https://spring.io/guides/gs/accessing-data-mysql/] MYSQL

Posted by 구차니

정말로 정말로 올해는 아작내고 싶은 녀석들

 

1. python 3

[링크 : https://www.python.org/]

 

2. PyGL / PyCV

[링크 : https://sourceforge.net/projects/pycv/]

[링크 : http://pyopengl.sourceforge.net/]

 

3. DBMS 개론 및 튜닝

4. 개인 홈페이지 작성

 

4개나 되는게 욕심이 좀 많아 보이지만 DB 개론 까진 좀 아작을 내고

다음을 위해 사용할 칼로 갈아 놔야지... 안되겠다

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

출근길 일기?  (2) 2020.01.19
피곤한 하루  (2) 2020.01.18
오랫만에.. 정시보다 일찍 퇴근이면 머하냐..  (2) 2020.01.06
지치는 주말.. 아내도 힘든 주말  (0) 2020.01.05
새해의 시작..  (0) 2020.01.01
Posted by 구차니

dictionary 라고 하는 녀석은 node.js 에서 json 객체와 같은 녀석으로 보이는데..

아무튼 dictionary라고 하니 그렇게 표현을 해주자 -_-

 

dictionary는 {}

list는 []

tuple은 () 으로 표기되며

 

dictionary와 tuple은 [0]을 통해서 접근이 가능하고

dictionary는 ['apple'] 식으로 접근방법이 추가된다.

 

list는 []로 접근할 수 없으며, append(), pop() 등을 통해 stack이나 queue로 사용이 가능하다.

대신 list 답게 정렬등의 기능을 지원한다.

'Programming > python(파이썬)' 카테고리의 다른 글

pythonpath  (0) 2021.04.16
python yield  (0) 2021.04.07
python 반복문 for in range()  (0) 2020.01.11
python print 와 while 문  (0) 2020.01.11
오랫만에 한가로움?  (0) 2020.01.11
Posted by 구차니

실제 DB가 파일로 저장되는 경로를 확인하는 방법

 

show data_directory;

[링크 : https://confluence.curvc.com/pages/viewpage.action?pageId=10092649]

Posted by 구차니

byte 단위로 나오려나?

 

select pg_relation_size('schema.table_name');

[링크 : https://korearank1.tistory.com/43]

[링크 : https://wiki.postgresql.org/wiki/Disk_Usage]

 

+

byte가 맞는듯

pg_size_pretty()로 감싸면 읽기 편한 단위로 바꾸어 준다

[링크 : https://ktdsoss.tistory.com/383]

'프로그램 사용 > postgreSQL' 카테고리의 다른 글

postgresql 테이블 크기  (0) 2020.01.15
postgresql data_directory  (0) 2020.01.13
sql combination 생성하기  (0) 2020.01.13
postgres limits - max capacity  (0) 2020.01.10
pgmodeler  (0) 2020.01.05
Posted by 구차니
Programming/Java(Spring)2020. 1. 13. 14:37

java VM 특성(?)으로 localhost에 대해서 주소를 IPv4와 IPv6로 resolve하는 것으로 보인다.

java -jar 앞에 아래의 옵션을 주면 해결!

 

-Djava.net.preferIPv4Stack=true

[링크 : https://hane-1.tistory.com/42]

'Programming > Java(Spring)' 카테고리의 다른 글

ckedtior file upload  (0) 2024.02.07
spring 다시 시작  (0) 2020.01.15
jsoup html body 사이즈 제한  (0) 2019.09.26
java 메모리 관련...2?  (0) 2019.07.06
java.lang.OutOfMemoryError: GC overhead limit exceeded  (1) 2019.07.06
Posted by 구차니

원래 글에서 응용해서 만들어 본 예제

4*3=12 개 나오는게 맞...겠지? 순열과 조합부터 다시 봐야하나 헷갈리네

 

select t1, t2
from (select unnest(array['a','b','c','d'])) as t1
join (select unnest(array['1','2','3'])) as t2 on t1 <> t2

[링크 : https://stackoverflow.com/questions/31129507/postgres-query-to-create-combinations]

 

t1과 t2가 동일 데이터가 있으면 안되기에 on에 조건을 true로 주면 문제없이 되긴 한다.

select t1, t2
from (select unnest(array['a','b'])) as t1
join (select unnest(array['1','2','3','a','as'])) as t2 on true

 

+

위의 예제에서 join on.. 대신 cross join 해도 되는 듯 하다

select t1, t2
from (select unnest(array['a','b','c','d'])) as t1
cross join (select unnest(array['1','2','3'])) as t2

[링크 : https://www.essentialsql.com/cross-join-introduction/]

'프로그램 사용 > postgreSQL' 카테고리의 다른 글

postgresql data_directory  (0) 2020.01.13
postgres table의 물리적 용량 확인하기  (0) 2020.01.13
postgres limits - max capacity  (0) 2020.01.10
pgmodeler  (0) 2020.01.05
스칼라 서브쿼리(scalar subquery)  (0) 2020.01.04
Posted by 구차니
Linux2020. 1. 13. 11:55

 

언제부터인지 확실히는 알 수 없으나

리눅스에서 메모리가 넉넉하면(이게 전제조건이라 발동하는걸 이제 본걸지도?)

디스크 IO를 캐싱한다.

pagecache 1은 파일의 내용을

pagecache 2는 파일의 속성 및 디렉토리 정보 등을 캐싱한다고 하는데

메모리가 몇 기가 이상이어야 캐싱을 하는지 이런것들에 대한 정보를 찾으려고 해도 보이질 않는다.

 

pagecache 해제 
echo 1 > /proc/sys/vm/drop_caches 

dentries, inodes 해제 
echo 2 > /proc/sys/vm/drop_caches 

pagecache, dentries, inodes 모두 해제 
echo 3 > /proc/sys/vm/drop_caches

[링크 : https://zetawiki.com/wiki/리눅스_캐시_메모리_비우기]

[링크 : https://en.wikipedia.org/wiki/Page_cache]

 

[링크 : https://www.linuxatemyram.com/play.html]

[링크 : https://www.thegeekdiary.com/how-to-clear-the-buffer-pagecache-disk-cache-under-linux/]

[링크 : https://discuss.aerospike.com/t/how-to-tune-the-linux-kernel-for-memory-performance/4195]

 

+

2.2 kernel 부터 들어있었으면 정말 오래전 부터인데. 메모리 양에 작동을 하던거라 존재를 몰랐을 뿐인건가?

The term, Buffer Cache, is often used for the Page Cache. Linux kernels up to version 2.2 had both a Page Cache as well as a Buffer Cache. As of the 2.4 kernel, these two caches have been combined. Today, there is only one cache, the Page Cache.

[링크 : https://www.thomas-krenn.com/en/wiki/Linux_Page_Cache_Basics]

'Linux' 카테고리의 다른 글

find -mmin  (0) 2020.12.04
linux 스토리지 정보  (0) 2020.10.14
dmesg 시간 환산하기  (0) 2020.01.07
screen 사용법  (0) 2019.12.18
byobu  (0) 2019.12.18
Posted by 구차니
게임2020. 1. 12. 22:04

몇년째 엔딩을 못보고 있는 녀석.. 공략을 보고라도 끝내야지 하면서 하는데..

게임 멀미가 없어서 참 다행이다만.. 길 찾기가 너무 어렵고

몇 곳에서는 공략 없으면 길을 못 찾는 미묘한 설계 라고 해야 하나..

조금 익숙해지니 뻔하게 직진만 하면 되도록 설계한게 보이지만

그럼에도 명중율 문제인지 적을 제압하질 못하니 계속 죽다가 동영상 공략 보고 하나하나 진행하는 중..

 

총 8시간이면 웬만해서는 엔딩을 본다는데

언넝 끝내고 다음편도 하고.. 그래야 하려나?

그냥 시작했으니.. 라는 의무감으로 하는 느낌이 너무 싫네

 

 

 

[링크 : https://blog.naver.com/2pnn/90177709064]

'게임' 카테고리의 다른 글

magicka 시작!  (0) 2020.03.20
remember me 한글 패치  (0) 2020.03.10
페이데이 스팀버전 한글패치  (0) 2019.07.17
DCS World 해봄  (4) 2018.04.08
프렌즈 마블 벨소리 ㅋㅋㅋ  (4) 2018.03.10
Posted by 구차니

아내가 오랫만에 애들이랑 놀아준다고 고생했다고

 

그럼에도 불구하고 자꾸 애들에게 짜증만 내서 아내에게 미안하고

애들에게 미안하네...

'개소리 왈왈 > 육아관련 주저리' 카테고리의 다른 글

하루하루 정신없네  (0) 2020.01.26
정신없는 새해  (0) 2020.01.25
약간의 앨범정리  (0) 2019.12.28
지름 배송..  (2) 2019.11.17
지름의 날  (0) 2019.11.16
Posted by 구차니