전체 글
-
[Android] 무한스크롤 Infinite ScrollAOS 2023. 5. 17. 02:26
무한스크롤이란? API 데이터가 처음부터 모드 로드되지 않고, 사용자가 요청했을 때 다음 데이터가 로드되는 방법으로는 무한스크롤과 pagination(페이지 매기기)가 있습니다. 그 중 무한스크롤은 사용자가 스크롤 하면서 페이지의 하단에 도달했을 때, 다음 데이터가 로드되는 되는 UX 입니다. pagination은 페이지를 분할하여 사용자가 페이지를 클릭해야 다음 데이터가 로드됩니다. 스크롤은 클릭보다 상호작용 비용이 낮아 더 나은 UX를 제공합니다. 무한스크롤을 구현해보기 1. 데이터 불러오기 (ViewModel) class PlantListViewModel(private val repository: PlantRepository) : ViewModel() { private val _plantList =..
-
[Android] 이미지 라이브러리(glide)없이 URL로 이미지 나타내기AOS 2023. 5. 12. 21:54
glide 는 android 에서 대부분 사용하는 이미지 라이브러리이다. glide 는 기본적으로 비동기로 이미지를 로드하여 이미지뷰에 보여주고, 캐시처리를 해준다. 이러한 기능이 어떻게 동작하는지 glide 없이 직접 처리하여 공부해보자 1. 비동기 처리 ( 코루틴 ) ⭐️ 비동기 처리가 필요한 이유? 네트워크를 통해 이미지를 가지고 오면서 시간이 소요된다. 이미지 다운로드를 Main thread(UI Thread)에서 구현한다면 화면이 멈춘다. ( Main Thread를 5초 이상 사용하면 ANR 이 발생한다. ) 시간이 오래걸리는 작업은 별도의 Thread에서 처리하고 비동기적 처리해야한다. Android는 네트워크를 사용하는 작업이 Main Thread 에서 처리하지 못하게 하고 있다. 별도의 T..
-
[Computer Vision] Image Processing Operators (영상처리의 연산자)ML 2023. 4. 29. 19:45
Image Processing Operators (영상 처리 3가지 연산자) 1. Point Operator (점 연산) 2. Neighborhood Operator (이웃 연산) 3. Geometric Transformation (기하 연산) 1. Point Operator (점연산) point operator 는 각 픽셀을 독립적으로 연산한다. ex1 ) Linear Point Operator 선형 연산 ex2) Non-Linear Point Operator 비선형 연산 : Gamma correlation 감마 값이 커질 수록 그림은 어두워진다. ex3) Linear Blend Operator : 두 이미지(영상) 사이에서 교차 디졸브를 한다. ex4) Histogram Equalization Hi..
-
[Python]프로그래머스 N으로 표현/dpalgorithm/문제 2023. 4. 28. 14:39
https://school.programmers.co.kr/learn/courses/30/lessons/42895 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr ⚡️ 문제 설명 ⚡️ 해결 방법 5를 1번 사용해서 만들 수 있는 수 set {5} 5를 2번 사용해서 만들 수 있는 수 set {0, 1, 10, 55, 25} 5를 3번 사용해서 만들 수 있는 수 set = 5를 2번 사용해서 만들 수 있는 수 set 과 5를 1번 사용해서 만들 수 있는 수 set 의 사칙연산 한 set {0, 2, 4, 5, 6, 555, -20, -4, -50, 15, 1..
-
[Python]백준 9663번/N-Queen/백트래킹algorithm/문제 2023. 3. 31. 16:02
https://www.acmicpc.net/problem/9663 9663번: N-Queen N-Queen 문제는 크기가 N × N인 체스판 위에 퀸 N개를 서로 공격할 수 없게 놓는 문제이다. N이 주어졌을 때, 퀸을 놓는 방법의 수를 구하는 프로그램을 작성하시오. www.acmicpc.net ⚡️ 문제 설명 N-Queen 문제는 크기가 N × N인 체스판 위에 퀸 N개를 서로 공격할 수 없게 놓는 문제 퀸을 놓는 방법의 수를 구하는 프로그램 ⚡️ 해결 방법 퀸이 서로 공격할 수 없도록 하는 방법 1. 같은 행에 위치하면 안됨 2. 같은 열에 위치하면 안됨 3. 대각선상에 위치하면 안됨 graph_col 은 X행에서 퀸이 놓인 열의 위치를 저장할 것이다. queen을 놓은 뒤 이 queen의 자리가 p..
-
[Python]백준 1189번/컴백홈/백트래킹/dfs카테고리 없음 2023. 3. 31. 13:43
https://www.acmicpc.net/problem/1189 1189번: 컴백홈 첫 줄에 정수 R(1 ≤ R ≤ 5), C(1 ≤ C ≤ 5), K(1 ≤ K ≤ R×C)가 공백으로 구분되어 주어진다. 두 번째부터 R+1번째 줄까지는 R×C 맵의 정보를 나타내는 '.'과 'T'로 구성된 길이가 C인 문자열이 주어진다 www.acmicpc.net ⚡️ 문제 설명 R x C 맵에 못가는 부분이 주어지고 거리 K가 주어지면 한수가 집까지도 도착하는 경우 중 거리가 K인 가짓수를 구하는 것 ⚡️ 해결 방법 시작점은 (r-1,0) 도착점은 (0,c-1) 시작점 ~ 도착점 까지 거리가 k 인 가짓수를 구하는 문제이다. 백트래킹 문제를 풀어봤다면 쉽게 풀 수 있는 문제였다. 백트래킹은 한정 조건을 가진 문제를 ..
-
[자료구조] 우선순위 큐와 힙 / 최소 힙 / 최대 힙 / heap /algorithm/개념 2023. 3. 31. 00:21
우선순위 큐 Queue 자료구조는 먼저 집어 넣은 데이터가 먼저 나오는 선입선출 FIFO(First In First Out) 구조로 저장 우선순위큐(priority queue)는 들어간 순서에 상관없이 우선순위가 높은 데이터 먼저 나온다. 힙 (Heap) 이란? Heap은 우선순위큐(priority queue)의 구현과 일치 Heap은 완전이진트리 구조 최소 힙 : 각 node에 저장된 값은 child node들에 저장된 값보다 작거나 같다 최대 힙 : 각 node에 저장된 값은 child node들에 저장된 값보다 크거나 같다 파이썬 힙 함수 heapq.heappush(heap, item) : item을 heap에 추가 heapq.heappop(heap) : heap에서 가장 작은 원소를 pop + 리..
-
[Python]백준 13335번/트럭/queuealgorithm/문제 2023. 3. 29. 11:45
https://www.acmicpc.net/problem/13335 13335번: 트럭 입력 데이터는 표준입력을 사용한다. 입력은 두 줄로 이루어진다. 입력의 첫 번째 줄에는 세 개의 정수 n (1 ≤ n ≤ 1,000) , w (1 ≤ w ≤ 100) and L (10 ≤ L ≤ 1,000)이 주어지는데, n은 다리를 건너는 트 www.acmicpc.net ⚡️ 문제 설명 다리의 길이와 다리의 최대하중, 그리고 다리를 건너려는 트럭들의 무게가 순서대로 주어졌을 때, 모든 트럭이 다리를 건너는 최단시간을 구하는 프로그램 ⚡️ 해결 방법 bridge에 모든 트럭이 지나갈 때 까지 ( while bridge) 반복한다. 기다리고 있는 truck 이 있다면 현재 bridge 위에 있는 트럭의 무게 합 sum(..