수업 자료에 오류가 있는것 같습니다 ㅠ
해결됨
한국인이 좋아하는 속도로 때려넣는 파이썬
문서 정리 자동화 소프트웨어 만들기 압축 파일에 직원 정보라는 파일이 들어있지 않네요 ㅠ
- python
172만명의 커뮤니티!! 함께 토론해봐요.
해결됨
한국인이 좋아하는 속도로 때려넣는 파이썬
문서 정리 자동화 소프트웨어 만들기 압축 파일에 직원 정보라는 파일이 들어있지 않네요 ㅠ
해결됨
[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
postman에서 post요청 후 get으로 확인했을 때 잘 받아와집니다. MongoDB Compass에 localhost :27017로 연결해서 refresh해도 mydocker DB가 조회가 안됩니다. docker - mongodb가 연결이 잘 안된건지 어렵습니다.. 어떻게 확인할 수 있을까요? import express from 'express' import { checkValidationPhone, getToken, sendTokenToSMS } from './phone.js'; import swaggerUi from 'swagger-ui-express' import swaggerJSDoc from 'swagger-jsdoc' import { options } from './swagger/config.js' import cors from 'cors' import { checkValidationEmail, getWelcomeTemplate, sendWelcomeTemplateToEmail } from './email.js'; import mongoose from 'mongoose' import { Board } from './models/board.model.js' const app = express() app.use(cors()) app.use(express.json()); app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerJSDoc(options))); app.get('/boards', async (req, res) => { // const result = [ // { // number: 1, // writer: '철수', // title: '제목입니다~~~', // contents: '내용이에요@@@', // }, // { // number: 2, // writer: '영희', // title: '영희 제목입니다~~~', // contents: '영희 내용이에요@@@', // }, // { // number: 3, // writer: '훈이', // title: '훈이 제목입니다~~~', // contents: '훈이 내용이에요@@@' // }, // ]; const result = await Board.find() //DB접속해서 가져오는 내용 위랑동일 res.send(result) }) app.post('/boards', async (req, res) => { console.log(req.body); // 1. 데이터를 등록하는 로직 => DB에 접속해서 데이터 저장하기 const board = new Board({ writer: req.body.writer, title: req.body.title, contents: req.body.contents, }); await board.save(); //원래는 SQL문법을 써야하지만 mongoose가 자동으로 변환해줌.(ORM, ODM) // 2. 저장 결과 응답 주기 res.send("게시물 등록에 성공하였습니다."); }); app.post('/tokens/phone', (req, res) => { const myphone = req.body.myphone; const isValid = checkValidationPhone(myphone); if (isValid) { const mytoken = getToken(); sendTokenToSMS(myphone, mytoken); res.send('인증완료!!!'); } }); app.post("/users", (req, res) => { const user = req.body.myuser const isValid = checkValidationEmail(user.email) if(isValid){ const mytemplate = getWelcomeTemplate(user) sendWelcomeTemplateToEmail(user.email, mytemplate) res.send("가입완료!") } }) //몽고DB 접속 mongoose.connect("mongodb://my-database:27017/mydocker") // localhost로 접속하게되면 express 도커안에서의 localhost이기때문에 dockercompose로 묶인 my-database-1 컴퓨터로 들어가야함. // 단, dockercompose로 묶어뒀기 때문에 이름만 입력해서 진입가능(네임리졸루션). // Backend API 서버 오픈 app.listen(3000, () => console.log(`exemple app listening on port ${3000}`))
미해결
테스트주도개발(TDD)로 만드는 NodeJS API 서버
var user = require("./api/user"); app.use("/user", user); app.listen(3000, function () { console.log("Example app listening on port 3000"); }); module.exports = app; app.use("/user", user) 이렇게 하면 ./api/user/index.js파일에서 export한 router객체를 자동으로 참조하게 되는건가요? app.use("/user", router) 라고 해야 이해가 될거 같은데...express 문법을 몰라서 질문 올렸습니다
미해결
따라하며 배우는 리액트 A-Z[19버전 반영]
강의 열심히 듣고 있습니다. Row.js에서 사용하고 있는 isLargeRow에 관해 질문드립니다. isLargeRow는 부모 컴포넌트에서 boolean값을 설정하지 않고 단지 문자열로 props로 보내지는데 Rows.js에서는 true 값을 가지게 되는게 잘 이해가 안가네요 props로 문자열을 내려주면 자식 컴포넌트에서는 그 문자열이 내려오면 true로 없으면 false로 인식을 하는건가요? 바쁘시겠지만 답변 부탁 드리겠습니다.
미해결
실전! 스프링부트 상품-주문 API 개발로 알아보는 TDD
해당 영상 내에서 굳이 var 타입을 사용하신 이유를 알 수 있을까요?
해결됨
[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
노션에 써있는걸로 sudo systemctl start mongod 실행하면 실행이 안되서 공식문서에서 찾아보니 sudo service mongod start 를 입력하면 starting database mongod 라고 뜬 후 fail이 뜹니다.... localhost:27017 로 접속을 하면 잘 뜨긴 하는데 해결 방법이 없을까요 ??
해결됨
[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
docker run 이미지ID 하고 새로운 터미널 열어서 docker ps 로 containerID 확인 후 docker exec -it 명령어 사용해서 도커 내부로 들어가려고 하면 OCI runtime exec failed: exec failed: unable to start container process: exec: "C:/Program Files/Git/usr/bin/bash": stat C:/Program Files/Git/usr/bin/bash: no such file or directory: unknown 이런식으로 오류가 뜹니다 왜 그런건가요?? 해결 방법 알려주세요!
미해결
[개정판] 파이썬 머신러닝 완벽 가이드
안녕하세요, 좋은강의 감사합니다. precision_recall_curve() 함수를 이용해서, y값과, 예측 값을 넣어주었을때 리턴되는값이 정밀도, 재현율, thresholds 값이 반환이 되는것으로 확인했습니다. 여기서 궁금한 부분이 thresholds값의 변화는 함수에서 임의로 진행 되는것 일까요?
미해결
실리콘밸리 엔지니어가 가르치는 파이썬 기초부터 고급까지
행맨 만들기 프로젝트 일부 코드에서 이해가 안되는 부분이 있어 질문드립니다! while 문에서 i = 0 을 설정한 뒤에 elem 값이 char 의 input 값과 같으면 그 값이 lst에서 치환되는 것이라고 설명해주셨는데 lst[i] 는 lst 내에서 i+1 번째 값을 의미하는 것이 아닌가요?? 아니면 i 는 그냥 미지수의 의미로 설정한 변수로 생각하면 되나요? 비슷한 질문으로 i += 1 이라는 코드를 추가한 이유가 무엇인가요? 저 코드를 빼고 작동시켜보니 이전에 맞췄던 철자가 저장되지 않고 첫 단어에만 값이 입력되는 걸 보니 이전 값들을 차곡차곡 쌓는 느낌인가요..? 너무 초보적인 질문이라 죄송합니다.. 아무리 고민하고 찾아봐도 쉽게 답이 나오지 않아 질문드립니다..
해결됨
[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
products.service.ts에서 create 부근에 tag를 저장 하기 전 tag를 미리 조회하는 부분을 구현 중인데 findOne에서 {name: tagname} 을 구현하려고 할 때 다음과 같은 에러가 발생합니다. save에서는 에러가 발생하지 않는데 findOne 조회 부분만 에러가 발생하네요 관련된 코드 같이 보내드립니다. createProduct.input.ts import { InputType, Field, Int } from '@nestjs/graphql'; import { Min } from 'class-validator'; import { ProductSaleslocationInput } from 'src/apis/productsSaleslocation/entities/dto/productSaleslocation.input'; @InputType() export class CreateProductInput { @Field(() => String) name: string; @Field(() => String) description: string; @Min(0) @Field(() => Int) price: number; @Field(() => ProductSaleslocationInput) productSaleslocation: ProductSaleslocationInput; @Field(() => String) productCategotyId: string; @Field(() => [String]) productTags: string[]; } products.entity.ts import { Field, Int, ObjectType } from '@nestjs/graphql'; import { ProductCategory } from 'src/apis/productsCategory/entities/productsCategory.entity'; import { ProductTag } from 'src/apis/productsTags/productTags.entity'; import { User } from 'src/apis/users/users.entity'; import { Column, DeleteDateColumn, Entity, JoinColumn, JoinTable, ManyToMany, ManyToOne, OneToOne, PrimaryGeneratedColumn, } from 'typeorm'; import { ProductSaleslocation } from '../../productsSaleslocation/entities/productsSaleslocation.entity'; @Entity() @ObjectType() export class Product { @PrimaryGeneratedColumn('uuid') @Field(() => String) id: string; @Field(() => String) @Column() name: string; @Field(() => String) @Column() description: string; @Field(() => Int) @Column() price: number; @Field(() => Boolean) @Column({ default: false }) isSoldout: boolean; @DeleteDateColumn() deletedAt: Date; @Field(() => ProductSaleslocation) @JoinColumn() @OneToOne(() => ProductSaleslocation) productSaleslocation: ProductSaleslocation; @Field(() => ProductCategory) @ManyToOne(() => ProductCategory) productCategory: ProductCategory; @Field(() => User) @ManyToOne(() => User) user: User; @JoinTable() @ManyToMany(() => ProductTag, (productTags) => productTags.products) @Field(() => [ProductTag]) productTags: ProductTag[]; } productTags.entity.ts import { Field, ObjectType } from '@nestjs/graphql'; import { Column, Entity, ManyToMany, PrimaryGeneratedColumn } from 'typeorm'; import { Product } from '../products/entities/products.entity'; @Entity() @ObjectType() export class ProductTag { @Field(() => String) @PrimaryGeneratedColumn('uuid') id: string; @Column() @Field(() => String) name: string; @Field(() => [Product]) @ManyToMany(() => Product, (products) => products.productTags) products: Product[]; } products.service.ts import { Product } from './entities/products.entity'; import { Injectable, UnprocessableEntityException } from '@nestjs/common'; import { Repository } from 'typeorm'; import { InjectRepository } from '@nestjs/typeorm'; import { ProductSaleslocation } from '../productsSaleslocation/entities/productsSaleslocation.entity'; import { ProductTag } from '../productsTags/productTags.entity'; @Injectable() export class ProductService { constructor( @InjectRepository(Product) private readonly productRepository: Repository<Product>, @InjectRepository(ProductSaleslocation) private readonly productSaleslocationRepository: Repository<ProductSaleslocation>, @InjectRepository(ProductTag) private readonly productTagRepository: Repository<ProductTag>, ) {} async findAll() { return await this.productRepository.find({ relations: ['productSaleslocation', 'productCategory', 'productTags'], }); } async findOne({ productId }) { return await this.productRepository.findOne({ where: { id: productId }, relations: ['productSaleslocation', 'productCategory', 'productTags'], }); } async create({ createProductInput }) { // 1. 상품만 등록하는 경우 // const result = await this.productRepository.save({ // ...createProductInput, // // 하나 하나 직접 나열하는 방식 // // name: createProductInput.name, // // description: createProductInput.description, // // price: createProductInput.price, // }); // 2. 상품과 상품거래 위치 같이 등록 const { productSaleslocation, productCategotyId, productTag, ...product } = createProductInput; const result = await this.productSaleslocationRepository.save({ ...productSaleslocation, }); // productTag // ["#electronics, #computer"] const result2 = []; // [{name: ..., id: ...}] for (let i = 0; i < productTags.length; i++) { const tagName = productTags[i].replace('#', ''); // check the tags that has already registered const checkTag = await this.productTagRepository.findOne({ name: tagName, }); // if the tags has been existed if (checkTag) { result2.push(checkTag); // if the tags hasn't been existed } else { const newTag = await this.productTagRepository.save({ name: tagName }); result2.push(newTag); } } const result3 = await this.productRepository.save({ ...product, productSaleslocation: result, // result 통째로 넣기 vs id만 넣기 productCategory: { id: productCategotyId }, productTags: result2, }); return result3; } async update({ productId, updateProductInput }) { const myProduct = await this.productRepository.findOne({ where: { id: productId }, }); const newProduct = { ...myProduct, id: productId, ...updateProductInput, }; return await this.productRepository.save(newProduct); } async checkSoldOut({ productId }) { const product = await this.productRepository.findOne({ where: { id: productId }, }); if (product.isSoldout) { throw new UnprocessableEntityException('Sold out'); } // if(product.isSoldout) { // throw new HttpException('이미 판매 완료 된 상품입니다.', HttpStatus.UNPROCESSABLE_ENTITY) // } } async delete({ productId }) { // 1. 실제 삭제 // const result = await this.productRepository.delete({ id: productId }); // return result.affected ? true : false // 2. 소프트 삭제(직접 구현) - isDeleted // this.productRepository.update({ id: productId }, { isDeleted: true }); // 3. 소프트 삭제(직접 구현) - deletedAt // this.productRepository.update({ id: productId }, { deletedAt: new Date() }); // 4. 소프트 삭제(TypeORM 제공) - softRemove - id로만 삭제 가능 // this.productRepository.softRemove({ id: productId }); // 4 . 소프트 삭제(TypeORM 제공) - softDelete const result = await this.productRepository.softDelete({ id: productId }); return result.affected ? true : false; } } 내용 확인 부탁드립니다.
해결됨
[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
@ObjectType이랑 @EntryType이랑 같이 사용을 할수는 없는건가요?? dto와 entry가 다른부분이 없어서 같이 쓰는게 낫겠다싶어서 시도하려니 안되네요 확실히 역할을 나눠야하는건가요??
미해결
따라하며 배우는 리액트 A-Z[19버전 반영]
강사님 제가 넷플릭스 소스를 [git아이디/Repositories폴더/하위a폴더/하위b폴더] b폴더에 저장을 했다면 homepage경로와 base경로를 어떻게 설정해야하나요? 혹시 배포를 할땐 Repositories 폴더에 있는 소스들만 배포가 가능한건가요?
미해결
실전! 스프링부트 상품-주문 API 개발로 알아보는 TDD
변수들에 final 키워드를 붙이시는 이유 class를 만들때 접근지정자 public 을 지우시는 이유 메서드를 static 으로 생성하는 이유 위의 점들이 궁금합니다.
미해결
프로그래밍 시작하기 : 도전! 45가지 파이썬 기초 문법 실습 (Inflearn Original)
'is'와 '==' 차이점은 어느 정도 이해되는데, 각각을 언제 사용해야 하는지는 잘 모르겠습니다. 검색을 해보면 주로 '==' 사용하고 None 과 비교할 때 'is'를 사용한다고 하는데 실제로 이렇게 사용하나요? z = 'None' a = None print(f'z is None : {z is None}') print(f'z == None : {z == "None"}') print(f'a is None : {a is None}') print(f'a == None : {a == "None"}') z is None : False z == None : True a is None : True a == None : False
미해결
테스트주도개발(TDD)로 만드는 NodeJS API 서버
describe('GET /users는', () => { it('user리스트를 limit만큼 가져왔다', (done) => { request(app) .get('/users') .end((err, res) => { console.log(res.body) done() // 우리가 만든 API서버는 비동기로 동작한다. 그래서 비동기에 대한 처리로 콜백함수를 호출해야 한다?? }) }) }) 강사님께서 콜백함수 done()을 호출하는 부분에서 다음과 같이 말하셨습니다..."우리가 만든 API서버는 비동기로 동작한다. 그래서 비동기에 대한 처리를 해야한다" 그런데 done()이라는 콜백함수를 호출하는 것이 어떤의미에서 비동기에 대한 처린인지 이해가 가지않아 질문을 남깁니다.
미해결
따라하며 배우는 리액트 A-Z[19버전 반영]
data 프롭의 경우는 이미 id ,title, completed 같은 정보들이 다 들어있는거니까 data프롭만 내려받아서 List.js에서 .id, .title, .completed로 써도 문제가 없는거죠?
해결됨
ChatGPT 100% 활용하여 배우는 파이썬 기초 A to Z
ChatGPT와 함께 파이썬 시작하기 (변수, 정수) 편 아직 안올라 온건가요?
미해결
프로그래밍 시작하기 : 파이썬 입문 (Inflearn Original)
파이썬 Print 사용법(1-4) - New 2023 강의에서 print로 출력하려고 하는데 자꾸 아래와 같은 오류가 떠요... 입력 값: 출력값: >>> print(f'm : {m:,}') Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'm' is not defined Python Version : 3.11.2 64-bit
미해결
테스트주도개발(TDD)로 만드는 NodeJS API 서버
Pdf 파일에 "204:내용없음, DELETE"라고 되어 있어 질문이 생겼습니다. 204는 삭제요청을 했는데 내용 없을때 리턴해주는 상태 코드인건가요?? Get요청을 했는데 없을시에도 204를 리턴해 주어도 될까요? 3xx 잘가~ 는 어떤 의미로 받아들여야 할지...이해가 가지 않습니다...
미해결
테스트주도개발(TDD)로 만드는 NodeJS API 서버
HTTP경로로 자원을 식별한다고 알려주셨는데! lecture?user={id} 와 같은 식으로는 사용하지 않는건가요?