Se você veio de linguagens como JavaScript ou PHP, você pode ter um hábito de concatenar strings da seguinte forma:

nome = “matheus”
print(“olá “+nome+”, seja bem-vindo”)

Apesar de ser simples, o problema dessa abordagem está na forma como o Python lida com as strings. Por baixo dos panos, strings são objetos imutáveis, ou seja, são constantes que não podem ter o seu valor alterado. Quando uma string é modificada o interpretador não modifica o valor da string, e sim cria uma nova já com as alterações.

No CPython (interpretador mais utilizado) uma string é apenas um objeto na memória enquanto uma variável é um ponteiro que aponta para este objeto. Se várias string tem o mesmo conteúdo, elas sempre vão apontar para o mesmo objeto e, desta forma, economizar memória. …


This was originally posted on my blog drpexe.com. I moved it here because I didn’t want to spend money and time maintaining a VM with only a single WordPress blog installed. Written in July 23, 2011.

I wrote this post because it’s really hard to find detailed material about A* using navigation meshes (or navmesh). Additionally, most tutorials present either the grid-based algorithm or some vague reference to navmesh. My goal is to provide some clean, ready-to-use information which game programmers can use to enhance their pathfinding algorithms.

To understand the concept it’s mandatory that you feel comfortable with a grid-based A* algorithm. If you don’t fully understand A* please take your time to read this article for beginners. …


Until last year I had this idea that security is not a priority when developing software (website and apps included). I mean, I’m just a small developer and probably not a lot of people will ever use what I’m creating, so why bother with security?

After reading about the subject I could understand all the risks I was taking. My goal with this post is to show some facts and motivate you to change your mentality towards security.

Note: I’m using the name hacker loosely on this post. Every time you read hacker, I really meant black hat hacker.

You are a worthwhile target

Much of this disregard with security comes from the assumption that your software or website is so unpopular that hackers will never bother trying to find a vulnerability. Nothing could be further from the truth. …

About

Matheus Cansian

A developer hungry for new ideas

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store