묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨홍정모의 따라하며 배우는 C언어
표현식의 자료형
안녕하세요. 5-11 형변환을 공부하다가 궁금한 점이 생겨 질문드립니다.13행에서 변수 i에, 강제로 float로 변환된 표현식 'f + 2 * c;'의 값이 저장되는 것으로 이해했습니다.cpu는 다른 자료형들을 연산할 수 없기 때문에 컴파일러가 표현식의 자료형을 동일하게 변환시키는 것은 이해됩니다.그런데 변할 때 피연산자들 중 상대적으로 더 큰 자료형을 갖는 피연산자에 맞춰 변환되는 것인가요?즉 13행의 경우는 실수 자료형을 갖는 변수 f가 정수인 '2 * c' 보다 더 큰 자료형이기 때문에 두 피연산자를 더한 값의 자료형이 float가 되는 것인가요?늘 좋은 답변 감사합니다.
-
미해결데이터 분석 SQL Fundamentals
where절 단일 연산자
select *from nw.orders awhere a.order_date = (select min(order_date) from nw.orders x where x.customer_id = a.customer_id);이 쿼리가 실행되는 이유는 서브쿼리로 전달되는 메인쿼리의 레코드에 대한 결과가 한 건만 나와서 가능한게 맞나요?
-
미해결작정하고 장고! Django로 Pinterest 따라만들기 : 바닥부터 배포까지
19강 Process finished with exit code 0
모든 수업 내용을 따라가고 manage.py 우클릭해서 Debug 'manage' 를 누르니 이렇게 Process finished with exit code 0 라고 나오면서 서버가 실행이 되지 않네요
-
미해결스프링 시큐리티 OAuth2
OAuth2 + JWT : 소셜 로그인 시 JWT 발급
제가 일반적은 시큐리티와 JWT 로그인하는 방법과 소셜 로그인 2개를 구현해서 어느 방법으로 하던 accessToken을 발급해주고 accessToken을 통해서 게시판이라던지 해당 유저 인지 판별할 때 accessToken으로 판별하려고 합니다.질문 1:해당 수업이 OAuth2가 메인이고 OAuth2와 JWT 토큰과는 별개인 것은 알고 있지만 찾아봐도 못찾겠어서 질문을 남깁니다. accessToken을 발급받으면 클라이언트가 header에 accessToken을 같이 요청을 보내 줄 때 보내주고(저 같은 경우 TokenDTO와 TokenEntitty를 만들어줘서 DB에 넣어줌 )DB에 담긴 정보:grantTypeaccessTokenrefreshTokenuserEmailnickName서버(백엔드)에서는 그 accessToken을 받아서 유효성 검사를 통과하면 컨트롤러나 서비스에서 뭔가 해주지 않아도 클라이언트 요청을 실행해줌// 클라이언트 요청 시 JWT 인증을 하기 위해 설치하는 커스텀 필터로 // UsernamePasswordAuthenticationFiler 이전에 실행된다. // 이전에 실행된다는 뜻은 JwtAuthenticationFilter를 통과하면 // UsernamePasswordAuthenticationFilter 이후의 필터는 통과한 것으로 본다는 뜻이다. // 쉽게 말해서, Username + Password를 통한 인증을 Jwt를 통해 수행한다는 것이다. // JWT 방식은 세션과 다르게 Filter 하나를 추가해야 합니다. // 이제 사용자가 로그인을 했을 때, Request에 가지고 있는 Token을 해석해주는 로직이 필요합니다. // 이 역할을 해주는것이 JwtAuthenticationFilter입니다. // 세부 비즈니스 로직들은 TokenProvider에 적어둡니다. 일종의 service 클래스라고 생각하면 편합니다. // 1. 사용자의 Request Header에 토큰을 가져옵니다. // 2. 해당 토큰의 유효성 검사를 실시하고 유효하면 // 3. Authentication 인증 객체를 만들고 // 4. ContextHolder에 저장해줍니다. // 5. 해당 Filter 과정이 끝나면 이제 시큐리티에 다음 Filter로 이동하게 됩니다. @RequiredArgsConstructor @Slf4j public class JwtAuthenticationFilter extends GenericFilterBean { public static final String HEADER_AUTHORIZATION = "Authorization"; private final JwtProvider jwtProvider; // doFilter는 토큰의 인증정보를 SecurityContext에 저장하는 역할 수행 @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest httpServletRequest = (HttpServletRequest) request; // Request Header에서 JWT 토큰을 추출 String jwt = resolveToken(httpServletRequest); String requestURI = httpServletRequest.getRequestURI(); if(StringUtils.hasText(jwt) && jwtProvider.validateToken(jwt)){ // 토큰이 유효할 경우 토큰에서 Authentication 객체를 가지고 와서 SecurityContext에 저장 Authentication authentication = jwtProvider.getAuthentication(jwt); SecurityContextHolder.getContext().setAuthentication(authentication); log.info("Security Context에 '{}' 인증 정보를 저장했습니다., uri : {}", authentication.getName(), requestURI); } else { log.debug("유효한 JWT 토큰이 없습니다. uri : {}", requestURI); } chain.doFilter(request, response); } // Request Header 에서 토큰 정보를 꺼내오기 위한 메소드 private String resolveToken(HttpServletRequest httpServletRequest) { String bearerToken = httpServletRequest.getHeader(HEADER_AUTHORIZATION); if(StringUtils.hasText(bearerToken) && bearerToken.startsWith("Bearer ")) { return bearerToken.substring(7); } else { return null; } } }여기서 필요하거나 자세히 진행하고 싶다면 DB에서 체크해서DB에서 accessToken과 비교해서 맞으면UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(userEmail, userPw);로 아이디와 비밀번호를 기반으로 생성했으니 해당 유저가 맞으므로 요청을 성공적으로 받아준다. 이게 맞는 흐름인가요? 질문 2:먼저, 로그인 시 accessToken과 refreshToken을 발급해주는 것은 구현을 했는데 소셜 로그인에서 JWT를 발급해주는 것이 헷갈리더군요. // 로그인 @PostMapping("/login") public ResponseEntity<TokenDTO> login(@RequestBody MemberDTO memberDTO) throws Exception { try { return memberService.login(memberDTO.getUserEmail(), memberDTO.getUserPw()); } catch (Exception e) { return ResponseEntity.badRequest().build(); } }// 로그인 public ResponseEntity<TokenDTO> login(String userEmail, String userPw) throws Exception { // Login ID/PW를 기반으로 UsernamePasswordAuthenticationToken 생성 UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(userEmail, userPw); // 실제 검증(사용자 비밀번호 체크)이 이루어지는 부분 // authenticateToken을 이용해서 Authentication 객체를 생성하고 // authentication 메서드가 실행될 때 // CustomUserDetailsService에서 만든 loadUserbyUsername 메서드가 실행 Authentication authentication = authenticationManagerBuilder .getObject() .authenticate(authenticationToken); // 해당 객체를 SecurityContextHolder에 저장 SecurityContextHolder.getContext().setAuthentication(authentication); // authentication 객체를 createToken 메소드를 통해서 생성 // 인증 정보를 기반으로 생성 TokenDTO tokenDTO = jwtProvider.createToken(authentication); HttpHeaders headers = new HttpHeaders(); // response header에 jwt token을 넣어줌 headers.add(JwtAuthenticationFilter.HEADER_AUTHORIZATION, "Bearer " + tokenDTO); MemberEntity member = memberRepository.findByUserEmail(userEmail); log.info("member : " + member); TokenEntity tokenEntity = TokenEntity.builder() .grantType(tokenDTO.getGrantType()) .accessToken(tokenDTO.getAccessToken()) .refreshToken(tokenDTO.getRefreshToken()) .userEmail(tokenDTO.getUserEmail()) .nickName(member.getNickName()) .build(); log.info("token : " + tokenEntity); tokenRepository.save(tokenEntity); TokenDTO token = TokenDTO.toTokenDTO(tokenEntity); return new ResponseEntity<>(token, headers, HttpStatus.OK); }(JWT 설정을 생략...) 소셜 로그인 같은 경우는 프론트에서 특정 URL로 보내주잖아요<a href="/oauth2/authorization/google">구글 로그인</a>위의 방법은 그냥 아이디, 비밀번호를 치면 되는 방법이고 소셜 로그인도 1차 인증을 받고 JWT를 발급해주면 된다고 알고있는데 위에서 구현한 방법으로 사용하기에는 URL이 다르잖아요? 프론트 URL은 고정으로 저 방법을 사용해야 한다고 알고 있는데... 그러면 소셜 로그인을 여러개 사용하면 예를들어, 구글, 카카오톡, 네이버 이런식으로 사용하면 컨트롤러에 각각의 URL로 위의 방식처럼 만들어야 JWT 발급해주는 기능을 구현할 수 있는건가요?
-
해결됨모의해킹 실무자가 알려주는, SQL Injection 공격 기법과 시큐어 코딩 : PART 1
ampsetup monitor 오류
설치는 잘 됐다고 뜨는데실행시키면 이렇게 뜨네요어떻게 해야 하나요?
-
해결됨홍정모의 따라하며 배우는 C언어
5-11 형변환 질문
안녕하세요! 형변환 공부 중 예상치 못한 결과가 나와서 질문드립니다.11행의 float 자료형을 갖는 변수 f에 double 표현식의 값이 들어갔습니다.그래서 '분명 표현식의 값이 커지면 절삭되겠군?' 이라는 생각을 갖고, 변수 d와 비교하며 그 값을 크게 설정했습니다.그런데 그 크기를 늘리니 둘 다 똑같은 값이 절삭되어 나오는 것 같습니다.왜 이런 현상이 일어났는지 설명해주시면 감사하겠습니다.
-
미해결[신규 개정판] 이것이 진짜 크롤링이다 - 실전편 (인공지능 수익화)
좋은 강의 잘 듣고 있습니다.
저는 테슬라 키워드로 응용을 하고 있었는데요, 아래 기사에서 https://www.yna.co.kr/view/AKR20230706003700075?input=1195mtitle을 어떻게 가져와야 할지, 일반화 되는 방법을 아무리 봐도 잘 모르겠습니다 ㅠ 본문은 #contents로 가져왔습니다. 도와주세요..import requests import time from bs4 import BeautifulSoup response = requests.get("https://search.naver.com/search.naver?where=news&sm=tab_jum&query=%ED%85%8C%EC%8A%AC%EB%9D%BC") html = response.text soup = BeautifulSoup(html, 'html.parser') articles = soup.select("div.info_group") # 뉴스 기사 div 10개 추출 for article in articles: links = article.select("a.info") if len(links) > 1: # 링크가 2개 이상이면 url = links[1].attrs['href'] # 두번째 링크의 herf를 추출 # requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer')) 방지를 위해 header 추가 response = requests.get(url, headers={'User-agent': 'Mozila/5.0'}) html = response.text soup = BeautifulSoup(html, "html.parser") content = soup.select_one("#contents") print(content.text) time.sleep(0.3)
-
미해결
Next.js - Vercel net::ERR_ABORTED 405
API Route관련 질문입니다.. 로컬 환경에선 잘 작동하는api route가 vercel 배포 후에 계속 제목에 적어놓은 405 에러가 발생합니다. 파일은 정확하게 pages/api/myapi.ts 이런식으로 되어있구요. 핸들러에 접근도 못하는 상황 입니다 매우답답하네요,,POST 나 GET 등 메소드 관련 로직은 당연히 다 적용 시켜봤습니다 머리로는 도저히 이해가 안가는 상황이라 같은 경우 겪어보신분 계시면 답좀 부탁드리겠습니다.. vercel 커뮤니티에서도 저랑 비슷한경우인 분들 계시던데 답을 다 못받으셧더라구요 혹시나 해서 질문올립니다. 참고로 405가 일반적으로 생기는 경우는 다 막아놨습니다.혹시나 코드에서 문제가 있다고 생각하시는분들 계실 수도 있으시니 클라이언트, 서버 코드 올려놓겠습니다.serverexport const config = { runtime: 'edge', }; export default async function handler (req: Request): Promise<Response> { if(req.method === 'POST') { // some code } }client const response = await fetch(endpoint, { method: 'POST', headers: { 'Content-Type': 'application/json', }, signal: controller.signal, body });
-
미해결실리콘밸리 엔지니어가 가르치는 파이썬 장고 웹프로그래밍
import 오류
path('signup/', views.SignUpView.as_view(), name='signup'),이 부분에서 from . import views가 되지 않아 오류가 생기는 것 같습니다 왜 오류인지 잘 모르겠습니다 ImportError: cannot import name 'views' from 'dealershop' (/Users/minjiwon/Desktop/py/dealershop/dealershop/__init__.py)inventory 에서는 from . import views를 해도 잘 되는데 저쪽 부분에서만 되질 않습니다
-
미해결스프링 핵심 원리 - 기본편
AllBeanTest시, NoUniqueBeanDefinitionException 오류
AllBeanTest에서,강사님하고는 다른 오류가 뜹니다 ㅠ < 강사님 오류 > < 저의 오류 >org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'orderServiceImpl' defined in file [C:\study2\core\out\production\classes\hello\core\order\OrderServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'hello.core.discount.DiscountPolicy' available: expected single matching bean but found 2: fixDiscountPolicy,rateDiscountPolicy 라고 뜨는데, 왜 강사님과 다르게 저는 빈이 2개가 있다는 오류가 뜰까요?? ㅠㅠ orderServiceImplpackage hello.core.order; import hello.core.annotation.MainDiscountPolicy; import hello.core.discount.DiscountPolicy; import hello.core.member.Member; import hello.core.member.MemberRepository; import hello.core.member.MemoryMemberRepository; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.AutoConfigurationPackage; import org.springframework.stereotype.Component; @Component public class OrderServiceImpl implements OrderService{ private final MemberRepository memberRepository; private final DiscountPolicy discountPolicy; // final이 붙으면 필수값이 됨.@RequiredArgsConstructor는 필수값을 가지고 생성자를 만들어준다. @Autowired private DiscountPolicy rateDiscountPolicy; @Autowired public OrderServiceImpl(MemberRepository memberRepository, DiscountPolicy discountPolicy) { this.memberRepository = memberRepository; this.discountPolicy = discountPolicy; } @Override public Order createOder(Long memberId, String itemName, int itemPrice) { Member member = memberRepository.findById(memberId); int discountPrice = discountPolicy.discount(member, itemPrice); return new Order(memberId, itemName, itemPrice, discountPrice); } public MemberRepository getMemberRepository(){ return memberRepository; } } RateDiscountPolicypackage hello.core.discount; import hello.core.annotation.MainDiscountPolicy; import hello.core.member.Grade; import hello.core.member.Member; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Component; @Component public class RateDiscountPolicy implements DiscountPolicy{ private int discountPercent = 10; @Override public int discount(Member member, int price) { if(member.getGrade() == Grade.VIP){ return price * discountPercent / 100; } else { return 0; } } } FixDiscountPolicypackage hello.core.order; import hello.core.annotation.MainDiscountPolicy; import hello.core.discount.DiscountPolicy; import hello.core.member.Member; import hello.core.member.MemberRepository; import hello.core.member.MemoryMemberRepository; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.AutoConfigurationPackage; import org.springframework.stereotype.Component; @Component public class OrderServiceImpl implements OrderService{ private final MemberRepository memberRepository; private final DiscountPolicy discountPolicy; // final이 붙으면 필수값이 됨.@RequiredArgsConstructor는 필수값을 가지고 생성자를 만들어준다. @Autowired private DiscountPolicy rateDiscountPolicy; @Autowired public OrderServiceImpl(MemberRepository memberRepository, DiscountPolicy discountPolicy) { this.memberRepository = memberRepository; this.discountPolicy = discountPolicy; } @Override public Order createOder(Long memberId, String itemName, int itemPrice) { Member member = memberRepository.findById(memberId); int discountPrice = discountPolicy.discount(member, itemPrice); return new Order(memberId, itemName, itemPrice, discountPrice); } public MemberRepository getMemberRepository(){ return memberRepository; } } AppConfigpackage hello.core; import hello.core.discount.DiscountPolicy; import hello.core.discount.FixDiscountPolicy; import hello.core.discount.RateDiscountPolicy; import hello.core.member.MemberService; import hello.core.member.MemberServiceImpl; import hello.core.member.MemoryMemberRepository; import hello.core.order.OrderService; import hello.core.order.OrderServiceImpl; import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; // @Bean memberService -> new MemoryMemberRepository() // @Bean orderService -> new MemoryMemberRepository() // call AppConfig.memberService // call AppConfig.memberRepository // call AppConfig.memberRepository // call AppConfig.orderService // call AppConfig.memberRepository // 예상은 위와 같지만, 실제 실행된 것은 // call AppConfig.memberService // call AppConfig.memberRepository // call AppConfig.orderService @Configuration public class AppConfig { @Bean public MemberService memberService() { System.out.println("call AppConfig.memberService"); return new MemberServiceImpl(memberRepository()); } @Bean public MemoryMemberRepository memberRepository() { System.out.println("call AppConfig.memberRepository"); return new MemoryMemberRepository(); } @Bean public OrderService orderService() { System.out.println("call AppConfig.orderService"); return new OrderServiceImpl(memberRepository(), discountPolicy()); // return null; } @Bean public DiscountPolicy discountPolicy() { //return new FixDiscountPolicy(); return new RateDiscountPolicy(); } } AllbeanTestpackage hello.core.Autowired; import hello.core.AutoAppConfig; import hello.core.discount.DiscountPolicy; import hello.core.member.Grade; import hello.core.member.Member; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import java.util.List; import java.util.Map; import static org.assertj.core.api.Assertions.*; public class AllBeanTest { @Test void findAllBean(){ ApplicationContext ac = new AnnotationConfigApplicationContext(AutoAppConfig.class, DiscountService.class); DiscountService discountService = ac.getBean(DiscountService.class); Member member = new Member(1L, "userA", Grade.VIP); int discountPrice = discountService.discount(member, 10000, "fixDiscountPolicy"); // discount가 얼마나 되는지 보는 서비스 assertThat(discountService).isInstanceOf(DiscountService.class); assertThat(discountPrice).isEqualTo(1000); } static class DiscountService { private final Map<String, DiscountPolicy> policyMap; private final List<DiscountPolicy> policies; @Autowired public DiscountService(Map<String, DiscountPolicy> policyMap, List<DiscountPolicy> policies) { this.policyMap = policyMap; this.policies = policies; System.out.println("policyMap = " + policyMap); System.out.println("policies = " + policies); } public int discount(Member member, int i, String fixDiscountPolicy) { return 0; } } }
-
해결됨풀스택 리액트 라이브코딩 - 간단한 쇼핑몰 만들기
routes.tsx에서 질문이 있습니다!
라우츠 파일에 보면 제일 밑에 코드에서 pages 를 익스포트해주는데, 쓰는곳이 없더라구요...!혹시 이 코드가 반드시 필요한 것인지 궁금해서 질문 남깁니다:)import GlobalLayout from './pages/_layout'; import Index from './pages/index'; import ProductsIndex from './pages/products/index'; import ProductsId from './pages/products/[id]'; import Cart from './pages/cart'; export const routes = [ { path: '/', element: <GlobalLayout />, children: [ { path: '/', element: <Index />, index: true }, { path: '/products', element: <ProductsIndex />, index: true }, { path: '/products/:id', element: <ProductsId /> }, { path: '/cart', element: <Cart />, index: true }, ], }, ]; export const pages = [{ route: '/' }, { route: '/products' }, { route: '/products/:id' }, { route: '/cart' }];
-
해결됨직장인에게 꼭 필요한 파이썬-아래아한글 자동화 레시피
누름틀 없는 한글문서 엑셀로 취합하기 응용 질문드려요
해당 강의 잘 보고 응용해보려고 하는데 잘 풀리지 않는 부분이 있어 문의 드립니다.제가 자동화하고자 하는 파일은 예시의 서식이 여러파일형태로 존재하는 게 아니라 한 파일안에 동일한 양식의 표가 반복되는 형태인데요.동일한 양식의 표를 엑셀에 항목별로 입력하고자 합니다.강의로 예를 들면 강의에서는 용역과제 심의신청서가 각 파일에 1개씩 이어서 폴더내의 파일을 하나하나 열면서 안의 내용을 리스트로 정리하고, 리스트 중 옮길 값을 추출했지만제 경우에는 용역과제 심의신청서가 한 파일에 모두 모여있는 경우라고 할 수 있을 것 같습니다.그래서 파일안에 있는 텍스트를 모두 추출하여 list화 까지는 수행했는데, 거기서 엑셀로 옮길 값만 추출하는데 있어서 어떤 규칙성을 찾기가 어려워서 어떻게 해야할지 좀 막막하네요...예를 들면 예시에서 과제명이 contents[1]이었으면 다음 표에서는 과제명이 contents[26] (<-연구결과활용방안다음)이어야 하는데 중간중간 끊기는 부분이 있는지 갑자기 contents[27]이라던가 번호가 하나씩 밀리는 문제가 발생합니다.이런 경우에는 어떤 for문으로 반복되는 표 양식 안의 내용을 가져올 수 있을까요..?
-
해결됨[라이브 멘토링] 유니티 뱀파이어 서바이벌 장르 모작
안녕하세요. 7월 예정강의에 대해 질문이 있습니다.
유니티 & 웹서버(키우기 게임 + 웹서버) 강의가 7월 예정으로 들었는데 항상 강의 전달 말쯤에소식이 들렸는데 이번엔 아직 소식이 없어서 질문드립니다!관련해서 예정이 있으신건가요?
-
미해결토비의 스프링 부트 - 이해와 원리
테스트시에 나오는 문제
안녕하세요. 토비님스프링부트로 api테스트시에 가끔식 400 Bad Request 가 나오는데요.호출하는 header와 body는 모두 동일한데, 2~30번 호출 중에 한번씩 튀어나오는 경우는 어떤 설정에 문제일까요?api 내용은 별게 없고 로그를 다 찍기도 전에 앞에서 400에러가 나는 상황입니다. 혹시 관련해서 경험하신 바가 있으신지 궁금합니다.
-
미해결SCSS(SASS)+FLEX 실전 반응형 웹 프로젝트 with Figma
강의 자료가 열리지 않습니다.
안녕하세요~디자인 작업(beyound+insight) > 피그마(Figma)원본 폴더 안에 있는 두 개 파일이 열리지 않아서요.어떻게 볼 수 있을까요~?
-
미해결아두이노 시작하기
3색 led 아두이노 연결ㄹ
영상에서 3색 led를 아두이노를 연결할 떄, 아두이노의 5V도 빵판에 연결시키셨는데, 5V의 역할은 무엇인지 궁금합니다. 그냥 LED에서는 5V연결이 없었는데, 3색 LED에서는 5V연결이 필요한 것인지도 궁금하네요.
-
미해결홍정모의 따라하며 배우는 C언어
강의 4:29 0.01f 위에 커서를 올렸을 때
강의의 경우 (float)(0.009999999776F)라고 뜨는데왜 저는 그냥 단순하게 (flat)(0.01F)라고 뜰까요?비쥬얼스튜디오에서 따로 설정해야하는건가요?
-
미해결이득우의 언리얼 프로그래밍 Part1 - 언리얼 C++의 이해
VS2022 Always show Error List if... 옵션을 끄는 이유
강의 10:13 부분에서 VS2022 옵션 중 Always show Error List if build finishes with errors 를 끄시는 데.. 옵션 내용만 보면 켜놓는 게 좋을 것 같다고 생각이 드는데요. 왜 끄는 지 이유를 알수 있을까요.
-
해결됨10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
8 - L 질문입니다.
안녕하세요 선생님! 8주차와서 많은 질문으로 찾아뵙는 것 같습니다... 항상 감사합니다.http://boj.kr/f01a3b3704f147638cb5d548fbe26459바로 이전 문제였던 8 - K의 풀이처럼 펜윅트리를 행별로 형성하게 해서 코드를 짜보았습니다. 테스트케이스는 잘 통과하는데 틀렸습니다...ㅠ 혹시 제 코드에서 어떤 점이 문제였을지 알 수 있을까요?
-
미해결실전! Querydsl
sort관련 질문드립니다.
직접 파라미터를 받아 처리하는걸 권장 한다고 하셨는데 @Data public class MemberSearchDto { private String username; private String teamName; private Integer ageGoe; private Integer ageLoe; private String sort; private String orderBy; } sort=desc; orderby=username 으로 값을 받는다면 .orderBy(addSort(searchDto.getSort(),searchDto.getOrderBy())) private OrderSpecifier<?> addSort(String sort, String orderBy) { if(StringUtils.hasText(sort) && StringUtils.hasText(orderBy) && (sort.equals("desc") || sort.equals("asc"))){ if(orderBy.equals("username")){ return sort.equals("desc") ? member.username.desc() : member.username.asc(); } } return member.age.desc(); } 이런식으로 처리하면 되는지 궁금합니다.