
[React Native Error] unable to find utility "simctl", not a developer tool or in PATH
2023. 3. 8. 20:45
프로그래밍/React Native
unable to find utility "simctl", not a developer tool or in PATH error 내용 xcrun: error: unable to find utility "simctl", not a developer tool or in PATH error Could not get the simulator list from Xcode. Please open Xcode and try running project directly from there to resolve the remaining issues. Error: Command failed: xcrun simctl list --json devices xcrun: error: unable to find utility "simct..
[JavaScript] byte 수로 문자열 자르기
2023. 3. 7. 20:55
프로그래밍/JavaScript
byte 수로 문자열 자르기 const str = '10센치는 권정열'; function sliceStringByByte(str, byteLength) { const encoder = new TextEncoder(); let currentByteLength = 0; let i = 0; while (i < str.length && currentByteLength < byteLength) { const charCode = str.charCodeAt(i); const byteCount = encoder.encode(str[i]).length; currentByteLength += byteCount; i++; } return str.slice(0, i); } console.log(sliceStringByByte..

[React Native Error] Error: spawnSync adb ENOENT
2023. 3. 6. 20:25
프로그래밍/React Native
Android 실행 builde하려고 할때 Error: spawnSync adb ENOENT 에러가 뜨는 경우 해결 방법 brew install --cask android-platform 위의 명령어로 설치 후 adb version 확인해보기 adb --version

[React Native error] error Failed to install the app. Make sure you have the Android development environment
2023. 3. 3. 20:04
프로그래밍/React Native
React Native 프로젝트 빌드 오류 내용 error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:installDebug'. > com.android.builder.testing.api.Devi..
[Java Error] java.lang.IllegalArgumentException: No enum constant 에러
2023. 3. 2. 20:19
프로그래밍/JAVA
java.lang.IllegalArgumentException: No enum constant 에러 데이터를 조회하려는데 위의 에러가 뜨면서 조회에 실패했음 분명 enum에 추가되어 있는데 error가 떠서 순간 당황함 에러 발생 원인 및 해결 방법 enum에 값이 추가되어 있지 않은 경우 발생 → enum에 값을 추가하여 해결! 내 코드에는 분명 추가되어 있는데? 그렇다면 값 비교를 잘못했을 가능성이 큼 내 코드를 예시로 들어보자면 enum class public enum ContractStatus { request("request", "신청"), cancel("cancel", "취소"), returnRequest("return_request", "반납신청"), ; ContractStatus(Strin..
[Java] StringBuffer와 StringBuilder
2023. 2. 28. 20:48
프로그래밍/JAVA
StringBuffer와 StringBuilder 공통점 String의 단점을 보완한 클래스 내부에 버퍼를 가지고 있어서 버퍼에 메모리를 임시로 저장했다가 사용함 버퍼 내부에서 추가, 수정, 삭제 작업을 할 수 있음 String의 단점 내부 문자열을 수정할 수 없음 문자열에 +연산자를 사용해 문자를 더하면 새로운 객체 생성됨 새로운 객체가 만들어져 재참조 하게 되기에 연산이 있을 때마다 메모리에 객체가 생성된다는 단점이 있음 StringBuffer와 StringBuilder 차이점 동기화 여부에 차이점이 있음 StringBuffer는 각 메서드 별로 Synchronized keyword가 존재하여 멀티스레드 환경에서도 동기화를 지원 StringBuilder는 동기화를 보장하지 않기에 단일스레드 환경에서 ..

[Mac] 맥북 메모 복구 방법
2023. 2. 27. 20:49
OS/Mac
맥북 메모 복구 방법 메모장 검색을 하다보니 몇몇 메모들만 보이는 상태가 됨🥲 해결을 위해 이것 저것 누르다 휴지통 버튼을 잘못 눌러 지우지 말아야할 메모를 지움😵💫 정말 다신 경험하고 싶지 않은 상황이기에 복구 방법을 작성하기로 함 사라진 메모 찾기 1. 상단 메뉴바에서 보기 > 폴더 보기 혹은 option + command + s (단축키는 맥북에 따라 다를 수 있음) 2. 메모의 왼쪽 탭에서 원하는 폴더 클릭 최근 삭제한 메모 복구 이 방법으로는 최근 30일까지만 복구가 가능하다고 함 1. 위의 1번 따라하기 보기 > 폴더 보기 클릭 2. 최근 삭제된 항목 폴더 클릭하여 복구 진행
[JPA] Order by multiple Columns
2023. 2. 24. 20:18
프로그래밍/JPA
Pageable 다중 sorting 하는 방법 Pageable의 sort를 정의하는 부분에 내용만 추가해주면 됨 우선순위는 앞쪽부터 차례대로임 // 컬럼 하나 Pageable pageable = PageRequest.of(page, size, Sort.by("created").descending()); // 컬럼 여러개 Pageable pageable = PageRequest.of(page, size, Sort.by("created").descending(), Sort.Order.asc("startDate")); Sort만 따로 정의한다면? Sort sort = Sort.by( Sort.Order.asc("created"), Sort.Order.desc("startDate") );