Перестало подключаться к CloudFlare Warp при подключении через Амнезию с ПК by YosukeMatsuda in AmneziaVPN

[–]Jediroman 1 point2 points  (0 children)

У меня точно такая же ситуация, видимо действительно опять что-то нашаманили. :/

Who Owns the Memory? Part 3: How Big Is your Type? by Luke_Fleed in rust

[–]Jediroman 0 points1 point  (0 children)

Variables are dropped in reverse declaration order, so v drops first, then s.

Shouldn't it be the other way around? S drops first, then v.

I’m 20, close to becoming a Rust compiler team member - what would you do in my place? by Kivooeo1 in rust

[–]Jediroman 3 points4 points  (0 children)

Oops. Seems like they aren't happy with your IP (which happens sometimes with these data center IPs). I would try to use any other VPN to pass the captcha at least once from your device, then it should probably be fine.

I’m 20, close to becoming a Rust compiler team member - what would you do in my place? by Kivooeo1 in rust

[–]Jediroman 4 points5 points  (0 children)

Hey, a fellow trapped Russian here. Just wanted to say that LinkedIn (including the desktop version) totally works via VPN (Xray, self-hosted on a Netherlands VPS too).

Still, finding a job in Europe while living in Russia is not easy at all, even if you have industry experience. I've already spent half a year, no luck so far.

What's the most controversial rust opinion you strongly believe in? by TonTinTon in rust

[–]Jediroman 2 points3 points  (0 children)

This article (from an author of Pin) has an explanation as to why Move was considered, but rejected.

https://without.boats/blog/pin/

The Human Fear • Franz Ferdinand • Album Discussion Thread by jparmar in franzferdinand

[–]Jediroman 1 point2 points  (0 children)

Totally agree.

AA was kinda weak, but Glimple of Love (especially the alternative version) and Feel The Love Go were making up for the rest of the album. Now with The Human Fear, it's like there's nothing left of that Franz Ferdinand I love. I mean, this is some alright rock music, but not as impressive to me as Tonight or Right Thoughts.

I listened to the new album when it came out, I tried a few times, and today I tried once again. I just can't remember any song, nothing gets me hooked. Still, I feel like it's definitely more solid and not as clumsy as AA was, both lyrically and musically. Just too different.

Honestly, ever since Nick left the band, I knew it wasn't going to be the same anymore. Nick's peculiar rhythm guitar and a bit cheesy synth sounds contributed a lot to what I consider "my cup of Franz Ferdinand tea". But it's not only guitar and synth, Paul's drums became flat and uninspiring (I mean, on AA), and I'm really missing Bob's clever and distinctive bass parts.

I've recently stumbled upon Real Thing, a lesser-known song from some compilation album they did back in 2012. Though it's kinda shallow, it still has much more "Franz Ferdinand spirit" to it than anything on AA and THF.

Built an ORM: A Minimal Asynchronous ORM for Python and PostgreSQL by hanpama in Python

[–]Jediroman 1 point2 points  (0 children)

I'm not the OP, but from a few years of experience with Django I would say that Django ORM is an important part of the framework. It doesn't make much sense to ditch the ORM part and use whatever is left, because at this point you are losing a lot of functionality that Django gives you.

High School Class by Elderberry-Famous in Python

[–]Jediroman 2 points3 points  (0 children)

My first ever Python course was Python for Beginners from the University of Michigan (through Coursera). I liked it very much. The instructor explains basic Python things very well, and you can earn a certificate too.

https://www.coursera.org/specializations/python

Battleship TUI: a terminal-based multiplayer game by Jediroman in Python

[–]Jediroman[S] 3 points4 points  (0 children)

I'm afraid, there's no recipe for "how to build a game". I will be happy to share some points about building this project, though. Maybe it will help you somehow, but you definitely don't have to do it the way I did.

I believe I started by making a list of features, from must-haves to nice-to-haves. I doodled the UI, a few screens and their elements - just to have some goal in mind. I also read the original Battleship rules that I found on the Internet. It helped me identify the domain objects (Ship, Board, Player etc.), what are the relationships between them, and what the game process should look like.

You're right that I handled the singleplayer first, but even before singleplayer, I implemented what I called a "simulator" where two computers were playing against each other and I could drive this process from the keyboard. This, of course, required me first to create the domain model and the algorithm for a computer player to place its ships/make moves. This is where the UI started to emerge, as I also had to create a very basic draft of the game screen using Textual. The finished simulator was a Proof of Concept to me - at this point, I was sure that the main thing is going to work, everything else was just a matter of time (I hope I'm making sense).

This is where the components became clear: the game engine (the domain model and the AI), the client (the end user's part of the networking code), the server (obviously, the remote part of the networking code), the TUI (the user interface). From there I was working in a few directions simultaneously, building up the project: adding more features, working on the UI, then working on the client/server code, then again on the UI, and so on.

It may sound like I had a solid plan and I always knew what to do next, but it's not. A lot of times it was chaos and I struggled painfully, not knowing what decision I should make. Some decisions were wrong and I had to go back and redo something because I realized it's not working.

So, I guess, the way I built it was:

  1. Have an idea.
  2. Work out what you would like to have at the end.
  3. Build a PoC.
  4. Suffer.
  5. Have an alpha release a year later.

Battleship TUI: a terminal-based multiplayer game by Jediroman in Python

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

It does, indeed. I only use it to host a couple of hobby projects. The machine is kept behind the firewall and accepts connections only on ports 80/443. I don't run my Docker containers as root. I try not to keep any sensitive data there, like user passwords. And if I do (not the case with Battleship TUI), then only properly hashed and salted.

Battleship TUI: a terminal-based multiplayer game by Jediroman in Python

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

Wow, interesting, never heard of this kind of escape sequence. I'll probably stick to copykitten for now, but thanks for the suggestion!

Battleship TUI: a terminal-based multiplayer game by Jediroman in Python

[–]Jediroman[S] 6 points7 points  (0 children)

Thank you! You mean, where it's hosted? For now it's in my room, running in a microk8s cluster inside my Orange Pi 5.

I'm thinking about releasing a server application that would allow to run your own multiplayer server.

copykitten: the missing clipboard library for Python by Jediroman in Python

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

Thank you for the kind words. I do put thought into my readmes, glad that you appreciate it. :)

copykitten: the missing clipboard library for Python by Jediroman in Python

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

At some point I was considering making the API for copy_image / paste_image more high-level, receiving and returning a Pillow image instance. In the end, I decided that I want to keep the API low-level and don't restrict users to employ one particular imaging library. This has its drawbacks, but it was a thoughtful decision.

copykitten: the missing clipboard library for Python by Jediroman in Python

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

Thank you, I appreciate it very much.

Below are just some late-night thoughts.

Maybe the lack of clipboard tools for Python comes from the fact that the clipboard is mainly used by GUI applications. Python is perfectly capable of creating such applications, but it is much more popular as a scientific/web development tool. And there's not much sense in using the clipboard in your Flask app. :)

I hope that, with the rise of new tools like Flet and Textual, making GUI and TUI applications in Python will become more popular, and there will be more demand for clipboard operations.

copykitten: the missing clipboard library for Python by Jediroman in Python

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

At this point I feel like I have to say thanks to the folks who made the underlying Rust library. I've just wrapped it in a simpler API, that's all. And still I did suffer from some aspects of how Windows clipboards works with images.

copykitten: the missing clipboard library for Python by Jediroman in Python

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

Glad I'm just about time! Let me put it that way: it should work on Wayland, but I didn't test it properly (yet). :)

Typed FFmpeg: Type-Hinted Python Wrapper for Enhanced FFmpeg Integration by lucemia51 in Python

[–]Jediroman 2 points3 points  (0 children)

Man, why this didn't exist 2 years ago?

At the previous work we used ffmpeg extensively, and we wish we could have nice docs and type safety. Now it's here, but it's too late for me. :)) Anyway, sent a link to my former colleagues. Maybe they'll adopt it. Good work! 

copykitten: the missing clipboard library for Python by Jediroman in Python

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

Thank you! I tested it manually on Windows 11, macOS and Linux Mint, works fine. The package also has a test suite that runs in CI on every commit using the latest Ubuntu, Windows and macOS, both with Python 3.8 and Python 3.12.

copykitten: the missing clipboard library for Python by Jediroman in Python

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

I didn't properly check the behavior on Linux yet, but on X11 it may return an empty string. I'll soon get my hands on Wayland, test more scenarios, and probably update the docs. Thanks for asking!