Skip to content

Instantly share code, notes, and snippets.

View singun's full-sized avatar
🎯
Focusing

Daewook Shin singun

🎯
Focusing
  • Coupang
  • Seoul, Republic of Korea
View GitHub Profile
@ExtendWith(MockitoExtension.class)
class OwnerControllerTest {
@InjectMocks
OwnerController ownerController;
MockMvc mockMvc;
@BeforeEach
void setUp() {
@singun
singun / HearingInterpreter.java
Last active April 16, 2019 23:09
Spring framework testing context
@Service
public class HearingInterpreter {
private final WordProducer wordProducer;
HearingInterpreter(WordProducer wordProducer) {
this.wordProducer = wordProducer;
}
public String whatIHeard() {
@singun
singun / 1-throw.java
Created April 8, 2019 23:17
throw exception
@Test
void testDoThrow() {
doThrow(new RuntimeException("throw")).when(visitRepository).delete(any(Visit.class));
assertThrows(RuntimeException.class, () -> service.delete(new Visit(1l)));
verify(visitRepository).delete(any(Visit.class));
}
public String processFindForm(Owner owner, BindingResult result, Model model){
// allow parameterless GET request for /owners to return all records
if (owner.getLastName() == null) {
owner.setLastName(""); // empty string signifies broadest possible search
}
// find owners by last name
List<Owner> results = ownerService.findAllByLastNameLike("%"+ owner.getLastName() + "%");
if (results.isEmpty()) {
@singun
singun / urlshortener-capture
Created May 23, 2018 17:57
url shortener capture images
images
λŒ“κΈ€λ‘œ 이미지λ₯Ό λ‹¬μ•„μ„œ μ‚¬μš©
@singun
singun / norm-denorm.md
Created April 4, 2016 15:42
λ°μ΄ν„°λ² μ΄μŠ€ μ •κ·œν™” λΉ„μ •κ·œν™” μš”μ•½

μ •κ·œν™” vs λΉ„μ •κ·œν™”

μ •κ·œν™”

κ΄€κ³„ν˜• λ°μ΄ν„°λ² μ΄μŠ€μ˜ μ„€κ³„μ—μ„œ 쀑볡을 μ΅œμ†Œν™”ν•˜κ²Œ 데이터λ₯Ό κ΅¬μ‘°ν™”ν•˜λŠ” ν”„λ‘œμ„ΈμŠ€λ₯Ό μ •κ·œν™”λΌκ³  ν•œλ‹€. λ°μ΄ν„°λ² μ΄μŠ€ μ •κ·œν™”μ˜ λͺ©ν‘œλŠ” 이상이 μžˆλŠ” 관계λ₯Ό μž¬κ΅¬μ„±ν•˜μ—¬ μž‘κ³  잘 쑰직된 관계λ₯Ό μƒμ„±ν•˜λŠ” 것에 μžˆλ‹€. 일반적으둜 μ •κ·œν™”λž€ 크고, μ œλŒ€λ‘œ μ‘°μ§λ˜μ§€ μ•Šμ€ ν…Œμ΄λΈ”λ“€κ³Ό 관계듀을 μž‘κ³  잘 쑰직된 ν…Œμ΄λΈ”κ³Ό κ΄€κ³„λ“€λ‘œ λ‚˜λˆ„λŠ” 것을 ν¬ν•¨ν•œλ‹€. μ •κ·œν™”μ˜ λͺ©μ μ€ ν•˜λ‚˜μ˜ ν…Œμ΄λΈ”μ—μ„œμ˜ λ°μ΄ν„°μ˜ μ‚½μž…, μ‚­μ œ, 변경이 μ •μ˜λœ κ΄€κ³„λ“€λ‘œ μΈν•˜μ—¬ λ°μ΄ν„°λ² μ΄μŠ€μ˜ λ‚˜λ¨Έμ§€ λΆ€λΆ„λ“€λ‘œ μ „νŒŒλ˜κ²Œ ν•˜λŠ” 것이닀.

λΉ„μ •κ·œν™”

μ •κ·œν™”λŠ” λ˜λ„λ‘ μ€‘λ³΅λœ 데이터λ₯Ό μ œκ±°ν•΄μ„œ μ„±λŠ₯ ν–₯상에 도움을 주것을 λͺ©ν‘œλ‘œ ν•˜κ³  μžˆλ‹€. κ·ΈλŸ¬λ‚˜ κ³Όλ„ν•œ μ •κ·œν™”λ‘œ μΈν•΄μ„œ ν…Œμ΄λΈ”μ˜ μˆ˜κ°€ μ¦κ°€ν•˜κ²Œ 되면, λ‹€μˆ˜μ˜ JOIN이 λ°œμƒν•¨μ— λ”°λΌμ„œ μ„±λŠ₯ μ €ν•˜κ°€ λ°œμƒν•  수 μžˆλ‹€. λ³΄ν†΅μ˜ 경우 μ •κ·œν™” 과정을 λͺ¨λ‘ 거친 λ‹€μŒ λ§ˆμ§€λ§‰ λ‹¨κ³„μ—μ„œ λΉ„μ •κ·œν™”λ₯Ό μ‹€μ‹œν•œλ‹€. 단, ν…Œμ΄λΈ”μ„ ν•©μΉ˜λŠ” κ²ƒλ§Œμ΄ λΉ„μ •κ·œν™”λŠ” μ•„λ‹ˆλ‹€.

  • 그룹에 λŒ€ν•œ 합계와 같은 값을 미리 κ³„μ‚°ν•˜μ—¬ ν…Œμ΄λΈ”μ— μ €μž₯ν•΄ λ‘”λ‹€. (얍 ν”Œλ ˆμ΄μŠ€λ₯Ό 예둜 λ“€λ©΄, μ‚¬μš©μžκ°€ μ’‹μ•„μš”λ₯Ό ν•˜κ±°λ‚˜ 리뷰λ₯Ό 남기면 톡계 κ΄€λ ¨ μž‘μ—…μ„ ν•΄μ£ΌλŠ”λ°, 톡계 ν…Œμ΄λΈ”μ„ μƒμ„±ν•˜μ—¬ κ΄€λ¦¬ν•˜λŠ” 것 λ˜ν•œ λΉ„μ •κ·œν™”λΌκ³  해석할 수 μžˆλ‹€.)
  • ν•˜λ‚˜μ˜ ν…Œμ΄λΈ”μ—μ„œ 자주 μ‚¬μš©λ˜λŠ” ν–‰(λ ˆμ½”λ“œ)와 κ·Έλ ‡μ§€ μ•Šμ€ 행듀을 λΆ„λ¦¬ν•˜μ—¬ 두 개의 ν…Œμ΄λΈ”λ‘œ λ‚˜λˆˆλ‹€. (이런 κ²½μš°μ—λŠ” UNION으둜 λ‹€μ‹œ μ—°κ²°μ‹œν‚¨λ‹€.)
  • λ‹€λ₯Έ ν…Œμ΄λΈ”μ— μ˜μ‘΄μ μ΄μ§€λ§Œ 자주 JOINν•˜μ—¬ μ‚¬μš©ν•˜λŠ” μ»¬λŸΌμ„ μ€‘λ³΅ν•˜μ—¬ ν…Œμ΄λΈ” μ•ˆμ— ν•˜λ‚˜ 더 μƒμ„±ν•œλ‹€.
@singun
singun / google-guide.md
Last active October 6, 2020 08:35
κ΅¬κΈ€λŸ¬κ°€ μ „ν•˜λŠ” IT μ·¨μ—… κ°€μ΄λ“œ

κ΅¬κΈ€λŸ¬κ°€ μ „ν•˜λŠ” IT μ·¨μ—… κ°€μ΄λ“œλΌλŠ” 책이 μžˆλŠ”λ°, κ±°κΈ°μ„œ 일단 μ œκ°€ ν•„μš”ν•œ λΆ€λΆ„λ§Œ λ”°λ‘œ 볼라고 μ •λ¦¬ν•œ λ¬Έμ„œμ˜ˆμš”. 밑에 λ‹΅λ³€ 같은 뢀뢄은 책에 λ‚˜μ™€μžˆλŠ” 사둀 κ·ΈλŒ€λ‘œ 타이핑 ν•œκ±°μ˜ˆμš”. 참고용으둜 λ³΄μ‹œλ©΄ 될 것 κ°™μ•„μš”.

νšŒμ‚¬κ°€ μ›ν•˜λŠ” μ‚¬λžŒ

νšŒμ‚¬λŠ” λ‹¨μˆœνžˆ λ˜‘λ˜‘ν•œ 지적 λŠ₯λ ₯보닀 더 λ§Žμ€ 것을 μ§€μ›μžμ—κ²Œ μ›ν•œλ‹€. 기본적으둜 μ•„λž˜μ™€ 같은 μ‚¬λžŒμ„ μ›ν•œλ‹€

  • 무엇인가 μ„±μ·¨ν•œ μ‚¬λžŒ
  • λ™λ£Œλ“€μ—κ²Œ 동기λ₯Ό λΆ€μ—¬ν•˜λŠ” μ‚¬λžŒ
  • 높은 λͺ©ν‘œλ₯Ό μ •ν•˜κ³  λ‹¬μ„±ν•˜λŠ” μ‚¬λžŒ
  • 윀리적으둜 ν–‰λ™ν•˜κ³  μ •μ§ν•œ μ‚¬λžŒ

IT νšŒμ‚¬λ“€μ€ ν˜μ‹ μ μΈ 문화에 μžλΆ€μ‹¬μ„ κ°€μ§€κ³  있으며 이런 문화에 잘 적응할 수 μžˆλŠ” μ‚¬λžŒμ„ μ›ν•œλ‹€. λ”°λΌμ„œ μžμ‹ μ΄ μ™œ μ—¬κΈ° μžˆλŠ”μ§€ μ„€λͺ…ν•΄μ•Ό ν•˜κ³ , IT νšŒμ‚¬μ˜ 파격적이고 ν˜μ‹ μ μΈ μƒν™œ 방식을 μ¦κΈ°λŠ” μ‚¬λžŒμ΄κΈ° 떄문에 νšŒμ‚¬μ— 잘 적응 ν•  수 μžˆλ‹€λŠ” 것을 증λͺ…ν•΄μ•Ό ν•œλ‹€.