Web 242

[HTML mdn web docs] table 의 th에 id 쓰는 법

intellij 에서 테이블만 만들면 자꾸 th에 id나 scope attribute를 넣어라고 한다 왜 일까... 🤔 Table에서 id와 headers 속성을 이용하여 연결을 만든다 Purchase Location Date Evaluation Cost (€) Haircut Hairdresser 12/09 Great idea 30 … th 에 id를 추가해주고 td 는 headers 요소를 추가하고 공백으로 구분하는 것이다 제대로 작동하려면 테이블에 열과 행 머리글이 모두 필요하다. https://mdn.github.io/learning-area/html/tables/assessment-finished/planets-data.html Planets data Dwarf planets Pluto 0.014..

Web/front 2023.12.15

[Generics] 제네릭 알아보기

https://inpa.tistory.com/entry/JAVA-%E2%98%95-%EC%A0%9C%EB%84%A4%EB%A6%ADGenerics-%EA%B0%9C%EB%85%90-%EB%AC%B8%EB%B2%95-%EC%A0%95%EB%B3%B5%ED%95%98%EA%B8%B0 ☕ 자바 제네릭(Generics) 개념 & 문법 정복하기 제네릭 (Generics) 이란 자바에서 제네릭(Generics)은 클래스 내부에서 사용할 데이터 타입을 외부에서 지정하는 기법을 의미한다. 객체별로 다른 타입의 자료가 저장될 수 있도록 한다. 자바에서 배 inpa.tistory.com 제네릭 : 클래스 내부에서 사용할 데이터타입을 외부에서 지정하는 기법이다. 각 객체별로 다른 타입의 자료가 저장될 수 있도록 해준다. A..

Web/JAVA 2023.11.29

[비교] Object.equals() 와 equals()

equals() 를 사용할 때 비교하는 예시가 null 일 경우 에러가 난다. NullPoitException public class Equals { public static void main(String[] args) { String a = null; String b = "b"; if(a != null & aa.equals(b)) { System.out.println("a equal to b"); } } } 굳이 널 여부까지 체크해줘야된다는 말임 public class Equals { public static void main(String[] args) { String a = null; String b = null; String c = "apple"; String d = "apple"; System.o..

Web/JAVA 2023.11.26

[단일요소배열] Collections.singletonList 와 Arrays.asList

https://prohannah.tistory.com/85 Java 단일 요소의 배열 Collections.singletonList vs Arrays.asList 나의 개발 친구 intelliJ가 친절하게 알려주었다. 단일 요소의 배열에는 asList() 대신 singletonList()를 사용해달라고. intelliJ가 괘 이러한 가이드를 주었는지 IntelliJ의 설명을 읽어 보자. [요약] 메모리 prohannah.tistory.com 메모리 절약을 위해서 empty인지 아닌지를 체크하기 위해서는 Collections.singletonList 를 사용하는게 좋다. Collections.singletonList() 변경여부 : immutable (불변) 사이즈 : size가 1로 고정됨(지정된 단일 ..

Web/JAVA 2023.11.25

[Task Execution and Scheduling] @Scheduled annotation

@Scheduled 애노테이션을 이용하면 아주 쉽게 메소드 추가가 가능하다 @EnableScheduling // 스케줄링 @SpringBootApplication public class AnythingTestApplication { ... } 다음 메서드는 고정된 지연 시간을 두고 5초(5000밀리초)마다 호출됩니다. 즉, 기간은 각 이전 호출의 완료 시간부터 측정된다. @Scheduled(fixedDelay = 5000) public void doSomething() { // something that should run periodically } https://velog.io/@kenux/Spring-Boot-Scheduled-%EC%9D%B4%EC%9A%A9%ED%95%9C-%EA%B0%84%EB%..

Web/spring 2023.11.22

[Generator] * 과 yield

Generator 함수의 실행을 중간에 멈췄다가 재개할 수 있는 기능입니다. next(), return(), throw() 다른 작업을 하다가 다시 돌아와서 다시 next() 해주더라도 멈춘 부분 부터 이어서 실행할 수 있다 function 옆에 * 을 써서 만들고, 내부에 yield 키워드를 사용한다. yield 에서 함수의 실행을 멈출 수 있다. iterable Symbol.iterator 메서드가 있다. Symbol.iterator 는 iterator 를 반환해야 한다. iterator next 메서드를 가진다. next 메서드는 value 와 done 속성을 가진 객체를 반환한다. 작업이 끝나면 done 은 true 가 된다. 외부에서 값 입력받기

Web/JavaScript 2023.11.20

[Design Pattern] 8.Builder Pattern

// 이전 방식 // 심지어 내가 쓰는 방식이네 ㅡㅜ class Request { constructor(url, data, method) { this.url = url; this.method = method; this.data = data; } } 이렇게 코드를 작성하면 계속 데이터를 전달해줘야하는 문제가 생긴다.(동감동감) const request = new Request('http://localhost', {}, method); //이런식으로 생성해야만 했음 Builder Pattern 적용 class Request { constructor() { this.url = ''; this.method = ''; this.data = null; } } class RequestBuilder { construc..

Web/JavaScript 2023.11.18
728x90