teleren/devto huggingface dataset:
Writing a NES game day 12, The Aqualate!
Tags: assembly, 6502, nintendo, gamedev
Published: 2023-07-24 16:40:29

Now that the main character can shoot, it should shoot something, so I need to create enemies.
When I was starting, my 7 year old daughter passed by my computer, asked me what I was doing and told me that she wanted to create the testing monster.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9n7u3b9v5agrms41ao0e.PNG)

She called this "The Aqualate". I needed this to be on screen and needed to make it move on its own, so I needed to create some of this beautiful code.

First of all, I need 3 variables, one for the position in X, one for the position in Y and one for the stage of movement it is (we will go over it briefly).

```
 ax: .res 1 ; Aqualate x position
 ay: .res 1 ; Aqualate y position
 al: .res 1 ; Aqualate in the loop
```

For now I put some initial values to place it somewhere

```
LDA #$50
STA ax
LDA #$80
STA ay
```
Now, I need a fixed pattern for the enemy, let's say an easy one, so let's make the Aqualate move in squares. Here comes the third variable into the game. The position status, the position has 4 status ($00, $01, $02 and $03), every status has a place and in every cicle the al variable increments in one and changes the place of ay and ax. If incrementing the variable results in $04, then it goes to $00 again.


```
aqualate:
    LDA #$00 ;in the original position x+1, y-1
    CMP al
    BNE :+
    LDA ax
    CLC
    ADC #05
    STA ax
    LDA ay
    SEC
    SBC #05
    STA ay
    :
    LDA #$01 ;position 2 x+1, y+1
    CMP al 
    BNE :+
    LDA ax
    CLC
    ADC #05
    STA ax
    LDA ay
    CLC
    ADC #05
    STA ay
    :
    LDA #$02 ;position 3 x-1, y+1
    CMP al
    BNE :+
    LDA ax
    SEC
    SBC #05
    STA ax
    LDA ay
    CLC
    ADC #05
    STA ay
    :
    LDA #$03 ; position 4 x-1, y-1
    CMP al
    BNE :+
    LDA ax
    SEC
    SBC #05
    STA ax
    LDA ay
    SEC
    SBC #05
    STA ay
    :
    ;update
    LDA al
    CLC
    ADC #01
    STA al
    LDA #05
    CMP al
    BNE :+
    LDA #00
    STA al
    :
    RTS
```

And now in the engine zone, in every cicle I need to call this function

```
JMP aqualate
```

The last part is placing it into the screen, for that I assigned the aqualate the addresses from $0214 to $0217. So I only need to put this into the updatesprites function

```
;Aqualate ($0214 to $0217)
    LDA ay
    STA $0214
    LDA #$02
    STA $0215
    LDA #$00
    STA $0216
    LDA ax
    STA $0217
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ajg8b1yoqqiivtvb7kdy.PNG)


And about Megaman 1, well, I could beat Cutman, but the rest is terribly hard. I have no skills :(
DOCKER SWARM CLUSTER & NFS
Tags: docekr, devops, swarm
Published: 2023-07-24 16:39:11

## Docker Swarm emerges as an excellent solution, offering a simple and scalable cluster management system. To complement this, utilizing NFS (Network File System) as a shared volume storage brings significant advantages, providing seamless data sharing and robustness across the Swarm cluster. Moreover, it is essential to emphasize the importance of referring to official documentation for both Docker Swarm and NFS, as it ensures a well-informed and successful setup.
**The web app code :**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nitgli0l4u9626cgwkgf.png)
**My Cluster:** 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s0viu1lnoykq7fe3f9qh.png)
**On the NFS Server (NFS Server Host):**
The necessary steps and commands to set up an NFS server and mount the NFS share on the client node (Docker Swarm node):
_Install NFS Server:_
`sudo yum install nfs-utils`
_Create the Shared Directory:_
`sudo mkdir -p /shared_dir`
_Export the Shared Directory at /etc/exports:_
`/shared_dir  *(rw,sync,no_root_squash)`
_Apply the NFS Export Changes:_
`sudo exportfs –a`
_Start NFS Server:_
`sudo systemctl enable nfs-server   `
**On the NFS Client (Docker Swarm Node):**
`sudo yum install nfs-utils`
_Create the Target Mount Directory:_
`sudo mkdir -p /mnt/shared_dir`
_Mount the NFS Share:_
`sudo mount -t nfs nfs_server:/shared_dir /mnt/shared_dir`

**NOTE: fro NFS3 and NFS4 you should explicitly allow Port 2049**

Now we create the NFS docker volume on the worker node : 
`docker volume create --driver local --name website_volume --opt type=nfs4 --opt device=:/shared_dir --opt o=addr=20.111.58.70,rw,nolock`
_Now Create Docker service with NFS volume :_
`docker service create --replicas=2 --name hostname_service --restart-condition on-failure -p 80:80 --mount type=volume,source=website_volume,target=/app taqiyeddinedj/hostname_web_app`
Explore Our World of Badges & Influence the Next Addition! 🏅🌟
Tags: meta, community, badges, design
Published: 2023-07-24 16:27:53

Hey there, awesome DEV Community members!

Did you know we have an array of [amazing badges](https://dev.to/badges) that celebrate your achievements and contributions on DEV? Each badge tells a unique story and highlights your skills and passions.

From the prestigious "Top 7" and "One Year Club" badges, to the talent-driven "JavaScript," "Python," and "React" badges, our collection showcases the diverse skills and passions of our amazing members.

We're constantly retiring old badges and introducing new ones that reflect your interests and achievements.


## Now, we want your input! 
Which badge would you love to see next in our collection? It could be a badge that celebrates your favorite technology, highlights your proudest achievement on DEV, or represents a unique aspect of our community. **Share your badge idea with us in the comments below.** 🗣️💬
set up sanity in next13 >
Published: 2023-07-24 16:07:02

**create next app **-`npx create-next-app@latest` 
navigate project folder

- add install `npm install next-sanity @sanity/client @portabletext/react @sanity/image-url`
-run `npx sanity init`
    configure it

![setting sanity in next13 with app router](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rwbgkm2j17qr36f70uvb.png)
    it creates -studio page -entry to embedded studio
               -.env file
               - sanity folder with client and schemas
![next13 project1 setup afterrunning npx sanity init](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cl2mvbcqz062234ziaji.png)
Terraform vs Pulumi
Tags: cloud, infrastructureascode, webdev
Published: 2023-07-24 15:47:24

On the face of it Terraform and Pulumi are the same thing. They let you write code that defines your cloud setup. When you modify that code - they will update your cloud setup accordingly. 

## Terraform vs Pulumi on Github

https://star-history.com/#pulumi/pulumi&hashicorp/terraform&Date

(for some reason [this image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sopbu5qstrt2fm0nyr1z.png
) is looking broken when I embed it)


<!--
![Pulumi vs Terraform github star history](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sopbu5qstrt2fm0nyr1z.png)

...

![Pulumi vs Terraform github star history](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2n19tnfqzia9amtfvh04.png) -->


* https://github.com/pulumi/pulumi - Infrastructure as Code in any programming language. Build infrastructure intuitively on any cloud using familiar languages
* https://github.com/hashicorp/terraform - Terraform enables you to safely and predictably create, change, and improve infrastructure. It is an open source tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.

## The subtle lock-in difference

Pulumi allows you to write the code in your programming language of choice, which is going to be far more expressive. Terraform requires you use a simplistic configuration language.

A consequence of this difference is that it's easy to migrate from Terraform configuration files to Pulumi. But it's going to be extremely difficult to migrate from Pulumi to anything else.

## Caveats and conclusions

I  personally only used Terraform and it was a bit tricky to learn at the time. Pulumi's idea of using a more capable language to manage infrastructure intrigues me. It seems the idea is so powerful that it might be worth it to take the risk of never being able to migrate off of it. I'll post an update after I try it. Please let me know of lessons  you already have from real life experiences with these two.
The Latest Updates on Next.js in 2023
Tags: webdev, javascript, nextjs, react
Published: 2023-07-24 15:40:04

Next.js, the popular React framework, has been making waves in the web development community with its continuous updates and improvements. In 2023, the team behind Next.js has been focusing on several key areas to enhance the performance, stability, and developer experience of the framework. Here's a rundown of the latest news and updates on Next.js in 2023.

## **Next.js App Router Update**
The App Router in Next.js represents a new foundation for the future of the framework. The team has been working on improving the performance, stability, and developer education around the App Router. The App Router was designed to align with modern React features, like Server Components, Suspense, and more, which have been designed for streaming architectures.

The team has been focusing on three aspects of performance: local iteration speed, production build times, and serverless performance. They have been replacing pieces of its underlying architecture with faster, more scalable tools. For instance, they started by replacing Babel (compilation) and Terser (minification) with SWC to improve local iteration speeds and production build times.

## **Next.js 13.4**
Next.js 13.4 marked stability for the App Router. This release included the App Router (Stable), Turbopack (Beta), and Server Actions (Alpha). The marking of stability signaled to the community that the core API was settled and would not go through major breaking changes that would require rewrites.

## **Next.js 13.3**
Next.js 13.3 added popular community-requested features and was the last release before the App Router became stable. This release included the File-Based Metadata API, Dynamic Open Graph Images, Static Export for App Router, and Parallel Routes and Interception.

## **Next.js 13.2**
Next.js 13.2 included major improvements to the App Router in preparation for stability. This release brought Built-in SEO Support, Route Handlers, MDX for Server Components, Rust MDX Parser, Improved Error Overlay, Statically Typed Links (Beta), Turbopack Improvements (Alpha), and Next.js Cache (Beta).

## **The Future of Next.js**
The team behind Next.js is continuously working on improving the framework. They are exploring further opportunities to make incremental adoption even easier. They are also working on improving the performance and reliability of the existing webpack architecture.

In conclusion, the team behind Next.js is committed to providing the best developer experience. They are continuously working on improving the framework and are open to feedback from the community. With these updates and improvements, Next.js continues to be a powerful tool for web developers.
TIL the basics of Ruby
Tags: beginners, webdev, programming, ruby
Published: 2023-07-21 20:37:18

I dived right into learning Ruby these past few days, and it's been pretty exciting! I've learned a lot and here are a few bullet points to organize my thoughts about this journey

- You can create your own classes in Ruby, and methods associated with it. There are instance methods and class-level methods. This is how it is done:
```Ruby
class New_class
  attr_accessor :attribute

  def method_class
    return #some method
  end

end
```

`:attribute` is a Symbol. They act like Strings but are unique, great for using as a key in Hash.


- Ruby has a class `Date` that needs to be loaded. It allows manipulations on dates
```Ruby
require Date

pp Date.today
pp Date.parse("3rd Feb 2001")
```

Substracting two dates gives a Rational! It helps with getting accurate results as opposed to ‘Float’ and ‘Decimal’ objects which  can produce inaccurate results because computers have limited memory. For this reason financial payment services always use Integers in their calculations.

- Ruby has a large community with many programs available, called "gems". They can be loaded more easily with a "Gemfile" (no extension) with the following code:
```Ruby
source "https://rubygems.org"
# the following are examples of gem available
gem "activesupport"
gem "awesome_print"
gem "pry-byebug"
```
These are then installed all at once by typing `bundle install` in the terminal.

- Github is an amazing ressource for programming. I have an IDE readily available online, it saves and keeps track of all my programming. I'm barely scratching the surface of it right now, and I'm sure there is much more to it.

- `rand` is based off the Mersenne Twister algorithm. It generates random numbers from a seed value. This seed value can be called with `srand`, and by default is based on the computer's clock. For a given `srand`, `rand` will generate the same sequence of numbers. The `rand` is random enough for lower stake application, but can technically be predicted if one can observe 624 numbers in the sequence! For cryptography, the module `SecureRandom` is the way to go!
`.sample` uses `rand` to pick a random element in an array.

- `gsub` can be used with a block. I learned this while trying to use a Hash for encrypting and decrypting a message:
```Ruby
def encrypting(secret)
  code = {
    "a" => "1",
    "e" => "2",
    "i" => "3",
    "o" => "4",
    "u" => "5"}
  return secret.gsub(/[aeiou]/i) { |match| code.fetch(match.downcase) }
end
```
Use AdonisJS 6 Alpha today
Tags: javascript, node, adonisjs, news
Published: 2023-07-24 15:31:22

> **Note**: Before we start. The Alpha release is available for sponsors only. You can learn more about the sponsorship program [here](https://adonisjs.com/road-to-v6).

Recently, we outlined in an [article](https://github.com/adonisjs/core/discussions/4184) what to expect from our new major version, i.e., AdonisJS v6. We have received a lot of positive feedback on that article, and there is excitement in the community to use v6 as early as possible.

Therefore, we are announcing the Alpha release of AdonisJS v6 today. The Alpha release will provide you access to the following resources.

- Updated documentation
- Onboarding screencasts
- Access to our internal project management dashboard
- And the opportunity to join the monthly conference calls

Since we want to work closely with a small group during the Alpha phase, you have to be a [sponsor of Harminder Virk](https://github.com/sponsors/thetutlage) (the creator of the framework) before you can access it.

{% embed https://twitter.com/AmanVirk1/status/1683375932810182656 %}

**Let us assure you, AdonisJS is NOT becoming a paid framework**. We will always live up to the ethos of open source and ensure stable releases are available publicly. However, at the same time, we want to work closely with individuals who deeply care for the framework and have been supporting us in this journey.

Sponsoring us brings you many benefits and helps ensure the framework's longevity.

--

Your core team
Desvendando o poder da Dashboard
Tags: devrel, frontend, backend
Published: 2023-07-24 15:24:28

Em tempos acelerados de negócios, tomar decisões é crucial. A chave para alcançar informações relevantes é ter acesso ágil a essas informações, e é nesse ponto que a Vindi atua. Utilizando nosso painel de controle de vendas e pagamentos poderoso, estamos simplificando a rotina dos desenvolvedores e mudando o cenário.

Uma dashboard é uma interface visual que reúne informações e dados relevantes em um único lugar, proporcionando uma visão panorâmica dos principais indicadores de desempenho de uma companhia. Ela possibilita que os líderes e tomadores de decisão acessem, transformem e utilizem esses dados de maneira eficiente e intuitiva, aprimorando a análise e permitindo ações estratégicas mais precisas.

A criação de uma dashboard completa e eficiente pode ser complexa, requerendo a coleta, integração e organização de dados de diversas fontes. Com a Vindi, os desenvolvedores têm acesso a uma integração simplificada por meio de uma #API completa e documentação detalhada. Isso reduz o tempo e os recursos valiosos, permitindo que os desenvolvedores se dediquem ao desenvolvimento de soluções inovadoras para os seus negócios.

A nossa #dashboard é uma ferramenta poderosa para aumentar o sucesso dos negócios, fornecendo dados cruciais para tomar decisões estratégicas. A Vindi torna a vida dos desenvolvedores e gestores mais fácil, uma vez que eles contam com uma plataforma robusta, atualizada e de fácil integração para criar dashboards poderosas. Portanto, se você deseja obter informações relevantes sobre pagamento e vendas com facilidade, pode contar com a Vindi e explorar todo o potencial de uma dashboard poderosa!

Assista a esse vídeo com a Melissa Almeida explicando sobre nossa Dashboard: https://lnkd.in/dQe-cp7z

Leia matéria completa no nosso Blog: https://lnkd.in/d8t2QBRf
Introduction to Terraform: From Zero to Hero eBook
Tags: terraform, devops, cloud, programming
Published: 2023-07-24 15:04:20

## Introduction

Hey folks, I'm super stoked to announce my brand-new eBook: "**Introduction to Terraform: From Zero to Hero**". This project is something I'm genuinely excited about, born from countless late-night coding sessions and my growing fascination with Infrastructure as Code. I've come to realize that Terraform is an absolute game-changer in the DevOps world, and I can't wait to share everything I've learned with you!

## Table of Contents

A sneak peek into what's inside:

1.  Introduction to Infrastructure as Code (IaC)
2.  Introduction to Terraform
3.  Installation and Setup
4.  Terraform Basics
5.  Terraform Configuration Language (HCL)
6.  Terraform State
7.  Modules in Terraform
8.  Terraform Cloud
9.  Best Practices
10.  Intermediate Terraform Language Features
11.  Importing Existing Infrastructure into Terraform
12.  Advanced State Management
13.  Terraform with Multiple Providers
14.  Terraform for Serverless Architecture
15.  Terraform for Container Orchestration
16.  Terraform with Continuous Integration/Continuous Deployment (CI/CD)
17.  Security and Compliance with Terraform
18.  Managing Secrets with Vault
19.  Troubleshooting and Debugging Terraform
20.  Terraform with Ansible
21.  Advanced Topics and Conclusion

## Why "From Zero to Hero"?

The philosophy behind this title is simple. We all start our learning journeys from square one, with a spark of curiosity and an urge to get better at something new. Consider this book your handy roadmap that'll guide you from being a newbie in the world of Infrastructure as Code to really understanding the ins and outs of Terraform. This guide is loaded with in-depth chapters, real-world examples, and hands-on exercises designed to help you in the awesome world of Terraform. By the end of it, I promise you'll be bossing around your own projects like a champ!

## Who is it for?

Whether you're a beginner just starting out in the DevOps world or a professional looking to expand your skill set, this book has something for everyone. It's written in a way so that both newcomers and those seeking advanced knowledge could benefit from.

## Conclusion

In a rapidly evolving tech world, staying updated and continuously learning is the key. "Introduction to Terraform: From Zero to Hero" isn't just a book; it's your next step in the DevOps world. So, don't hesitate and get your copy today from [Leanpub](https://leanpub.com/introduction-to-terraform). Let's start this exciting adventure together!

I genuinely hope you find value in every page of this book.

Until next time, happy learning and terraforming!
As 5 principais tendências de tecnologia para 2023
Published: 2023-07-24 15:00:00

A indústria de tecnologia está em constante mudança, e é importante estar ciente das últimas tendências para se manter à frente da concorrência. Aqui estão as 5 principais tendências de tecnologia para 2023:à frente da concorrência.


- Internet das coisas (IoT): A IoT é uma rede de dispositivos físicos, veículos, máquinas e outros itens que são incorporados com sensores, software e outras tecnologias para coletar e trocar dados. A IoT está revolucionando muitas indústrias, incluindo manufatura, saúde, agricultura e transporte.
- Big data: Big data é um termo usado para descrever grandes quantidades de dados estruturados e não estruturados que são difíceis de processar com métodos tradicionais. O big data está sendo usado para melhorar a tomada de decisão, identificar tendências e desenvolver novos produtos e serviços.
- Inteligência artificial (IA): A inteligência artificial (IA) é uma área da ciência da computação que se preocupa em criar agentes inteligentes, que são sistemas que podem raciocinar, aprender e agir de forma autônoma. A IA está sendo usada em uma ampla gama de aplicações, incluindo carros autônomos, assistentes virtuais e diagnósticos médicos.
- Computação em nuvem: A computação em nuvem é um modelo de entrega de serviços de TI baseado na Internet. Os serviços em nuvem podem ser acessados de qualquer lugar, a qualquer hora e em qualquer dispositivo com conexão à Internet. A computação em nuvem está tornando mais fácil e acessível para as empresas de todas as formas e tamanhos adotarem novas tecnologias.
- Realidade aumentada (AR): A realidade aumentada (AR) é uma tecnologia que superpõe informações digitais ao mundo real. A AR está sendo usada em uma ampla gama de aplicações, incluindo jogos, educação e treinamento.

Essas são apenas algumas das muitas tendências de tecnologia que estão moldando o futuro. Ao estar ciente dessas tendências, você pode estar preparado para as mudanças que estão por vir e se manter à frente da concorrência.

Aqui estão algumas dicas adicionais para se manter atualizado sobre as últimas tendências de tecnologia:

- Leia blogs e artigos sobre tecnologia.
- Assista a conferências e eventos de tecnologia.
- Siga pessoas e organizações de tecnologia nas redes sociais.
- Experimente novas tecnologias.
- Conecte-se com outras pessoas interessadas em tecnologia.
- Ao seguir essas dicas, você pode estar ciente das últimas 
tendências de tecnologia e se manter à frente da concorrência.
Desktop Apps : Code your backend from Javascript with Photino.API
Tags: net, csharp, photino
Published: 2023-07-24 13:49:12

With Photino.API you can code nearly all your backend-logic in Javascript.
Here is a non exhaustive list of the available IO API methods accessible from Javascript

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/op6a9tet8wofta7q7b9k.png)

You can read, write files using Javascript, awesome.

Tasks to accomplish this :

- download [Visual Studio Community Edition](https://visualstudio.microsoft.com/fr/vs/community/)
- clone or download [PhotinoAPI](https://github.com/Raxdiam/photino.API)
- run the solution

Here is what you get :

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9z3q24vmsnepu0lmfg30.png)

When creating trimed executable, put this code in project file

```html
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <Platforms>AnyCPU;x64</Platforms>
	<PublishTrimmed>true</PublishTrimmed>
	<TrimMode>partial</TrimMode>
  </PropertyGroup>
```


If you want more informations, simply post a comment

Regards