Browsed by
[Category:] 공부

숲 해설을 위한 영어 공부

Understanding Immutable State in Java: When Why & How to Use It

Understanding Immutable State in Java: When Why & How to Use It

대부분의 프로그래밍 언어에는 시간이 흐르더라도 변하지 않는 개념 즉, 신뢰성(Reliability)과 효율성(Efficiency)을 들 수 있다. 이는 Immutability과 관련된 개념이다. Immutability 상태라 함은 Object에 속해있는 속성들이 Object 생성 이후부터는 변경되지 않는 상황(불변)을 말한다. 이와 반대로 Mutable 상태는 Object가 생성된 이후 속성들이 변경되는 상황을 말한다. 이 두 상태는 개발하다 보면 그에 상응하는 목적과 역할이 존재함을 알 수 있는데 이 글에서는 Immutable 상태에 초점을 맞추는 것으로 하며 다음과 같은 내용들을 얘기해 보고자 한다. Java에서 immutable상태가 왜 중요한가? Immutability 상태는 Java 개발 관점에서 보면 매우…

Read More Read More

Java Stream API: Mastering Collectors

Java Stream API: Mastering Collectors

Java에서 Stream을 이용할 때 그 값이 하나의 값이든, Collection이든 또는 배열이든간에 최종 결과값을 산출하게 된다. Java에서 Stream은 Collector들을 통과하면서 어떤 형태의 Container로 변환된다. Java Stream API는 다양 형태의 Collector들을 제공하며 이 글에서 이런 Collector들을 하나씩 살펴보고자 한다. Stream을 Collection으로 변형시키는 것은 광범위한 토픽이라 할 수 있다. 따라서 다양한 툴들이 존재하고 다양한 방법으로 활용하거나 무수한 조합으로 사용할 수 있으므로 언제, 어떻게 사용하는지에 대해 모두 이해하는 것은 현실성이 떨어진다. 활용방법에 대해 좀 더 쉽게 접근할 수 있도록 어떻게 소개할 지 시나리오를 제시하고자…

Read More Read More

Java Stream API: Mastering Reduction Operations

Java Stream API: Mastering Reduction Operations

Java에서 Stream을 다루다 보면 stream에 있는 값들을 하나의 결과 값으로 변환하는 작업들이 흔히 발생한다. stream을 하나의 값으로 reducing하거나 모든 값을 더해 하나의 값으로 취합하는 작업들이 여기에 해당한다. Java Stream API는 이런 일련의 작업들을 효율적으로 할 수 있도록 직관적이면서 강력한 툴을 제공한다. 이 글에서는 코드를 깔끔하게 하고 원하는 성과를 달성할 수 있도록 이런 operation들의 활용 방법에 대해 알아본다. 앞으로 다루게 될 모든 Operation들은 Terminal Operation이라고 하며 Stream을 가공해서 반환될 값으로 변형한 다음 Stream을 Close한다는 의미를 갖고 있다. count method Stream에서 처리하는…

Read More Read More

Concurrency and parallelism

Concurrency and parallelism

We need to clarify an important point. Concurrency and parallelism are two concepts that are often confused, leading to misunderstandings. Parallel means that two or more tasks are executed at the same time. This is possible only if the CPU supports it, requiring multiple cores to achieve parallelism. However, modern CPUs are typically multi-core, and single-core CPUs are largely outdated and no longer widely used, as they are significantly outperformed by multi-core ones. This shift is because modern applications are designed to…

Read More Read More

Get to know the Contraction Hierarchy

Get to know the Contraction Hierarchy

앞서 길찾기 알고리즘 관련해서 2개의 알고리즘(Dijkstra, BidirectionalDijkstra)에 대해 살펴봤다. 컴퓨터를 활용하여 길을 찾아가는 알고리즘의 목적은 크게 최적의 경로를 최대한 빨리 찾아내는 것이라 할 수 있다. 이론적으로 이들 알고리즘은 최적의 경로를 찾아주는 것을 보장하지만 최대한 빨리 찾는 것에는 한계를 드러내고 있다. 앞에서 설명한 BidirectionalDijkstra 알고리즘도 이런 맥락에서 탐색속도를 개선하기 위한 하나의 방법으로 볼 수 있다. 이처럼 Dijkstra Algorithm의 탐색 속도는 탐색공간 크기에 종속적일 수 밖에 없으며 나아가 길찾기가 한 국가를 넘어 글로벌 규모로 확대해 나간다면 탐색 속도는 서비스 경쟁력을 유지에 중요한…

Read More Read More

Understanding Bidirectional Dijkstra Algorithm

Understanding Bidirectional Dijkstra Algorithm

Dijkstra Algorithm은 내비게이션의 길찾기 뿐만 아니라 최단거리를 찾는 알고리즘으로 잘 알려져 있다. Dijkstra Algorithm은 출발지와 목적지 사이의 최단 거리 탐색을 보장하긴 하지만 탐색 거리가 멀면 멀수록 소요되는 시간도 비례적으로 증가한다는 것이 맹점이다. 이런 문제점을 해결하기 위해 다양한 방법들이 시도 되었으며 그 중 대표적인 것이 A*와 양방향 탐색이라 할 수 있다. 이 글에서는 내비게이션 업계에서 주로 적용하고 A*알고리즘보다 최적 경로 탐색을 보장하면서 탐색시간을 거의 절반으로 줄일 수 있는 양방향 탐색(Bidirectional Dijkstra Algorithm)을 자세히 알아보고자 한다. 참고로 Dijkstra Algorithm에 대해 이해가 필요하다면…

Read More Read More

Rust memory safety explained

Rust memory safety explained

What makes the Rust language one of the best for writing fast, memory-safe applications? Rust’s memory safety features are baked into the language itself. In Rust, behaviors that are not memory-safe are treated not as runtime errors but as compiler errors. Whole classes of problems, like use-after-free(해제된 메모리 접근) error, are syntactically wrong in Rust. This doesn’t mean that code written in Rust is entirely bulletproof or infallible. Some runtime issues, line race conditions, are still the developer’s responsibility. But…

Read More Read More

Transformer

Transformer

참고: The illustrated Transformer GPT는 Generative Pre-trained Transformer의 약자라고 알고 있다. 여기서 가장 중요한 역할을 하는 것이 Transformer일 것이다. 그렇다면 Transformer가 어떤 기능을 하기에 가장 중요한지 궁금증을 가지지 않을 수 없다. 논문의 포함해서 여러 자료를 살펴봐도 글자만 보이지 문맥이 보이지 않았는데 이 문서를 보고서 무릅을 탁 치게 되었다. 우선 쉬운 설명을 통해 궁금증을 해결하도록 해 준 Jay Alammar에게 감사를 드리고 나의 언어로 다시 정리해 보고자 한다. 나중에 자세하게 설명하겠지만 Transformer는 내부적으로 Attention이라는 개념을 사용한다. 이를 사용함으로써 그동안 문제로 지적됐던 느린…

Read More Read More

Generative Deep Learning

Generative Deep Learning

What is Generative Modeling? Generative modeling is a branch of machine learning that involves training a model to produce new data that is similar to a given dataset We can sample from this model to create novel, realistic images of horses that did not exist in the original dataset. One data point in the training data is called as observation. Each observation consists of many features. A generative model must be probabilistic rather than deterministic, because we want to be…

Read More Read More

The Power of Trees

The Power of Trees

(be) at rock bottom ( ➞ bottom ¹ (n))(be) in arrears ( ➞ arrearsㅤ연체되다)abstain from ( ➾ abstain [2])amputateanimal food ( ☛ feed ² (n))arableat the earliest opportunity ( ➞ opportunity)at the latest ( ➞ latest ² (n)ㅤ늦어도)bail out ( ➝ bail ² (v))bill something as something ( ➝ bill ² (v))bring somebody/something ↔ down ( ➝ bring)carrioncash something ↔ in ( ➞ cash ² (v))come to a standstill something to a standstill ( ➾ standstill)copiousdepredationdip into something ( ➝ dip ¹ (v)ㅤ3번)epigeneticsexudeeye teeth ( ➞ eye tooth)fall ill ( ➞ ill ¹ (adj))far-fetchedfurrowgloss…

Read More Read More