Tag: software

  • How to debug user warning in pydantic

    When pydantic comes across serialization issues, it outputs: But that doesn’t leave much trace to debug. To fix that, change warning filter. Then now you’ll see stack trace was the warning becomes an exception.

  • How to wait for ProcessPoolExecutor and ThreadPoolExecutor

    If your wait() doesn’t work, it’s probably due to exception that wasn’t caught. Catch it.

  • How do I compute sha256 for arbitrary python data

    Computing sha256 for python data is useful as ID or as filename. See this test.

  • LLM의 한계에 대하여

    LLM이 인간의 모든 지식을 담을 수 없다는 흥미로운 글을 읽었다. 인공지능이 인간의 지식을 다 표현할 수 있는가 아닌가는 상당히 오래된 주제이지만, 이 글의 열정적인 톤과 풍부한 사례는 무척 재미있었다. 예를들어 글에서는 performer (예를들어 피겨 스케이팅 선수) 의 perform 하는 기술은 글로 기술되지 않으며 글로 기술된다 하였다고 해도 그것이 그대로 그 퍼포먼스를 따라할 수 있단 이야기는…

  • Structural matching simplifies the code

    Well known structural matching in python would be match case. But there’s an other kind and it checks # of items, e.g., If foo() returns [1], it works fine. But if it returns either multiple items [1, 2, 3] or an empty list, it fails. This is pretty neat. I have been checking the length…

  • Better dict for configuration

    When I use dict as a config of deep learning algorithms, I often run multiple training runs, varying the config value. As a trivial example: And then I run multiple iterations varying the ‘lr’. When doing that, I feel worried about making mistake like updating the dict with wrong key, e.g., To address such concerns,…

  • 시간을 초월한 개발자에 대한 조언: 이름 짓기

    트위터에서 이런 글을 읽었다. 지나치게 표면적인 이야기처럼 들릴지 모르지만, 모두의 경험은 다르다. 서로 다른 제품을 만들었고, 다른 환경, 다른 사람들과 일해왔다. 관찰의 범위가 다르고 각자가 추구해온 목표도 다르다. 그러므로 조언은 … 어디까지나 개인적인 것이고 읽는 사람이 그것을 내 상황에 맞게 이해하는 것이 필요하다. 그렇다면 그 모두를 초월한 지혜는 없을까. 여기에 ‘이름 짓기’가 떠올랐다. 컴퓨터 과학에서…

  • Tuple is immutable in python

    I find this very interesting. These examples are from fluent python. Likewise… The reason of these behaviors are easier to understand if we take a look at the methods of tuple. Whenever += is called for tuple, say, a += b, what’s actually happening is a + b and then a = a + b.…

  • Forcing accessibility font size and dark theme on mobile chrome

    Chrome on Android has accessibility settings to override font size. But there are websites that the change doesn’t apply. Also, chrome doesn’t use dark theme even when system theme is using it. Enable these two flags at chrome://flags to fix them. Restarting Chrome, you’ll see new accessibility settings for fonts and new menu item on…

  • Use left option key as ALT for VIM on mac

    Use iterm2 and change the left option to ESC+ Once that done, left option will work as alt in the vim. But it will break your cursor movement in the shell, i.e., opt+left and opt+right won’t move cursor over words. To fix that, type in ‘cat’, type the key you want to bind, i.e., opt+left…