본문 바로가기

분류 전체보기79

이진수<-> 십진수 소수 파트 => fractional part: Binary number <-> Decimal number Decimal to Binary To convert the fractional part of a decimal number to binary, you can use the following steps: Multiply the fractional part by 2. Write down the integer part of the result. Repeat step 1 with the fractional part of the result from the previous step. Continue this process until the fractional part becomes 0 or until you have obtained the desired number of binary digits. For exam.. 2023. 3. 26.
p, np, np-complete, np-hard + polynomial time(n^k: n is the size of input, k is constant) from lecture 결정론적 튜링 기계 p: 결정론적 튜링 기계로 다항식 시간 안에 풀 수 있는 문제 np: 비결정론적 튜링 기계로 풀 수 있는 문제 중 > 정답이 있을 때 결정론적 튜링 기계로 다항식 시간 안에 검증 가능한 문제 np-complete: intersection of np ∩ np-hard. np-hard: np가 아닌데 np가 붙어 있다 =_= | p ⊂ np | np-complete = np ∩ np-hard | np-complete ⊂ np from ChatGPT P, NP 및 NP-완전 다이어그램은 계산 복잡도 이론에서 결정 문제의 복잡도 클래스를 나타냅니다. 각 클래스와 그 관계에 대한 간략한 설명은 다음과 같습니다. P: 클래스 P는 결정론적 알고리즘에 의해 다항 시간 내에 .. 2023. 3. 25.
npm ci vs npm i npm ci CI stands for clean install and npm ci is used to install all exact version dependencies or devDependencies from a package-lock.json file. npm i install all dependencies or devDependencies from a package.json file. 2023. 3. 23.
[디자인 패턴] Observer pattern export interface Observer { update(): void; } export interface Observable { count: number; map: Record; addObserver(observer: Observer): number; removeObserver(id: number): void; notifyAll(): void; } export class Subject implements Observable { count: number = 0; public map: Record = {}; constructor() {} notifyAll(): void { for (const observer of Object.values(this.map)) { if (observer === undef.. 2023. 3. 5.
[github] your profile README 꾸미기 [github] your profile README 꾸미기 #customize #github #profile #readme #username #custom 개인 깃헙 Adding a profile README Managing your profile README GitHub will display your profile README on your profile page if all of the following are true. You&#39;ve created a repository with a name that matches your GitHub username. The repository is public. The repository contains a file named README.md in it.. 2023. 3. 4.
부동 소수점: 0.1을 100번 더하면 10이 아니다?? Floating Point let sum = 0; for (let i = 0; i 100000111 0.3 => 0.01001100110011......(0011)의 무한 반복입니다. 이렇게 2진수로 표현하지 못하는 소수가 발생합니다. 어쩔 수 없이 컴퓨터에는 표현할 수 있는 가장 근사치의 값이 저장됩니다. 읽어 보기 2023. 3. 1.
Mac 화면 녹화, gif 변환하기 [gif] CREATE GIF on Mac Is there a Mac screen capture tool that will export to animated gif? Starting with macOS Mojave, and later, simply press ⇧⌘5 (Shift-Command-5) and you can choose from the following: Capture Entire Screen Capture Selected Window Capture Selected Portion Record Entire Screen Record Selected Portion Afterwards, if you want to convert the MOV file into a GIF, you can use Gifs.. 2023. 1. 28.
DFS: 깊이 우선 탐색- iteration, recursion Chapter 7 DFS DFS - Depth first search function dfsRecursion(adjacencyList: Array, here: number, visited: boolean[]) { visited[here] = true; const currentEdges = adjacencyList[here]; for (let i = 0; i < currentEdges.length; i++) { const connectedVertex = currentEdges[i]; if (visited[connectedVertex] === true) continue; dfsRecursion(adjacencyList, connectedVertex, visited); } } function dfsIterat.. 2023. 1. 15.
[Node] execute command line with argument:: process.argv.slice(2) Search:: node execute with arguments How do I pass command line arguments to a Node.js program? To normalize the arguments like a regular javascript function would receive, I do this in my node.js shell scripts: var args = process.argv.slice(2); Note that the first arg is usually the path to nodejs, and the second arg is the location of the script you&#39;re executing. 2023. 1. 13.
How to detect text overflow ellipsis? Search:: how to check if html element is in ellipsis HTML text-overflow ellipsis detection Try this JS function, passing the span element as argument: function isEllipsisActive(e) { return (e.offsetWidth < e.scrollWidth); } @NicolasS.Xu I believe if the element is a span, you might get zeros in these properties. So one solution is to wrap the span in a div which has overflow: hidden and then che.. 2023. 1. 9.