본문 바로가기

전체 글

(315)
Docker 내의 pytorch 이미지 컨테이너에서 GPU 인식 문제(NVIDIA 그래픽 드라이버 문제) 몇 달 전에 테스트한 도커를 이용한 프로젝트가 갑자기 작동을 하지 않게 되었는데 설정이 꼬여서 그런가 싶어서 2일 동안 포맷 설정을 반복했는데 드라이버 문제일지도 모른다는 깃허브 글을 보고 테스트했던 시기의 드라이버로 변경하니 자연스럽게 해결되었습니다.NVIDIA 그래픽 드라이버에 대해서는 잘 몰랐었는데 이렇게 버전이 나눠져 있기에 권장 버전이나 인증된 버전을 선택하는 것이 더 안전해보여서 권장 드라이버로 설치했습니다. 저와 같이 고통받고 있다면 한 번 시도해보는 것도 좋을 것 같습니다.https://www.nvidia.co.kr/Download/Find.aspx?lang=kr Advanced Driver Search official NVIDIA driversAdvanced Driver Search of..
라즈베리파이5 xrdp 원격 접속 시 웹 브라우저 깨짐 현상 해결 방법 라즈베리파이5에서 rasberry Pi OS(Raspbian)에서 루트 계정 즉 설치 시 처음 만든 계정으로 xrdp를 이용해서 접속 시 생기는 문제점인데 바로 파이어폭스와 크로미움 두 브라우저 모두 화면이 깨져서 나오는데 간단한 해결방법이 있다. $ sudo adduser "새로운 유저명" 위 명령어를 통해서 새로운 유저를 생성한다. 그리고 해당 유저의 password 기입 후 나머지 내용은 입력하지 않고 Enter를 눌러도 상관없다. 그리고 원격으로 다시 접속 시 새로 추가한 유저를 사용하면 웹 브라우저는 문제없이 동작된다. 그런데 새로 추가된 사용자 계정을 통해서 sudo 명령어를 사용하지 못하는데 sudoers 파일에 sudo 명령에 대한 설정이 존재하는데 해당 내용에 추가해야 한다. $ su "..
백준 알고리즘 - 12891번: DNA 비밀번호 [Java] 문제: https://www.acmicpc.net/problem/12891 12891번: DNA 비밀번호 평소에 문자열을 가지고 노는 것을 좋아하는 민호는 DNA 문자열을 알게 되었다. DNA 문자열은 모든 문자열에 등장하는 문자가 {‘A’, ‘C’, ‘G’, ‘T’} 인 문자열을 말한다. 예를 들어 “ACKA” www.acmicpc.net 1. 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Main { static int answer; static String[] DNA = {"A", "C", "G", "T"}; publ..
LeetCode 42 Trapping Rain Water Hard [Java] 문제: https://leetcode.com/problems/trapping-rain-water/ Trapping Rain Water - LeetCode Can you solve this real interview question? Trapping Rain Water - Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. Example 1: [https://assets.leetcode.com/upl leetcode.com 1. 코드 class Solution { public int trap(int[] ..
LeetCode 1 Two Sum Easy [Java] 문제: https://leetcode.com/problems/two-sum/ Two Sum - LeetCode Can you solve this real interview question? Two Sum - Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not leetcode.com 1. 코드 class Solution { public int[] twoSum(int[] nums, int target) ..
LeetCode 5 Longest Palindromic Substring Medium [Java] 문제: https://leetcode.com/problems/longest-palindromic-substring/ = 0 && r < s.length() && s.charAt(l) == s.charAt(r)) { l--; r++; } if(len < r - l - 1) { left = l + 1; len = r - l - 1; } } public String longestPalindrome(String s) { if(s.length() == 1) return s; for(int i = 0; i < s.length() - 1; i++) { sol(s, i, i + 1); sol(s, i, i + 2); } return s.substring(left, left + len); } } 양 끝의 문자가 동일하면..
LeetCode 49 Group Anagrams Medium [Java] 문제: https://leetcode.com/problems/group-anagrams/ Group Anagrams - LeetCode Can you solve this real interview question? Group Anagrams - Given an array of strings strs, group the anagrams together. You can return the answer in any order. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase leetcode.com 1. 코드 class Solution { public List groupAnagrams(Str..
LeetCode 819 Most Common Word Easy [Java] 문제: https://leetcode.com/problems/most-common-word Most Common Word - LeetCode Can you solve this real interview question? Most Common Word - Given a string paragraph and a string array of the banned words banned, return the most frequent word that is not banned. It is guaranteed there is at least one word that is not banned, and tha leetcode.com 1. 코드 class Solution { public String mostCommonWo..