묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결최고의 프론트엔드 CSS Frameworks, UIkit
모달과 light box차이점
모달과 light box차이점은 light box가 슬라이드가 된다는것뿐이죠??
-
해결됨따라하며 배우는 노드, 리액트 시리즈 - 레딧 사이트 만들기(NextJS)(Pages Router)
import express 하는 부분에서
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 혹시 아래와 같이 자동완성 사용하는 거랑 같을까요??
-
미해결Vue3 완벽 마스터: 기초부터 실전까지 - "실전편"
axios 컴포저블 함수 구현 2에서
저 빨간줄 부분에서 if문을 안쓰면 에러가 나던데, 왜그럴까요?then안에서 바로 onSuccess()로 사용 될줄 알았는데.. is not a function 에러가 나는 이유가 궁금합니다.
-
미해결배달앱 클론코딩 [with React Native]
이미지 촬영 후 완료 버튼 반응 없음
LOG {"addListener": [Function addListener], "canGoBack": [Function canGoBack], "dispatch": [Function dispatch], "getId": [Function getId], "getParent": [Function getParent], "getState": [Function anonymous], "goBack": [Function anonymous], "isFocused": [Function isFocused], "jumpTo": [Function anonymous], "navigate": [Function anonymous], "pop": [Function anonymous], "popToTop": [Function anonymous], "push": [Function anonymous], "removeListener": [Function removeListener], "replace": [Function anonymous], "reset": [Function anonymous], "setOptions": [Function setOptions], "setParams": [Function anonymous]} LOG {"end": {"latitude": 37.577, "longitude": 127.045}, "orderId": "DXCbe0Q55", "price": 6000, "rider": "LlnQ3qTJvU", "start": {"latitude": 37.516999999999996, "longitude": 126.944}} LOG 960 1280 {"DateTime": "2023:02:23 18:11:22", "DateTimeDigitized": "2023:02:23 18:11:22", "ExposureTime": "0.01", "FNumber": "2.8", "Flash": "0", "FocalLength": "5000/1000", "GPSAltitude": null, "GPSAltitudeRef": null, "GPSDateStamp": null, "GPSLatitude": null, "GPSLatitudeRef": null, "GPSLongitude": null, "GPSLongitudeRef": null, "GPSProcessingMethod": null, "GPSTimeStamp": null, "ISOSpeedRatings": "100", "ImageLength": "1280", "ImageWidth": "960", "Make": "Google", "Model": "sdk_gphone_x86", "Orientation": "1", "SubSecTime": "063", "SubSecTimeDigitized": "063", "SubSecTimeOriginal": "063", "WhiteBalance": "0"} LOG orientation 1 LOG file:///data/user/0/com.zzz.fooddeliveryapp/cache/2dfe7384-6463-4c9c-b07a-e86a4184388b.JPEG 2dfe7384-6463-4c9c-b07a-e86a4184388b.JPEG원래는 완료버튼을 누른 후 내 정보로 가야하고 수익금이 정산되어야하는데,일단 완료버튼을 눌러도 아무런 반응이 없습니다Complete.tsx import React, {useCallback, useState} from 'react'; import { Alert, Dimensions, Image, Pressable, StyleSheet, Text, View, } from 'react-native'; import { NavigationProp, RouteProp, useNavigation, useRoute, } from '@react-navigation/native'; import {LoggedInParamList} from '../../AppInner'; import ImagePicker from 'react-native-image-crop-picker'; import ImageResizer from 'react-native-image-resizer'; import axios, {AxiosError} from 'axios'; import Config from 'react-native-config'; import {useSelector} from 'react-redux'; import {RootState} from '../store/reducer'; import orderSlice from '../slices/order'; import {useAppDispatch} from '../store'; function Complete() { const dispatch = useAppDispatch(); const route = useRoute<RouteProp<LoggedInParamList>>(); const navigation = useNavigation<NavigationProp<LoggedInParamList>>(); const [image, setImage] = useState<{uri: string; name: string; type: string}>(); const [preview, setPreview] = useState<{uri: string}>(); const accessToken = useSelector((state: RootState) => state.user.accessToken); // { uri: '경로', name: '파일이름', type: '확장자' } // multipart/form-data 통해서 업로드 const onResponse = useCallback(async (response: any) => { console.log(response.width, response.height, response.exif); setPreview({uri: `data:${response.mime};base64,${response.data}`}); const orientation = (response.exif as any)?.Orientation; console.log('orientation', orientation); return ImageResizer.createResizedImage( response.path, // 파일 경로 (file:///안드로이드 경로) 600, // width 600, // height response.mime.includes('jpeg') ? 'JPEG' : 'PNG', // format 100, // quality 0, // rotation ).then(r => { console.log(r.uri, r.name); setImage({ uri: r.uri, name: r.name, type: response.mime, }); }); }, []); const onTakePhoto = useCallback(() => { return ImagePicker.openCamera({ includeBase64: true, includeExif: true, // saveToPhotos: true, }) .then(onResponse) .catch(console.log); }, [onResponse]); const onChangeFile = useCallback(() => { return ImagePicker.openPicker({ includeExif: true, includeBase64: true, mediaType: 'photo', }) .then(onResponse) .catch(console.log); }, [onResponse]); const orderId = route.params?.orderId; const onComplete = useCallback(async () => { if (!image) { Alert.alert('알림', '파일을 업로드해주세요.'); return; } if (!orderId) { Alert.alert('알림', '유효하지 않은 주문입니다.'); return; } const formData = new FormData(); formData.append('image', image); formData.append('orderId', orderId); try { await axios.post(`${Config.API_URL}/complete`, formData, { headers: { authorization: `Bearer ${accessToken}`, }, }); Alert.alert('알림', '완료처리 되었습니다.'); navigation.goBack(); navigation.navigate('Settings'); dispatch(orderSlice.actions.rejectOrder(orderId)); } catch (error) { const errorResponse = (error as AxiosError).response; if (errorResponse) { Alert.alert('알림', (errorResponse.data as any).message); } } }, [dispatch, navigation, image, orderId, accessToken]); return ( <View> <View style={styles.orderId}> <Text>주문번호: {orderId}</Text> </View> <View style={styles.preview}> {preview && <Image style={styles.previewImage} source={preview} />} </View> <View style={styles.buttonWrapper}> <Pressable style={styles.button} onPress={onTakePhoto}> <Text style={styles.buttonText}>이미지 촬영</Text> </Pressable> <Pressable style={styles.button} onPress={onChangeFile}> <Text style={styles.buttonText}>이미지 선택</Text> </Pressable> <Pressable style={ image ? styles.button : StyleSheet.compose(styles.button, styles.buttonDisabled) } onPress={onComplete}> <Text style={styles.buttonText}>완료</Text> </Pressable> </View> </View> ); } const styles = StyleSheet.create({ orderId: { padding: 20, }, preview: { marginHorizontal: 10, width: Dimensions.get('window').width - 20, height: Dimensions.get('window').height / 3, backgroundColor: '#D2D2D2', marginBottom: 10, }, previewImage: { height: Dimensions.get('window').height / 3, resizeMode: 'contain', // cover(꽉 차게), contain(딱 맞게), stretch(비율 무시하고 딱 맞게), repeat(반복되게), center(중앙 정렬) }, buttonWrapper: {flexDirection: 'row', justifyContent: 'center'}, button: { paddingHorizontal: 20, paddingVertical: 10, width: 120, alignItems: 'center', backgroundColor: 'yellow', borderRadius: 5, margin: 5, }, buttonText: { color: 'black', }, buttonDisabled: { backgroundColor: 'gray', }, }); export default Complete; 중간에 이 에러가 나는데 혹시 관련이 있나요? WARN SerializableStateInvariantMiddleware took 123ms, which is more than the warning threshold of 32ms. If your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions. It is disabled in production builds, so you don't need to worry about that.
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스
프리캠프 섹션 2 "CSS 의 기본과 싸이월드 실습 1탄 > CSS 정렬" 강의 질문입니다
CSS 정렬 강의 마지막 숙제에서 회원 가입 화면을 아래 피그마처럼 만들라고 숙제를 주셨는데요. 숙제 다하고 예시(답안?) 코드는 없는 건가요?제가 코드를 만들고 참고하려고 답안 코드를 찾으려고 하니 없네요. 설마 없지는 않겠지요?
-
미해결[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
새로고침 한번에 클러스터 2개 종료
안녕하세요?setTimeout 대신 setImmediate를 적용해 요청이 발생하는 즉시 워커가 종료되게 해보았는데요, 이 경우엔 워커가 한번에 두개씩 종료됩니다.DevTool - network 창에 보이는 요청은 새로고침 1회당 GET 1회씩인데 왜 이러는지 궁금합니다! const cluster = require('cluster'); const http = require('http'); const numCPUs = require('os').cpus().length; if (cluster.isMaster) { console.log(`마스터 프로세스 아이디 : ${process.pid}`); // CPU 갯수만큼 워커를 생산 for (let i=0; i < numCPUs; i++ ){ cluster.fork(); } //워커가 종료되었을 때 cluster.on('exit', (worker, code, signal) => { console.log(`${worker.process.pid}번 워커가 종료되었습니다.`); console.log('code', code, `signal`, signal); }); } else { // 워커들이 포트에서 대기 http.createServer((req, res) => { res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8'}); res.write('<h1>Hello Node!'); res.end('<p>Hello Cluster!</p>'); setImmediate(()=> { process.exit(1); }); }).listen(8086); console.log(`${process.pid}번 워커 실행`); };
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
1장 bts관련 질문입니다.
똑같이 따라했는데 java가 빨간줄이 뜨는데 어떤 문제일까요
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
4-H 성곽
http://boj.kr/12848c5737a747c6b107af81e35dbd5e 해당문제를 맞추긴 했는데92번째줄 코드를 원래if(check(k,i,j))로 작성하였을 때는 오류가 발생했습니다. 조금 설명을 드리면,0-북/1-동/2-남/3-서 > 시계방향으로 벽이 있는 지 체크하는 함수인데 connectedcomponent 내부에서는 제대로 작동하는데92번째줄 코드에서 사용하였을 때는 0,0일때 동쪽에는 벽에 없는데도 동쪽에 벽이있다고 확인됩니다...어떤 점이 잘못되었는지 모르겠습니다
-
미해결[구버전] 웹 애플리케이션 개발을 위한 IntelliJ IDEA 설정 (2020 ver.)
tomcat등록
tomcat등록하고 초록색 실행 버튼 눌렀는데java: error: release version 5 not supported 라고 떠요두 가지 해결 방안 중에 뭐를 어떻게 설정해야할까요?
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
3 - D : 4179 질문있습니다
안녕하세요 좋은 강의 감사합니다.https://www.acmicpc.net/source/56355675저는 일단 dfs로 접근을 했는데 문제가 다른 정답들을 보았는데 bfs로 푸시더라구여dfs로는 재귀 호출이 많아서 못푸는 문제인건가요?재귀로 풀지 말지 결정하는 기준점이 따로 있을까요?
-
미해결[개정판 2023-11-27] Spring Boot 3.x 를 이용한 RESTful Web Services 개발
@Size(min, max) 검증 관련 질문
안녕하세요.User 테이블에 데이터를 삽입하다 검증 애노테이션이 적용이 안되서 질문드립니다. 동일한 질문이 있어서 Javax.validation 의존성 삭제하고 springboot.starter validation 을 적용했지만 계속 검증이 안되는 상황입니다.@Size(min=2, max=4)private String name;이름 필드에 제한을 두었는데 max 테스트는 에러를 내보내지만 min 을 테스트했을때 한글자 문자를 넣었을 때 왜 에러가 발생되지 않는지 궁금합니다..
-
미해결Axure RP 9,10 - 서비스 기획자를 위한 최적의 프로토타이핑 툴
반응형 기획
안녕하세요!반응형 기획(디바이스별 해상도 세팅)중 모바일 버전 화면이 더 빠르게 필요해 모바일을 먼저 그렸습니다.그런데 이후에 pc타입에 화면 설계를 하니 모바일까지 다 반영이 되어버려서 pc만 그리는 것이 불가능하더라구요혹시 방법이 있을까요??종속 관계를 바꾸면 되는거라면 어떻게 바꾸면 되는건지 설명 부탁드릴게용ㅠㅠ
-
미해결ERC20 깨부수기 (+ truffle, 프론트엔드)
pure view
function balance1(address _a) public view returns (uint256) { return _a.balance; } function fun1(uint256 _a) public pure returns (uint256) { if (_a == 3) { return 555; } return 111; } 안녕하세요 여기 두개 함수에서 둘다 외부에서 _a를 받아오는것으로 보이는데 왜 위에는 view를 쓰고 밑에는 pure 를 쓰는건지 잘 모르겠습니다.
-
미해결유니티 Addressable 을 이용한 패치 시스템 구현
Unloading 5 Unused Serialized files
다운로드 완료 후 씬 로드를 하려고 하는데(씬 파일 자체가 다운로드 파일이에요)Addressables.LoadSceneAsync("~~").Completed+=(result)=> {~~ 이렇게 불러오게 했는데Unloading 5 Unused Serialized files 오류가 뜨면서프로그램이 튕겨져요....ㅠㅠ 에러 이유를 모르겠어요.
-
해결됨실전! 스프링 데이터 JPA
테스트 코드 오류가 뜹니다...
강의를 보면서 혼자 정말 여러 번 코드를 고쳐봤지만 도저히 원인을 알 수가 없어서 질문드립니다.https://www.inflearn.com/questions/792196/%EA%B0%95%EC%9D%98-%EB%93%A4%EC%9C%BC%EB%A9%B4%EC%84%9C-%EC%9D%91%EC%9A%A9%ED%95%B4%EC%84%9C-%ED%85%8C%EC%8A%A4%ED%8A%B8%EB%A5%BC-%EC%9E%91%EC%84%B1%ED%95%98%EA%B3%A0-%EC%9E%88%EB%8A%94%EB%8D%B0-%EC%9E%90%EA%BE%B8-null%EC%9D%B8-%EC%83%81%ED%83%9C%EB%9D%BC%EA%B3%A0-%ED%95%B4%EC%84%9C-%EC%A7%88%EB%AC%B8%EB%93%9C%EB%A6%BD%EB%8B%88%EB%8B%A4이 글에 대한 답변 좀 주실 수 있을까요...?
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
h2 데이터 베이스 mac사용자는 어디 서 다운 받나요?
데이터 베이스 h2 데이터 베이스 mac사용자는 어디 서 다운 받나요?
-
미해결[초급편] 안드로이드 커뮤니티 앱 만들기(Android Kotlin)
파이어베이스 연결 문제
회원가입 부분에서 막혔는데요,sampleapp 실행할 땐 문제없이 잘 돌아갔었습니다. 근데 mysololife에서는 회원가입을 하려고 하면W/System: Ignoring header X-Firebase-Locale because its values was null이렇게 나오네요 비밀번호 6자리 이상 설정해봤습니다. 에뮬레이터 인터넷 연결 되어있습니다파이어베이스 로그인 제공업체 설정 되어있습니다. 전에 했던 sampleapp은 잘 돌아가서 참고해도 다른게 없어 도저히 이유를 모르겠네요..ㅠ
-
미해결홍정모의 따라하며 배우는 C언어
질문! int와 main(), 그리고 return에 대해서
안녕하세요 c언어를 공부 중 인 학생입니다.일단 int main()은 '메인 함수가 프로그램 종료 시 return값을 정수형 으로 반환 받겠다.' 의 의미 인 건 알겠습니다. 그래서 main함수 앞에 정수형인 int 가 붙는 것 이고요. 그런데 여기서 return값에 대해 궁금한게 프로그램을 성공적으로 종료 시켰다 라는 의미로 값 0을 반환 하는데 굳이 반환 값이 꼭 0 이여야 하나 궁금합니다. 0이 아니여도 1, 4, 5, 7, 같은 다른 정수를 반환 시켜도 프로그램은 정상적으로 작동 하는 거 같은데 0과 다른 정수들의 차이점을 모르겠습니다. int main() 함수에서 return 값을 반환 시킬때 꼭 0을 쓰는 이유가 있나요?
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
교안 79페이지 질문이요!
교안 79페이지 2차원 배열 예제에서 for(int i = 0; i < 10; i++){ vector<int> vv; v.push_back(vv); }. 이 코드가 하는 역할이 어떤건가요??
-
해결됨스프링 시큐리티 OAuth2
Ajax 인증시 AuthenticationManager 등록 문의
Spring Authorization 1.0 을 사용하여 FormLogin 이 아닌 Ajax로 로그인을 하려고 합니다.Spring Security 강의를 참조하여AbstractAuthenticationProcessingFilter를 상속하여 CustomUserDetailsService, CustomAuthenticationProvider, CustomAuthenticationProcessingFilter, CustomAuthenticationToken 구현체를 만들었습니다.CustomAuthenticationProcessingFilter는 AbstractAuthenticationProcessingFilter 상속하여 개발하였는데 Filter를 등록 하려면 강의에서 내용처럼 AuthenticationManager를 등록 해줘여 하는데 강의는 WebSecurityConfigurerAdapter 상속하여 설정 하는것으로 설명되어 있는데 Spring Securitty 6.0 에서는 삭제되었습니다.Spring Security 의 강의를 보면 @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.authenticationProvider(ajaxAuthenticationProvider()); }configure(AuthenticationManagerBuilder auth)를 구현하고 @Bean public AjaxLoginProcessingFilter ajaxLoginProcessingFilter() throws Exception { AjaxLoginProcessingFilter filter = new AjaxLoginProcessingFilter(); filter.setAuthenticationManager(authenticationManagerBean()); return filter; } 질문)AjaxLoginProcessingFilter Bean 에서 설정하는데 SecurityFilterChain 를 등록하는 방식에서는 어떻게 등록해야 할지 문의 합니다.제가 구현한 소스 일부Authorization Server 설정을 다른 클래스에서 설정하였고 디버깅을 해보니 Authorization Server 용 FilterChain 과 로그인 처리용 FilterChain 이 따로 등록되어 로그인 프로세스는 Spring Security FilterChain Class 에서 진행하였습니다@Configuration는 Spring Security 6에서는 @EnableWebSecurity에 포함되지 않아 추가 하였습니다.@EnableWebSecurity @RequiredArgsConstructor @Configuration public class DefaultSecurityConfig { private final PasswordEncoder passwordEncoder; private final CustomAuthenticationProvider customAuthenticationProvider; // @Bean public CustomAuthenticationProcessingFilter customAuthenticationProcessingFilter() throws Exception { CustomAuthenticationProcessingFilter filter = new CustomAuthenticationProcessingFilter(); return filter; } // @formatter:off @Bean SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) throws Exception { http .authorizeHttpRequests(authorizeRequests ->authorizeRequests .requestMatchers(CorsUtils::isPreFlightRequest).permitAll() .requestMatchers("/login/**").permitAll() .requestMatchers("/api/registered-client/**").permitAll() .anyRequest().authenticated() ) .csrf(csrf -> csrf .ignoringRequestMatchers(new AntPathRequestMatcher("/api/registered-client/**")) ) .formLogin().disable(); http.authenticationProvider(customAuthenticationProvider); http.addFilterBefore(customAuthenticationProcessingFilter(), UsernamePasswordAuthenticationFilter.class); return http.build(); } // @formatter:on }AuthenticationManager를 등록하지 않아 예와가 발생함Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customAuthenticationProcessingFilter' defined in class path resource [com/naon/oidc/security/config/DefaultSecurityConfig.class]: authenticationManager must be specified그리고 @Bean으로 만들어 등록하면 순환참조가 됩니다.