Tag: software

  • Sort values in each row of polars df

    If your data size isn’t too big, here’s an easy solution. Let’s say you have this data: Use this function to sort values across chosen columns but within each row. As an example, if we sort across [“A”, “C”]:

  • How to suppress “Using categorical units to plot a list of strings that are all parsable as floats or dates.”

    If log level is set to INFO, “Using categorical units to plot a list of strings that are all parsable as floats or dates. If these strings should be plotted as numbers, cast to the appropriate data type before plotting.” may be observed when it’s not really relevant. Here’s how to suppress it.

  • 웹사이트 성능 최적화

    소프트웨어 품질의 끝은 결국 측정과 최적화라고 생각하고, 측정이 모든 접근의 시작이자 끝이라고 생각한다. 측정은 목표를 설정할 수 있게 하고, 그 과정에서 목표 자체에 의미가 있는지 따져보게 한다. 하지만 기술적 지식으로 무장한 엔지니어들은 측정을 먼저 시작하기보다는 해결 방법과 수단을 먼저 떠올리게 되고 그것부터 적용 해 놓고 보려고 한다. 대부분의 경우에 적용되는 훌륭한 룰들은 있어서 그게 항상…

  • Modern linux cli tools

    I personally use bat, fd, exa, rg, jq, fzf, sd. https://github.com/ibraheemdev/modern-unix?tab=readme-ov-file Not mentioned in the above but z is also an awesome tool.

  • OpenAI batch API python example

    OpenAI announced batch api which “returns completions within 24 hours for a 50% discount.” To test it, I wrote a trivial python example of the API. I didn’t test the response retrieval yet since my run will take 24h, but I expect it works fine, hopefully. Use jupyter notebook to persist the print output!

  • Mac shortcuts to move window to left/right side of screen

    Mac has Application shortcut and it can be used to select a menu using a keyboard. We can use that to move the windows. Here’s how I set it. It’s not super convenient as one needs to enter exact text like “Move Window to…”. Also, the application itself should have that exact menu name for…

  • shift+space로 한영 전환

    최근 맥 os 업데이트후 shift+space 한영전환이 막혔다. 해결 방법을 찾아 정리해둠. 카라비너를 설치한다. 권한을 주고 실행 후 Settings -> Complex Modification에서 다음 부분을 수정 이후 f18 로 shift+space가 맵핑이 된다. 맥의 settings -> keyboard shortcuts -> input methods에서 next source를 눌러 shift+space를 입력하면 f18이 입력되어 완성! 주의할 점은 karabiner는 어디까지나 키 입력을 받아 키 코드를…

  • Joblib Memory that expires after timelimit

    This doesn’t look well documented, but there’s an issue that trackes the problem a solution. I made it a bit simpler to use this way: And then you can use it like

  • poetry is great

    There are various tools for creating virtual env and I settled down with poetry. What’s great with poetry is that I can manage dependencies of development and serving. Dependencies of ‘dev’ can be specified using -G. For installing packages for serving, exclude a group as: Poetry creates pyproject.toml to list the packages I added. When…

  • How to add unittest to pre-commit

    I was looking for the predefined hooks but then learned that unittest can be easily written myself. What’s in the below runs all tests of the project. If you don’t use poetry, remove ‘poetry run’ from ‘entry’.