springboot2-thymeleaf 사용 예제를 다룬 코드를 참고한다.


https://www.mkyong.com/spring-boot/spring-boot-hello-world-example-thymeleaf/



실수하기 좋은 부분은 다음과 같다. 


1. html 파일에 다음을 추가해야 한다.

<html lang="ko" xmlns:th="http://www.thymeleaf.org">


2. th를 잘 사용한다.

velocity에서 아래와 같이 사용했다면..

  <span class="item">${link.itemName}</span>


아래와 같이 th:text를 사용한다.

<span class="item" th:text="${link.itemName}"></span>



3, 

velocity에서 아래와 같이 사용했다면..


    <span class="image" style="background-image:url(${link.thumbnail})"></span>


아래와 같이 th:style과 콜럼을 잘 사용해야 한다. 실수하기 가장 쉬운 곳이 아래 빨간색 색칠한 부분이다.

<span class="image" th:style="'background-image:url(' + ${link. thumbnail} + ');'"></span>


Posted by '김용환'
,


list/set/dict comprehension 예시



# list comprehension
print([x for x in range(5)])

print([x*2 for x in range(5) if x != 1])

print(["You are good, " + x for x in ["Zero, Jonathan"]])

#결과
#[0, 1, 2, 3, 4]
#[0, 4, 6, 8]
#['You are good, Zero, Jonathan']

# set comprehension

print({"You are good, " + x for x in ["Zero, Zero"]})

# 결과
# {'You are good, Zero, Zero'}

# dictionary comprehension
score = [('merlin', 90), ('zero', 80), ('samuel', 95)]
print({x[0]: x[1] for x in score})

# 결과
# {'merlin': 90, 'zero': 80, 'samuel': 95}


# generator expression
gen = (x+1 for x in range(5))
print(gen)
print(next(gen))
print(next(gen))
print(next(gen))

# 결과
# <generator object <genexpr> at 0x103721570>
# 1
# 2
# 3


여기에 sum을 사용해 lambda 처럼 비슷하게 사용할 수 있다. 

print([1 for x in range(5)])
#[1, 1, 1, 1, 1]

print(sum([1 for x in range(5)]))
#5


Posted by '김용환'
,


어벤져스 엔드게임 중에 좋았던 대사


Thor's mother: A failure? Absolutely. 

                         실패라고 한다면 맞지. 완전히 실패했지. 


Thor : That's a little bit harsh. 

           너무 막말하시네요. 어머니. 


Thor's mother: Do you know what that makes you? Just like everyone else.

                       그 실패가 무엇을 알려준 줄 아니? 그저 다른 사람과 같아지는 것일 뿐이야. 


Thor : I'm not supposed to be like everyone else, am I? 

          내가 대단한 뭔가가 될 수 없다는 의미인가요. 제가요?


Thor's mother: Everyone fails at who they're supposed to be, Thor. The measure of a person a hero is how well they succeed at being who they are. 

                        모든 사람은 되고 싶은 뭔가에 되는 걸 실패한단다. 토르..

                        히어로의 척도는 스스로 얼마나 자신의 존재로서 성공하느냐에 달려있단다.


'영화를 보고' 카테고리의 다른 글

"아름다운 것들은 관심을 바라지 않지"  (0) 2018.11.21
[더스토리] 영화의 기억나는 대사  (0) 2018.06.26
레디 플레이어 원  (0) 2018.04.04
칠드런 오브 맨  (0) 2016.10.25
[마이크롭 앤 가솔린]  (0) 2016.07.02
Posted by '김용환'
,



spring boot2  (Spring Framework 5)부터 지원하지 않는 게 있다..



https://github.com/spring-projects/spring-framework/wiki/What%27s-New-in-Spring-Framework-5.x#removed-packages-classes-and-methods


Dropped support: Portlet, Velocity, JasperReports, XMLBeans, JDO, Guava.

Recommendation: Stay on Spring Framework 4.3.x for those if needed.


Posted by '김용환'
,


JPA 개발을 편리하게 해주는 querydsl 라이브러리는 2018년 중순 개발이 멈췄고,

querydsl 의 gradle 라이브러리는 조심스럽게 써야 한다. querydsl gradle 개발회사인 ewerk가 망하면서.. 자연스럽게 개발이 멈춰졌다. 



https://github.com/ewerk/gradle-plugins


EWERK Gradle Plugins

NOTE: The plugins are currently not compatible to Gradle 5+ and have not been tested with a JDK higher than 1.8. Currently a lot of issues arise related to using the plugins with Gradle 5+. There are plans to adopt the plugins to the newest Gradle API but time is lacking. Help is pretty much appreciated. Please see https://github.com/ewerk/gradle-plugins/milestone/1.



jdk 10+, gradle 5+를 써도 컴파일되긴 한다... 다만 안정성은 보장 못하니.. 조심하게 사용할 필요가 있다. 


Posted by '김용환'
,


springboot 에서 아래와 같은 에러가 발생한다면.


Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.




다음과 같이 드라이브 클래스 이름부터 제대로 추가했는지 확인하다.



spring.datasource.driver-class-name: com.mysql.jdbc.Driver
spring.datasource...
....



Posted by '김용환'
,
Posted by '김용환'
,


https://news.v.daum.net/v/20190819152101283



쿠옥은 이에 대해 "내가 말할 수 있는 것은 다른 입장이 돼 생각해보라는 것"이라며 "당신의 어머니, 여자형제, 아내, 여자친구가 짐승 취급당했다면 어떨까?"라고 되물었다. 이어 "나는 일본 회사와 같이 일하고 있고 일본인과도 친구이며 그들을 이해하고 있지만, 동시에 나는 그들이 과거 멍청한 행동을 반복하지 않길 바란다"고 덧붙였다.

쿠옥은 "일제는 대동아 공동번영을 위해 (말레이시아 침공에) 나섰다고 말했지만 '공동번영'이라는 의미는 일본이 90%를 가져가고 10%만을 주겠다는 뜻"이라며 식민통치를 비판했다.


자세전은 아마존에 있다. (언젠가 봐야지..)

https://www.amazon.com/gp/product/9814189731


Posted by '김용환'
,


http://www.yes24.com/Product/Goods/6139530?scode=032&OzSrank=1

구글을 움직이는 10가지 황금율을 읽고 10가지 황금율을 발췌했다.




Google's 10 Golden Rules are:
  • Hire by committee.
  • Cater to their every need.
  • Pack them in.
  • Make coordination easy.
  • Eat your own dog food.
  • Encourage creativity.
  • Strive to reach consensus.
  • Don't be evil (Note: we knew it had to be there somewhere)


1. 채용은 위원회에서 담당한다. 


2. 필요한 것은 모두 충족시킨다.


3. 한곳에 모아놓는다.


4. 조율하기 쉬운 환경을 만든다.


5. 출시 전 자사 제품을 사용하게 한다.


6. 창조성을 장려한다.


7. 합의를 이끌어내기 위해 노력한다.


8. 사악해지지 않는다.


9. 데이터가 판단을 쉽게 하도록 한다.


10. 효과적으로 커뮤니케이션한다. 


'After reading book' 카테고리의 다른 글

[펌] 넥슨, 플레이의 좋은 내용  (0) 2019.10.08
"쿠팡" - 우리가 혁신하는 이유  (0) 2019.10.05
파워풀  (0) 2019.07.25
'플랫폼 제국의 미래'를 보고  (0) 2019.06.24
소프트 스킬의 잼있는 부분 발췌  (0) 2019.03.30
Posted by '김용환'
,


kubernetes namespace 추가하기

$ kubectl create namespace capture

$ kubectl get namespace

NAME            STATUS   AGE

capture         Active   13s


쿠버네티스 설정 yaml 파일에서도 커맨드와 동일한 효과를 줄 수 있다.


---
apiVersion: v1
kind: Namespace
metadata:
name: capture
labels:
app.kubernetes.io/name: capture
app.kubernetes.io/part-of: capture
app.list: phantomjs


Posted by '김용환'
,