// error fix :Failed to lookup view  in views directory "/views"

app.set('views', path.join(__dirname, 'views'));


 

app.use(express.json());
app.use(express.urlencoded({extended:true}));

...

app.put('/location/:loc_cd', function(req,res) {
    
var loc_cd = req.params.loc_cd;
console.log('Put Parameter = ' + loc_cd);

var loc_nm = req.body["loc_nm"];
console.log('Put loc_nm = ' + loc_nm);

})



document.querySelectorAll("input[type='checkbox']");

(https://developer.mozilla.org/ko/docs/Web/API/Document/querySelectorAll)



strPhone.replaceFirst("(^02|[0-9]{3})([0-9]{3,4})([0-9]{4})$", "$1"+"-"+"$2"+"-"+"$3"); // 01012345678 -> 010-1234-5678


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

(https://stackoverflow.com/questions/14751276/eclipse-not-recognizing-project-as-gradle-project/28313449)


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)