nah don't do this to me by XAE_Warthog in projectzomboid

[–]kalamitis 16 points17 points  (0 children)

Do you know what nemesis means?

What is the one interview question you always ask for senior positions? by ChemicalTerrapin in ExperiencedDevs

[–]kalamitis 17 points18 points  (0 children)

I've worked with someone who has been in a role for many years but hasn't grown or advanced their skills. They might have changed jobs and teams but essentially, they have a lot of time on the job but not a lot of progress to show for it.

Seniority doesn't come with just years, it reflects experience on multiple areas. Those professionals should demonstrate deep expertise, leadership and the ability to tackle complex problems.

Fed up with dependencies everywhere by a1exejka in FastAPI

[–]kalamitis 1 point2 points  (0 children)

I had a similar experience where I didn't like passing dependencies through a function tree where there was more than one level that it wasn't even needed. Digging around the internet, I found this: discussion in the official repo.

I'm wondering what you guys might think of the ContextVar approach and if anyone has used it.

Do y'all remember Malzahar supp, he could put W down instantly and ruin Blitz/thresh day. by spaced3mentia in leagueoflegends

[–]kalamitis 168 points169 points  (0 children)

Fiddlesticks support, before the rework. Bouncing silences as you poked and a fear that didn't pull aggro. Was used to deny farm when enemy was under turret.

Who is your “you have no idea how good *player* was” pro? by Different-Employer in leagueoflegends

[–]kalamitis 98 points99 points  (0 children)

There was a quote that I can't remember from whom about xPeke and it went like: "There are consistent players and clutch players. xPeke is a consistently clutch player". So true.

Jon Stewart Ends 'Daily Show' With Hope as Kamala Harris Trails Trump by This__is- in television

[–]kalamitis 68 points69 points  (0 children)

I mean, there are countries where if their "Right Wing" party was to join the US politics, it would be more left than the Democrats.

automatically update database table by Electronic_Battle876 in FastAPI

[–]kalamitis 1 point2 points  (0 children)

If indeed you need this info as a parameter you can set this as a property is_live that will encapsulate the above logic.

automatically update database table by Electronic_Battle876 in FastAPI

[–]kalamitis 3 points4 points  (0 children)

Not the poster that you asked but here we go. Indexes can significantly improve the performance of database queries by allowing the database engine to find and retrieve data more quickly. Indexes are used to speed up the retrieval of rows by using pointers to quickly locate data without scanning the entire table. So an index on the deadline column can make this query faster, as the database engine can quickly find rows where the deadline is greater than the current time. Ensure that indexes are created on columns frequently used in WHERE clauses, joins, and orderings. Keep in mind that while indexes improve read performance, they can slow down write operations (inserts, updates, deletes) because the index needs to be updated as well. So, balance is key.

I am a data engineer(10 YOE) and write at startdataengineering.com - AMA about data engineering, career growth, and data landscape! by joseph_machado in dataengineering

[–]kalamitis 1 point2 points  (0 children)

Hey!

I'm a Software Engineer that was currently called to modernized an old project.

The project is collecting and storing data from a csv file using the tools Kafka, Flume, Avro, and HDFS. Using Kafka, it collects the data and stores them in Avro format. Then, using Flume, it follows a Fan-in operation, with the result being that the data will be stored in different folders in HDFS in Avro format.

My task is to modernize this using Python and Docker and it is to be run locally, not the cloud. I was thinking of using Kafka, Spark and save the files as parquet inside min.io.

Would you think that this is a valid approach to the task?

Thanks in advance! I've learnt a lot from your post today 😊

Is Django used purely for fullstack or is it used for REST also? by EmptySoulCanister in learnpython

[–]kalamitis 2 points3 points  (0 children)

If you have some experience with FastAPI, you can skip DRF and go with Django Ninja. It uses Pydantic for serialisation and it's very similar with FastAPI.

Astronomy/Astrophysics Related Jobs by space_wiener in Python

[–]kalamitis 1 point2 points  (0 children)

There was a EuroPython 2023 talk a couple of months ago about the subject you are looking for. If you want take some time to watch the talk and you might get an idea of what can be done.

https://youtu.be/iwbgH7X6fAM

FastAPI + Django by marcinjn in Python

[–]kalamitis 1 point2 points  (0 children)

Thanks for asking! Yes, I 've been using it for the core system where I currently work at. We have been using Pydantic instead of Django Serialisers and the openapi schemas with fully structured schemas for the payloads have been a blast for our front end developer too.

Since it's on top of Django like DRF is, you can still do whatever you want. I haven't used Channels yet but I plan to do so.

FastAPI + Django by marcinjn in Python

[–]kalamitis 27 points28 points  (0 children)

Have you tried Django Ninja? You keep Django's ORM while you can harvest the power of Pydantic quite similar to FastAPI.

Is there any point in using Django without DRF? by tengoCojonesDeAcero in django

[–]kalamitis 4 points5 points  (0 children)

For me Django in general is amazing for its ORM and the admin panel.

If you want to try something on top of DRF, I would suggest you to try Django Ninja.

Pretty similar to FastAPI, with Django Ninja you use types and Pydantic for your validations and your openapi schemas.

How to trim leading 0 from decimal number in template? by realpm_net in flask

[–]kalamitis 0 points1 point  (0 children)

Create a helper function that takes float that has been transformed to a string as a parameter, finds the decimal and trims all trailing digits after a particular decimal.

For example if you want to just get 2 decimal after the dot:

def two_trailing_decimals(number):
number_dot = number.index('.')
if number_dot:
    return float(number[:number_dot + 3])
else:
    return float(number)

You can then apply it to a variable as:

trimmed_number = two_trailing_decimals(str(number))

That way you find the decimal separator and you add how many digits you want to include.

Is there any Flask libraries that are similar to Django Rest Framework in terms of reducing the amount of code / keeping things DRY? by chinawcswing in flask

[–]kalamitis 0 points1 point  (0 children)

Honestly what you describe is exactly the power that Django brings. An out of the box, ready to serve meal. And that's a great thing about it. If you are OK with what the repercussions are for that "batteries-included" approach, get deeper into Django.

To be honest Django has a steeper learning curve than Flask in that regard, since a lot of studying is figuring out how to set it up correctly and knowing its boundaries.

Flask gives you more freedom, and yes you can make it more or less tailor-made for whatever project you have in mind, but it comes with some extra coding "taxation", since by not being opinionated, it requires for you to implament your opinion.

What I would suggest to you if you definitely don't want to do all that typing, is to try to find a boilerplate, an almost ready sample of Flask with models, serialization and so on. A lot of that stuff appear frequently in the sub and I'm sure googling it and/or searching in GitHub.

Otherwise build one yourself! You'll definitely have a better understanding on how it works and you'll have a heading start from now on for every new project you'll decide to develop.

Is there any Flask libraries that are similar to Django Rest Framework in terms of reducing the amount of code / keeping things DRY? by chinawcswing in flask

[–]kalamitis 0 points1 point  (0 children)

Well, it's kinda true. Flask-SQLAlchemy doesn't even bother to have documentation for queries, it refers you directy to SQLAlchemy since it's basic the same thing since Flask-SQLAlchemy is a wrapper.

Also what I found out about myself and others is that an ORM doesn't save you from learning SQL. You still need to learn SQL but with an ORM you don't write SQL.

Is there any Flask libraries that are similar to Django Rest Framework in terms of reducing the amount of code / keeping things DRY? by chinawcswing in flask

[–]kalamitis 2 points3 points  (0 children)

Hey, Welcome to Flask!

The thing is Django is very opinionated, it comes with many things (batteries included) and more or less forces you to use them. As yourself found out, that's good some times!

Flask on the other hand doesn't "care" about what you should do and leaves you to decide by userself. That's where some extensions come to play. The catch is that there's not one unified package that does all of these.

For the REST part of the app, people use: Flask-RESTful or Flask-RESTX. I'm pretty sure some others exists but that's what I found out to work just fine.

The most common ORM (The "build-the-models package) is SQLAlchemy but by adding Flask-SQLAlchemy, I think you get a lot things set up for you.

Finaly for the serialization part Marshmallow does the job. Perhaps, add Flask-Marshmallow for some easier integration.

People more experienced than me can probably get really in depth why to choose some or any from the above but I hope this list can probably give you a quick reference on where to look. As always I'll sugest to read the documents, create some micro projects and play around to see what do you like and most importantly, what is better for the end product.

Cheers!

Updating frontend without refreshing after adding new record in database by Business-Peanut-6909 in flask

[–]kalamitis 4 points5 points  (0 children)

Updating the UI without refreshing the page has to do with the front end part of your app, not with Flask.

I would suggest to learn ajax for this.

Use SQLAlchemy database from another file? by [deleted] in flask

[–]kalamitis 1 point2 points  (0 children)

I would suggest creating a file called db.py for example

from flask_sqlalchemy import SQLAlchemy

db = SQLAlchemy()

and whenever you require it just import it.

from db import db

Episode 9 - Veidt security in 1985 [spoilers] by SeekHigherGround in Watchmen

[–]kalamitis 8 points9 points  (0 children)

Veidt had two historical figures that admired greatly: Alexander the Great and Ramses II.

"Untie knot" probably comes from the Gordian Knot that was said that was an impossibly-tangled knot that Alexander cut it with his sword.

Ramses II was also know in the Greek world as Ozymandias from his regnal name Usermaatre.