mysql, pivot

카테고리 없음 2021. 11. 2. 18:21

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)


Gson, \u003d

카테고리 없음 2021. 10. 26. 16:12

        // // \u003d (=) 에러 String req = new GsonBuilder().create().toJson(sendObj);
        String req = new GsonBuilder().disableHtmlEscaping().create().toJson(sendObj);

(https://acet.pe.kr/519)


    @NotEmpty
    private String userId;

-->

/* @NotEmpty */
    private String userId;

 

(https://tecoble.techcourse.co.kr/post/2020-09-20-validation-in-spring-boot/)



(https://stackoverflow.com/questions/12711786/convert-command-line-arguments-into-an-array-in-bash/12711837)

#!/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

보호되어 있는 글입니다. 내용을 보시려면 비밀번호를 입력하세요.


java, Gson

카테고리 없음 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);

 


java, Gson

카테고리 없음 2021. 9. 7. 14:58
$ 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);

 


 you can create new instances of Foo by writing: Foo.of(5); instead of having to write: new Foo<Integer>(5);.

(https://projectlombok.org/features/Data)


$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$ python get-pip.py