본문 바로가기

전체 글93

[leetcode] 20. Valid Parentheses / JS Javascript 코드 , 풀이 문제 제목 Valid Parentheses 문제 링크 https://leetcode.com/problems/valid-parentheses/ Valid Parentheses - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 코드 /** * @param {string} s * @return {boolean} */ var isValid = function(s) { let A = [s[s.length-1]]; for (let i =s.length-2; i>=0; i-.. 2022. 4. 6.
[Angular/앵귤러] ngClass 란? ngClass 디렉티브사용법 안녕하세요 질서 정연 입니다. 👽 오늘은 ngClass에 대해서 예제를 함께 보며 알아볼게요 ngClass ngClass를 이용하면 HTM element에 CSS class를 지워줄 수도 있고 더해 줄 수도 있답니다. ... ... ... ... ... HTML 태그 안에 [ngClass] ="" 를 넣어 사용 합니다. String 을 넣어주는 경우 맨 첫 줄 예제부터 볼게요! ... 이렇게 string 을 넣어주면 some-element 태그에 first, second 클래스가 추가 됩니다. 제가 만약 CSS에서 first, second라는 이름으로 어떤 스타일을 넣어줬다면 some-element에 first, second 클래스가 추가 되면서 그 스타일이 적용 되겠죠! Array를 넣어주는 경우 .... 2022. 4. 6.
[CSS] display: flex 요소 수평,수직 정렬 하는법 justify-content: center ,align-items : center , 높이가 다른 요소 수직 정렬 하기 안녕하세요 질서정연 입니다. 오늘은 CSS 의 display: flex 와 align-items 에 대해 알아보겠습니다. div 안에다가 여러 요소를 넣고 수직 정렬, 수평 정렬 하고 싶으실 때 어떻게 하시나요? 저는 어떤 원리 인지도 잘 모르면서 매번 display: flex 해 주고 justify-content: center, align-items: center 를 써 줬었어요 justify-content를 했을 때 , align-items를 했을때 어떻게 정렬이 되는지 이번 기회에 제대로 알아보자구요 ~ 😎 CSS Flexible Box Layout 은 사용자 인터페이스 디자인과 단방향 레이아웃에 최적화된 CSS모듈입니다. 플렉스 레이아웃 모델에서는 플렉스 컨테이너의 자식을 어떤 방향으로도 배치할 .. 2022. 4. 5.
[ Typescript ] Target Flag / --target ES5 --noEmitOnError / error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. / ts 오류시 js 생성 막기 안녕하세요 질서정연 입니다 ~ 👽 target flag 란 무엇일까요 ? typescript 로 코딩 할 때 프레임 워크를 사용 하신다면 tsconfig.json 이라는 파일에 설정을 추가 해 보신 적이 있을거예요 tsconfig.json 에서 ts를 js로 컴파일 할 때의 설정을 지정 해 줄 수 있어요 tsconfig.json 에서 지정하는 방법도 있고 터미널 창에서 tsc --target ES5 --noEmitOnError Customer.ts 이렇게 적어서 설정 해 줄 수도 있어요 tsc 뒤에 적어준 --target ES5와 --noEmitOnError 같은걸 Target Flag 라고 합니다~ --noEmitOnError --noEmitOnError 는 ts 파일에 오류가 있을 시 js 파일을 생.. 2022. 3. 24.
[Angular/앵귤러] ngModel 이란? ngModel 디렉티브란? 안녕하세요 질서정연입니다! 🧚‍♂️ 저는 요즘 앵귤러를 공부하고있는데요! 오늘은 Angular ngModel에 대해서 알아볼게요 ngModel은 directive 예요! 근데.. 디렉티브가 뭘까요? ngModel이 무엇인지 알아보기 전에 먼저 디렉티브가 무엇인지부터 살펴볼게요 ~ 디렉티브(Directive) 란? directive는 앵귤러 프로그램의 요소에 동작을 추가하는 클래스 입니다. Angular의 기본 제공 지시문을 사용하여 양식, 목록, 스타일 및 사용자가 보는 내용을 관리 할 수 있습니다. directives는 Components, Attribute directives, Structural directives 세가지 종류가 있습니다. 1. Components : 템플릿이 있는 directive.. 2022. 3. 11.
[Spring] cannot reliably process 'remove' call; nested exception is javax.persistence.TransactionRequiredException: No EntityManager with actual transaction available for current thread - cannot reliably process 'remove' call 에러 안녕하세요 질서정연 입니다. 👻 https://stackoverflow.com/questions/32269192/spring-no-entitymanager-with-actual-transaction-available-for-current-thread Spring - No EntityManager with actual transaction available for current thread - cannot reliably process 'persist' call I get this error when trying to invoke "persist" method to save entity model to database in my Spring MVC web application. Can't really fi.. 2022. 3. 9.
[TypeScript] object is possibly 'null' 에러 해결법 안녕하세요 질서정연입니다. 👻 제가 분명 저렇게 container를 선언 했는데 Error: src/app/app.component.ts:108:5 - error TS2531: Object is possibly 'null'. 라는 에러가 나더라고요 바로 구글링 해 봤습니다. https://stackoverflow.com/questions/43951090/typescript-object-is-possibly-null 2022. 3. 8.
스테이트 패턴(State Pattern) 목적: 객체의 내부 상태가 바뀔 때 객체의 동작을 변경할 수 있도록 함. 객체는 자신의 클래스를 바꾸는 것처럼 보임 State(상태) : 시점에 따라 특정 상태에 있어야함. 처음에 가지게 되는 초기상태 (state)또는 상황에 따라 여러 상태 가운데한 상태를 가질 수 있음. Transition(전이) : 외부 입력에 따라 가능한 상태로 전환 상태(state)가 여러 개 있고 , if 문으로 상태를 통제했던 것을 상태를 한 곳에서 관리하고 변경을 최소화 할 수 있도록 한다. 상태표시를 정수로 하던 것을 상태 객체를 사용하는 것으로 변경한다. 상태를 별도의 클래스로 캡슐화 한 다음, 현재 상태를 나타내는 객체에게 행동을 위임한다. 2020. 12. 8.
Attributes type : 어트리뷰트 타입, 어트리뷰트 종류. •An entity is represented by a set of attributes >Example: a instructor entity= {(ID,76766), (name, Crick), (dept_name, Biology), (salary, 72000)} a instructor entity= {(ID,45565), (name, Katz), (dept_name, Physics), (salary, 55000)} entity는 어트리뷰트의 집합으로 나타난다. •Domain – the set of permitted values for each attribute >Semester -> {Fall, Winter, Spring, Summer} >course_id -> the set of all text str.. 2020. 12. 7.