<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vandy in the Vandyverse</title>
    <description>The latest articles on DEV Community by Vandy in the Vandyverse (@argentinomota).</description>
    <link>https://dev.to/argentinomota</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F238577%2F56dd5065-0134-45b8-a3a8-45fbc6b08c09.png</url>
      <title>DEV Community: Vandy in the Vandyverse</title>
      <link>https://dev.to/argentinomota</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/argentinomota"/>
    <language>en</language>
    <item>
      <title>Como se tornar um Dev influencer com o mínimo de esforço</title>
      <dc:creator>Vandy in the Vandyverse</dc:creator>
      <pubDate>Thu, 11 Feb 2021 17:44:23 +0000</pubDate>
      <link>https://dev.to/argentinomota/como-se-tornar-um-dev-influencer-com-o-minimo-de-esforco-1jam</link>
      <guid>https://dev.to/argentinomota/como-se-tornar-um-dev-influencer-com-o-minimo-de-esforco-1jam</guid>
      <description>&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Poste polêmicas no twitter periodicamente. Engajamento é o que você precisa.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Atenha-se a assuntos simples e rasos. Assim você vira uma figura de autoridade para iniciantes e fica longe do radar dos profissionais mais experientes, minimizando o risco de ser corrigido, e por fim mostrar que você não sabe tudo. Por exemplo, fale sobre novidades de tecnologias, afinal é basicamente ler o changelog&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Regurgite discursos prontos de autoridades da nossa área como verdades absolutas, ao invés de guidelines que devem levar o contexto em consideração. Assim você supre a necessidade da maioria pela resposta fácil, afinal, pensar dá muito trabalho e tá todo mundo ocupado. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Siga a moda e fale que o jeito famoso é o jeito certo, independente da situação. Monolito? ERRADO! Tem que botar microsserviços em tudo! Tua aplicação de 10 usuários precisa de NoSQL pra escalar!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Vincule sua marca pessoal a uma tecnologia, mas esteja pronto para pular pra próxima silenciosamente. Ao fazer a mudança, pareça que você já sabia tudo há tempos. Ninguém se interessa por quem está aprendendo, e sim por quem já sabe. Não se esqueça disso.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pratique gatekeeping, utilizando qualquer critério arbitrário no qual você se inclua na parte privilegiada. Ex: “Quem não usa VIM nem programador é” - Assim cria-se um grupo no qual você faz parte, botando todo o resto pra baixo. Se der sorte, ainda arruma uma galera para te proteger dos seus detratores.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use toda sua pompa e escreva sobre outros assuntos, afinal, todos sabemos que o desenvolvedor é capaz de falar com autoridade sobre qualquer tema, pois somos mais inteligentes que o resto do mundo. De política à saúde pública, nada escapa de seu intelecto implacável.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Abuse do viés do sobrevivente: Se funcionou pra você, funciona para todos.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Nunca fique tempo suficiente num emprego para lidar com as partes ruins de suas decisões, pois você só quer caso de sucesso para contar.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Fale mal do trabalho alheio, é o caminho mais fácil para você parecer fodão, além de botar medo em quem quiser te contrariar&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Coloque tudo o que você faz ou fez na sua descrição em redes sociais, mesmo que você seja um bosta na maioria. Vale tudo, hobbies, trabalho, etc. Ex: "Esgrimista, CEO, Programador, Cozinheiro, Campeão regional de dominó" &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>Interviewing the interviewer</title>
      <dc:creator>Vandy in the Vandyverse</dc:creator>
      <pubDate>Fri, 16 Oct 2020 14:14:45 +0000</pubDate>
      <link>https://dev.to/argentinomota/interviewing-the-interviewer-2fmb</link>
      <guid>https://dev.to/argentinomota/interviewing-the-interviewer-2fmb</guid>
      <description>&lt;p&gt;The interview is not only getting asked to invert a binary tree for working on a Rails shop or designing a microservice architecture with Kafka to solve the business imaginary scaling challenges. It is also an opportunity for you to understand little bit about the company and people you'll work with.&lt;/p&gt;

&lt;p&gt;This is a compilation of questions and what you might learn from them when interviewing for a job. Consider this a list of suggestions to use as a foundation to write your own.&lt;/p&gt;

&lt;h2&gt;
  
  
  Team and company structure questions
&lt;/h2&gt;

&lt;p&gt;Here you check how different parts and teams connect to each other and how your team fits in the big picture.&lt;/p&gt;

&lt;h3&gt;
  
  
  What's the team structure? Who I'll report to?
&lt;/h3&gt;

&lt;p&gt;This is to learn how the company works. Here you can learn if the hierarchy is explicit or implicit, the later also known as "Oh, we don't have a hierarchy here".&lt;/p&gt;

&lt;h3&gt;
  
  
  How's the onboarding process looks like and what are the expectations?
&lt;/h3&gt;

&lt;p&gt;Once you start on the job, if you're going to receive help fitting into your role and in how much time the company expects you to be productive. Here you can check how much support will be provided for new employees.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is the turnover? How many people left the team?
&lt;/h3&gt;

&lt;p&gt;If a considerable amount of people left the team, it can be one or more of the following, though not restricted to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Toxic environment&lt;/li&gt;
&lt;li&gt;Team is not a priority&lt;/li&gt;
&lt;li&gt;Job is not interesting&lt;/li&gt;
&lt;li&gt;Mismanagement&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Did you have a conflict within the company? How it was handled? Someone was fired?
&lt;/h3&gt;

&lt;p&gt;If yes, ask them to tell the story. You can learn a bunch of stuff here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How management deals with a**holes&lt;/li&gt;
&lt;li&gt;How conflict resolution works there&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What is the journey the code takes from my machine to production?
&lt;/h3&gt;

&lt;p&gt;Code reviews, trunk based development, CI/CD...? This is where we check some indicatives about the quality and real development processes&lt;/p&gt;

&lt;h2&gt;
  
  
  Career
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How's the career ladder?
&lt;/h3&gt;

&lt;p&gt;Can you advance your career inside the company without having to go into management roles? Usually larger companies have this well defined.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do you have training/books/conference budget?
&lt;/h3&gt;

&lt;p&gt;Do they invest in their workforce?&lt;/p&gt;

&lt;h3&gt;
  
  
  Can developers contribute to open source tools you use?
&lt;/h3&gt;

&lt;p&gt;Perhaps not only the company gives back to community, but it is also invests on technology it depends on. &lt;/p&gt;

&lt;h2&gt;
  
  
  Business
&lt;/h2&gt;

&lt;p&gt;Most of people are very fond of getting paid for their work. That said, it is important to know where the money comes from and goes to.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is the churn rate?
&lt;/h3&gt;

&lt;p&gt;How many users/clients you lose every year/month? You might ask this both about the company in general or your specific team, in case it is a multiple product company.&lt;/p&gt;

&lt;h3&gt;
  
  
  How many new users? Is it a net positive?
&lt;/h3&gt;

&lt;p&gt;Customers always come and go, but if there is no net positive, business might be struggling.&lt;/p&gt;

&lt;h3&gt;
  
  
  How were you affected by corona virus?
&lt;/h3&gt;

&lt;p&gt;In some countries (like Germany) you have a trial period where is surprisingly easy to fire people during it. When the first wave hit, guess who was fired to cut costs?&lt;/p&gt;

&lt;h3&gt;
  
  
  Did the company achieve break even? If not, what is the projection? If yes, what's the profit in % ?
&lt;/h3&gt;

&lt;p&gt;"Break even" is the term for: "revenue &amp;gt;= costs"&lt;br&gt;
This is one of my personal favourites, and I've seen founders get uncomfortable with this one.&lt;/p&gt;

&lt;h3&gt;
  
  
  Given you keep your current revenue + funding, how long can the company continue its operations?
&lt;/h3&gt;

&lt;p&gt;This is a important one for startups that didn't achieve break even.&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing thoughts
&lt;/h2&gt;

&lt;p&gt;There are a lot more questions you can ask. Remember, use your own judgment to pick the time and the person you'll ask each one. I've seen some of these questions leaving a few interviewers uncomfortable(though they shouldn't).&lt;br&gt;
I believe some of these questions balance the power dynamics of the interview process between both parties and some interviewers don't like that.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Creating a queue system using only Python 3</title>
      <dc:creator>Vandy in the Vandyverse</dc:creator>
      <pubDate>Sun, 29 Sep 2019 09:37:44 +0000</pubDate>
      <link>https://dev.to/argentinomota/creating-a-queue-system-using-only-python-3-4akf</link>
      <guid>https://dev.to/argentinomota/creating-a-queue-system-using-only-python-3-4akf</guid>
      <description>&lt;p&gt;I was looking for some practice, but wasn't feeling like solving coding challenges. I wanted instead to build something and learn/remember stuff on my way, on a experimental fashion.&lt;br&gt;
How can one do such thing, you may ask. What about picking something from your daily work and put an extreme constraint on it? &lt;br&gt;
That said I came up with the task: &lt;strong&gt;“We need a queue, but nothing beyond python and files is allowed. Also, no third party libraries"&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Disclaimer: This is meant as an exercise. The code here is by no means production-ready or close to it.&lt;/p&gt;
&lt;h3&gt;
  
  
  Move your big toe
&lt;/h3&gt;

&lt;p&gt;The problem and constraints are set. But now, what is the first step? After being stuck for a while, I came up with it: "Persist the messages in a binary file, taking care to compress them"&lt;/p&gt;
&lt;h4&gt;
  
  
  First version and the problem of atomic writes
&lt;/h4&gt;

&lt;p&gt;How it works: We reserve the first 50 bytes on the beginning for the indexes. They're responsible for keeping track of what messages were already consumed and which are next on line.&lt;/p&gt;

&lt;p&gt;At the same time, we're avoiding filling up the whole memory by reading the file in &lt;em&gt;chunks&lt;/em&gt;&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
 

&lt;p&gt;Every time we call &lt;em&gt;self.q.write&lt;/em&gt;, we’re writing data to the python’s internal buffer, without really writing the file, avoiding system calls that could make operations slow.&lt;/p&gt;

&lt;p&gt;So, in order to really write the file in the disk, we call flush(), right? Well, more or less. The flush method copies the file internal buffer (which is 8192 bytes by the way, but it can use the file preferred block size when defined) to the operating system file buffer, what even so, does not guarantee that the data will be written to the disk.&lt;/p&gt;

&lt;p&gt;That said, to really write the file in the disk, we call &lt;em&gt;flush()&lt;/em&gt;, right? Well, more or less. The flush method copies the file internal buffer (which is &lt;a href="https://gist.github.com/vandersonmota/e44455bba570124ca82386e1eabf1959"&gt;8192 bytes&lt;/a&gt; by default, but it can be &lt;a href="https://docs.python.org/3.6/library/os.html#os.stat_result.st_blksize"&gt;changed&lt;/a&gt;) to the operating system file buffer, what even so, &lt;strong&gt;does not guarantee the data will be written to the disk&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The function call &lt;em&gt;os.fsync()&lt;/em&gt; at line 82, writes all the buffers from a file on the disk. If you want to know a little bit more about it, see the module &lt;a href="https://docs.python.org/3.6/library/os.html#os.fsync"&gt;docs&lt;/a&gt; and the system call &lt;a href="http://man7.org/linux/man-pages/man2/fsync.2.html"&gt;docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Yet, this approach has a few problems. In case of system failure (like a power outage) we might have an incomplete file write and/or index update. This happens because there is no &lt;em&gt;atomicity&lt;/em&gt; in the operations (more on this later). Also, we're not deleting the consumed messages, bloating the file during usage. Finally, the file is not being locked for exclusive access by an instance of &lt;em&gt;Queue&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/2333872/atomic-writing-to-file-with-python/2333979#2333979"&gt;This answer&lt;/a&gt; on StackOverflow says atomicity can be achieved by making a copy of the file, writing on it and then replacing the original. Being this also the common approach, because according to the &lt;a href="https://en.wikipedia.org/wiki/POSIX"&gt;POSIX standard&lt;/a&gt;, renaming a file is an atomic operation. Click &lt;a href="http://man7.org/linux/man-pages/man2/rename.2.html"&gt;here&lt;/a&gt; if you want to know more about it.&lt;/p&gt;

&lt;p&gt;Seems great, but also quite costly approach for big files. Thus, we can keep a separate index file, with the position of the last successfully written bytes. Since this will be a tiny file, perhaps might not even need to use the rename operation?&lt;/p&gt;
&lt;h3&gt;
  
  
  File systems, blocks and sectors
&lt;/h3&gt;

&lt;p&gt;File systems usually store data in blocks of &lt;em&gt;4096 bytes&lt;/em&gt;. This means that even if you create a file having 200 bytes of size, it will fit inside of a &lt;em&gt;4096 bytes&lt;/em&gt; block. &lt;br&gt;
Blocks are an abstraction of the disk sectors, where each one of them has &lt;em&gt;512 bytes&lt;/em&gt; usually. So, a block can span many sectors, and a sector may be part of more than one block. According to an interview with &lt;a href="http://olstrans.sourceforge.net/release/OLS2000-ext3/OLS2000-ext3.html"&gt;Dr. Stephen Twiddle&lt;/a&gt;, even in a power outage scenario, disks have energy to finish writing a sector:&lt;/p&gt;

&lt;p&gt;“If you start a write operation to a disk, then even if the power fails in the middle of that sector write, the disk has enough power available, and it can actually steal power from the rotational energy of the spindle; it has enough power to complete the write of the sector that's being written right now. In all cases, the disks make that guarantee.”&lt;/p&gt;

&lt;p&gt;So, even fitting our index in a single disk sector, we’re only writing in blocks. That said, we cannot guarantee that the whole block will be written in a case of a system failure.&lt;/p&gt;
&lt;h3&gt;
  
  
  Solving Atomic writes
&lt;/h3&gt;

&lt;p&gt;Well, looks like using &lt;em&gt;rename()&lt;/em&gt; is the way to go. The index file is small, so copying -&amp;gt; renaming won’t be as costly. Let’s see the code.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;We can notice some changes here. Now we keep an index file, where the &lt;em&gt;os.rename()&lt;/em&gt; operation (line 107). Also it is worth to remember o.rename uses the system call rename, which we said before it is atomic. That said, it is nice to have this as a transaction commit point.&lt;/p&gt;

&lt;p&gt;Another nice thing, this change makes the queue more robust, since it not only points to the next message to be consumed, but also to the last successfully written byte. This means if a write wasn't finished, the index will continue to point to valid positions in the file, so we’ll always have a contiguous block of messages.&lt;/p&gt;

&lt;p&gt;More safety has its price. The chart below show operations per second:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wQoUarWR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.ibb.co/8rcBkCD/filaspy3-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wQoUarWR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.ibb.co/8rcBkCD/filaspy3-1.png" alt="ops per second"&gt;&lt;/a&gt;&lt;/p&gt;
 Enqueue / dequeue 



&lt;p&gt;Since dequeuing updates only the index file, it allows more operations per second. So, how can we improve that? Perhaps avoiding a file write per operation might help. Let’s see bellow.&lt;/p&gt;

&lt;h4&gt;
  
  
  Buffers
&lt;/h4&gt;

&lt;p&gt;A buffer is a region in memory where we store data for reads and writes. Remember the Youtube gray bar when you’re watching a video? That’s one of the many applications of a buffer. Unlike a cache, the data will not be available once consumed.&lt;/p&gt;

&lt;p&gt;Here we need two buffers. One will perform reads (consuming messages) and other for writes (adding messages). Also, the messages inside the write buffer should be accessible, in case they’re requested before being persisted in the file. Let’s see the code:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;This is not a functional implementation. That's because it’ll only update the files once the buffers get filled, meaning we’ll lose some messages if a system error happens in-between. But, it serves as demonstration of how much performance we can have if we avoid writing a file constantly. Let’s see:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TOudmWYD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.ibb.co/CvD2QqH/filaspy3-2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TOudmWYD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.ibb.co/CvD2QqH/filaspy3-2.png" alt="performance with buffers"&gt;&lt;/a&gt;&lt;/p&gt;
 Enqueue/Dequeue 



&lt;p&gt;This is a huge performance gain compared with the previous versions. However we end up with some reliability risks. There are strategies to mitigate this problem, making this queue both reliable and fast, but implementing them has enough topics to write a book!&lt;/p&gt;

&lt;h3&gt;
  
  
  Problems, Improvements that I'll never make and final thoughts
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;This was written as a Python library, but it should run as a service, accepting connections via socket.&lt;/li&gt;
&lt;li&gt;Implementing async IO might improve performance, but the code would be much more complex, since the messages order should be guaranteed. The most popular approach on that is via Thread pools, and if you want to know more, see &lt;a href="https://github.com/Tinche/aiofiles"&gt;this project&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Messages consumed are not erased, causing a file bloat. Perhaps something in the lines of &lt;a href="https://www.postgresql.org/docs/9.1/sql-vacuum.html"&gt;PostgreSQL's vacuum&lt;/a&gt; might be a solution?&lt;/li&gt;
&lt;li&gt;Buffers are flushed to the disk only when they reach a limit, instead of also having a delay to do so.&lt;/li&gt;
&lt;li&gt;We don’t have a message size limit, which can cause us some troubles.&lt;/li&gt;
&lt;li&gt;The queue files are not being locked for usage, meaning we may have two processes using the same queue at a time. Causing all the types of trouble (corrupted reads and writes, for instance)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tackling this problem was a lot of fun, even without ending up with a production ready solution. However, it can be a very fun and educational experience to try to reinvent things we use in our everyday work. Hope you had fun reading this and get some ideas of your own to make your own experiments.&lt;/p&gt;

</description>
      <category>python</category>
    </item>
  </channel>
</rss>
