분류 전체보기 171

자료구조(Data Structures) 10가지

https://www.youtube.com/watch?v=ouipSd_5ivQ 1. list 트위터 목록(feeder) 2. array math operations, large data sets list와 array 차이 list는 수정에 빠르고 array는 수학 계산에 특화되어 있음(파이썬의 경우) https://favtutor.com/blogs/python-array-vs-list Python: Array vs List | 5 Main Differences (& When to use?) Confused between array vs list in python? find out the main differences between array & list in python programming. Also,..

cs/자료구조 2023.06.01

next.js 13으로 chat GPT API 사용

chat GPT API는 python, node 등에서 사용할 수 있지만 저는 python 대신 node를 사용하였습니다. 그 이유는 node가 python 보다 웹에서 최적화 되어있기 때문입니다. 기본적으로 openai에서 제공하는 예시 코드를 약간 수정하는 방향으로 진행하였습니다. 제가 짠 코드의 문제는 api의 응답속도가 매우 느리다는 점, css, jsx가 안 맞다는 점입니다. 아래 github내용을 참조하세요. .env 파일도 생성해 주시고 아래 내용에 api key를 넣어주세요 OPENAI_API_KEY=[openai key] https://github.com/whiteout367/AIGuide GitHub - whiteout367/AIGuide Contribute to whiteout367/..

BACK END/chatGPT 2023.05.26

DALL.E 2 prompt 참고서

DALL.E로 사진을 만들고 있는 와중에 더 좋은 사진을 얻고 싶어 promp를 더 잘 사용하는 방법을 찾던 중 아래 사이트를 발견했습니다. https://pitch.com/v/DALL-E-prompt-book-v1-tmd33y/ac8c000d-7e6c-49a5-b6f6-51541b1013e1 The DALL·E 2 prompt book pitch.com 14페이지부터 예시 내용이 나옵니다. 저는 예시로 나와있는 내용은 아주 약간만 수정했습니다. a great photograph of subject, wide shot, outdoors, joyful, sunset photo at golden hour, Tilt shift photography, soft focus

7. useRef

react 공식홈페이지에도 나와있지만 더 좋은 예시와 함께 정리한 블로그가 있어 추천드립니다. https://dmitripavlutin.com/react-useref/ React useRef() Hook Explained in 3 Steps React.useRef() hook creates persisted mutable values (aka references or refs). refs are used to access DOM elements. dmitripavlutin.com 핵심 내용은 Calling const reference = useRef(initialValue) with the initial value returns a special object named reference. The refe..

FRONT END/react 2023.05.25

next.js에 bootstrap 설치

chatGPT api를 활용한 간단한 next.js 앱을 만들려고 하는데 백엔드는 했지만 프론트 엔드의 디자인에서 문제를 만났습니다. 이를 해결하기 위해 bootstrap을 사용할 것입니다. 공식문서에 설치법이 나와있습니다. https://react-bootstrap.github.io/getting-started/introduction/ React-Bootstrap The most popular front-end framework, rebuilt for React. react-bootstrap.github.io npm install react-bootstrap bootstrap app.js에 import해줍니다.(저는 index.js 에 했습니다.) import 'bootstrap/dist/css/boo..

BACK END/next.js 2023.05.25

centos7 mqtt mosquitto install

1. EPEL (Extra Packages for Enterprise Linux)을 설치합니다. mosquitto 서버를 설치하기 위해서는 EPEL(기업용 리눅스 패키지)을 설치하여야 합니다. sudo yum install epel-release 2. mosquitto broker 설치 sudo yum -y install mosquitto 3. broker systemctl에 등록 sudo systemctl enable mosquitto 4. broker 실행 sudo systemctl start mosquitto 상태 확인 sudo systemctl status mosquitto mosquitto port 변경 기본 port는 1883입니다. sudo vi /etc/mosquitto/mosquitto...

SERVER/linux 2023.05.16