분류 전체보기 87

RN stack navigator와 screen의 재활용

잊어버리기 전에... 리액트 네이티브로 사이드 프로젝트를 진행하면서 에러 메시지가 명확하지 않아 문제 상황을 어렵게 유추해야하는 경우가 꽤 있다.. PhotoPicker PhotoEditor MainEditor (앱의 흐름) 얼마 전에는 PhotoEditor(이미지 선택 후 순서, 캡션 등을 수정할 수 있는 페이지)에서 수정을 마치고 MainEditor로 넘어갔다가, 다시 PhotoEditor로 되돌아 간 뒤 MainEditor로 되돌아가면 의도와 다르게 동작하는 문제가 있었다. 현재는 스크린 이동시 유지 시키고 싶은 정보를 navigation.navigate 함수의 파라미터를 통해 전달시킴으로써 유지시키고 있다. 어쨌든 A -> B -> C -> B -> C 에서 유지 시키고 싶은 정보는 같이 전달하면..

trouble shooting 2020.10.19

735. Asteroid Collision

https://leetcode.com/problems/asteroid-collision/ Asteroid Collision - 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 스택 문제를 더 연습하고 싶어서 하나 더 골라봤다. 고려해야할 경우의 수를 잘 나눠놓고 접근해야 무한루프에 빠지지 않는다. 스택을 이용하되, 연쇄작용 하는 부분을 신경써야함. 40% class Solution: def asteroidCollision(self, asteroids: List[i..

algorithm 2020.10.18

316. Remove Duplicate Letters [R]

https://leetcode.com/problems/remove-duplicate-letters/ Remove Duplicate Letters - 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 항상 자신이 없는 스택 문제를 오랜만에 풀어봤다. 결국 제한 시간 안에 못풀었다. 대충 250케이스중 200몇개만 통과하고 예외 케이스가 발생. 코드를 딱 봐도 ... 복잡. class Solution: def removeDuplicateLetters(self, s: s..

algorithm 2020.10.18

NATS streaming client example

https://github.com/nats-io/stan.py nats-io/stan.py Python Asyncio NATS Streaming Client. Contribute to nats-io/stan.py development by creating an account on GitHub. github.com STAN을 쓰는 방법을 정리해보았다. 문서와는 다르게, ip 주소 및 포트를 명시해야 했다 (커스텀 포트를 써서 그런듯) stan은 nats를 기반으로 돌아가기 때문에 nats client를 생성해서 stan client에 전달해줘야한다. stan의 첫 인자는 클러스터 아이디로 클러스터를 실행시킬 때 명시를 하지 않았다면, 디폴트가 test-cluster라고 한다. 중요 포인트중 하나는 각 st..

dist. system 2020.09.25

1405. Longest Happy String

https://leetcode.com/problems/shopping-offers/ Shopping Offers - 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 a, b, c의 갯수가 주어지고 aaa, bbb, ccc와 같이 연속된 3개의 문자가 나오지 않는 선에서 가장 긴 스트링을 리턴하는 문제 한 번 재귀로 접근해보았는데... 계속 예외케이스가 발생하고 결국 중단. 재귀로 푼 다음 메모이제이션으로 최적화가 가능할 것 같았는데... ccaccbcc 예시에서 ..

algorithm 2020.09.14

638. Shopping Offers

https://leetcode.com/problems/shopping-offers/ Shopping Offers - 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 음.. 요즘에는 예전과는 다르게, 최적 값 찾는 문제를 테이블로 어떻게 접근할 것인지 부터 생각하고있네 예전엔 반대였는데 아무튼, 긍정적인 신호고 반대로 DP문제에서 테이블 접근에 있어서 답이 도저히 안나 올 때는 그냥 직관적으로 recursion을 이용해 코드를 풀어 쓰고, memoization을 적..

algorithm 2020.09.12