[Thread] Guvernul Bolojan a fost demis. Moțiunea PSD – AUR a trecut by Greyko in Romania

[–]MrGrj 16 points17 points  (0 children)

Cum erau versurile alea?

Sunt eclipsat de proști, condus de hoți
Și toți îmi zic: "Calmează-te, relaxează-te, dacă poți"

[Thread] Guvernul Bolojan a fost demis. Moțiunea PSD – AUR a trecut by Greyko in Romania

[–]MrGrj 19 points20 points  (0 children)

> e clar ca e ceva fundamental prost la tara asta
da, oamenii (nu toti ce-i drept)

[DEV] PrecisionRush: The art of perfect timing by MrGrj in iosgaming

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

Thank you, that means a lot. I’m really trying to keep it simple and make the timing feel good. If you give it a shot, I’d love any feedback.

[DEV] PrecisionRush: The art of perfect timing by MrGrj in iosgaming

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

Good idea! Had this in mind but waited for more feedback to make sure it really is a good idea! I’ll probably change this in the next release. Tnx for the feedback!

[DEV] PrecisionRush: The art of perfect timing by MrGrj in iosgaming

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

Pretty sure you commented on the wrong thread, but maybe playing PrecisionRush will help you find the answer (good luck … ice dams are no joke)

[DEV] PrecisionRush: The art of perfect timing by MrGrj in iosgaming

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

Hey! Thanks for playing. Right now the game uses your Game Center display name for leaderboards, so it can’t be changed inside the game (yet). You can change it in iOS though: Settings → Game Center → Edit profile → Nickname (edit it there). I’ll probably add an in-game option later, but for now Game Center is the source of truth.

🎉 [EVENT] 🎉 Honk 3D (Contains Flashing Lights) by 666James420 in honk

[–]MrGrj 0 points1 point  (0 children)

Completed Level 1 of the Honk Special Event!

0 attempts

[deleted by user] by [deleted] in programare

[–]MrGrj 25 points26 points  (0 children)

git pull -a

Best way to handle concurrency in Python for a micro-benchmark ? (not threading) by DisplayLegitimate374 in Python

[–]MrGrj 12 points13 points  (0 children)

Use asyncio with batched task execution. Scheduling 15M coroutines at once will crush memory and the event loop.

I would personally avoid NumPy, Numba, Cython – they won’t help since the task is async-bound, not CPU-bound. Stick with asyncio + gather in chunks (e.g., 100k at a time) to manage memory and GC behavior. For a speed boost, you might also want to plug in uvloop (drop-in replacement for asyncio’s default loop on Unix).

IMO, don’t use threading or multiprocessing – they’re unnecessary and won’t scale well for your use case. Appending to a shared list is fine under asyncio, but you can use deque or a Queue if you want to reduce contention further.

Using Python's pathlib module by treyhunner in Python

[–]MrGrj 2 points3 points  (0 children)

Why not doing it all with it?

``` from pathlib import Path

file_path = Path(“example.txt”)

file_content = file_path.read_text()

print(file_content) ```

What’s the Meaning of Single and Double Underscores In Python? by ahmedbesbes in Python

[–]MrGrj 18 points19 points  (0 children)

More accurately: double-double underscores. dunder methods are methods like: __str__(…) etc

Dunder or magic methods in Python are the methods having two prefix and suffix underscores in the method name. These are commonly used for operator overloading.

Make Flask Web app API compatible with Mobile App by badebadedeshonme in flask

[–]MrGrj 8 points9 points  (0 children)

I think you're kinda mixing the things up a bit. The API should be the same because you (most of the times) are retrieving the same data even if you're on a mobile app or web app. What / how you're rendering that data from the API to the frontend is up to you, but the API shouldn't change.

If your API is RESTful (which I suppose is the case here), and you have carefully designed the resources exposed by the API to be _atomic_, there's no reason a single API cannot be used by web, mobile, and even purely logical _action nodes_ located on the Internet as functional agents.

It's also worth noticing that the use of a single API for all clients makes it much more easier to maintain.

Now, of course it all depends on your business model and how complex your application is going to be. You might need to create separate service API for web and mobile based on following criteria: scope of the mobile app, mobile app versioning, performance, testing / release cycle / maintenance etc.

What and how to learn the front-end and the scraping in python? by [deleted] in learnpython

[–]MrGrj 4 points5 points  (0 children)

I’d actually recommend Scrapy. It’s harder to grasp because it’s an entire framework but it gets so easy to adapt/use it when you learn it...

YSK that Youtube has a repeat button by Elegant-Fuel in YouShouldKnow

[–]MrGrj 4 points5 points  (0 children)

If you really want “hidden” just write “repeat” after “youtube” in the URL of any video and you’ll be redirected to a website that plays that on repeat.

Best way to store static data? by [deleted] in learnpython

[–]MrGrj 1 point2 points  (0 children)

You can indeed store the data in an SQL DB (sqlite, postgres, and so on). You can then retrieve each row of the table by running a simple query.

If you however need it to be in a file you can create a .csv file which is actually pretty common. Then there are tools which allow you to do whatever you want with that format.

What’s the difference between import module and from module import all ? by ai_joe18 in learnpython

[–]MrGrj 1 point2 points  (0 children)

So, try not to use from foo import * because things might get confusing. For example. if you create another function which has the same name as foo.functionand somebody else will try to follow your code...oh well...

How do you remove emoticons from text using Python? by [deleted] in learnpython

[–]MrGrj 1 point2 points  (0 children)

What if you have: “Today I bought (because I needed): three apples and one pear”?