172만명의 커뮤니티!! 함께 토론해봐요.
해결됨
[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스
const messageContainer = document.querySelector("#d-day-message"); const container = document.querySelector("#d-day-container"); container.style.display = 'none' messageContainer.innerHTML = "<h3>D-Day를 입력해 주세요</h3>"; const dateForMaker = function () { const inputYear = document.querySelector("#target-year-input").value; const inputMonth = document.querySelector("#target-month-input").value; const inputDate = document.querySelector("#target-date-input").value; //const dateFormat = inputYear + "-" + inputMonth + "-" + inputDate; const dateFormat = `${inputYear}-${inputMonth}-${inputDate}`; return dateFormat; // console.log(inputYear, inputDate, inputMonth); }; const counterMaker = function () { const targetDateInput = dateForMaker(); // console.log(targetDateInput); const nowDate = new Date(); const targetDate = new Date(targetDateInput).setHours(0, 0, 0, 0); const remaining = (targetDate - nowDate) / 1000; // 만약 remaining이 0이라면 , 타이머가 종료 되었습니다 출력 (수도코드) console.log(remaining); if (remaining === 0 || remaining < 0) { // console.log("타이머가 종료되었습니다"); messageContainer.innerHTML = "<h3>타이머가 종료되었습니다</h3>"; } else if (isNaN(remaining)) { // 만약 잘못된 날짜가 들어왔다면, 유효한 시간대가 아닙니다 출력 // console.log("유효한 시간대가 아닙니다"); messageContainer.innerHTML = "<h3>유효한 시간대가 아닙니다</h3>"; } // const remainingDate = Math.floor(remaining / 3600 / 24); //Math. floor 소숫점 제거 // const remaingHours = Math.floor(remaining / 3600) % 24; // const remaingMin = Math.floor(remaining / 60) % 60; // const remaingSec = Math.floor(remaining) % 60; const remaingObj = { remainingDate: Math.floor(remaining / 3600 / 24), remaingHours: Math.floor(remaining / 3600) % 24, remaingMin: Math.floor(remaining / 60) % 60, remaingSec: Math.floor(remaining) % 60, }; // const days = document.getElementById("days"); // const hours = document.getElementById("hours"); // const min = document.getElementById("min"); // const sec = document.getElementById("sec"); // const documentObj = { // days: document.getElementById("days"), // hours: document.getElementById("hours"), // min: document.getElementById("min"), // sec: document.getElementById("sec"), // }; const documentArr = ['days', 'hours', 'min' , 'sec'] // const docKeys = Object.keys(documentObj); const timeKeys = Object.keys(remaingObj); // Object.keys : 객체의 키를 가져와 배열로 반환f let i = 0; for (let tag of documentArr) { // 배열로 이용한다 document.getElementById(tag).textContent = remaingObj[timeKeys[i]] i++ } const starter = function () { container.style.display ='flex' messageContainer.style.display = 'none' counterMaker() } // for (let i = 0; i < timeKeys.length; i = i + 1) { for문 // documentObj[docKeys[i]].textContent = remaingObj[timeKeys[i]]; // // console.log(timeKeys); // // console.log(timeKeys[i]); // } // let i = 0; // for (let key in documentObj) { // 객체로 이용한다 for in // documentObj[key].textContent = remaingObj[timeKeys [i]] // i++; // } // documentObj['days'].textContent = remaingObj["remainingDate"]; // documentObj['hours'].textContent = remaingObj["remaingHours"]; // documentObj['min'].textContent = remaingObj["remaingMin"]; // documentObj['sec'].textContent = remaingObj["remaingSec"]; // console.log("클릭"); // console.log(remainingDate, remaingHours, remaingMin, remaingSec); }; <!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" href="./main.css" /> <!-- <script src="./script.js" defer></script> --> <title>Document</title> </head> <body> <h1>D-Day</h1> <div id="d-day-container"> <div class="d-day-child-container"> <span id="days">0</span> <span>일</span> </div> <div class="d-day-child-container"> <span id="hours">0</span> <span>시간</span> </div> <div class="d-day-child-container"> <span id="min">0</span> <span>분</span> </div> <div class="d-day-child-container"> <span id="sec">0</span> <span>초</span> </div> </div> <div id="d-day-message"></div> <div id="target-selector"> <input type="text" id="target-year-input" class="target-input" / size="5"> <input type="text" id="target-month-input" class="target-input" / size="5"> <input type="text" id="target-date-input" class="target-input" / size="5"> </div> <button onclick="starter()" id="start-btn">카운트 다운 시작</button> <script src="./script.js"></script> </body> </html> 아무리 호출하고 수정해도 계속 오류가 납니다 이유 좀 알려주세요 ㅠ
react node.js seo graphql next.js
이 규성
2024-11-06T15:43:18.507Z
댓글 3
좋아요 0
조회수 215
해결됨
[신규 개정판] 이것이 진짜 크롤링이다 - 실전편 (인공지능 수익화)
r
손과발
2024-11-06T15:26:51.194Z
댓글 1
좋아요 0
조회수 143
미해결
Next + React Query로 SNS 서비스 만들기
안녕하세요 프로젝트 진행 중에 해결되지 않는 부분이 있어 질문 드립니다. middleware에서 쿠키의 값을 업데이트 하려고 하는데 업데이트 되지 않는 현상이 발생하고 있습니다. 아래의 코드와 같이 NextResponse.next() 실행 후에 response에 쿠키를 업데이트를 하려 하는데 반영이 되지 않습니다. request에서 세팅해도 마찬가지입니다. 쿠키 세팅이 되지 않는 원인에 대해 알고 계신가요?? export default async function middleware(request: NextAuthRequest) { if (request.nextUrl.pathname.startsWith("/gateway")) { const token = await getToken({ req: request, secret: process.env.AUTH_SECRET as string, secureCookie: process.env.NODE_ENV === "production", }); const accessToken = token?.accessToken; const { device } = userAgent(request); request.headers.set("Accept", "*/*"); request.headers.set("Authorization", `Bearer ${accessToken}`); request.headers.set("Access-Control-Allow-Origin", "*"); request.headers.set("deviceType", "1"); request.headers.set("User-Agent", device.model ?? ""); request.headers.set("locale", localeFromCookie); request.headers.set("language", defaultLocale); const response = NextResponse.next({ request: request.headers }); response.cookies.set("test", "test"); return response; } ... }
react next.js react-query next-auth msw
박지수 Jisu Park
2024-11-06T14:06:24.334Z
댓글 1
좋아요 0
조회수 294
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
그냥 object라고 쓸 때가 있고 ""붙이는 경우도 있는데, 이 차이가 궁금합니다
python 머신러닝 빅데이터 pandas 빅데이터분석기사
shs4166
2024-11-06T13:42:13.264Z
댓글 2
좋아요 0
조회수 120
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
안녕하세요. 강의와 교재로 학습중입니다. 코랩 환경에서 자꾸 문서 팝업이 떠서 불편하여 구글링을 해보았는데도 잘 안나와서 혹시 방법을 아실까 하여 질문드립니다. 사진과 같이 ( 를 칠때 이와 관련된 안내문서 창이 나타나는데, 이걸 안나타나게 하는 방법이 있을까요? 답변에 미리 감사드립니다.
python 머신러닝 빅데이터 pandas 빅데이터분석기사
위잉
2024-11-06T13:20:59.311Z
댓글 3
좋아요 0
조회수 195
해결됨
[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스
const weatherSearch = function (position) { fetch( `https://api.openweathermap.org/data/2.5/weather?lat=${position.latitude}&lon=${position.longitude}&exclude={part}&appid=b53e0e301571ed81576201a2a4fee23b` ); }; const accessToGeo = function (position) { const positionObj = { latitude: position.coords.latitude, longitude: position.coords.longitude, }; weatherSearch(positionObj); console.log(position.latitude); }; const askForLocation = function () { navigator.geolocation.getCurrentPosition(accessToGeo, (err) => { console.log(err); }); }; askForLocation(); 위 코드 13번째 줄에서 console.log(position.latitude);를 하면 저는 undefined가 출력되고, console.log(position.coords.latitude);를 해야 위도 값이 나오는데... 강사님께서는 console.log(position.latitude); 라고 코드를 작성하셨는데, 위도 값이 잘 나오더라고요.. 이게 왜 그런지 별건 아니지만 궁금해서 질문남깁니다!
react node.js seo graphql next.js
jihun6548
2024-11-06T12:12:09.290Z
댓글 1
좋아요 0
조회수 139
해결됨
파이썬/장고 웹서비스 개발 완벽 가이드 with 리액트 (장고 4.2 기준)
안녕하세요 강사님, 강사님 강의는 다른 강사님들 강의와는 다르게 먼저 한번 전체적으로 다뤄주고나서 나중에 세세히 강의해주시는것 같습니다. 지금 장고핵심기능 리뷰를 보고 있는데, 각 섹션마다 수강생들이 어떤 부분을 염두하고 보면 좋은지를 알려주시면, 혹은 어떤 목적으로 섹션을 나눴는지를 알려주시면 제가 강의를 이해하고 앞으로 강의를 듣는데 좀더 이해가 잘 될거같습니다. 감사합니다.
react python django web-api htmx
sunnnwo
2024-11-06T12:10:11.856Z
댓글 2
좋아요 0
조회수 230
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
선생님 해설에 보면 f3컬럼의 결측치를 replace로 활용하여 0으로 바꿀때 import numpy as np df['f3'] = df['f3'].replace(np.nan,0) 라고 되어있는데 제가 캡쳐한 화면처럼 풀어도 상관이 없는걸까요?
python 머신러닝 빅데이터 pandas 빅데이터분석기사
expk
2024-11-06T11:32:44.539Z
댓글 2
좋아요 0
조회수 79
미해결
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
강의 15:40 정도 보면 # 남성 중 0과 1 (인원수) 부분에서 코드를 똑같이 입력했는데 저는 뒤에 값이 0이 나옵니다... 뭐가 잘못된건가요,,? 는
python 머신러닝 빅데이터 pandas 빅데이터분석기사
dyddnjs1219
2024-11-06T11:02:06.954Z
댓글 2
좋아요 0
조회수 107
미해결
Next.js 시작하기
섹션 11의 이미지 성능 최적화 강의에서 Next.js의 이미지 성능 최적화에 대해 설명하실 때의 강의 코드가 <Image /> 컴포넌트가 아닌 <img /> 요소인데도 이미지 성능 최적화가 잘 되는 것을 보았습니다. 그럼 굳이 <img /> 요소 대신 <Imgae /> 컴포넌트를 사용해야 하는 이유가 있나요?
javascript react next.js imgae컴포넌트 성능최적화 lazyloading 지연로딩
play _Er
2024-11-06T08:51:46.974Z
댓글 2
좋아요 0
조회수 281
미해결
[신규 개정판] 이것이 진짜 크롤링이다 - 실전편 (인공지능 수익화)
1 . 해당 명령어를 치려면 전역변수로 등록 하고 ui 파일 있는 위치에서 명령어를 실행하기 2 . 환경변수 등록 없이 pyside6-uic.exe 파일이있는 폴더로 터미널 경로를 이동하고 .ui 파일도 exe 폴더있는 경로로 이동시켜서 명령어 실행 위에 두가지 방법으로 했을때 .py로 컴파일이 됐었는데 pyside6-uic login.ui -o login_ ui.py 명령어 실행 할때 vscode 로 다른 방법이 있나요? 환경변수 등록을 안하고 그냥 터미널로 바로 실행하면 pyside6-uic 배치파일 에러가 떴었고 .ui 파일 있는곳에서 실행을 꼭 해야 하더라고요
진용
2024-11-06T08:03:17.732Z
댓글 2
좋아요 0
조회수 254
해결됨
[풀스택 완성] Supabase로 웹사이트 3개 클론하기 (Next.js 14)
무한 스크롤 구현 중에, 스크롤을 내리면 자연스럽게 다음 페이지로 이어지는 게 아니라, 한번 아래로 내려갔다가 다시 스크롤했던 위치로 돌아옵니다. 이 문제는 어떻게 해결할 수 있을까요?
firebase next.js tailwindcss react-query supabase
2024-11-06T06:07:39.997Z
댓글 3
좋아요 0
조회수 375
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
원핫 인코딩을 했는데 0,1 이 아닌 true false 가 나오는 이유가 궁금합니다.
python 머신러닝 빅데이터 pandas 빅데이터분석기사
shs4166
2024-11-06T03:28:25.627Z
댓글 2
좋아요 0
조회수 121
미해결
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
X_train['age']가 아니라 X_train[X_train['age'] 인 이유가 궁금합니다.
python 머신러닝 빅데이터 pandas 빅데이터분석기사
shs4166
2024-11-05T14:35:35.273Z
댓글 2
좋아요 0
조회수 82
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
이 둘의 차이는 뭘까요?
python 머신러닝 빅데이터 pandas 빅데이터분석기사
shs4166
2024-11-05T14:17:53.661Z
댓글 2
좋아요 0
조회수 97
미해결
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
수치형 컬럼들 리스트로 만들 시, cols = list(X_train.columns[X_train.dtypes != 'object']) 시험에서 이렇게 해도 되나요? object랑 int랑 float 세개만 나오면 이렇게 해도 될 듯한데, 그 외 변수들이 나올 경우 대비해서, 수치형 컬럼들만 리스트 할 때, 어떤식으로 코딩하는 것이 나을까요?
python 머신러닝 빅데이터 pandas 빅데이터분석기사
wsyang
2024-11-05T13:50:54.835Z
댓글 2
좋아요 0
조회수 132
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
[0,-1]인 이유에 대해 잘 이해하지 못하겠어요
python 머신러닝 빅데이터 pandas 빅데이터분석기사
shs4166
2024-11-05T13:40:50.365Z
댓글 2
좋아요 0
조회수 89
미해결
남박사의 파이썬으로 봇 만들기 with ChatGPT
5강 기상청사이트 날씨모듈 구현1 중에서 다음과 같이 날씨 태그를 살펴보는데 <span class="tmp">4.6<small>℃</small> <span class="minmax"><span>최저</span><span>-</span><span>최고</span><span>-</span></span></span> _span_tmp.span.decompose() 을 통하여 <span class="tmp">4.6<small>℃</small></span> 남기고 모두 지우는데 제가 알기로는 span 태그가 모두 사라지는 걸로 알고 있었는데 처음 span 태그는 원래 사라지지 않는건가요?? 보통의 블로그에서는 처음부터 삭제대상 태그인 경우가 없었던지라 좀 당황스럽습니다.
python 웹-크롤링 챗봇 객체지향 openai-api
역학자
2024-11-05T12:59:22.561Z
댓글 1
좋아요 0
조회수 109
해결됨
[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
시험환경에서 fillna(method = 'bfill')를 사용했더니, 아래 에러코드가 발생해서 gpt로 확인했더니, train['컬럼명'] = train['컬럼명'].bfill()로도 사용할 수 있더라구요. 시험환경에서 이러한 에러코드가 발생했으니 실제 시험에서도 이렇게 사용해도 상관 없을까요 ? 에러코드 전문 /goorm/Main.out:12: FutureWarning: Series.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead. train['abc'] = train['abc'].fillna(method = 'bfill')
python 머신러닝 빅데이터 pandas 빅데이터분석기사
rokkk
2024-11-05T11:24:47.513Z
댓글 2
좋아요 0
조회수 369
미해결
[리뉴얼] 처음하는 파이썬 백엔드와 웹기술 입문 (파이썬 중급, flask[플라스크] 로 이해하는 백엔드 및 웹기술 기본) [풀스택 Part1-1]
여러 방법으로 시도해봤는데 계속 failed가 뜨네요 왜그럴까요? (py311) PS C:\Users\MS> http GET http://localhost:8080/login?user_name=dave HTTP/1.1 200 OK Connection: close Content-Length: 18 Content-Type: application/json Date: Tue, 05 Nov 2024 10:13:02 GMT Server: Werkzeug/3.0.3 Python/3.12.4 { "auth": "failed" } from flask import Flask, jsonify, request, render_template app = Flask(__name__) @app.route('/login') def login(): username = request.args.get('user_name') passwd = request.args.get('pw') email = request.args.get('email_address') print (username, passwd, email) if username == 'dave': return_data = {'auth': 'success'} else: return_data = {'auth': 'failed'} return jsonify(return_data) @app.route('/html_test') def hello_html(): # html file은 templates 폴더에 위치해야 함 return render_template('login.html') if __name__ == '__main__': app.run(host="0.0.0.0", port="8080")
2024-11-05T10:14:42.880Z
댓글 1
좋아요 0
조회수 182