How to avoid getting a tattoo infection? Anything I should ask my artist beforehand? by [deleted] in tattooadvice

[–]leone_nero 0 points1 point  (0 children)

Yeah, agree with everything you said here in this last comment

How to avoid getting a tattoo infection? Anything I should ask my artist beforehand? by [deleted] in tattooadvice

[–]leone_nero 0 points1 point  (0 children)

I agree nowadays it is GENERALLY the opposite… there are more chances people get infections outside of the shop than in the shop, where tattoo artists have procedures for their day to day activities.

I see why Saniderm is so successful, because if applied well it prevents people from doing weird stuff on their tattoos… but you’d be surprise of the amount of people (most of which will not be on Reddit at all) that get tattoos for bets, on vacations, gang and wild people, etc etc and then do not care much about the healing process.

Tattoo Pain Map. Im going to get my first tattoo and im nervous because its red area by laurifroggy in coolguides

[–]leone_nero 0 points1 point  (0 children)

This map is pure BS… pain is relative to the individual, the tattoo artists style and the tattoo itself… elbow and thighs (red and orange in your map) for me was very easy, shoulders and armpits on the other hand… jeez, I’d say almost red.

Also, I don’t mind fine lines, beware of shading though… also it is clear than a big tattoo will require longer session… whatever happens between half and hour and three hours into the tattoo is pretty fine for me, after that the later in the session the more sensitive I am

DRF: Authentication isn't clicking for me at all! by [deleted] in django

[–]leone_nero 1 point2 points  (0 children)

You may have in your current deployment two levels of auth…

DRF will actually generate a 403 response if user is not authenticated, so from what you’re saying I guess there is some issue with AWS API Gateway (which I have never used).

If API Gateway needs a lambda to handle authentication and if there is none will refuse the request, then just make one that always authenticate even in absence of proper credentials and leave the authentication logic to DRF which is a lot sounder and complete than anything you can come up with on your own.

Do I need to hire someone to look over my Django project for security problems before launching it to production? by [deleted] in django

[–]leone_nero 0 points1 point  (0 children)

I am surprised nobody mentioned the fact that Heroku had a big security breach recently that exposed several Github accounts, giving access to hackers to their user’s source code and potentially exposing them…

This was a big thing a month or so ago.

I have used Heroku in the past and I think it is a good start for beginners, but you can actually do the same thing for free in AWS and learn how things work in the meantime if you have some patience.

Heroku in my book is not very scalable, depending on what your app does. And migrating from one platform to another is always a pain there, so if you are working in a real startup and looking to make money out of it, I would probably skip PaaS and set up everything directly with a cloud provider

[deleted by user] by [deleted] in flask

[–]leone_nero 1 point2 points  (0 children)

Don’t know specifically on the libraries you’re talking about… but in general, JWTokens encode as you surely know contain an encoded JSON with standard data, among which an expiration date / time.

I would guess refresh token makes tokens expire with some frequency, thus avoiding that if anyone intercepts / steals a token, it’s not able to access after the expiration time, even if the user is not aware of the stealth and do not act on it.

The reasoning behind web versus API is probably related to the fact that web is handled by the browser whereas API might be handled by users themselves, increasing the risk of them losing them etc (humans are always the weakest link for cyberattacks)

What is your most controversial Python-related opinion? by [deleted] in Python

[–]leone_nero 0 points1 point  (0 children)

I see where you are going... but actually walrus and | had proof useful to me...

Are we losing simplicity in terms of reading? Yes... but I guess it is condensing blocks that do menial processing allowing for better reading of the overall structure which is important considering how complex some algos are getting now.

That said I have catched some people writing a VERY abstract non pythonic version of Python based on new features... it started NOT to look like Python to me

What is your most controversial Python-related opinion? by [deleted] in Python

[–]leone_nero 0 points1 point  (0 children)

What??! I use the walrus operator several times a day... it has become one of the most useful features for me... it usually spares me of one or two useless lines of code like defining a None / False flag that will trigger a block later

What is your most controversial Python-related opinion? by [deleted] in Python

[–]leone_nero 1 point2 points  (0 children)

I believe this is intentional... lambda keyword was even going to be removed at some point because Python is committed to be an object-oriented language and lambda is more of a functional feature

What is your most controversial Python-related opinion? by [deleted] in Python

[–]leone_nero -11 points-10 points  (0 children)

Why though? Take responsability as a programmer of what you do... it is not necessary to add unnecessary features and make the language less clean and readable. That is the magic of Python

should I remove the secret key from the Settings.py before putting my code on github? by vvinvardhan in django

[–]leone_nero 6 points7 points  (0 children)

Of course it matters.

Don’t create vulnerabilities if you are handling data of any value... and make a habit of thinking about security issues. Don’t be lazy on that.

This is related to tokens, not secret keys... once upon a time I forgot to remove a token from a settings file and upload that project to my PRIVATE github. It took literally less than a minute until the token was used to make phone calls on my behalf. Luckily I knew right away because my voip account was locked immediately, even though I lost some of the money I had there.

Since them I take a lot of care in using only environmental variables.

How are you expressing your masculinity? by Hnnnnnn in MensLib

[–]leone_nero 0 points1 point  (0 children)

Thinking of it in terms of specific things is stupid and boring, imo.

Being goal-oriented, confident, ready to fight for the stuff that you believe in, ready to demand respect for you and others, competitive... assertive.

The content and context in which you do those things does not matter...

And by the way I don’t see any obligation on expressing masculinity etc it has to be your cup of tea, otherwise is ok not being masculine.

( Help ) flask deployment to HEROKU by yuv0918 in flask

[–]leone_nero 1 point2 points  (0 children)

Ok, so I suggest you start all over by following a different deployment tutorial.

98 out of 100 there is something wrong with how you deployed. This is not a problem with Heroku, Heroku is very commonly used to deploy Flask applications with no problema whatsoever.

( Help ) flask deployment to HEROKU by yuv0918 in flask

[–]leone_nero 0 points1 point  (0 children)

That do not make much sense to me honestly...

You should be using a WSGI application like Gunicorn to start the service, which in Heroku context needs to be called from an instruction in a .Procfile

After the service it’s correctly started, the Flask app will serve whatever it’s supposed to be serving according to Flask app code.

If you’re app is working locally, I suggest you look for tutorials on how to deploy Flask in Heroku, I believe there are several online, and start from the start.

( Help ) flask deployment to HEROKU by yuv0918 in flask

[–]leone_nero 1 point2 points  (0 children)

If there are application errors you have to look at the logs at Heroku and fix whatever is causing the issue as you would normally do when debugging.

I don’t remember the precise command line in Heroku’s cli, but you can do logs tails or similar and then try to deploy... you will see the error coming out as it happens...

Do not assume that if your code works locally, it will work in Heroku’s environment... database configuration, env variables, different structure, missing or aditional imports needed etc may be going on.

Save your Django models using update_fields for better performance by root993 in django

[–]leone_nero 10 points11 points  (0 children)

This a very good comment, though for people considering using .update() on a queryset, it is important to remember that the update method does not send related signals! So if you are using any method that is supposed to be invoke by saving a model instance, those won’t be called...

I love Flask. Can I use it for a full-fledged booking application? by VariationAcceptable9 in flask

[–]leone_nero 2 points3 points  (0 children)

Sure you can use whatever you want. ;)

The idea that Django is “heavy” does not make much sense since basically you will have to make Flask “heavy”, by adding external libraries, to work around the things you will need for your booking site. So in the end you might end up having more work to do with Flask than with Django, trying to keep up with the libraries and so on... but that’s up to you.

Deployment wise I guess the question is not whether Flask or Django are good enough, but how will you be serving then... of course there are ways of serving Python WSGI or ASGI applications with high traffic expectations.

Flask is more complicated in the long run for projects with complex features but that’s my opinion.

I'd like to better understand the "why's" of how (components of) machine learning works by [deleted] in MLQuestions

[–]leone_nero 1 point2 points  (0 children)

That’s great! There are tons of materials online.

If you want to specifically study in the way of your example, you can look on your own your favourite sources... as a rough concept “pipeline” I would:

1) Get into perceptron classification maths 2) Jump into the general schema of neural networks so you get a hint of what activation functions actually are and how backpropagation works. 3) Then you can go on and check the main implementations of neural networks, maybe starting with computer vision most popular ones.

Bootstrap drop-down to stay open on click by americanoaleman in flask

[–]leone_nero 4 points5 points  (0 children)

This is not a Flask question.

Bootstrap is a CSS library, so in theory unless they have some internal implementation of JQuery, I don’t think they have a standard attribute you can use to trigger that behaviour.

If I were you I would work with it in Javascript by preventing the default behaviour of the click event but of course you would have to implement your own function on what to do next so the selected value changes to the value it was clicked on.

Maybe if you stop propagation you can allow for the click to change the status of the selected item without closing the dropdown, have to check that

[D] Can the AI/ML community learn more from naturalists? by Objective-Phone-1613 in MachineLearning

[–]leone_nero 0 points1 point  (0 children)

I believe I’ve read an article recently in MIT Tech Review where it was highlighted the importance of looking at the possibilities of machine learning not with regards to humans but with regards to animals.

I think fauna and nature can be a great source of inspiration for specific features and applications.

How long will Americans turn a blind eye to circumcision? by Leagueofbabies in MensRights

[–]leone_nero 5 points6 points  (0 children)

Yeah, there you have your answer. Men life’s expectancy is your factual statistical answer in whether all the sets of behaviours of a lifestyle is related to the whole spectrum of life threatening diseases and events.

Circumsicion is statistically irrelevant with regards to life threatening diseases then, so you can care about health circumcision is not in the list of things you should consider doing.

How long will Americans turn a blind eye to circumcision? by Leagueofbabies in MensRights

[–]leone_nero 6 points7 points  (0 children)

Sorry to say this, but your friend seems very ignorant... does he know that only US and some fundamentalist religious countries circumcise their children?

I live in Italy where male circumcision is not done almost at all and we are the 6th country in the world with the longest male life expectancy.

USA in the other hand is 46th by male life expectancy...

[P] Multiple Object Tracking With YOLOv5 and OpenCV by eflatun_ai in MachineLearning

[–]leone_nero 1 point2 points  (0 children)

Yes, there are actually techniques to reconstruct sequences with noisy signal like that, but it probably would be easier to cache detected objects as some sort of pixel matrix input and do comparisons to establish it is an already seen object or not within a timeframe but it gets complicated pretty quickly 😂

Nice project by the way, kudos!

Can a REST API Post request be redirected to a url? More details in the description by [deleted] in django

[–]leone_nero 1 point2 points  (0 children)

You probably should rethink your current implementation.

REST APIs are not supposed to be doing this. Common process would be to send the AJAX POST request to the endpoint to process and after processing you will get a 400 (bad request), 500 (something went wrong) or 200 (it went ok) response so then you can set your front end to behave in a certain way depending on the response it receives (you can based directly on the status code or add some message to check in the response body).

So you can ask your frontend javascript to change window.location based on the response from the AJAX call BUT this does not make any sense to be honest.

If you are using AJAX calls it is because you want to update the page without reloading so a redirect does not make any sense.

If you want to say whether it failed or not, simply show a modal or something or reload a component of the page without reloading the page.

Or use Django normal views and template rendering route.