일 년 전 · 다형 님의 새로운 답변
aws spring boot 배포 오류
안녕하세요 백엔드 공부 중인 학생입니다. aws ec2로 Spring boot 프로젝트를 배포 시도 중에 있습니다. (maven, java 8, jar) java -jar jar파일명.jar 명령어로 배포 시도 중에 에러메세지가 도저히 해결이 안되어서 도움 요청드립니다.. 도와주신다면 감사하겠습니다.. 아 참고로 rds로 데이터베이스 생성하지 않고 mysql(workbench)로 데이터베이스 생성했습니다 <오류메세지> Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2024-02-07 04:33:35.742 ERROR 31012 --- [ main] o.s.boot.SpringApplication : Application run failed org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:181) ~[spring-context-5.3.22.jar!/:5.3.22] at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54) ~[spring-context-5.3.22.jar!/:5.3.22] at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356) ~[spring-context-5.3.22.jar!/:5.3.22] at java.lang.Iterable.forEach(Iterable.java:75) ~[na:1.8.0_392] at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:155) ~[spring-context-5.3.22.jar!/:5.3.22] at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:123) ~[spring-context-5.3.22.jar!/:5.3.22] at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:935) ~[spring-context-5.3.22.jar!/:5.3.22] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) ~[spring-context-5.3.22.jar!/:5.3.22] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.2.jar!/:2.7.2] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734) [spring-boot-2.7.2.jar!/:2.7.2] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) [spring-boot-2.7.2.jar!/:2.7.2] at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) [spring-boot-2.7.2.jar!/:2.7.2] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) [spring-boot-2.7.2.jar!/:2.7.2] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) [spring-boot-2.7.2.jar!/:2.7.2] at com.se.social.SocialApplication.main(SocialApplication.java:13) [classes!/:0.0.1-SNAPSHOT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_392] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_392] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_392] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_392] at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) [social-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) [social-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) [social-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65) [social-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:229) ~[spring-boot-2.7.2.jar!/:2.7.2] at org.springframework.boot.web.servlet.context.WebServerStartStopLifecycle.start(WebServerStartStopLifecycle.java:43) ~[spring-boot-2.7.2.jar!/:2.7.2] at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:178) ~[spring-context-5.3.22.jar!/:5.3.22] ... 22 common frames omitted Caused by: java.lang.IllegalArgumentException: standardService.connector.startFailed at org.apache.catalina.core.StandardService.addConnector(StandardService.java:238) ~[tomcat-embed-core-9.0.65.jar!/:na] at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:282) ~[spring-boot-2.7.2.jar!/:2.7.2] at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:213) ~[spring-boot-2.7.2.jar!/:2.7.2] ... 24 common frames omitted Caused by: org.apache.catalina.LifecycleException: Protocol handler start failed at org.apache.catalina.connector.Connector.startInternal(Connector.java:1077) ~[tomcat-embed-core-9.0.65.jar!/:na] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.65.jar!/:na] at org.apache.catalina.core.StandardService.addConnector(StandardService.java:234) ~[tomcat-embed-core-9.0.65.jar!/:na] ... 26 common frames omitted Caused by: java.net.SocketException: Permission denied at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_392] at sun.nio.ch.Net.bind(Net.java:461) ~[na:1.8.0_392] at sun.nio.ch.Net.bind(Net.java:453) ~[na:1.8.0_392] at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:222) ~[na:1.8.0_392] at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:275) ~[tomcat-embed-core-9.0.65.jar!/:na] at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:230) ~[tomcat-embed-core-9.0.65.jar!/:na] at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1227) ~[tomcat-embed-core-9.0.65.jar!/:na] at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1313) ~[tomcat-embed-core-9.0.65.jar!/:na] at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:614) ~[tomcat-embed-core-9.0.65.jar!/:na] at org.apache.catalina.connector.Connector.startInternal(Connector.java:1074) ~[tomcat-embed-core-9.0.65.jar!/:na] ... 28 common frames omitted <전체> . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.7.2) 2024-02-07 04:33:27.975 INFO 31012 --- [ main] com.se.social.SocialApplication : Starting SocialApplication v0.0.1-SNAPSHOT using Java 1.8.0_392 on ip-172-31-39-15 with PID 31012 (/home/ubuntu/socialboardPJ/target/social-0.0.1-SNAPSHOT.jar started by ubuntu in /home/ubuntu/socialboardPJ/target) 2024-02-07 04:33:27.980 INFO 31012 --- [ main] com.se.social.SocialApplication : No active profile set, falling back to 1 default profile: "default" 2024-02-07 04:33:29.591 INFO 31012 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. 2024-02-07 04:33:29.681 INFO 31012 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 76 ms. Found 1 JPA repository interfaces. 2024-02-07 04:33:30.960 INFO 31012 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 80 (http) 2024-02-07 04:33:30.986 INFO 31012 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2024-02-07 04:33:30.987 INFO 31012 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.65] 2024-02-07 04:33:31.641 INFO 31012 --- [ main] org.apache.jasper.servlet.TldScanner : At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 2024-02-07 04:33:31.880 INFO 31012 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2024-02-07 04:33:31.880 INFO 31012 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 3717 ms 2024-02-07 04:33:32.215 INFO 31012 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... 2024-02-07 04:33:32.569 INFO 31012 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. 2024-02-07 04:33:32.659 INFO 31012 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default] 2024-02-07 04:33:32.822 INFO 31012 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.6.10.Final 2024-02-07 04:33:33.157 INFO 31012 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final} 2024-02-07 04:33:33.383 INFO 31012 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect 2024-02-07 04:33:34.255 INFO 31012 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] 2024-02-07 04:33:34.266 INFO 31012 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 2024-02-07 04:33:34.906 WARN 31012 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning 2024-02-07 04:33:35.616 WARN 31012 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server 2024-02-07 04:33:35.620 INFO 31012 --- [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' 2024-02-07 04:33:35.624 INFO 31012 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... 2024-02-07 04:33:35.646 INFO 31012 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. 2024-02-07 04:33:35.650 INFO 31012 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2024-02-07 04:33:35.676 INFO 31012 --- [ main] ConditionEvaluationReportLoggingListener : Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2024-02-07 04:33:35.742 ERROR 31012 --- [ main] o.s.boot.SpringApplication : Application run failed org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:181) ~[spring-context-5.3.22.jar!/:5.3.22] at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54) ~[spring-context-5.3.22.jar!/:5.3.22] at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356) ~[spring-context-5.3.22.jar!/:5.3.22] at java.lang.Iterable.forEach(Iterable.java:75) ~[na:1.8.0_392] at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:155) ~[spring-context-5.3.22.jar!/:5.3.22] at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:123) ~[spring-context-5.3.22.jar!/:5.3.22] at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:935) ~[spring-context-5.3.22.jar!/:5.3.22] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) ~[spring-context-5.3.22.jar!/:5.3.22] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.2.jar!/:2.7.2] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734) [spring-boot-2.7.2.jar!/:2.7.2] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) [spring-boot-2.7.2.jar!/:2.7.2] at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) [spring-boot-2.7.2.jar!/:2.7.2] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) [spring-boot-2.7.2.jar!/:2.7.2] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) [spring-boot-2.7.2.jar!/:2.7.2] at com.se.social.SocialApplication.main(SocialApplication.java:13) [classes!/:0.0.1-SNAPSHOT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_392] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_392] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_392] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_392] at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) [social-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) [social-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) [social-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65) [social-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:229) ~[spring-boot-2.7.2.jar!/:2.7.2] at org.springframework.boot.web.servlet.context.WebServerStartStopLifecycle.start(WebServerStartStopLifecycle.java:43) ~[spring-boot-2.7.2.jar!/:2.7.2] at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:178) ~[spring-context-5.3.22.jar!/:5.3.22] ... 22 common frames omitted Caused by: java.lang.IllegalArgumentException: standardService.connector.startFailed at org.apache.catalina.core.StandardService.addConnector(StandardService.java:238) ~[tomcat-embed-core-9.0.65.jar!/:na] at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:282) ~[spring-boot-2.7.2.jar!/:2.7.2] at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:213) ~[spring-boot-2.7.2.jar!/:2.7.2] ... 24 common frames omitted Caused by: org.apache.catalina.LifecycleException: Protocol handler start failed at org.apache.catalina.connector.Connector.startInternal(Connector.java:1077) ~[tomcat-embed-core-9.0.65.jar!/:na] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.65.jar!/:na] at org.apache.catalina.core.StandardService.addConnector(StandardService.java:234) ~[tomcat-embed-core-9.0.65.jar!/:na] ... 26 common frames omitted Caused by: java.net.SocketException: Permission denied at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_392] at sun.nio.ch.Net.bind(Net.java:461) ~[na:1.8.0_392] at sun.nio.ch.Net.bind(Net.java:453) ~[na:1.8.0_392] at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:222) ~[na:1.8.0_392] at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:275) ~[tomcat-embed-core-9.0.65.jar!/:na] at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:230) ~[tomcat-embed-core-9.0.65.jar!/:na] at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1227) ~[tomcat-embed-core-9.0.65.jar!/:na] at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1313) ~[tomcat-embed-core-9.0.65.jar!/:na] at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:614) ~[tomcat-embed-core-9.0.65.jar!/:na] at org.apache.catalina.connector.Connector.startInternal(Connector.java:1074) ~[tomcat-embed-core-9.0.65.jar!/:na] ... 28 common frames omitted
개발자
#aws
#springboot
#배포
답변 1
댓글 0
조회 595
6달 전 · 노원재 님의 답변 업데이트
ReactNative ios build 에러 3일째 해결을 못했습니다.
시뮬레이션을 실행하려고 해도 스크립트 문제, iPhone 버전 범위 문제, 시뮬레이터 문제가 계속 발생합니다. 어떤 도움이라도 감사합니다. ReactNative를 처음 접했습니다. 저희 팀에서 저를 도울 수 있는 사람이 없습니다. #프로젝트 환경 mac M2 ruby -v ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin23] node -v v20.10.0 pod --version 1.15.2 package.json { "name": "labts", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "lint": "eslint .", "start": "react-native start", "test": "jest" }, "dependencies": { "@react-native-community/async-storage": "^1.12.1", "@react-native-community/cli": "13.6.9", "@react-navigation/bottom-tabs": "^6.6.0", "@react-navigation/native": "^6.1.17", "@react-navigation/native-stack": "^6.10.0", "@tanstack/react-query": "^5.51.5", "@types/react-native-vector-icons": "^6.4.18", "axios": "^1.7.2", "date-fns": "^3.6.0", "immer": "^10.1.1", "react": "18.2.0", "react-native": "0.74.3", "react-native-calendars": "^1.1305.0", "react-native-date-picker": "^5.0.4", "react-native-dotenv": "^3.4.11", "react-native-get-random-values": "^1.11.0", "react-native-image-crop-picker": "^0.41.2", "react-native-image-zoom-viewer": "^3.0.1", "react-native-paper": "^5.12.3", "react-native-permissions": "^4.1.5", "react-native-safe-area-context": "^4.10.8", "react-native-screens": "^3.32.0", "react-native-splash-screen": "^3.3.0", "react-native-tab-view": "^3.5.2", "react-native-vector-icons": "^10.1.0", "react-native-vision-camera": "^4.5.1", "uuid": "^10.0.0", "yarn": "^1.22.22" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", "@react-native/babel-preset": "0.74.85", "@react-native/eslint-config": "0.74.85", "@react-native/metro-config": "0.74.85", "@react-native/typescript-config": "0.74.85", "@types/react": "^18.2.6", "@types/react-native-dotenv": "^0.2.2", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.6.3", "babel-plugin-module-resolver": "^5.0.2", "eslint": "^8.19.0", "jest": "^29.6.3", "prettier": "2.8.8", "react-test-renderer": "18.2.0", "typescript": "5.0.4" }, "engines": { "node": ">=18" } } PodFile require Pod::Executable.execute_command('node', ['-p', 'require.resolve( "react-native/scripts/react_native_pods.rb", {paths: [process.argv[1]]}, )', __dir__]).strip platform :ios, '12.0' use_frameworks! #use_modular_headers! prepare_react_native_project! linkage = ENV['USE_FRAMEWORKS'] if linkage != nil Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green use_frameworks! :linkage => linkage.to_sym end target 'nexlabts' do config = use_native_modules! use_react_native!( :path => config[:reactNativePath], # An absolute path to your application root. :app_path => "#{Pod::Config.instance.installation_root}/.." ) target 'nexlabtsTests' do inherit! :complete # Pods for testing end post_install do |installer| # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202 react_native_post_install( installer, config[:reactNativePath], :mac_catalyst_enabled => false, # :ccache_enabled => true ) end end 제가 아래 에러 3가지에 대해 제가 해본 방법들입니다. 1. node 재설치 node_module 폴더 삭제, package-rock.json 삭제 후 재설치 npm install --legacy-peer-deps yarn install 2. Xcode가 node 읽을 수 있도록 설정 sudo ln -s "$(which node)" /usr/local/bin/node 3. Podfile 내 platform 설정 수정 platform :ios, '12.0' or platform :ios, '14.0' 4. Pods 재설치 rm -rf ~/Library/Developer/Xcode/DerivedData or rm -rf ~/Library/Developer/Xcode/DerivedData/* rm -rf Pods rm Podfile.lock pod install --repo-update Xcode \> Product \> Clean Build Folder. cd ./ios pod cache clean -all pod install --repo-update cd ../ npx react-native run-ios --no-packager --simulator="iPhone 15" or npx react-native run-ios --simulator="iPhone 15" or yarn start > i(run ios) Err 1. cocoaPods 설치할 때 [!] CocoaPods could not find compatible versions for pod "React-RuntimeHermes": In Podfile: React-RuntimeHermes (from ../node_modules/react-native/ReactCommon/react/runtime) Specs satisfying the React-RuntimeHermes (from ../node_modules/react-native/ReactCommon/react/runtime) dependency were found, but they required a higher minimum deployment target. Err2. iOS 실행할때 run-ios --no-packager --simulator="iPhone 15" Build description signature: fc1341421f84b87c5245d346c2c17b66 Build description path: /Users/nowonjae/Library/Developer/Xcode/DerivedData/nexlabts-argvodqcybjfcybstpulfpghnzvm/Build/Intermediates.noindex/XCBuildData/fc1341421f84b87c5245d346c2c17b66.xcbuilddata /Users/nowonjae/Desktop/project/NeXLabRN/ios/nexlabts.xcodeproj:1:1: error: Unable to open base configuration reference file '/Users/nowonjae/Desktop/project/NeXLabRN/ios/Pods/Target Support Files/Pods-nexlabts/Pods-nexlabts.release.xcconfig'. (in target 'nexlabts' from project 'nexlabts') warning: Unable to read contents of XCFileList '/Target Support Files/Pods-nexlabts/Pods-nexlabts-resources-Release-output-files.xcfilelist' (in target 'nexlabts' from project 'nexlabts') warning: Unable to read contents of XCFileList '/Target Support Files/Pods-nexlabts/Pods-nexlabts-frameworks-Release-output-files.xcfilelist' (in target 'nexlabts' from project 'nexlabts') error: Unable to load contents of file list: '/Target Support Files/Pods-nexlabts/Pods-nexlabts-frameworks-Release-input-files.xcfilelist' (in target 'nexlabts' from project 'nexlabts') error: Unable to load contents of file list: '/Target Support Files/Pods-nexlabts/Pods-nexlabts-frameworks-Release-output-files.xcfilelist' (in target 'nexlabts' from project 'nexlabts') warning: Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'nexlabts' from project 'nexlabts') warning: Run script build phase '[CP] Embed Pods Frameworks' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'nexlabts' from project 'nexlabts') error: Unable to load contents of file list: '/Target Support Files/Pods-nexlabts/Pods-nexlabts-resources-Release-input-files.xcfilelist' (in target 'nexlabts' from project 'nexlabts') error: Unable to load contents of file list: '/Target Support Files/Pods-nexlabts/Pods-nexlabts-resources-Release-output-files.xcfilelist' (in target 'nexlabts' from project 'nexlabts') warning: Run script build phase '[CP] Copy Pods Resources' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'nexlabts' from project 'nexlabts') --- xcodebuild: WARNING: Using the first of multiple matching destinations: { platform:iOS Simulator, id:B5AA2E84-4F83-4749-A986-A1FCE5E398A3, OS:17.5, name:iPhone 15 } { platform:iOS Simulator, id:B5AA2E84-4F83-4749-A986-A1FCE5E398A3, OS:17.5, name:iPhone 15 } ** BUILD FAILED ** ] Err3. Xcode 로 Build 할때 (Any iOS Simulator Device (arm64, x86_64)) Command PhaseScriptExecution failed with a nonzero exit code
개발자
#reactnative
#xcode
#reactnative-run-ios
답변 1
댓글 0
조회 427
4달 전 · 문종호 님의 새로운 답변
RAG 를 짜는 중에 도무지 어떤 부분이 문제인지 모르겠습니다.
# JSON 파일에서 FAQ 데이터를 로드하는 함수 def load_faq_data_from_json(file_path): with open(file_path, 'r', encoding='utf-8') as f: faq_data = json.load(f) return faq_data # FAQ 데이터 로드 json_file_path = '' faq_data = load_faq_data_from_json(json_file_path) # ChromaDB 클라이언트 및 Embedding 설정 chroma_client = chromadb.Client() # ChromaDB 클라이언트 생성 # 고유한 컬렉션 이름 생성 collection_name = "faq_data_" + datetime.datetime.now().strftime("%Y%m%d_%H%M%S") collection = chroma_client.create_collection(collection_name) # LangChain의 Text Splitter 설정 text_splitter = RecursiveCharacterTextSplitter( chunk_size=512, chunk_overlap=50 ) # OpenAI 임베딩 설정 openai_api_key = '' embedding_function = OpenAIEmbeddings( model="text-embedding-ada-002", openai_api_key=openai_api_key ) # 텍스트 스플리팅 및 임베딩 생성 함수 def split_and_embed_text(text): splitted_texts = text_splitter.split_text(text) print(f"Splitted texts: {splitted_texts}") try: # OpenAIEmbeddings는 embed_documents를 사용합니다. embeddings = embedding_function.embed_documents(splitted_texts) except Exception as e: print(f"임베딩 생성 중 오류 발생: {e}") return None # 임베딩이 제대로 생성되었는지 확인합니다. if embeddings is None or len(embeddings) == 0: print("임베딩 생성 실패") return None # 임베딩을 numpy 배열로 변환 embeddings = np.array(embeddings) print(f"Embeddings shape: {embeddings.shape}") # 임베딩 벡터의 차원을 확인하고 처리합니다. if embeddings.ndim == 1 and embeddings.shape[0] == 1536: # 임베딩이 1차원 배열이고 길이가 1536인 경우 final_embedding = embeddings elif embeddings.ndim == 2 and embeddings.shape[1] == 1536: # 임베딩이 2차원 배열이고 두 번째 차원이 1536인 경우 final_embedding = np.mean(embeddings, axis=0) else: print("임베딩 벡터의 차원이 예상과 다릅니다.") return None print(f"Final embedding shape: {final_embedding.shape}") return final_embedding # FAQ 데이터를 Vector DB에 저장 def store_faq_data_in_vector_db(faq_data, collection): for faq in faq_data: # 'question'과 'answer'가 있는지 확인하고, 'answer'가 None이 아닌지 확인 if 'question' not in faq or 'answer' not in faq or faq['answer'] is None: print(f"누락된 'question' 또는 'answer'로 인해 항목을 건너뜁니다: {faq}") continue # 다음 항목으로 넘어감 # 텍스트 스플리팅 및 임베딩 생성 question_embedding = split_and_embed_text(faq['question']) if question_embedding is None: print(f"Embedding generation failed for question: {faq['question']}") continue # 임베딩이 없으면 다음 질문으로 넘어감 print(f"Generated embedding for question '{faq['question']}': {question_embedding}") # 각 질문에 고유한 ID 생성 faq_id = str(uuid.uuid4()) # 메타데이터에서 None 값을 제거 metadata = {k: v for k, v in {"answer": faq['answer']}.items() if v is not None} # Vector DB에 저장 collection.add( documents=[faq['question']], metadatas=[metadata], ids=[faq_id], embeddings=[question_embedding] ) # 추가 후 임베딩 확인 (저장된 후 곧바로 확인) stored_results = collection.get(ids=[faq_id], include=["embeddings"]) if stored_results['embeddings'] is not None and len(stored_results['embeddings']) > 0: print(f"Embedding for question '{faq['question']}' successfully stored.") else: print(f"Failed to store embedding for question '{faq['question']}'") # FAQ 데이터를 JSON에서 로드하고 저장 store_faq_data_in_vector_db(faq_data, collection) 이렇게 데이터를 저장하고 # 환경 변수에서 API 키 로드 openai_api_key = os.getenv("OPENAI_API_KEY") if not openai_api_key: raise ValueError("OpenAI API 키가 설정되지 않았습니다. 환경 변수 OPENAI_API_KEY를 설정하세요.") # OpenAI 임베딩 설정 embedding_function = OpenAIEmbeddings( model="text-embedding-ada-002", openai_api_key=openai_api_key ) # LangChain의 Text Splitter 설정 (일관성 유지) text_splitter = RecursiveCharacterTextSplitter( chunk_size=512, chunk_overlap=50 ) # ChromaDB 클라이언트 및 컬렉션 설정 chroma_client = chromadb.Client() collection_name = "faq_data_collection" try: # 이미 존재하는 컬렉션인지 확인하고, 있으면 가져옴 collection = chroma_client.get_collection(name=collection_name) except chromadb.errors.CollectionNotFoundError: # 컬렉션이 존재하지 않을 경우에만 생성 collection = chroma_client.create_collection(name=collection_name) # Vector DB에서 유사 질문 검색 (ChromaDB) def find_similar_question_in_vector_db(new_question_embedding, collection, k=5): results = collection.query(query_embeddings=[new_question_embedding], n_results=k, include=['documents', 'metadatas', 'embeddings']) best_similarity = 0 best_question = None best_answer = None # 검색 결과에서 각 질문의 유사도와 답변을 처리합니다. if 'documents' in results and 'metadatas' in results: documents = results['documents'][0] metadatas = results['metadatas'][0] embeddings = results['embeddings'][0] for i in range(len(documents)): stored_embedding = embeddings[i] metadata = metadatas[i] if stored_embedding is not None: # 코사인 유사도를 통해 유사도를 계산합니다. similarity = cosine_similarity([new_question_embedding], [stored_embedding])[0][0] print(f"유사도: {similarity} for {documents[i]}") # 유사도가 가장 높은 결과를 선택하며, 임계값 이상일 경우에만 선택 if similarity > best_similarity and similarity >= SIMILARITY_THRESHOLD: best_similarity = similarity best_question = documents[i] if isinstance(metadata, list): metadata = metadata[0] best_answer = metadata.get('answer') if isinstance(metadata, dict) else None return best_question, best_answer # Fine-tuned GPT를 사용해 새로운 답변 생성 def gpt_generate_response_from_finetuned_gpt(question, style="의사 A 말투"): prompt = f"다음은 환자의 질문입니다: \"{question}\". 아래 말투를 사용하여 질문에 대해 성실하고 정확한 답변을 작성해주세요.\n\ 말투: {style}" response = client.chat.completions.create( model="", # Fine-tuned된 GPT 모델 ID messages=[ {"role": "system", "content": "You are a helpful medical assistant."}, {"role": "user", "content": prompt}, ], max_tokens=300, temperature=0.7, # 답변의 다양성을 조절합니다. ) return response.choices[0].message.content.strip() # 새로운 질문 처리 및 최종 응답 생성 def generate_final_response(new_question, collection): # 텍스트 스플리팅 및 임베딩 생성 splitted_texts = text_splitter.split_text(new_question) new_question_embedding = np.mean(embedding_function.embed_documents(splitted_texts), axis=0) # ChromaDB에서 유사 질문 검색 similar_question, answer = find_similar_question_in_vector_db(new_question_embedding, collection) if similar_question and answer: final_response = f"질문: {new_question}\n유사 질문: {similar_question}\n기본 답변: {answer}" else: generated_answer = gpt_generate_response_from_finetuned_gpt(new_question) final_response = f"질문: {new_question}\nGPT로 생성된 답변: {generated_answer}\n(이 답변은 벡터데이터에서 유사한 답변을 찾을 수 없어 GPT에 의해 생성되었습니다.)" return final_response # 사용자로부터 새로운 질문 입력 받기 new_question = input("새로운 질문을 입력하세요: ") # 최종 응답 생성 response = generate_final_response(new_question, collection) print(response) 로 데이터베이스에서 유사한 질문-답변 쌍을 끌어오려는데 정확히 같은 질문을 넣어도 (이러면 유사도가 1인데) 저장되어있는 답변이 끌어와지질 않네요...
개발자
#llm#rag
답변 1
댓글 0
조회 74
리액트 라우팅을 이렇게 하는게 맞는지 모르겠습니다..
안녕하세요 독학 하고 있는 학생입니다.. 작은 프로젝트로 혼자서 홈페이지를 만들고 있습니다. 우선 로그인 페이지부터 만들고 있는데, 로그인페이지에는 아이디찾기 비밀번호찾기 등등 많은 페이지가 들어가더라구요.. 그래서 리액트 라우터를 공부하고 적용시켰습니다. 코드는 아래와 같습니다. 이렇게 해도 제가 원하는대로 로그인페이지에서 아이디 찾기 페이지로 이동하고 하는 것은 맞는데 App.js에 이렇게 주저리주저리 원하는 것을 다 넣어두면 나중에 전체적으로 페이지를 완성시켰을 때 App.js에 너무 방대한 내용이 들어가지않나..? 싶더라구요.. 그래서 중첩된 라우트도 찾아서 공부했는데 크흡..암만해도 적용이 안됩니다.. 그래서 그냥 이대로 홈페이지를 계속 만들어도 되는지,,아니면 저의 고민을 해결할 방법이 중첩된 라우트가 맞는지 알고싶습니다.. 맞다면 다시 공부해야겠죠 ㅜ.. 답변부탁드립니다 (_ _) import "./App.css"; import { Route, Routes } from "react-router-dom"; import WigTemplate from "./components/wigtemplate"; import FindId from "./components/findId"; import FindPwd from "./components/findPwd"; import SignIn from "./components/signIn"; import NotFound from "./components/notFound"; function App() { return ( <Routes> <Route path="/" element={<WigTemplate />} /> <Route path="/findId" element={<FindId />} /> <Route path="/findPwd" element={<FindPwd />} /> <Route path="/signIn" element={<SignIn />} /> <Route path="*" element={<NotFound />} /> </Routes> ); } export default App; ---------------------------------------------------------- import React from "react"; import styled from "styled-components"; import WigLoginButton from "./wigLoginButton"; import WigHeader from "./wigHeader"; import WigInput from "./wigInput"; import WigFind from "./wigFind"; const WigTemplateContainer = styled.div` height: 100vh; display: flex; align-items: center; justify-content: center; `; const WigTemplateBlock = styled.div` width: 500px; height: 600px; background: #d0ebff; border-radius: 80px; `; function WigTemplate() { return ( <WigTemplateContainer> <WigTemplateBlock> <WigHeader></WigHeader> <WigInput></WigInput> <WigFind></WigFind> <WigLoginButton></WigLoginButton> </WigTemplateBlock> </WigTemplateContainer> ); } export default WigTemplate; ------------------------------------------------------- import React from "react"; import styled from "styled-components"; import { RxDividerVertical } from "react-icons/rx"; import { Link } from "react-router-dom"; const FindBlock = styled.div` display: flex; justify-content: center; `; const ABlock = styled(Link)` color: black; font-size: 0.9rem; text-decoration: none; `; function WigFind() { return ( <FindBlock> <ABlock to="/findId">아이디 찾기</ABlock> <RxDividerVertical style={{ marginTop: "3px" }} /> <ABlock to="/findPwd">비밀번호 찾기</ABlock> <RxDividerVertical style={{ marginTop: "3px" }} /> <ABlock to="/signIn">회원가입</ABlock> </FindBlock> ); } export default WigFind;
개발자
#react
답변 2
댓글 3
조회 469
일 년 전 · 손호영 님의 질문
가계부 어플리케이션 만들기 java질문
import javax.swing.*; import java.math.*; import java.util.ArrayList; import java.awt.event.*; import java.util.Scanner; import java.text.NumberFormat; import java.util.Locale; class momry extends JFrame { private ArrayList<Integer> incomeList = new ArrayList<>(); private ArrayList<Integer> expenseList = new ArrayList<>(); private boolean isIncome = false; // 초기값은 지출로 설정 public momry() { setTitle("가계부"); setSize(800, 200); JButton button1 = new JButton("추가"); JButton button2 = new JButton("제거"); JButton button3 = new JButton("수입"); JButton button4 = new JButton("지출"); button3.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent actionEvent) { JFrame frame = new JFrame(); frame.setTitle("수입입력"); frame.setSize(500, 600); JLabel label = new JLabel("수입을 입력하세요");//수입을 입력한다. frame.add(label);//라벨에 표시한다. JTextField textField = new JTextField(10); // 텍스트 필드를 생성하여 수입을 입력 받음 frame.add(textField); JButton submitButton = new JButton("확인"); submitButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { ArrayList<Integer>i1=new ArrayList<Integer>(); int income = Integer.parseInt(textField.getText()); // 입력된 값을 정수로 변환 int income1 = Integer.parseInt(textField.getText()); // 입력된 값을 정수로 변환 i1.add(income); // 수입을 ArrayList에 추가 submitButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent actionEvent) { int income = Integer.parseInt(textField.getText()); incomeList.add(income); frame.dispose(); // 입력 창 닫기 } }); frame.add(submitButton); frame.setVisible(true); } }); } NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.KOREA); }); button4.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent actionEvent) { JFrame frame1 = new JFrame(); frame1.setTitle("지출입력"); frame1.setSize(500, 600); JLabel label1 = new JLabel("지출 내용을 입력하세요");//수입을 입력한다. frame1.add(label1);//라벨에 표시한다. JTextField textField = new JTextField(10); // 텍스트 필드를 생성하여 수입을 입력 받음 frame1.add(textField); JButton submitButton1 = new JButton("확인"); submitButton1.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { ArrayList<Integer>i1=new ArrayList<Integer>(); int income = Integer.parseInt(textField.getText()); // 입력된 값을 정수로 변환 int income1 = Integer.parseInt(textField.getText()); // 입력된 값을 정수로 변환 i1.add(income); // 수입을 ArrayList에 추가 submitButton1.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent actionEvent) { int income = Integer.parseInt(textField.getText()); incomeList.add(income); frame1.dispose(); // 입력 창 닫기 } }); frame1.add(submitButton1); frame1.setVisible(true); } }); } }); } } class Scratch { public static void main(String[] args) { } } 이게 맞나요?
개발자
#java
#android
답변 0
댓글 0
보충이 필요해요 3
조회 124
일 년 전 · 익명 님의 질문 업데이트
api의 첫번째 호출 이후부터 antd Button 렌더링 안되는 이슈가 있습니다.
```jsx import { Popover, Modal, Button, Image, Result } from "antd"; const [prevImg, setPrevImg] = useState(["any"]); const [loading, setLoading] = useState(false); const [removeImgFiles, setRemoveImgFiles] = useState([]); const combinePrevImages = (prevImages, newImages) => { const combinedImages = [...prevImages, ...newImages]; return combinedImages; }; useEffect(() => { const postSeg = async () => { try { const res = await axios.post( "apiurl", { filepath: filePath, clips: sortableList.map(list => `${list.seg.start}-${list.seg.end}`), frame: frameValue }, { proxy: false } ); return res.data; } catch (error) { console.error("Error posting segments:", error); return []; } finally { setLoading(false); } }; const postSegments = async () => { if (segments[0]?.start === 0 && segments[0]?.end === 0) return; if (sortableList && filePath) { setLoading(true); const res = await postSeg(); const combinedPrevImg = combinePrevImages(prevImg, res.results); setPrevImg(combinedPrevImg); console.log("Post Request Success"); } }; postSegments(); }, [filePath, segments, frameValue]); const handleModalOpen = useCallback(() => setModalOpen(true), []); const handleModalClose = useCallback(() => { setRemoveImgFiles([]); setModalOpen(false); }, []); const handleDeleteButtonClick = async () => { if (removeImgFiles.length > 0) { setPrevImg([...removeImgFiles]); setRemoveImgFiles([]); } else { const result = await showSwal({ title: "Are you sure delete?", showCancelButton: true, confirmButtonText: "Confirm", cancelButtonText: "Cancel", confirmButtonColor: "#3085d6", cancelButtonColor: "#d33" }); if (result.isConfirmed) { setRemoveImgFiles([...prevImg]); setPrevImg([]); } const success = await Promise.all(removeImgFiles.map(deleteFiles)); return success; } } const handleRemoveFinish = async () => { if (removeImgFiles) { for (const filePath of removeImgFiles) { try { await removeFile(filePath); } catch (e) { console.log("File Remove Error", e); } } } setRemoveImgFiles([]); handleModalClose(); }; return ( <motion.div initial={{ x: width }} animate={{ x: 0 }} exit={{ x: width }} transition={mySpring} > <div style={{ fontSize: 12, padding: "0 5px", color: "var(--gray12)", display: "flex", justifyContent: "space-between", alignItems: "center" }} > <FaAngleRight title={t("Close sidebar")} size={20} className="angle-right" role="button" onClick={toggleSegmentsList} /> {header} <FaExpandArrowsAlt title={t("Image Inspection")} size={18} className="expand-arrow-alt" style={{ cursor: "pointer" }} role="button" onClick={!loading ? handleModalOpen : handleModalClose} /> <Modal title={t("Image Inspection")} centered onCancel={handleModalClose} open={modalOpen} footer={[]} width="100%" > <div className="imagecontainer"> <Button danger className="toggle-remove" onClick={handleDeleteButtonClick}> {removeImgFiles.length > 0 ? "Add" : "Remove"} </Button> {prevImg?.length > 10 && prevImg.map(img => ( <Popover key={img}> {removeImgFiles?.includes(img) ? ( <span> <Result className="result" icon={<FaSmile />} subTitle="delete" /> </span> ) : <Image key={uuidv4()} src={img} preview={{ src: img }} alt={uuidv4()} /> )} </Popover> ))} </div> <Button block onClick={handleRemoveFinish}> Finish </Button> </Modal> </div> ) ``` api 호출을 통해 frameValue 개수(여기서는 12개씩) 만큼 이미지를 렌더링 하고 있는데 두번째 호출부터는 Button이 렌더링되지 않아서 어디가 잘못됐는지 알고싶습니다.. 필요한 부분이 imagecontainer 클래스네임인 div를 렌더링 해야합니다.
개발자
#react
답변 0
댓글 0
조회 81
일 년 전 · 김하림 님의 새로운 답변
예외처리가 더 효율적인 코드
유저 로그인 관련 메서드를 구현하던 중, 예외처리 방법 두가지 중 어느 것이 더 효율적(가독성, 유지보수 측면 등등..)인지 여쭤보고 싶습니다 첫번째 방법: try문에 NotFoundException을 던지고, catch문에서 instanceof를 사용해서 예외의 타입을 확인하고 처리하기 async userLogin(nickname: string, password: string) { try { const user = await this.usersRepository.findOne({ where: { nickname } }); // console.log(user) if (user && (await bcrypt.compare(password, user.password))) { return user; } else { throw new NotFoundException('아이디 또는 비밀번호가 일치하지 않습니다.'); } } catch (e) { console.error(e); if (e instanceof NotFoundException) { throw e; // NotFoundException은 그대로 던지기 } else { throw new InternalServerErrorException('알 수 없는 오류'); } } } 두번째 방법: try문에서는 일반적인 Error객체를 던진 후 catch문에서 error.message를 확인하여 예외 유형을 판단하기 async userLogin(nickname: string, password: string) { try { const user = await this.usersRepository.findOne({ where: { nickname } }); // console.log(user) if (user && (await bcrypt.compare(password, user.password))) { return user; } else { throw new Error('아이디 또는 비밀번호가 일치하지 않습니다.'); } } catch (error) { if (error.message === '아이디 또는 비밀번호가 일치하지 않습니다.') { throw new NotFoundException('아이디 또는 비밀번호가 일치하지 않습니다.'); } else { // 다른 예외 처리 throw new InternalServerErrorException('알 수 없는 오류'); } } }
개발자
#node.js
#예외처리
답변 1
댓글 0
추천해요 1
조회 243
5달 전 · 익명 님의 질문
WebView로 개발한 앱 개발 경력은 도움이 안될까요?
질문 자체가 우문이라고 생각은 합니다만, 경험이 적다보니 조언을 구하고자 질문합니다. (조언 주시면 달게 받겠습니다ㅠㅠ) Q. iOS 앱 개발로 전문성을 쌓고 싶은데, WKWebView 경력은 채용입장에서 기피하게 되나요? 채용 요건은 대부분 (SwiftUI + TCA / Rxswift) + Tuist + TDD 로 요약될 것 같습니다. 그런데 WKWebview로 프로젝트를 구성하게되면, Tuist 그리고 Rx관련 라이브러리 적용이 일부분 가능하지만, 대부분은 없더라구요. 제가 고민인 것이 WKWebview를 많은 회사에서 사용하지만, 막상 요건에서는 주로 네이티브에 대한 개발 능력을 보다보니, 제가 가진 프로젝트 경력에 부족하지 않은가 라는 생각을 많이 합니다. 채용 입장에서는 이런 부분을 약점으로 보는지 궁금했습니다! Q. (커리어 패스 질문) Flutter 경력이 최근에 많이 있긴한데, WKWebview 경력으로 Native로 나아가기보다는 Flutter 개발로 나아가는게 나을까요? 저는 현재 다음과 같은 개발 경험을 가지고 있습니다. 현재 앱 프로젝트를 8건 - iOS Native 개발 2건 - iOS WKWebview를 통한 하이브리드 앱 2건 - Flutter 앱 개발 4건 다만, 네이티브 개발한지가 2~3년전 경력이다보니, 괜히 움추려드네요ㅠㅠ 최근에는 대부분 Flutter 개발과 WebView 이용한 하이브리드 앱 개발이 전부입니다. 저는 iOS도 너무 재미있고 Flutter도 너무 재미있습니다. 이런 상황이라 어떠한 식으로 커리어패스를 생각해야할지 고민입니다. 먼저 경험이 있으신 분들의 입장에서 어떠한 모습으로 보여질지 궁금하여 질문드렸습니다 긴 글 읽어주셔서 감사합니다. 어떤 조언이든 해주시면 저에게 큰 도움이 될 것 같습니다. 감사합니다 ^-^
개발자
#이직
#ios
#flutter
#커리어
답변 0
댓글 0
추천해요 3
조회 154
9달 전 · 최용빈 님의 답변 업데이트
파이썬 오류 좀 고쳐주세요 ㅠㅠ
import time import requests import streamlit as st API_BASE_URL = "http://localhost:8000/qna" # Fastapi로 api 생성 def request_chat_api(user_message: str) -> str: url = API_BASE_URL resp = requests.post( url, json={ "user_message": user_message, }, ) resp = resp.json() print(resp) return resp["answer"] def init_streamlit(): st.set_page_config(page_title='Dr. KHU', page_icon='🩺') if "messages" not in st.session_state: st.session_state.messages = [{"role": "assistant", "content": "안녕하세요! Dr.seo입니다🩺"}] # Initialize chat history if "messages" not in st.session_state: st.session_state.messages = [] # Display chat messages from history on app rerun for message in st.session_state.messages: with st.chat_message(message["role"]): st.markdown(message["content"]) def chat_main(): if message := st.chat_input(""): # Add user message to chat history st.session_state.messages.append({"role": "user", "content": message}) # Display user message in chat message container with st.chat_message("user"): st.markdown(message) # Display assistant response in chat message container assistant_response = request_chat_api(message) with st.chat_message("assistant"): message_placeholder = st.empty() full_response = "" for lines in assistant_response.split("\n"): for chunk in lines.split(): full_response += chunk + " " time.sleep(0.05) # Add a blinking cursor to simulate typing message_placeholder.markdown(full_response) full_response += "\n" message_placeholder.markdown(full_response) # Add assistant response to chat history st.session_state.messages.append( {"role": "assistant", "content": full_response} ) if __name__ == "__main__": init_streamlit() chat_main() 이 코드를 실행시키면 자꾸 AttributeError: st.session_state has no attribute "messages". Did you forget to initialize it? More info: https://docs.streamlit.io/library/advanced-features/session-state#initialization 라고 뜨네요..
개발자
#파이썬
#python
답변 2
댓글 1
보충이 필요해요 2
조회 333
4달 전 · 성희 님의 질문
파이참 코딩 관련 질문
import pandas as pd #데이터를 쉽고 효율적으로 처리하기 위해 사용하는 라이브러리 import pyautogui #GUI automation 라이브러리로, 마우스 클릭, 키보드 입력 등의 작업을 자동화하는데 사용 score_A = 0 #쾌락 score_B = 0 #사회적환경 score_C = 0 #보복심리 score_D = 0 #B와C가 점수가 같을때를 위해 만듦. question1 = pyautogui.prompt('난 가정 폭력을 당한적 있다.') #질문1 if question1 == "o": #만약 질문1에 맞다고 대답 한다면 score_B += 1 #사회적환경에 1점 추가 score_C += 1 #보복심리에 1점추가 question2 = pyautogui.prompt('난 학교 폭력을 당한적 있다.') #질문2 if question2 == "o": #만약 질문2에 맞다고 대답한다면 score_B += 1 #사회적환경에 1점추가 score_C += 1 #보복심리에 1점추가 question3 = pyautogui.prompt('난 여아가 이성적 으로 좋다.') #질문3 if question3 == "o": #만약 질문3에 맞다고 대답한다면 score_A += 1 #쾌락에 1점추가 question4 = pyautogui.prompt('난 살인을 할때 쾌락을 느낀다.') #질문4 if question4 == "o": #만약 질문4에 맞다고 대답한다면 score_A += 1 #쾌락에 1점추가 question5 = pyautogui.prompt('나의 범죄는 충동적 이였다.') #질문5 if question5 == "o": score_A ++ 0 #딱히 아무 일 없음 question6 = pyautogui.prompt('난 반 사회적 인격 장애를 진단 받은적 있다.') #질문6 if question6 == "o": #질문6에 맞다고 대답한다면 score_A += 1 #쾌락에 1점추가 score_C += 1 #사회적환경에 1점추가 question7 = pyautogui.prompt('나의 인간관계는 좋지않다.') #질문7 if question7 == "o": #질문7에 맞다고 대답한다면 score_B += 1 #사회적환경에 1점추가 question8 = pyautogui.prompt('난 예전에 아동범죄 피해자였다.') #질문8 if question8 == "o": #만약 질문10에 맞다고 대답한다면 score_C += 1 #보복심리에 1점추가 question9 = pyautogui.prompt('나의 범죄는 계획적이였다.') #질문9 answer_list = [] #답변리스트 answer_list.append(question1) #답변리스트에 질문1~9를 추가하는것. answer_list.append(question2) # answer_list.append(question3) # answer_list.append(question4) # answer_list.append(question5) # answer_list.append(question6) # answer_list.append(question7) # answer_list.append(question8) # answer_list.append(question9) # print(answer_list) #질문리스트를 보여지게함 survey_dict= {'문항번호': [1,2,3,4,5,6,7,8,9], '내용': answer_list, } survey_df = pd.DataFrame(survey_dict).set_index("문항번호") #위의 survey_dict을 데이터프레임 형태로 변환. print(survey_df) #데이터프레임으로 변환한 survey_dict를 출력 if score_B == score_C: #만약 사회적환경과 보복심리의 점수가 같다면 score_D += 10 #스코어D에 점수 10점 추가 score_dict = {'A': score_A, 'B': score_B, 'C': score_C, 'D': score_D} #각각의 점수를 딕셔너리(dict)로 저장함. max_score = max(score_dict.values()) #딕셔너리값중 최댓값을 찾아냄. if max_score == score_A: #만약 최댓값이A라면 아래 문장을 출력 print("설문자는 단순한 쾌락을 위해 범죄를 저질렀을것으로 추정됩니다.") if max_score == score_B: #만약 최댓값이 B라면 아래 문장을 출력 print("설문자는 사회적인 환경으로 인해 범죄를 저질렀을것으로 추정됩니다.") if max_score == score_C: #만약 최댓값이 C라면 아래 문장을 출력 print("설문자는 어릴적환경으로 인한 보복심리때문에 범죄를 저질렀을것으로 추정됩니다.") if max_score == score_D: #만약 최댓값이 D라면 아래문장을 출력 print("설문자는 현재의 사회적환경과 어릴적환경으로 인한 보복심리로 인해 범죄를 저질렀을것으로 추정됩니다.") if question9 == "o": #질문9에 맞다고 대답했을때 if question5 == "o": #질문5에도 맞다고 대답한다면 print("설문자가 솔직하게 문항에 답하고있지 않습니다.") #설문자가 제대로 설문에 응하고 있지 않다고 판단. 에서 survey_dict= {'문항번호': [1,2,3,4,5,6,7,8,9], '내용': answer_list, } 이 어떤 역할을 할까요?
개발자
#코딩
#역할
#파이참
답변 0
댓글 0
조회 14
4달 전 · 익명 님의 질문
파이참 코딩 관련 질문
import pandas as pd #데이터를 쉽고 효율적으로 처리하기 위해 사용하는 라이브러리 import pyautogui #GUI automation 라이브러리로, 마우스 클릭, 키보드 입력 등의 작업을 자동화하는데 사용 score_A = 0 #쾌락 score_B = 0 #사회적환경 score_C = 0 #보복심리 score_D = 0 #B와C가 점수가 같을때를 위해 만듦. question1 = pyautogui.prompt('난 가정 폭력을 당한적 있다.') #질문1 if question1 == "o": #만약 질문1에 맞다고 대답 한다면 score_B += 1 #사회적환경에 1점 추가 score_C += 1 #보복심리에 1점추가 question2 = pyautogui.prompt('난 학교 폭력을 당한적 있다.') #질문2 if question2 == "o": #만약 질문2에 맞다고 대답한다면 score_B += 1 #사회적환경에 1점추가 score_C += 1 #보복심리에 1점추가 question3 = pyautogui.prompt('난 여아가 이성적 으로 좋다.') #질문3 if question3 == "o": #만약 질문3에 맞다고 대답한다면 score_A += 1 #쾌락에 1점추가 question4 = pyautogui.prompt('난 살인을 할때 쾌락을 느낀다.') #질문4 if question4 == "o": #만약 질문4에 맞다고 대답한다면 score_A += 1 #쾌락에 1점추가 question5 = pyautogui.prompt('나의 범죄는 충동적 이였다.') #질문5 if question5 == "o": score_A ++ 0 #딱히 아무 일 없음 question6 = pyautogui.prompt('난 반 사회적 인격 장애를 진단 받은적 있다.') #질문6 if question6 == "o": #질문6에 맞다고 대답한다면 score_A += 1 #쾌락에 1점추가 score_C += 1 #사회적환경에 1점추가 question7 = pyautogui.prompt('나의 인간관계는 좋지않다.') #질문7 if question7 == "o": #질문7에 맞다고 대답한다면 score_B += 1 #사회적환경에 1점추가 question8 = pyautogui.prompt('난 예전에 아동범죄 피해자였다.') #질문8 if question8 == "o": #만약 질문10에 맞다고 대답한다면 score_C += 1 #보복심리에 1점추가 question9 = pyautogui.prompt('나의 범죄는 계획적이였다.') #질문9 answer_list = [] #답변리스트 answer_list.append(question1) #답변리스트에 질문1~9를 추가하는것. answer_list.append(question2) # answer_list.append(question3) # answer_list.append(question4) # answer_list.append(question5) # answer_list.append(question6) # answer_list.append(question7) # answer_list.append(question8) # answer_list.append(question9) # print(answer_list) #질문리스트를 보여지게함 survey_dict= {'문항번호': [1,2,3,4,5,6,7,8,9], '내용': answer_list, } survey_df = pd.DataFrame(survey_dict).set_index("문항번호") #위의 survey_dict을 데이터프레임 형태로 변환. print(survey_df) #데이터프레임으로 변환한 survey_dict를 출력 if score_B == score_C: #만약 사회적환경과 보복심리의 점수가 같다면 score_D += 10 #스코어D에 점수 10점 추가 score_dict = {'A': score_A, 'B': score_B, 'C': score_C, 'D': score_D} #각각의 점수를 딕셔너리(dict)로 저장함. max_score = max(score_dict.values()) #딕셔너리값중 최댓값을 찾아냄. if max_score == score_A: #만약 최댓값이A라면 아래 문장을 출력 print("설문자는 단순한 쾌락을 위해 범죄를 저질렀을것으로 추정됩니다.") if max_score == score_B: #만약 최댓값이 B라면 아래 문장을 출력 print("설문자는 사회적인 환경으로 인해 범죄를 저질렀을것으로 추정됩니다.") if max_score == score_C: #만약 최댓값이 C라면 아래 문장을 출력 print("설문자는 어릴적환경으로 인한 보복심리때문에 범죄를 저질렀을것으로 추정됩니다.") if max_score == score_D: #만약 최댓값이 D라면 아래문장을 출력 print("설문자는 현재의 사회적환경과 어릴적환경으로 인한 보복심리로 인해 범죄를 저질렀을것으로 추정됩니다.") if question9 == "o": #질문9에 맞다고 대답했을때 if question5 == "o": #질문5에도 맞다고 대답한다면 print("설문자가 솔직하게 문항에 답하고있지 않습니다.") #설문자가 제대로 설문에 응하고 있지 않다고 판단. 여기서 score_dict = {'A': score_A, 'B': score_B, 'C': score_C, 'D': score_D} 가 하는 역할은 무엇일까요?
개발자
#코딩
#역할
#파이참
#파이썬
답변 0
댓글 0
조회 21
2년 전 · Hello World 님의 질문
DRF를 자세히 공부해보고싶은데 독학으로 하려니 자꾸 턱턱걸립니다... django 백엔드에서 프론트엔드로 보낸 data가 안불러와져요
django rest framework로 웹을 개발하는 것을 공부하는 중인데 막히는부분이 많아서 점점 괴로워지네요. 이거를 보면서 독학하고 있는데요. https://wikidocs.net/book/9596 django views.py에서 response(data)를 발신하는 것까지는 되는데 next.js를 이용한 프론트에서 data를 받아오지 못하고 있어요... 왜 그럴까요? 디버그 메시지가 안뜨니 더 알기가 어렵네요. # backend/views.py """ from django.shortcuts import render from django.http import HttpResponse from rest_framework.decorators import api_view, permission_classes from rest_framework.permissions import AllowAny from rest_framework.response import Response # Create your views here. @api_view(['GET']) @permission_classes([AllowAny]) def hello_world(request): return Response('Hello, World!') # frontend/index.js """ import React, { useState, useEffect } from "react"; // config.js export const BACKEND_URL = "http://127.0.0.1:8000/"; const Home = () => { // State to store the data fetched from the backend const [data, setData] = useState(""); // useEffect hook to fetch data from the backend when the component mounts useEffect(() => { // Fetch data from the backend API using the '/api/hello' endpoint fetch("${BACKEND_URL}api/hello") .then((response) => response.json()) .then((data) => setData(data)); }, []); // Render the component JSX return ( <div> <h1>Welcome to Fine-Tuning Chatbot!</h1> <p>{data}</p> </div> ); }; export default Home; """ pure django-template를 이용해서 홈페이지 만들고 그 원리를 이해하는 것까지는 되는데 DRF는 정말 다른 세상이라고 느껴지네요...ㅎㅎ 좋은 강의나 책이 있으면 추천부탁드립니다. ㅠㅠ 위에 언급한 강의로 RESTful 배워보려는데, 기술스택이 많아서 그런건지 정보량도 많고 어렵네요 ㅠ
개발자
#django
#rest
#next.js
답변 0
댓글 0
조회 294
4달 전 · 이 성희 님의 질문
파이참 코딩 질문입니다.
import pandas as pd import pyautogui score_A = 0 #쾌락 score_B = 0 #사회적환경 score_C = 0 #보복심리 score_D = 0 #B와C가 점수가 같을때를 위해 만듦. question1 = pyautogui.prompt('난 가정 폭력을 당한적 있다.') #질문1 if question1 == "o": #만약 질문1에 맞다고 대답 한다면 score_B += 1 #사회적환경에 1점 추가 score_C += 1 #보복심리에 1점추가 question2 = pyautogui.prompt('난 학교 폭력을 당한적 있다.') #질문2 if question2 == "o": #만약 질문2에 맞다고 대답한다면 score_B += 1 #사회적환경에 1점추가 score_C += 1 #보복심리에 1점추가 question3 = pyautogui.prompt('난 여아가 이성적 으로 좋다.') #질문3 if question3 == "o": #만약 질문3에 맞다고 대답한다면 score_A += 1 #쾌락에 1점추가 question4 = pyautogui.prompt('난 살인을 할때 쾌락을 느낀다.') #질문4 if question4 == "o": #만약 질문4에 맞다고 대답한다면 score_A += 1 #쾌락에 1점추가 question5 = pyautogui.prompt('나의 범죄는 충동적 이였다.') #질문5 if question5 == "o": score_A ++ 0 #딱히 아무 일 없음 question6 = pyautogui.prompt('난 반 사회적 인격 장애를 진단 받은적 있다.') #질문6 if question6 == "o": #질문6에 맞다고 대답한다면 score_A += 1 #쾌락에 1점추가 score_C += 1 #사회적환경에 1점추가 question7 = pyautogui.prompt('나의 인간관계는 좋지않다.') #질문7 if question7 == "o": #질문7에 맞다고 대답한다면 score_B += 1 #사회적환경에 1점추가 question8 = pyautogui.prompt('난 예전에 아동범죄 피해자였다.') #질문8 if question8 == "o": #만약 질문10에 맞다고 대답한다면 score_C += 1 #보복심리에 1점추가 question9 = pyautogui.prompt('나의 범죄는 계획적이였다.') #질문9 answer_list = [] #질문리스트 answer_list.append(question1) #질문리스트에 질문1~9를 추가하는것. answer_list.append(question2) # answer_list.append(question3) # answer_list.append(question4) # answer_list.append(question5) # answer_list.append(question6) # answer_list.append(question7) # answer_list.append(question8) # answer_list.append(question9) # print(answer_list) #질문리스트를 보여지게함 survey_dict= {'문항번호': [1,2,3,4,5,6,7,8,9], '내용': answer_list, } survey_df = pd.DataFrame(survey_dict).set_index("문항번호") #위의 survey_dict을 데이터프레임 형태로 변환. print(survey_df) #데이터프레임으로 변환한 survey_dict를 출력 if score_B == score_C: #만약 사회적환경과 보복심리의 점수가 같다면 score_D += 10 #스코어D에 점수 10점 추가 score_dict = {'A': score_A, 'B': score_B, 'C': score_C, 'D': score_D} #각각의 점수를 딕셔너리(dict)로 저장함. max_score = max(score_dict.values()) #딕셔너리값중 최댓값을 찾아냄. if max_score == score_A: #만약 최댓값이A라면 아래 문장을 출력 print("설문자는 단순한 쾌락을 위해 범죄를 저질렀을것으로 추정됩니다.") if max_score == score_B: #만약 최댓값이 B라면 아래 문장을 출력 print("설문자는 사회적인 환경으로 인해 범죄를 저질렀을것으로 추정됩니다.") if max_score == score_C: #만약 최댓값이 C라면 아래 문장을 출력 print("설문자는 어릴적환경으로 인한 보복심리때문에 범죄를 저질렀을것으로 추정됩니다.") if max_score == score_D: #만약 최댓값이 D라면 아래문장을 출력 print("설문자는 현재의 사회적환경과 어릴적환경으로 인한 보복심리로 인해 범죄를 저질렀을것으로 추정됩니다.") if question9 == "o": #질문9에 맞다고 대답했을때 if question5 == "o": #질문5에도 맞다고 대답한다면 print("설문자가 솔직하게 문항에 답하고있지 않습니다.") #설문자가 제대로 설문에 응하고 있지 않다고 판단. 라는 코드에서 pandas가 어떤 영향을 줬을까요?
개발자
#코딩
#파이참
#pandas
답변 0
댓글 0
조회 18
4달 전 · 성희 님의 질문
파이참 관련 질문드립니다
import pandas as pd import pyautogui score_A = 0 #쾌락 score_B = 0 #사회적환경 score_C = 0 #보복심리 question1 = pyautogui.prompt('난 가정 폭력을 당한적 있다.') #질문1 if question1 == "o": #만약 질문1에 맞다고 대답 한다면 score_B += 1 #환경에 1점 추가 score_C += 1 #보복심리에 1점추가 question2 = pyautogui.prompt('난 학교 폭력을 당한적 있다.') #질문2 if question2 == "o": #만약 질문2에 맞다고 대답한다면 score_B += 1 #환경에 1점추가 score_C += 1 #보복심리에 1점추가 question3 = pyautogui.prompt('난 여아가 이성적 으로 좋다.') #질문3 if question3 == "o": #만약 질문3에 맞다고 대답한다면 score_A += 1 #쾌락에 1점추가 question4 = pyautogui.prompt('난 살인을 할때 쾌락을 느낀다.') #질문4 if question4 == "o": #만약 질문4에 맞다고 대답한다면 score_A += 1 #쾌락에 1점추가 question5 = pyautogui.prompt('나의 범죄는 충동적 이였다.') #질문5 if question5 == "o": question6 = pyautogui.prompt('난 반 사회적 인격 장애를 진단 받은적 있다.') #질문6 if question6 == "o": #질문6에 맞다고 대답한다면 score_A += 1 #쾌락에 1점추가 score_C += 1 #사회적환경에 1점추가 question7 = pyautogui.prompt('나의 인간관계는 좋지않다.') #질문7 if question7 == "o": #질문7에 맞다고 대답한다면 score_B += 1 #사회적환경에 1점추가 question8 = pyautogui.prompt('난 예전에 아동범죄 피해자였다.') #질문8 if question8 == "o": #만약 질문10에 맞다고 대답한다면 score_C += 1 #보복심리에 1점추가 question9 = pyautogui.prompt('나의 범죄는 계획적이였다.') #질문9 if question9 == "o": #질문9에 맞다고 대답했을때 if question5 == "o": #질문5에도 맞다고 대답한다면 print("설문자가 솔직하게 문항에 답하고있지 않습니다.") #설문자가 제대로 설문에 응하고 있지 않다고 판단. answer_list = [] answer_list.append(question1) answer_list.append(question2) answer_list.append(question3) answer_list.append(question4) answer_list.append(question5) answer_list.append(question6) answer_list.append(question7) answer_list.append(question8) answer_list.append(question9) answer_list.append(question10) print(answer_list) survey_dict= {'문항번호': [1,2,3,4,5,6,7,8,9,10], '내용': answer_list, } survey_df = pd.DataFrame(survey_dict).set_index("문항번호") print(survey_df) 이 코드에서 IndentationError: expected an indented block after 'if' statement on line 23 이런 오류코드가 뜨는데 어떤 이유때문일까요?
개발자
#코딩
#파이참
#오류코드
답변 0
댓글 0
조회 10
개발자 선생님들 도와주세요..
안녕하세요 초보개발자입니다 지금 구글로 코드 복붙하며 게시판 수정중인데 아예 똑같이 복붙 하였는데 저는 왜 이런 식으로 나올까요 도와주세요 .. ㅠㅠ 프로젝트 발표가 코앞인데.. 1번째사진은 작성자의 사진이고 2번째 사진이 제 출력 화면입니다... 코드는 댓글에 적어두겠습니다..도와주세요.. ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <!--부트스트랩은 어떤device로 접속하더라도 해상도에 맞게 알아서 설정되는 탬플릿이다. --> <meta name="viewport" content="width=device-width" , inital-scale="1"> <!--스타일시트를 참조, 주소는 css안에 부트스트랩.css--> <link rel="stylesheet" href="css/bootstrap.css"> <title>JSP 게시판 웹 사이트</title> </head> <body> <!-- 네비게이션 구현 네비게이션이라는 것은 하나의 웹사이트의 전반적인 구성을 보여주는 역할 --> <nav class="navbar navbar-default"> <!-- header부분을 먼저 구현해 주는데 홈페이지의 로고같은것을 담는 영역이라고 할 수 있다. --> <div class="navbar-header"> <!-- <1>웹사이트 외형 상의 제일 좌측 버튼을 생성해준다. data-target= 타겟명을 지정해주고--> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-exmaple="false"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <!-- 여긴 웹페이지의 로고 글자를 지정해준다. 클릭 시 main.jsp로 이동하게 해주는게 국룰 --> <a class="navbar-brand" href="main.jsp">JSP 게시판 웹 사이트</a> </div> <!-- 여기서 <1>에만든 버튼 내부의 데이터 타겟과 div id가 일치해야한다. --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <!-- div 내부에 ul은 하나의 어떠한 리스트를 보여줄때 사용 --> <ul class="nav navbar-nav"> <!-- 리스트 내부에 li로 원소를 구현 메인으로 이동하게만들고--> <li><a href="main.jsp">메인</a></li> <!-- 게시판으로 이동하게 만든다. --> <li><a href="bbs.jsp">게시판</a></li> </ul> <!-- 리스트 하나 더 생성 웹페이지 화면에서 우측 부분--> <ul class="nav navbar-nav navbar-right"> <!-- 원소를 하나 구현해 준다. 네비게이션 우측 슬라이드메뉴 구현 --> <li class="dropdown"> <!-- 안에 a태그를 하나 삽입한다. href="#"은 링크없음을 표시한다. --> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">접속하기<span class="caret"></span></a> <!--접속하기 아래에 드랍다운메뉴 생성 --> <ul class="dropdown-menu"> <!-- li class="active" 현재 선택된 홈페이지를 의미 --> <li><a href="login.jsp">로그인</a></li> <li class="active"><a href="join.jsp">회원가입</a></li> </ul> </li> </ul> </div> <!-- 네비게이션 바 구성 끝 --> </nav> <!-- 하나의 컨테이너처럼 감싸주는 역할 --> <div class="container"> <div class="col-lg-4"></div> <!-- 회원가입 폼은 위의 양식은 일치하며, 이제 내부 폼만 바꿔준다. --> <div class="col-lg-4"> <div class="jumbotron" style="padding-top: 20px;"> <!-- 양식 삽입 post는 회원가입이나 로그인같이 어떠한 정보값을 숨기면서 보내는 메소드/ 로그인 Action페이지로 정보를보내겠다--> <form method="post" action="joinAction.jsp"> <!-- 회원 가입에 맞게 위에 액션은 joinAction페이지로 밑에 제목은 회원가입 화면으로 변경 --> <h3 style="text-align: center;">회원가입 화면</h3> <div class="form-group"> <!-- 회원 가입에서도 userID or userPassword는 동일하게 가져가고, 회원가입에 필요한 나머지 속성추가 --> <input type="text" class="form-control" placeholder="아이디" name="userID" maxlength="20"> </div> <div class="form-group"> <input type="password" class="form-control" placeholder="비밀번호" name="userPassword" maxlength="20"> </div> <!-- userName 추가 --> <div class="form-group"> <input type="text" class="form-control" placeholder="이름" name="userName" maxlength="20"> </div> <!-- 성별 선택 추가 --> <div class="form-group" style="text-align: center;"> <!-- 버튼 공간을 따로 마련해준다.(남,녀) --> <div class="btn-group" data-toggle="buttons"> <!-- 선택이 된곳에 표시를 하는 active를 설정해준다. --> <label class="btn btn-primary active"> <input type="radio" name="userGender" autocomplete="off" value="남자" checked>남자 </label> <label class="btn btn-primary"> <input type="radio" name="userGender" autocomplete="off" value="여자" checked>여자 </label> </div> <!-- 성별 선택부분 완료 --> </div> <!-- email 작성부분 구현 --> <div class="form-group"> <!-- placeholder는 아무런 입력이 없을때 띄워주는 값 --> <input type="email" class="form-control" placeholder="이메일" name="userEmail" maxlength="20"> </div> <!-- 버튼 또한 회원가입으로 value변경 --> <input type="submit" class="btn btn-primary form-control" value="회원가입"> </form> </div> </div> <div class="col-lg-4"></div> </div> <!-- 애니메이션을 담당하게 될 자바스크립트 참조 --> <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> <!-- 특정홈페이지에서 제이쿼리 호출 --> <script src="js/bootstrap.js"></script> </body> </html>
개발자
#jsp
#java
답변 2
댓글 4
보충이 필요해요 3
조회 362
4달 전 · 성희 님의 질문
파이참 코딩 관련 질문
import pandas as pd import pyautogui score_A : 0 #단순 쾌락 score_B : 0 #경제 적압박 score_C : 0 #사회 적압박 score_D : 0 #유전 score_E : 0 #보복 score_F : 0 #환경 question1 = pyautogui.prompt('난 가정 폭력을 당한적 있다.') #질문1 if question1 == "o": #만약 질문1에 맞다고 대답 한다면 score_E += 1 #환경에 1점 추가 score_D += 1 #유전에 1점 추가 question2 = pyautogui.prompt('난 학교 폭력을 당한적 있다.') question3 = pyautogui.prompt('난 여아가 이성적 으로 좋다.') question4 = pyautogui.prompt('난 가정 형편 또는 개인 적인 형편이 좋지 않다.') question5 = pyautogui.prompt('나의 범죄는 충동적 이였다.') question6 = pyautogui.prompt('난 반 사회적 인격 장애를 진단 받은적 있다.') question7 = pyautogui.prompt('난 대인 관계에 능통치 못하다.') question8 = pyautogui.prompt('난 감정 기복이 심하다.') question9 = pyautogui.prompt('나의 범죄는 계획적 이였다.') question10 = pyautogui.prompt('난 주변에 친한 사람이 없다.') answer_list = [] answer_list.append(question1) answer_list.append(question2) answer_list.append(question3) answer_list.append(question4) answer_list.append(question5) answer_list.append(question6) answer_list.append(question7) answer_list.append(question8) answer_list.append(question9) answer_list.append(question10) print(answer_list) survey_dict= {'문항번호': [1,2,3,4,5,6,7,8,9,10], '내용': answer_list, } survey_df = pd.DataFrame(survey_dict).set_index("문항번호") print(survey_df) 이 코드에서 NameError: name 'score_E' is not defined 라는 오류가 자꾸 뜨는데 왜때문인가요??ㅠㅠ
개발자
#파이참
#코딩
#심리테스트
답변 0
댓글 0
조회 15
4달 전 · 성희 님의 질문
파이참 코딩 관련 질문
score_A : 0 #단순 쾌락 score_B : 0 #경제 적압박 score_C : 0 #사회 적압박 score_D : 0 #유전 score_E : 0 #보복 score_F : 0 #환경 question1 = input('난 가정 폭력을 당한적 있다.') #질문1 if question1 == "o": #만약 질문1에 맞다고 대답 한다면 score_E += 1 #환경에 1점 추가 score_D += 1 #유전에 1점 추가 question2 = pyautogui.prompt('난 학교 폭력을 당한적 있다.') question3 = pyautogui.prompt('난 여아가 이성적 으로 좋다.') question4 = pyautogui.prompt('난 가정 형편 또는 개인 적인 형편이 좋지 않다.') question5 = pyautogui.prompt('나의 범죄는 충동적 이였다.') question6 = pyautogui.prompt('난 반 사회적 인격 장애를 진단 받은적 있다.') question7 = pyautogui.prompt('난 대인 관계에 능통치 못하다.') question8 = pyautogui.prompt('난 감정 기복이 심하다.') question9 = pyautogui.prompt('나의 범죄는 계획적 이였다.') question10 = pyautogui.prompt('난 주변에 친한 사람이 없다.') answer_list = [] answer_list.append(question1) answer_list.append(question2) answer_list.append(question3) answer_list.append(question4) answer_list.append(question5) answer_list.append(question6) answer_list.append(question7) answer_list.append(question8) answer_list.append(question9) answer_list.append(question10) print(answer_list) survey_dict= {'문항번호': [1,2,3,4,5,6,7,8,9,10], '내용': answer_list, } survey_df = pd.DataFrame(survey_dict).set_index("문항번호") print(survey_df) 위의 코드에서 NameError: name 'score_E' is not defined 라고 오류가 나는 이유가 뭘까?
개발자
#파이참
#코딩
#심리테스트
답변 0
댓글 0
조회 19
4달 전 · 성희 님의 질문
파이참 코딩 관련 질문
import pandas as pd import pyautogui score_A = 0 #쾌락 score_B = 0 #사회적환경 score_C = 0 #보복심리 question1 = pyautogui.prompt('난 가정 폭력을 당한적 있다.') #질문1 if question1 == "o": #만약 질문1에 맞다고 대답 한다면 score_B += 1 #환경에 1점 추가 score_C += 1 #보복심리에 1점추가 question2 = pyautogui.prompt('난 학교 폭력을 당한적 있다.') #질문2 if question2 == "o": #만약 질문2에 맞다고 대답한다면 score_B += 1 #환경에 1점추가 score_C += 1 #보복심리에 1점추가 question3 = pyautogui.prompt('난 여아가 이성적 으로 좋다.') #질문3 if question3 == "o": #만약 질문3에 맞다고 대답한다면 score_A += 1 #쾌락에 1점추가 question4 = pyautogui.prompt('난 살인을 할때 쾌락을 느낀다.') #질문4 if question4 == "o": #만약 질문4에 맞다고 대답한다면 score_A += 1 #쾌락에 1점추가 question5 = pyautogui.prompt('나의 범죄는 충동적 이였다.') #질문5 if question5 == "o": score_A ++ 0 #딱히 아무 일 없음 question6 = pyautogui.prompt('난 반 사회적 인격 장애를 진단 받은적 있다.') #질문6 if question6 == "o": #질문6에 맞다고 대답한다면 score_A += 1 #쾌락에 1점추가 score_C += 1 #사회적환경에 1점추가 question7 = pyautogui.prompt('나의 인간관계는 좋지않다.') #질문7 if question7 == "o": #질문7에 맞다고 대답한다면 score_B += 1 #사회적환경에 1점추가 question8 = pyautogui.prompt('난 예전에 아동범죄 피해자였다.') #질문8 if question8 == "o": #만약 질문10에 맞다고 대답한다면 score_C += 1 #보복심리에 1점추가 question9 = pyautogui.prompt('나의 범죄는 계획적이였다.') #질문9 answer_list = [] answer_list.append(question1) answer_list.append(question2) answer_list.append(question3) answer_list.append(question4) answer_list.append(question5) answer_list.append(question6) answer_list.append(question7) answer_list.append(question8) answer_list.append(question9) print(answer_list) survey_dict= {'문항번호': [1,2,3,4,5,6,7,8,9], '내용': answer_list, } survey_df = pd.DataFrame(survey_dict).set_index("문항번호") print(survey_df) 이 코드에서 점수 결과값이 가장 높은 스코어만 프린트로 출력해내고싶은데 어떻게해야할까요?
개발자
#코딩
#파이참
답변 0
댓글 0
조회 12
한 달 전 · 포크코딩 님의 새로운 답변
php + NestJS(Express) 백엔드 개발자를 찾습니다.
안녕하세요 저희 회사에서 php + NestJS(Express) 개발자를 찾고 있는데 적합자를 찾아내기가 쉽지 않아 가입하게 되었습니다. 관심 있으시다면 공고 한 번 봐주셨음 좋겠어요!!!!!! 그리고 저희 기술스택에 맞는 개발자를 찾을 수 있는 팁?이 있으신분들 댓글 남겨주시면 감사하겠습니다 ㅠㅠㅠㅠ https://www.saramin.co.kr/zf_user/jobs/relay/view?isMypage=no&rec_idx=49757484&recommend_ids=eJxVjrkNAzEMBKtxTi6%2FZexCrv8uTPuAowxFg5FG610dTr%2Bo%2Bqq3d8NK7WrBDxltsMeWQSMG87bmEnwwlfBamzTqk6rpav5ZOy3C9yNOGDIoN3YYYmekw0%2FsOXvZINabIqC1mDpDD%2FQk9q2GlxxlkN9V%2BQGdzkCp&view_type=search&searchword=%EB%B9%84%ED%81%AC%EC%BD%94%ED%8D%BC%EB%A0%88%EC%9D%B4%EC%85%98&searchType=search&gz=1&t_ref_content=generic&t_ref=search&relayNonce=4558130b90d1e71342c4&paid_fl=n&search_uuid=c2ac4cf3-f5ad-42fb-9011-3bf856e40282&immediately_apply_layer_open=n#seq=0
개발자
#구인구직
답변 1
댓글 0
조회 45
4달 전 · 익명 님의 질문
파이참 코딩 관련 질문
import pandas as pd #데이터를 쉽고 효율적으로 처리하기 위해 사용하는 라이브러리 import pyautogui #GUI automation 라이브러리로, 마우스 클릭, 키보드 입력 등의 작업을 자동화하는데 사용 score_A = 0 #쾌락 score_B = 0 #사회적환경 score_C = 0 #보복심리 score_D = 0 #B와C가 점수가 같을때를 위해 만듦. question1 = pyautogui.prompt('난 가정 폭력을 당한적 있다.') #질문1 if question1 == "o": #만약 질문1에 맞다고 대답 한다면 score_B += 1 #사회적환경에 1점 추가 score_C += 1 #보복심리에 1점추가 question2 = pyautogui.prompt('난 학교 폭력을 당한적 있다.') #질문2 if question2 == "o": #만약 질문2에 맞다고 대답한다면 score_B += 1 #사회적환경에 1점추가 score_C += 1 #보복심리에 1점추가 question3 = pyautogui.prompt('난 여아가 이성적 으로 좋다.') #질문3 if question3 == "o": #만약 질문3에 맞다고 대답한다면 score_A += 1 #쾌락에 1점추가 question4 = pyautogui.prompt('난 살인을 할때 쾌락을 느낀다.') #질문4 if question4 == "o": #만약 질문4에 맞다고 대답한다면 score_A += 1 #쾌락에 1점추가 question5 = pyautogui.prompt('나의 범죄는 충동적 이였다.') #질문5 if question5 == "o": score_A ++ 0 #딱히 아무 일 없음 question6 = pyautogui.prompt('난 반 사회적 인격 장애를 진단 받은적 있다.') #질문6 if question6 == "o": #질문6에 맞다고 대답한다면 score_A += 1 #쾌락에 1점추가 score_C += 1 #사회적환경에 1점추가 question7 = pyautogui.prompt('나의 인간관계는 좋지않다.') #질문7 if question7 == "o": #질문7에 맞다고 대답한다면 score_B += 1 #사회적환경에 1점추가 question8 = pyautogui.prompt('난 예전에 아동범죄 피해자였다.') #질문8 if question8 == "o": #만약 질문10에 맞다고 대답한다면 score_C += 1 #보복심리에 1점추가 question9 = pyautogui.prompt('나의 범죄는 계획적이였다.') #질문9 answer_list = [] #답변리스트 answer_list.append(question1) #답변리스트에 질문1~9를 추가하는것. answer_list.append(question2) # answer_list.append(question3) # answer_list.append(question4) # answer_list.append(question5) # answer_list.append(question6) # answer_list.append(question7) # answer_list.append(question8) # answer_list.append(question9) # 이 코드에서 answer_list.append(question)이 의미하는것은 무엇인가요?
개발자
#코딩
#파이참
#의미
답변 0
댓글 0
조회 12
일 년 전 · 손우진 님의 새로운 답변
nextauth 를 이용해 springboot 의 jwt를 받아와서 로그인을 구현중입니다.
안녕하세요. nextauth 를 이용해 로그인 구현중입니다. 흔히 생각하는 소셜 로그인이 아닌 username 과 password를 통해 springboot security 에서 jwt를 반환 받아오려고 합니다. // app/api/auth/[...nextauth]/route.ts CredentialsProvider({ name: 'Credentials', credentials: { username: { label: 'Username', type: 'text', placeholder: '아이디' }, password: { label: 'Password', type: 'password' }, }, async authorize(credentials, req) { const res = await fetch(`${process.env.NEXTAUTH_URL}/auth/login`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ username: credentials?.username, password: credentials?.password, }), }); const user = await res.json(); console.log(user); if (user) { return user; } else { return null; } }, }), 그런데 위의 코드처럼 코드를 구성했을때 .env.local 파일의 NEXTAUTH_URL 이 등록이 되면 authorize 가 작동하지 않습니다 . 에러 log라도 있으면 어떻게라도 해보겠는데.. 그것도 없습니다. 그래서 NEXTAUTH_URL 를 등록하지 않고 const res = await fetch(`http://localhost:8080/auth`, 바꾸면 이것역시 에러 log 없이 브라우저상에서 Error 라는 문구만 보여줍니다. 이렇게 생각했을때 authorize는 값을 내부에서만 가져올수 있는거 같은데요. 실제로 가상의 const user = {....} 를 만들어서 반환하면 로그인이 아주 잘 됩니다. 하지만 제가 원하는 방법은 아니죠..ㅍ 검색해보면 prisma 가 많이 나오는데.. 그것 또한 시스템상 제가 원하는 방식이 아닙니다. springboot security 에서 jwt를 받아와서 nextauth에 로그인을 할수 있는 방법은 없을까요? custom login 페이지를 만들어서 해야 할거 같은데 방법을 잘 모르겠습니다. 현재 springboot 서버에 cors 설정이 정상적으로 허용된 상태입니다.
개발자
#nextauth
#springboot
#jwt
#nextjs
#typescript
답변 1
댓글 0
조회 1,205
[SwiftUI]array에 값이 append 되질 않아요
코드 실행은 되는데 만든 plus버튼을 눌러서 AddFile함수를 실행시켜도 folders어레이에 아무 값이 추가 되질 않아요ㅠ AddFile함수를 잘못 작성한 것일까요? 코드는 전체 복붙해놨습니다 import SwiftUI struct Category: View { var body: some View { NavigationView { ScrollView { VStack { HStack { Text("Category") .font(.title) .padding(.horizontal) Spacer() Button { AddFile(title: "hello") } label: { Image(systemName: "plus") .font(.title2) .padding(.horizontal) } } Text("\(folders.count)") if folders.first != nil { ForEach(folders) { folder in ZStack { RoundedRectangle(cornerRadius: 15) .frame(width: 100, height: 100) .foregroundColor(.yellow) Text(folder.title) .font(.title3) .fontWeight(.bold) } } } else { Text("No folder") } } } } } func AddFile(title: String) { folders.append(Folder(title: title)) } } struct Folder: Identifiable { var id = UUID().uuidString var title: String } var folders: [Folder] = [ Folder(title: "hi"), Folder(title: "hello") ] struct Category_Previews: PreviewProvider { static var previews: some View { Category() } }
개발자
#swift
#swiftui
#append
#array
답변 1
댓글 0
추천해요 1
조회 209
AWS Beanstalk 배포 하기 전에 신경써줘야 할 것이 있나요 ?
현재 nodejs로 백엔드를 구성하고 EB에 배포하는데 몇 가지 오류가 생겨서 질문 드립니다. 프로젝트 구조는 다음과 같습니다. -customer └ .gitignore └ .dockerignore └ src ( 백엔드 코드 ) └ .gitignore └ Dockerfile └ Package.json -product └ customer 와 동일 -shopping └ customer 와 동일 -proxy └ Dockerfile docker-compose.yaml 리전 ap-northeast-2(seoul region) 로컬에서 빌드하고 작동하는 거 확인 후 위 코드를 모두 압축해서 EB에 올렸습니다. EB에 올리기전에 vpc , igw, 등등 미리 생성해줘야 할 게 있나요? 추가로 .gitignore 같은 파일도 같이 올려도 되나요 ? ( 초보라서 질문의 질이 떨어질 수 있지만 고수분들의 너그러운 양해를 부탁드립니다 .ㅠㅠ ) 에러 로그를 보면 1. ELB Fail -> VPC has no internet gateway 2. Stack named 'awseb-e-33wucpgpey-stack' aborted operation. Current state: 'CREATE_FAILED' Reason: The following resource(s) failed to create: [AWSEBV2LoadBalancer, AWSEBInstanceLaunchWaitCondition] 3. LaunchWaitCondition failed. The expected number of EC2 instances were not initialized within the given time. Rebuild the environment. If this persists, contact support.
개발자
#docker
#aws
#nodejs
답변 1
댓글 0
추천해요 1
조회 379
일 년 전 · 손설 님의 새로운 답변
게임 개발자를 희망중입니다. 게임 관련 학원 어떻게 생각하나요?
게임 개발자를 희망중인 컴공 학부생입니다. (3학년/여자) 재학중인 학교에 마땅찮은 게임 관련 과목이 있지않아, 독학으로 포트폴리오를 쌓아야 합니다. 도저히 독학 할 자신은 없어서, 휴학 후 게임 개발 학원을 다녀보고자 합니다. 우선 생각중인 것은 한국콘텐츠진흥원에서 진행하는 과정이고, (https://www.kocca.kr/kocca/online/usrOnlineDetail.do?menuNo=204104&onlineAplyNo=1336&fbclid=PAAaZuXxnF5y29Zesd7G8uRdZpvkcPjICazjh4aAUEoJPEhTmIwqNj0msNQBw_aem_AWXhZkHe_6_8N4aNu2aTDinS0QxnWxEpUTBNowC6AqyllECGtELAKuq_ltWmqM99-2uoBBepxXWMrG7_jWdcPiXu) 만약에라도 떨어지면 학원을 다녀볼까 싶습니다. 현직자 분들께서는 학원에 대해 어떻게 생각하시는지, 만약 고른다면 어떤 점을 보고 고르는게 좋을지 조언 부탁드립니다!
개발자
#게임
#게임개발
#학원
#게임개발자
#게임학원
답변 3
댓글 1
조회 777
일 년 전 · 최건 님의 질문
firebase authentication
html에서 아래 같이 data를 전송했을 때 백엔드에서 const {createUserWithEmailAndPassword,signInWithEmailAndPassword,signOut,browserSessionPersistence, setPersistence}= require("firebase/auth"); const db = require("../config/firestore"); const {email,password} = req.body; console.log(email,password) await signInWithEmailAndPassword(auth,email,password) res.redirect("/api/home") 로 받으면 첫 번째 로그인시 Cannot POST /auth/login가 뜨면서 로그인이 안되고 뒤로 갔다가 다시 로그인을 하면 로그인이 완료되는 오류가 발생합니다... firestore은 form 데이터를 받아 저장하는 것에 오류가 발생하지 않는데 왜 authentication에서는 이러 오류가 발생하는지 궁금합니다 ㅠㅠ 해결 방안도 궁금합니다 ! ㅠㅠ
개발자
#firebase
#firebase-authentication
답변 0
댓글 0
조회 59
7달 전 · 석정도 님의 질문
리액트 네이티브 릴리즈로 배포 시 build.gradle 설정대로 동작 안하는 이유가 뭔지 궁긍합니다.
안녕하세요. 현재 리액트 네이티브로 프로젝트를 진행하고 있습니다. 막바지 단계에 거의 도달해서 이제 배포 준비를 하려고 하는데요, 마지막으로 테스트를 하기 위해 stagingRelease 로 apk 를 만들어서 테스트를 하려고 하니, .env.staging 을 읽지를 못하고 있네요. 이상한건 stagingDebug 로 할 때에는 이런 문제가 없었습니다. 지금 환경변수는 루트 디렉토리에 env 폴더가 있고, 해당 폴더 내에는 3개의 환경변수 파일이 존재합니다. .env.development .env.staging .env.production 이렇게 3개 입니다. project.ext.envConfigFiles = [ productiondebug: "env/.env.production", productionrelease: "env/.env.production", developmentrelease: "env/.env.development", developmentdebug: "env/.env.development", stagingrelease: "env/.env.staging", stagingdebug: "env/.env.staging" ] 위의 코드는 제가 설정한 환경변수 매핑하는 부분입니다. 실제로 stagingrelease 로 빌드 시에 flavor 값이 stagingrelease 로 뜨는 걸 확인했습니다. node_modules 에서 react-native-config 폴더를 찾아서 dotenv.gradle 에서 찍으니까 확인이 가능하더라고요. 제가 궁금한 점은 왜 루트에서 .env 파일만을 읽어서 BuildConfig.java 에서 사용하려고 하는걸까요? .env.staging 을 참조하지 않는 이유가 궁금합니다. 아래는 dotenv.gradle 파일입니다. import java.util.regex.Matcher import java.util.regex.Pattern def getCurrentFlavor() { Gradle gradle = getGradle() def pattern = Pattern.compile("(?:.*:)*[a-z]+([A-Z][A-Za-z0-9]+)") def flavor = "" gradle.getStartParameter().getTaskNames().any { name -> Matcher matcher = pattern.matcher(name) if (matcher.find()) { flavor = matcher.group(1).toLowerCase() return true } } println "Current flavor: $flavor" return flavor } def loadDotEnv(flavor = getCurrentFlavor()) { def envFile = project.hasProperty("defaultEnvFile") ? project.defaultEnvFile : ".env" if (System.env['ENVFILE']) { envFile = System.env['ENVFILE'] } else if (System.getProperty('ENVFILE')) { envFile = System.getProperty('ENVFILE') } else if (project.hasProperty("envConfigFiles")) { project.ext.envConfigFiles.any { pair -> if (flavor.startsWith(pair.key.toLowerCase())) { envFile = pair.value return true } } } println "Reading env from: $envFile" def env = [:] File f = new File("$project.rootDir/../$envFile"); if (!f.exists()) { f = new File("$envFile"); } if (f.exists()) { println "Found env file: $f" f.eachLine { line -> def matcher = (line =~ /^\s*(?:export\s+|)([\w\d\.\-_]+)\s*=\s*['"]?(.*?)?['"]?\s*$/) if (matcher.getCount() == 1 && matcher[0].size() == 3) { env.put(matcher[0][1], matcher[0][2].replace('"', '\\"')) // 각 환경 변수 키-값 쌍 출력 println "Loaded env variable: ${matcher[0][1]} = ${matcher[0][2]}" } } } else { println("**************************") println("*** Missing .env file ****") println("**************************") } project.ext.set("env", env) } loadDotEnv() android { defaultConfig { project.env.each { k, v -> def escaped = v.replaceAll("%","\\\\u0025") buildConfigField "String", k, "\"$v\"" resValue "string", k, "\"$escaped\"" println "Set buildConfigField and resValue: $k = $v" } } } 안드로이드 스튜디오 터미널에서 ./gradlew assembleStagingRelease 명령어를 치게 될 경우, Current flavor: stagingrelease Reading env from: .env.staging ************************** *** Missing .env file **** ************************** 이런 로그가 뜨고 있습니다.
개발자
#react-native
#react-native-config
#다중환경변수
#release
답변 0
댓글 0
조회 57
10달 전 · 익명 님의 질문
Next.js 에서 fluent-ffmpeg 사용 시 에러 해결 가능할까요?
Next.js 에서 puppeteer를 사용해서 특정 url에 접속하여 애니메이션을 png로 100장 정도 캡처하여 생성하고, fluent-ffmpeg를 사용해서 해당 png 이미지들을 mp4 영상으로 만들려고 하는데요. yarn add puppeteer fluent-ffmpeg @ffmpeg-installer/ffmpeg yarn add --dev @types/fluent-ffmpeg 위와 같이 라이브러리들을 설치했구요. 아래 page.tsx 파일에서 코드를 구현했는데요. dev로 실행해서 해당 페이지에 접속을 하면 아래와 같은 에러가 발생하는데요. 해결이 가능할까요?? 다른 라이브러리를 써야할지 구현한 코드가 문제가 있는지 모르겠네요. 도움 부탁드립니다!! # 에러 코드 # 1 of 1 error Next.js (14.2.3) Server Error Error: Cannot find module '/Users/.../animation-capture/node_modules/@ffmpeg-installer/darwin-arm64/package.json' This error happened while generating the page. Any console logs will be displayed in the terminal window. Call Stack webpackEmptyContext file:///Users/.../animation-capture/.next/server/app/capture/page.js (22:10) eval node_modules/@ffmpeg-installer/ffmpeg/index.js (40:27) (rsc)/./node_modules/@ffmpeg-installer/ffmpeg/index.js file:///Users/.../animation-capture/.next/server/vendor-chunks/@ffmpeg-installer.js (20:1) Next.js eval /./src/app/capture/page.tsx (rsc)/./src/app/capture/page.tsx file:///Users/.../animation-capture/.next/server/app/capture/page.js (286:1) Next.js # 코드 구현부 # import { NextApiRequest, NextApiResponse } from 'next'; import puppeteer from 'puppeteer'; import fs from 'fs'; import path from 'path'; import ffmpeg from 'fluent-ffmpeg'; import ffmpegInstaller from '@ffmpeg-installer/ffmpeg'; ffmpeg.setFfmpegPath(ffmpegInstaller.path); .... 중략.... const outputFilePath = path.resolve("./screenshots/video.mp4"); ffmpeg() .addInput(`${folderPath}/screenshot-%d.png`) .inputFPS(10) .output(outputFilePath) .on("end", () => { res.status(200).send(`Video created successfully at ${outputFilePath}`); }) .on("error", (err) => { console.error("Error generating video:", err); res.status(500).send("Failed to generate video"); }) .run(); } catch (error) { console.error("Error capturing screenshots:", error); res.status(500).send("Failed to capture screenshots"); }
개발자
#next.js
#fluent-ffmpeg
#mp4
답변 0
댓글 0
조회 85
일 년 전 · 김지엽 님의 새로운 답변
"react-native doctor"에서 에러 반복 (Adb, Android Studio)
"npx react-native doctor"를 실행하여 문제를 찾고, F(fix)를 눌러 에러 해결을 진행하였습니다. ---------------------------------------------------------- Common ✓ Node.js - Required to execute JavaScript code ✓ npm - Required to install NPM dependencies ● Metro - Metro Bundler is not running Android ✖ Adb - No devices and/or emulators connected. Please create emulator with Android Studio or connect Android device. ✓ JDK - Required to compile Java code ✖ Android Studio - Required for building and installing your app on Android ✓ ANDROID_HOME - Environment variable that points to your Android SDK installation ✓ Android SDK - Required for building and installing your app on Android Errors: 2 Warnings: 1 Attempting to fix 3 issues... Common ✖ Metro Could not start the bundler. Please run "npx react-native start" command manually. Android ✖ Adb √ Select the device / emulator you want to use » Emulator s24u (disconnected) ✔ Adb ✔ Android Studio installed successfully in "C:\Users\OOO\AppData\Local\Android". ---------------------------------------------- 그러나 여전히 에뮬레이터는 작동하지 않으며, 다시 "npx react-native doctor"를 실행하면 다시 같은 오류가 발생합니다. --------------------------------------------- Common ✓ Node.js - Required to execute JavaScript code ✓ npm - Required to install NPM dependencies ● Metro - Metro Bundler is not running Android ✖ Adb - No devices and/or emulators connected. Please create emulator with Android Studio or connect Android device. ✓ JDK - Required to compile Java code ✖ Android Studio - Required for building and installing your app on Android ✓ ANDROID_HOME - Environment variable that points to your Android SDK installation ✓ Android SDK - Required for building and installing your app on Android Errors: 2 Warnings: 1 Usage › Press f to try to fix issues. › Press e to try to fix errors. › Press w to try to fix warnings. › Press Enter to exit.
개발자
#react
#react-native
#안드로이드
#android-studio
#android
답변 1
댓글 0
조회 634
7달 전 · 홍지상 님의 새로운 댓글
요즘 들어 많이 보이는 형태의 UX/UI 레이아웃 디자인을 지칭하는 용어가 있을까요?
안녕하세요. 최근에 쇼핑몰이나 온라인 서비스를 브라우저로 서칭하다보면 자주 보이는 형태가 있는데요. 모바일 크기인데 데스크톱이든 태블릿이든 상관없이 스마트폰 크기 하나만 지원하는 제품이 많이 보이더군요. 스마트폰보다 큰 화면에서 접속하면 양 옆이 footer 역할을 하는 형태의 제품 레이아웃을 보이기도 합니다. 반응형 대신 모바일 디자인만 고려하면 된다는 점에서 관심이 생겼는데, 이러한 레이아웃 디자인을 부르는 명칭이나 용어가 있을까 해서 질문 드립니다. Tailwind CSS를 접하면서 모바일 우선(Mobile-first)이라는 용어는 알고 있습니다. 그렇다면 저런 형태는 모바일 온리(Mobile-only)라고 부르는 걸까요? 특정 사이트를 언급해도 되는지 모르겠지만, 링크 걸어보고 문제 시 알려주시면 수정하겠습니다. - 페이브릴 https://fabrill.co.kr - 밸런스 https://www.balance.site - 모두의셔틀 https://www.modooshuttle.com - 팬심 https://fancim.me 조금 더 넓은 범위의 레이아웃을 보여주는 - 모요 https://www.moyoplan.com
디자이너
#ui/ux
#layout
#design
답변 1
댓글 1
조회 171
2년 전 · 박희천 님의 답변 업데이트
SwiftUI 매개변수에 View를 할당하고 싶어요.
SwiftUI 시작한 지 2주 정도 밖에 안돼서 질문이 조금 미숙한 점 미리 양해 구합니다. SubView에 다른 뷰를 매개변수로(?) 처리하고 싶습니다. 같은 UI의 NavigationLink를 여러 개 나열해서 각 링크를 클릭할 때 각각 다른 View로 이동하도록요. 근데 매개변수 toView의 타입을 View로 지정했더니 아래 사진과 같은 오류가 떴고 타입을 View 대신 any View로 설정했더니 SubView(toView: DayEndTime()) 여기에서 DayEndTime의 타입이 any View가 아니라고 오류가 뜹니다. 어떻게 하는 지 알려주시면 감사하겠습니다!!
개발자
#swiftui
답변 2
댓글 0
추천해요 1
조회 181