<?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>Forem: Diego Vallejo</title>
    <description>The latest articles on Forem by Diego Vallejo (@destructor1702).</description>
    <link>https://forem.com/destructor1702</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%2F54565%2F40c54cec-c127-4233-8082-d4d336c76495.png</url>
      <title>Forem: Diego Vallejo</title>
      <link>https://forem.com/destructor1702</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/destructor1702"/>
    <language>en</language>
    <item>
      <title>The Unspoken Truth: Diving into the Unwanted Secrets of the Tech World</title>
      <dc:creator>Diego Vallejo</dc:creator>
      <pubDate>Sat, 08 Jul 2023 08:17:16 +0000</pubDate>
      <link>https://forem.com/destructor1702/the-unspoken-truth-diving-into-the-unwanted-secrets-of-the-tech-world-4fag</link>
      <guid>https://forem.com/destructor1702/the-unspoken-truth-diving-into-the-unwanted-secrets-of-the-tech-world-4fag</guid>
      <description>&lt;p&gt;Hey Dev.to community! 👋 Before we dive into today's topic an how AYQ will help you a lot into your life, let me quickly bring you up to speed on what's been happening with our startup. We've implemented a 4-year VESTING model with a 1-year CLIFF, focusing on ensuring commitment from our team. As part of our efforts, we've been working hard to develop a robust API and have embraced CI/CD and DevOps practices to maximize efficiency.&lt;/p&gt;

&lt;p&gt;Our LLM (Large Language Model) has played a pivotal role in our company's growth. By identifying our TAM (Total Addressable Market), SAM (Serviceable Addressable Market), and SOM (Serviceable Obtainable Market), we've honed in on a specific business vertical. To deliver value quickly and effectively, we've adopted agile methodologies like Scrum, enabling us to meet customer expectations with each sprint.&lt;/p&gt;

&lt;p&gt;Increasing our visibility has been critical, and the diffusion model has proven to be essential. Our efforts have resulted in solid EBITDA and ARR, while our ATL (Above the Line) and BTL (Below the Line) strategies have successfully reached our target audience.&lt;/p&gt;

&lt;p&gt;But here's the thing we rarely talk about: how often do we actually question the meanings behind these acronyms?&lt;/p&gt;

&lt;p&gt;In our tech-filled world, we've become so accustomed to casually tossing around abbreviations that we assume everyone understands them. They've become linguistic shortcuts that we rely on for credibility and expertise. However, in reality, they often hinder effective communication and shared understanding.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--n83KJG6x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wwrd1ihm3n9s8p0lrs8o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n83KJG6x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wwrd1ihm3n9s8p0lrs8o.png" alt="yep" width="276" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Think about those meetings where you've nodded along, pretending to grasp the meaning behind a flurry of acronyms, while feeling lost and insecure. How many times have you refrained from asking for clarification, fearing that you'll expose your lack of knowledge?&lt;/p&gt;

&lt;p&gt;This unspoken agreement to keep quiet perpetuates a vicious cycle, giving the illusion of comprehension and reinforcing our psychological safety within professional circles. We nod, we smile, we play along, but deep down, doubt lingers.&lt;/p&gt;

&lt;p&gt;But what if we had the audacity to break this cycle? What if we had the courage to ask, "Wait a minute, could you please explain that acronym?" What if we embraced the vulnerability of not knowing and opened the door to genuine understanding?&lt;/p&gt;

&lt;p&gt;By challenging the assumption that everyone is on the same page, we can foster a culture of inclusivity, knowledge-sharing, and true expertise. Let's strive for clarity over complexity, for open dialogue over assumed understanding.&lt;/p&gt;

&lt;p&gt;As we embark on this journey together, let's remember that the true measure of expertise lies not in our ability to rattle off a laundry list of acronyms, but in our willingness to ask questions, seek understanding, and build bridges of knowledge.&lt;/p&gt;

&lt;p&gt;So, Dev.to community, let's break free from the acronym barrier and embrace a future where clarity prevails. Share your thoughts, experiences, and let's foster a culture of open communication, Ask Your Questions (AYQ) 💪💡&lt;/p&gt;

&lt;p&gt;Looking forward to your insights and discussions! Enjoy the ride! 🚀✨&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Dealing with depression as programmers</title>
      <dc:creator>Diego Vallejo</dc:creator>
      <pubDate>Mon, 23 Aug 2021 15:36:17 +0000</pubDate>
      <link>https://forem.com/destructor1702/dealing-with-depression-as-programmers-1f87</link>
      <guid>https://forem.com/destructor1702/dealing-with-depression-as-programmers-1f87</guid>
      <description>&lt;p&gt;Hello, I am a developer and I have suffered from depression for a few years now. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqh64vzl2ymeismevyjjf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqh64vzl2ymeismevyjjf.jpg" alt="begin"&gt;&lt;/a&gt;&lt;br&gt;
I have been reading a lot of posts on the internet about depression and burn out, and most of them focus on the symptoms of depression and how to deal with it, but I have yet to see one that talks about how it affects us as programmers.  This blog post is going to be about that. I will go through a few of the symptoms that I have experienced as a programmer, and I will share some thoughts about it.  &lt;/p&gt;

&lt;p&gt;I also want to say that I am not a doctor or a psychologist, and this is not a medical advice. I am just sharing what I have experienced with depression, so if you suffer from it and think that my suggestions could be harmful for you, then don't follow them.  I will also try to keep this blog post as objective as possible, but it will probably be hard since I am the one writing it. I will try to avoid using "I" as much as possible, and try to use "we" instead.  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;So, let's start.&lt;/em&gt;  &lt;/p&gt;

&lt;p&gt;Depression is often characterized by fatigue, lack of motivation or interest, changes in appetite and sleeping patterns, feelings of guilt or worthlessness, difficulty concentrating or thinking, feelings of being slowed down, and physical aches and pains.  &lt;/p&gt;

&lt;p&gt;A lot of these things are also common during a long hard period of work.  It is not uncommon for programmers to work for long periods of time without taking time away to rest, or even just to take a break. We are used to working hard for long periods of time, and we are aware of productivity diminishing with time, so we try to avoid the diminishing by working even harder.&lt;/p&gt;

&lt;p&gt;The problem with this is that we are not machines. We can't work at maximum capacity for months or years without taking time off.  When we finally stop working, we deserve some rest. But when you feel like you can't rest, and that you are slowing down, you feel like you can't take a break. You feel like you are slowing down the team and your project. You feel guilty and worthless, and this makes you feel even worse.  I have felt this way before many times in my life. &lt;/p&gt;

&lt;p&gt;The first time I felt this way was when I was working on a web application project for a big company in Mexico City. We were three people in charge of the whole project, and we had to deal with a company that had their own set of standards, their own way of doing things, and their own way of communicating things.  I felt guilty because I could feel that they were not happy with our progress, and because I felt like they were expecting too much from us, given the time we had. It felt like they wanted us to deliver them the moon in less than three months.  This was the first time I experienced depression as a programmer. The symptoms hit me really hard because I didn't understand them. &lt;/p&gt;

&lt;p&gt;We had never worked with this company before, so they had no idea how we work. We were used to working in big teams, and they weren't. My boss and I tried to adapt to their way of doing things, but it was just too much for us. We were getting depressed from the stress of trying to adapt to everything they wanted us to do.  I felt guilty because the project was behind schedule, and because we didn't deliver what we were supposed to deliver in time (but we did deliver something). This made me feel worthless.  &lt;/p&gt;

&lt;p&gt;The symptoms went away after a few months once the project was over, but they came back again when I started working on another project for them a few months later. It was the same situation: they had their own set of standards, they communicated things in a completely different way than they did before, they wanted things from us that we could not deliver in time given our experience with the product, etc. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp2eyaali9gtxyreyb0lc.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp2eyaali9gtxyreyb0lc.jpg" alt="cheems"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The second time it was less intense than the first time, but it still hit me hard enough to make me quit programming for a while. I decided to do something else because I didn't want to go through that again.  This was just one example of how depression can affect us as programmers. &lt;br&gt;
There are many other ways in which our work can affect us in such a way that it causes us to be depressed.  &lt;/p&gt;

&lt;p&gt;If you have never experienced depression as a programmer before, then now you know how it feels like when it happens the first time. If you have experienced it before, then this will sound familiar to you.  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;So what do we do? What can we learn from this? How can we avoid being depressed again?&lt;/em&gt;  &lt;/p&gt;

&lt;p&gt;Well, one obvious thing is that we need to rest when we feel tired. It is very simple: if you feel tired, then rest. Don't try to push yourself through it, because if you try to push yourself through it for too long, then it will get worse. Take some time off to rest and recover, and when you're rested again then you can go back to work. &lt;br&gt;
We need to avoid feeling guilty or worthless when things don't go as planned or when we feel like we are slowing down everyone else around us. We need to understand that our work is not a reflection of our self-worth. We need to understand that our work is not an obligation; instead it is something that we choose to do because we want to do it. &lt;/p&gt;

&lt;p&gt;We need to understand that there is no right or wrong in what we do; there is only what works best for us at a given moment. There is no point in being ashamed of what we do or how we do it; we should be proud of who we are and what we do as programmers.  So what do you do if you feel like you are slowing down everyone else? What if you feel like you are taking more time than you should? What if you feel like you are not doing anything useful anymore? &lt;/p&gt;

&lt;p&gt;First of all, don't be hard on yourself. You are not wasting your time. You are working on something that you enjoy, and that you are good at. You are not useless. You are not just slowing everyone else down. You are human, and humans have flaws. Yours is just that you take time to do things properly. Maybe not as much as everyone else, but it's okay. Everyone takes time to do things properly. You don't need to feel guilty or worthless just because you take more time to do things than others do. &lt;/p&gt;

&lt;p&gt;Second, if you feel like you are not doing anything useful anymore, then maybe you need to change something about the way you work. Maybe you need to change the project that you are working on. Maybe you need to change the team that you are working with. Maybe you need to change your expectations. Maybe you need to change the way you communicate with other people. &lt;/p&gt;

&lt;p&gt;Third, don't feel ashamed of taking more time than others do. Don't feel guilty or worthless for wanting to do things properly, for wanting to do things the right way. What you do and how you do it is a reflection of your values and personality, and that is something that makes you unique and valuable to others. Don't be ashamed of it; be proud of it.  So, what can we learn from all of this?  &lt;/p&gt;

&lt;p&gt;We can learn that as a programmer we need to take care of ourselves in order to keep working. We need to understand that we are not machines, and that our work is not an obligation; instead it is something we choose to do, so we need to take time off to rest when we feel tired, and when we feel like we are slowing down other team members or the project.&lt;br&gt;
We need to take time off to rest even when we feel like we are slowing down the project and team; we need to understand that our work is not an obligation, and that we are not worthless because we take more time than others do to do things properly. We need to be proud of who we are and what we do as programmers. We need to understand that our work is a reflection of our values and personality, and that this is something that makes us unique and &lt;br&gt;
valuable to others.  We should be proud of who we are and what we do as programmers.&lt;/p&gt;

&lt;p&gt;Finally, if we feel like we are slowing down everyone else, then maybe we need to change something about the way we work. Maybe we need to change&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqh64vzl2ymeismevyjjf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqh64vzl2ymeismevyjjf.jpg" alt="end"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>depression</category>
      <category>blog</category>
      <category>developer</category>
      <category>improve</category>
    </item>
    <item>
      <title>DEM: creating more accessible artificial intelligence</title>
      <dc:creator>Diego Vallejo</dc:creator>
      <pubDate>Sun, 30 May 2021 01:47:51 +0000</pubDate>
      <link>https://forem.com/destructor1702/dem-creating-more-accessible-artificial-intelligence-3k26</link>
      <guid>https://forem.com/destructor1702/dem-creating-more-accessible-artificial-intelligence-3k26</guid>
      <description>&lt;p&gt;I have always been fascinated by the concept of creativity, for that reason I entered the world of programming, your first hello world feels like something magical, and I thought that the same sensation would not be repeated, but they told me about the concept of "Creative Tools" and how  they would be able to create making their own decisions ... without a doubt I was fascinated by the idea and started trying to create something similar from home&lt;/p&gt;

&lt;p&gt;Back in 2018 I started an Ai model called JNFR it was similar to modern NLP tools like OPENAI's transformers, but of course it had less parameters, it's main goal was to learn some simple language structure, and after that I started to work on "diabolus ex machina" (a creepy yet cool name), a recurrent Ai model that has a much bigger structure than the previous one. In this project I wanted to learn what could be a successful architecture for a modern language model, and I learned a lot from this experience, I had to manage a lot of parameters and tasks and every time one of my model would learn something new I had to re-think my architecture. I learned a lot thanks to this experience, but I also learnt that I needed to have a generalist tool, a tool that could create new models from raw data and train them with any kind of architecture. This has been the base of everything that I have been working on since then, I have learned a lot in all the projects that I have done but this one was the most important one, it helped me to establish a strong base from which I could develop my own tools and solve any problem that I have to face.&lt;/p&gt;

&lt;p&gt;So, what is this new project, what have I been doing the last 3 months and what is going to happen next?&lt;/p&gt;

&lt;h2&gt;
  
  
  What is JNFR?
&lt;/h2&gt;

&lt;p&gt;The project is called JNFR. Why? Because it is a tribute name to a person who inspired me to create it, I changed it's name to "diabolus ex machina" in the major version upgrade&lt;/p&gt;

&lt;p&gt;My goal with this project is to simplify the creation of NLP models, I want to provide a tool that can be used by any developer to build and train a model using a simple interface, the same interface that is going to be used to create the model itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does it work?
&lt;/h2&gt;

&lt;p&gt;The DEMlibrary can be used to create a model from raw data, the library will do all the heavy lifting for you, it will read the data, tokenize the sentences, build a vocabulary from the tokens and it will create a model from the raw data using an architecture that you will provide.&lt;/p&gt;

&lt;p&gt;This is some code from my first version of DEM, this code reads a file, tokenizes it and creates an NLP model using the provided architecture.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Read the input data &lt;/span&gt;
&lt;span class="nx"&gt;DataInputStream&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;DataInputStream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;path/to/the/input/data/file&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// Tokenize the data into sentences Tokenizer&lt;/span&gt;
&lt;span class="nx"&gt;tokenizer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Tokenizer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;sentenceTokenizer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;StringTokenizer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tokenizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getTokens&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;TAB_SEPARATOR&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// Create the vocabulary from the sentences Vocabulary &lt;/span&gt;
&lt;span class="nx"&gt;vocabulary&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;VocabularyBuilder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tokenizer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;sentenceTokenizer&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;build&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="c1"&gt;// Create the model from the Tokenized data GraphBuilder &lt;/span&gt;
&lt;span class="nx"&gt;graphBuilder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;GraphBuilder&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;graphBuilder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addUnlabeled&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;vocabulary&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;graphBuilder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;NN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="c1"&gt;// Train the model with the provided Architecture &lt;/span&gt;
&lt;span class="nx"&gt;GraphBuilder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Train&lt;/span&gt; &lt;span class="nx"&gt;train&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;graphBuilder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;train&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Optionally save the model to disk&lt;/span&gt;
&lt;span class="nx"&gt;FileModel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;save&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;graphBuilder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getGraph&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is how you can create a model using the DEM library.&lt;br&gt;
YES the neural network and the NLP module are encapsulated&lt;br&gt;
&lt;code&gt;graphBuilder.add (new NN (... params))&lt;/code&gt;&lt;br&gt;
graphBuilder is a higher order object to control the given model and converts the tokens into unrepeatable and immutable floating values ​​to new word changes eg &lt;code&gt;token "word": .75240517&lt;/code&gt; something like mini AI-byte-size hash&lt;/p&gt;

&lt;h2&gt;
  
  
  What is DEM doing right now?
&lt;/h2&gt;

&lt;p&gt;I have been working the last 3 months on this library, I have created a lot of documentation and I have been focusing on the first version of the library, I want to have a stable version before I announce it to the world, this library will be open-source and I want to have a lot of people using it, I want to have a community where I can learn from everyone and I want everyone to learn from me.&lt;/p&gt;

&lt;p&gt;I have created some test models using this library, the most important one is a simple language model that has been used to generate a song, I have been working on this model for a while and I am almost done with it.&lt;/p&gt;

&lt;p&gt;I have created a lot of tests for this library and I have been working on a nice web interface for it, and now I am working on the last things that I want to do, I want to have a stable first version before I announce it to the world and I want to have a nice web interface for it, I have been working a lot on this interface and I have been able to create a lot of things with it, I have already exposed my API to the internet and I have used it to create a model in real time, I have used it in a web application, in a mobile application and I have used it in a program that I am writing. I have written a lot of documentation about this library and I have created a lot of tests, I have solved a lot of bugs and I have used this library for a lot of different problems, I want to have a stable version before I announce it to the world, I will wait a little bit more and then I will make a new post about it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is going to happen next?
&lt;/h2&gt;

&lt;p&gt;I am going to finish this project and I am going to release it, I am going to use it to create a lot of different things and I am going to make a lot of posts about it, I will start a series of posts about this library and I am going to create a new section on this website to show everything that I have done with it.&lt;/p&gt;

&lt;p&gt;This project has been a lot of work for me, I have learned a lot and I have done a lot of things, I have created a lot of tests, I have solved a lot of bugs and I have used this library for a lot of different problems.&lt;/p&gt;

&lt;p&gt;If you want to use this library soon you could download it from my github and maybe as an NPM package&lt;/p&gt;

&lt;p&gt;Stay tuned!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>javascript</category>
      <category>nlp</category>
    </item>
    <item>
      <title>PACT, the way to code</title>
      <dc:creator>Diego Vallejo</dc:creator>
      <pubDate>Mon, 24 May 2021 01:50:16 +0000</pubDate>
      <link>https://forem.com/destructor1702/pact-the-way-to-code-4hdg</link>
      <guid>https://forem.com/destructor1702/pact-the-way-to-code-4hdg</guid>
      <description>&lt;p&gt;Hello Developers! Many of us use various design patterns with React Development to make React Apps more clean, clearly understandable, and more structured. But still we are facing issues with coding standards, we changed at one place and it breaks at another place. Is there any resolution for this? Yes, there is. PACT is a tool that allows you to create contract between various components of your app that tell you which components are compatible with each other. It can help you create a consistent structure in your React Apps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is PACT?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;PACT stands for Prettier Acceptance Criteria Templates. It is a tool for creating pre-commit tests to enforce a consistent code style. PACT takes your current code style and compares it to the desired style. If your code matches, the test passes and your commit is accepted. If it doesn’t match, the test fails and your commit is rejected.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does it work?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;PACT is a tool that can be used to enforce a consistent code style. It takes your current code style and compares it to the desired style. If your code matches, the test passes and your commit is accepted. If it doesn’t match, the test fails and your commit is rejected.&lt;/p&gt;

&lt;p&gt;For example, in a pre-commit hook, you could specify a config file with an array of rules that your project should follow and a command for checking if your code is compliant with those rules:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
    &lt;span class="na"&gt;rule&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;error&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;message&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Use double quotes instead of single&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;matcher&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;source.js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;lineRange&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;var x = 'foo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; , }, { 
    rule: {
        "error": false,
        "message": "Use one space after function/array bracket",
        "matcher": "source.js",
        "lineRange": [4, 4]
    },
    input: "var x = function() {}, foo[",
}, {
    rule: {
        "error": true,
        "message": "Use two spaces after function/array bracket",
        "matcher": "source.js",
        "lineRange": [6, 6]
    },
    input: "foo[] = &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;bar&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;",
}]

var check = require ( &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;preact&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;pact&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; ).commands.check ; 
var pact = require ( &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;preact&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;pact&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; ); 
check(pact( config )).run();
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The whole thing is wrapped in a function that takes a configuration file and returns the promise that resolves to an array of errors that would be returned by the check command.&lt;/p&gt;

&lt;p&gt;The input and matcher properties of each rule tell Weasel what range of code to check for compliance. Since Weasel is using source-map’s precise mappings, it’s possible to check specific lines or ranges of lines.&lt;/p&gt;

&lt;p&gt;The check command looks for each rule in the config file and runs the command specified in the command property.&lt;/p&gt;

&lt;p&gt;PACT can be used with any editor, but we will use VSCode as our example.&lt;/p&gt;

&lt;p&gt;Install PACT via npm.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install pact-cli --global&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Create a pact file for the folder where you want to enforce the code style. For this example, let’s create a pact file for the app root.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pact create &amp;lt;app-name&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;This will create a pact file with the name .js .&lt;/p&gt;

&lt;p&gt;Add some rules to the pact file.&lt;/p&gt;

&lt;p&gt;This pact file will have a single rule for the whole app.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;rule&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;indent&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;spaces&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// 2 spaces per indent level &lt;/span&gt;
                &lt;span class="p"&gt;},&lt;/span&gt;
                &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Indentation should be 2 spaces per indent level.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To run the pact, you need to npm install the project and then run the pact test.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install
npm run pact
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The pact test will run and return a green check if it passes. In our case, it will return a red “x” because we haven’t added our rules into our app yet.&lt;/p&gt;

&lt;p&gt;We can also add a pact test to enforce the code style for a file.&lt;/p&gt;

&lt;p&gt;Add the following at the top of our index.js file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;rule&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;indent&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;spaces&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// 2 spaces per indent level }, message: 'Indentation should be 2 spaces per indent level.' &lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, when we run the pact test, it will return a green check because the file already matches the code style.&lt;/p&gt;

&lt;p&gt;If you want to enforce the code style for an individual file, you can add it to the pact file and run the test.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;rule&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;indent&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;spaces&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// 2 spaces per indent level }, message: 'Indentation should be 2 spaces per indent level.',&lt;/span&gt;
                &lt;span class="na"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;index.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; 
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, when you run the test, it will return a red “x” again.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why we should use PACT?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;PACT is a good tool that offers many advantages. But the main advantage is that it allows you to build a consistent React App. It is a very good tool for enforcing a consistent project structure, code style, and workflow. This is why PACT should be used in modern React App Development.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;PACT is a tool for enforcing a consistent code style across a project. It can help you create a consistent structure in your React Apps.It is a very good tool for enforcing a consistent project structure, code style, and workflow. This is why PACT should be used in modern React App Development.&lt;/p&gt;

&lt;p&gt;Hope you like it. Share your feedback in the comment section below.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
