[first, last) 표현 이해하기

이진수 표현으로 출력하기

  • tags: #algorithm
  • C++ 혹은 Java에서 printf() 함수는 포맷 문자를 사용하여 여러가지 형식으로 숫자를 출력할 수 있지만 이진 문자를 출력하는 옵션은 없다
  • 이진 문자를 출력할 수 있는 방법을 알아보자
  • 좋은 사이트 발견 :
    • 간단한 알고리즘 문제를 3가지 언어으로 풀어보는 사이트 TECHIE DELIGHT

이미지 배경을 투명으로 변경하기

Window Package Manager 비교

유용한 사이트 모음

  • tags: #icon #powershell #svg
  • IcoFont : Free! , 여러 카테고리 아이콘을 SVG 형식으로 다운받을수 있다
  • Powershell Blog : 여러가지 Powershell 관련 내용
  • react-mt-svg-lines : svg file에 animation을 끼얹는 패키지

Java의 Null에 대한 블로그 포스팅

C++로 Array를 ascending order로 sorting하기

How to Multiply String

  • 별표를 30개쯤 찍고 싶을때 Python 에서는 간단히 '*'*30로 처리했었는데 Java는 어떻게 하는지 궁금해졌다
  • Java에서 "*".repeat(30) 을 사용하면 된다
  • 사족 : 이 주제를 영어로 어떻게 검색하는 생각했는데 간단히 Multiply String으로 찾을수 있었다. 참 직관적이네..

Powershell 업데이트 하기

  • tags: #powershell
  • 이 꼭지는 이 곳으로 납치되었다.
  • 아래와 같이 업데이트 메시지가 뜨는 경우 어떻게 업데이트할까?

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    
    PowerShell 7.2.2
    Copyright (c) Microsoft Corporation.
    
    https://aka.ms/powershell
    Type 'help' to get help.
    
       A new PowerShell stable release is available: v7.2.3
       Upgrade now, or check out the release page at:
         https://aka.ms/PowerShell-Release?tag=v7.2.3
    
    Loading personal and system profiles took 3826ms.
    
    >
    
  • 간단히 winget upgrade -h --id Microsoft.PowerShell로 최신버전으로 업데이트 할 수 있다
  • 자세한 설명은 아래 링크를 참조한다

Subarray에서 zero-sum 발견하기

  • tags: #algorithm, #HashSet
  • 용어 설멍
  • 문제
  • 문제 풀이를 보고 처음엔 문제내용과 답안 내용이 전혀 다르다고 생각했는데… 댓글로 달린 아래 해설을 보고 깨달았다

    If anyone is having a hard time understanding how the algorithm works. You basically traverse through the array, and keep adding each element to the sum variable, and each time you store the new value of sum in a set.

    Here come’s the tricky part.

    [this is front part of the array] [sub array with zero sum] [this is back of the array]

    Now suppose the sum of the front part of the array was sum1, this would have been stored in our set. And you keep on iterating. When you have reached the end of the sub array with 0 sum, Guess what should be the value of the sum variable be? well it should be sum of the front part + sum of the sub array with sum 0. Which is sum of the front part. There sum would be sum1, which is already present in the set. And the function returns true. Now what if the sub array with 0 sum is in the front.

    [sub array with 0 sum] [back part of the array]

    We already add 0 to our set before we start iterating. So after iterating over the sub array with contiguous sum the value of sum becomes 0, which is already present in the sub array, so boom shakalaka. You get a true value returned from the function.