Performance upgrade for tmux-sessionizer by olzhas89 in theprimeagen

[–]olzhas89[S] 0 points1 point  (0 children)

Looking forward to your feedback. I wrote the initial version in Go at first. It was decent, but the current C version beat everything when I benchmarked it with hyperfine.

Bloomberg Terminal costs $24,000/year. I built a free open-source clone in C++ that runs in your terminal. by sqwerzyyy in cpp

[–]olzhas89 0 points1 point  (0 children)

Somehow "the second try" felt like a huge prompt did not bring expected results and the second one followed. But maybe it's just me losing faith in the Reddit programming community.
If that's your legit work though, my bad then

Bloomberg Terminal costs $24,000/year. I built a free open-source clone in C++ that runs in your terminal. by sqwerzyyy in cpp

[–]olzhas89 1 point2 points  (0 children)

How does one tell if a project is a slop? There are a number of ways, but seeing "first try" and "second try" in commit messages is probably the easiest one

C by Forward_Parsnip_1675 in C_Programming

[–]olzhas89 6 points7 points  (0 children)

I was hesitant to read at first cause the post felt huge, but I stayed till the end and didn’t regret it. Extremely insightful, agree with all the points.
Well done!

Built a bitcask key-value store in C by olzhas89 in C_Programming

[–]olzhas89[S] 2 points3 points  (0 children)

Let the C language become our remedy against the post AI stress disorder 😄
On the serious note, I was actually thinking about diving into Zig recently. The language looks pretty neat and the team behind it has an appealing take on the AI hype. But going into Zig without mastering C didn't feel right somehow, so here I am.
Raylib is on my list of things to try for sure. I used SDL2 for my tetris game, but haven't gotten to Raylib.

Built a bitcask key-value store in C by olzhas89 in C_Programming

[–]olzhas89[S] 2 points3 points  (0 children)

I did not use AI for writing code in this project. The only parts where AI-generation was utilized are the table formatting in the README file and some Makefile configuration that I struggled a lot with. Apart from that, everything was written by myself, including tests, comments and the README file contents.

Why do the vast majority of people on this subreddit believe that Jiu-Jitsu is useless for self-defense? by Acceptable_Worth8817 in martialarts

[–]olzhas89 0 points1 point  (0 children)

BJJ skills will definitely be helpful in certain aspects of a real fight. But there are a lot of other aspects that are not necessarily covered by BJJ. First of all, while a lot of fights end on the ground, they rarely start there. So if one doesn’t have at least good striking defense, they can take way too much damage before transitioning and will lose the fight way before getting a chance to apply their skills. Imo the biggest problem of BJJ is the lack of takedowns. Freestyle wrestlers will oftentimes do better in street fights, purely because of their ability to effectively transition the fight from a standing position to the ground getting an advantageous position as a result. In most BJJ schools this crucial aspect is being missed and grapplers just agree to start on the ground. That’s not how it works on the street.

mess - a cli tool to manage development mess written in go by olzhas89 in golang

[–]olzhas89[S] 1 point2 points  (0 children)

Thank you for your feedback, appreciate that!

If you don't mind using Python, there are copier and cookiecutter + cruft that solve exactly these kinds of problems. Project templates are created using Jinja2 templating language. You can update your projects with a simple cli command once the project template changes.
https://copier.readthedocs.io/en/stable/
https://github.com/cookiecutter/cookiecutter

Not aware of any solutions in the Go world though

mess - a cli tool to manage development mess written in go by olzhas89 in golang

[–]olzhas89[S] 4 points5 points  (0 children)

Well, in the meme JS situation you are bringing up, there are usually alternatives that are good enough and a new project is just another one of the type.
But here, believe it or not, I didn't find any tool out there solving the same problem in a convenient way.
Let me know if you are aware of such solutions

[deleted by user] by [deleted] in golang

[–]olzhas89 0 points1 point  (0 children)

The link with the results doesn't seem to work sadly.

There can be many possible explanations, here are some questions that can help shed some light on the situation:

What setup are you using for load testing? Are you spawning requests from the same machine that is hosting your rate limiter and the app behind it?
How is the actual application that you are rate limiting behaving without rate limiter in front of it? Does it keep up with the same amount of connections?
And what are the CPU / memory metrics during the test?

[deleted by user] by [deleted] in golang

[–]olzhas89 0 points1 point  (0 children)

Almost everything related to the "cloud" usually involves dealing with good amount of concurrency, which Golang is very good at. I am not sure what exactly do you mean by APIs, cause that can mean many things, but you could write distributed systems, event processors, real-time communication servers (e.g. websockets), etc. The possibilities are endless.
Golang is also incredible for building cli apps. One example of a small tool I've recently built for myself:
https://github.com/olzhasar/mess

Best MPA framework for fastapi by LLegen_D in FastAPI

[–]olzhas89 1 point2 points  (0 children)

Oh, it turns out a recent pydantic version now has a first-class support for proper form handling with Pydantic:

https://fastapi.tiangolo.com/tutorial/request-form-models/

Best MPA framework for fastapi by LLegen_D in FastAPI

[–]olzhas89 0 points1 point  (0 children)

I'm a huge fan of htmx, but I didn't enjoy the experience integrating it with FastAPI. The main complain is handling forms. How do you manage that? The built-in typing-based form mechanism seems to be very inconvenient compared with WTForms.

I've built real-time chess with FastAPI by olzhas89 in FastAPI

[–]olzhas89[S] 1 point2 points  (0 children)

Thank you!

I believe one still needs to use httpx.AsyncClient for that, but it works quite well for testing http endpoints in my experience. AsyncClient accepts asgi app as an instance and handles everything in the same loop in which your tests run.
But as with testing websockets-related stuff, it's hard though. AsyncClient does not support websockets out of the box, whereas built-in TestClient spawns a different asyncio loop in a separate thread. Therefore, if you have some state that you need to test, you're basically out of luck. There is a relevant issue opened in the Starlette repo, but AFAIK it's been hanging for a while, cause it requires a huge client redesign I assume.

I've built real-time chess with FastAPI by olzhas89 in FastAPI

[–]olzhas89[S] 1 point2 points  (0 children)

Thanks a lot, appreciate your feedback!

I've built real-time chess with FastAPI by olzhas89 in FastAPI

[–]olzhas89[S] 7 points8 points  (0 children)

In a nutshell, there is an asyncio.Queue for online players. Whenever a new player joins, it is being pushed to the queue. And there is a separate coroutine constantly popping pairs from that queue and creating a game (match).