strPhone.replaceFirst("(^02|[0-9]{3})([0-9]{3,4})([0-9]{4})$", "$1"+"-"+"$2"+"-"+"$3"); // 01012345678 -> 010-1234-5678
'분류 전체보기'에 해당되는 글 666건
- 2021.11.22 java, phone number
- 2021.11.15 mysql, weighted random select
- 2021.11.10 java, gradle project
- 2021.11.02 mysql, pivot
- 2021.10.26 Gson, \u003d
- 2021.10.26 spring boot, must not be empty (비어 있을 수 없습니다)
- 2021.10.06 JPA, native query mapping with SqlResultSetMapping
- 2021.09.29 bash, parameter
- 2021.09.24 spring, @Controller @RestController
- 2021.09.24 java, Gson
drop table test1;
create table test1
(id varchar(10),
weight int,
height int
);
delete from test1;
insert into test1 values('id20', 20, 150);
insert into test1 values('id30', 30, 140);
insert into test1 values('id50', 50, 130);
SELECT test1.*
FROM
test1
JOIN
(
SELECT id,weight FROM test1
ORDER BY RAND() * ( 1 / weight)
LIMIT 1
)
t2
USING (id)
;
(https://www.tek-tips.com/viewthread.cfm?qid=1296084)
eclipse 에서 설정
project 선택 > 우마우스 > Configure > Add Gradle Nature
WITH RECURSIVE
unwound AS (
SELECT CONCAT(1,',',2,',',3) AS colors
UNION ALL
SELECT regexp_replace(colors, '^[^,]*,', '') colors
FROM unwound
WHERE colors LIKE '%,%'
)
SELECT regexp_replace(colors, ',.*', '') colors
FROM unwound
(https://stackoverflow.com/questions/17308669/what-is-the-opposite-of-group-concat-in-mysql)
// // \u003d (=) 에러 String req = new GsonBuilder().create().toJson(sendObj);
String req = new GsonBuilder().disableHtmlEscaping().create().toJson(sendObj);
@NotEmpty
private String userId;
-->
/* @NotEmpty */
private String userId;
(https://tecoble.techcourse.co.kr/post/2020-09-20-validation-in-spring-boot/)
#!/bin/bash
echo "Dollar-1 : $1"
echo "Dollar-2 : $2"
echo "Dollar-3 : $3"
echo "Dollar-AT: $@"
echo ""
myArray=( "$@" )
echo "A Val 0: ${myArray[0]}"
echo "A Val 1: ${myArray[1]}"
echo "A Val 2: ${myArray[2]}"
echo "A All Values: ${myArray[@]}"
spring, @Controller @RestController
2021. 9. 24. 17:52보호되어 있는 글입니다. 내용을 보시려면 비밀번호를 입력하세요.
$ cat build.gradle
...
dependencies {
....
implementation 'com.google.code.gson:gson'
...
}
...
$ cat GsonTest.java
...
import com.google.gson.GsonBuilder;
...
String req = new GsonBuilder().create().toJson(obj);
...
Mono<String> result = webClient.mutate()
.build()
.post()
.uri(uri)
.header("Content-Type", "application/json")
.header("openapikey", openapikey())
.bodyValue(req)
.accept(MediaType.APPLICATION_JSON)
.retrieve()
.bodyToMono(String.class);