teleren/devto huggingface dataset:
Código Limpo - Capítulo 4 - Comentários
Published: 2024-04-28 17:15:23

Quando ou não comentar em um código? Segundo o livro Código limpo: habilidades práticas do Agile software, comentar um código já é sim um fracasso!

Segue considerações do último encontro on-line de Leitura em Grupo que aconteceu no dia 17/04/2024:

- Comentários:  Falamos sobre a importância dos comentários serem claros e necessários. Eles devem explicar o porquê de algo está sendo feito, não o que está sendo feito, pois o código deve ser auto explicativo.
  
  
- Comentários Ruins: Falamos sobre os tipos de comentários que devem ser evitados, como comentários óbvios, comentários redundantes, e comentários que contradizem o código.

    
- Comentários Bons:  Falamos sobre os tipos de coisas que podem ser úteis, como comentários de esclarecimento, avisos sobre consequências não intuitivas e comentários que fornecem contexto histórico.

    
- Esclarecendo o Código: Falamos sobre  a importância de escrever código claro e auto explicativo, eliminando a necessidade de comentários desnecessários.
    

- Comentários e Testes:  Discutimos como os testes podem ser mais eficazes do que comentários para documentar o comportamento do código.
    

- Escrevendo Comentários Úteis:  Vimos diretrizes para escrever comentários úteis, como ser claro e conciso, manter os comentários atualizados, e evitar comentários que enganam.
    

- Escolhendo Nomes Descritivos: Vimos novamente sobre  a importância de escolher nomes descritivos para variáveis, métodos e classes, reduzindo a necessidade de comentários explicativos.


Se interessou? Comente esse post e envio o link do grupo que está discutindo quinzenalmente este livro! Seje bem-vinde!
Learning AWS Day by Day — Day 49 — Amazon SNS
Tags: aws, cloud, cloudcomputing, sns
Published: 2024-04-28 17:10:35

Exploring AWS !!

Day 49:

Amazon SNS (Simple Notification Service)


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

Provides a message delivery platform from publishers to subscriber (producers to consumers)
Publishers communicate with subscribers asynchronously by sending messages to topics and the clients can subscribe to this SNS topic and receive the messages published, using an endpoint like Amazon SQS, Data Firehose, lambda etc.

Features:
Application-to-Application messaging
Application-to-person notifications
Standard and FIFO queues
Message durability
Message archiving, replay and analytics
Message attributes
Message filtering
Message security: end-to-end encryption

You can integrate SNS with below services:

Amazon SQS: secure, durable and available hosted queue, that lets you integrate and decouple software distributed system. SNS provides dead letter queues powered by SQS for undelivered messages, so that they can retry automatically in case any message is not delivered. You can subscribe to FIFO queues, if looking for messages to be delivered in an order.

AWS Lambda: serverless building of an application, you can subscribe lambda function to SNS topics.

AWS IAM: control access to AWS using roles, users and groups. You can use IAM to control access to SNS topics, like who can subscribe, what can be used and how it can be used.

AWS CloudFormation: helps create a template and provisions and manages your topics and subscriptions, all you need is to just add them in your code.

You can use SNS through console, CLI and SDKs.

Pricing: No upfront costs, pay only for messages that you publish and notifications that are delivered.

Use Case Scenarios:

You can use it for application alerts, or let’s say an order is being placed, and you have integrated SQS with SNS to receive the published message, and later EC2 maintains these at data warehouses for order fulfillment. User notifications, such as pushing email or text messages on successful confirmations can be used. Mobile push notifications are one of the best examples where you can send updates for mobile or alerts when discharged.
BITCOIN HALVING 🔥
Tags: bitcoin, bitcoinhalving, cryptocurrency
Published: 2024-04-28 17:09:45

The competitions or promotions related to the Bitcoin halving that exchanges host :

📚 Coinbase: Coinbase has offered educational content and quizzes around Bitcoin halving, aiming to engage and inform users about the significance of the event. They may also provide rewards or incentives for completing certain tasks related to halving education or trading activities.

🎉 WhiteBIT: WhiteBIT has hosted exciting video competitions specifically dedicated to Bitcoin halving, encouraging participants to showcase creativity and storytelling in their videos. Winners have the opportunity to share a prize pool of cryptocurrency rewards. To join, users often need to register on WhiteBIT and follow the competition guidelines provided by the exchange.

🔥 Binance: Binance has previously organized trading competitions where users can participate in specific trading pairs related to Bitcoin or other cryptocurrencies affected by halving events. Participants may compete for rewards based on trading volume, performance, or other criteria.

💼 OKX: OKX has run promotions such as trading contests focused on Bitcoin halving, where users can compete based on trading volume, accuracy of predictions, or other metrics. Prizes typically include cryptocurrency rewards, bonuses, or special offers for participants.

These exchanges have engaged their communities through innovative competitions and educational initiatives around Bitcoin halving, enhancing user participation and knowledge in the crypto space!
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a4c528ka77bflb29apxh.png)
We Buy Any Car
Published: 2024-04-28 11:29:55

Moreover, these services cater to a wide range of sellers, including those with busy schedules or limited automotive knowledge. By handling all aspects of the transaction, from valuation to paperwork, they alleviate much of the stress and uncertainty associated with selling a car privately. This level of assistance can be particularly valuable for individuals who lack the time, expertise, or inclination to navigate the intricacies of the used car market on their own.

However, it's essential for sellers to approach these services with a discerning eye. While the convenience they offer is undeniable, the final offer may not always be the highest possible price for the vehicle. Like any business, "We Buy Any Car" companies aim to make a profit, and their offers reflect this objective. Sellers should weigh the convenience factor against the potential for a slightly lower payout compared to selling through other channels.

In conclusion, "We Buy Any Car" services provide a convenient and efficient solution for individuals looking to sell their vehicles quickly and without hassle. By offering inclusive valuations, streamlined processes, and prompt payments, they cater to a diverse range of sellers' needs. While they may not always offer the highest prices, the trade-off in terms of time, effort, and peace of mind can be well worth it for many.

https://www.sellyourcar2rob.co.uk/we-buy-any-car-hartlepool
How To Write a Price Negotiation Letter?
Tags: seo, search, crawl
Published: 2024-04-28 16:44:46

SEO
“If competitors rank at the top of SERPs for the main keywords or key phrases, an alternate strategy can be to beat the competitors by ranking for the most common similar words and phrases. -Momenul Ahmad
Read More- https://www.quora.com/profile/Momenul-Ahmad/Negotiation-letter-writing-versus-Bargaining-letter-writing-SEO

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k1xw78mv1q8kguxoqu77.png)
#searchengineoptimization #seo #seosiri
Ink for Game Design
Tags: ink, gamedev
Published: 2024-04-28 16:35:15

Ever since I encountered [Overlap2D](https://github.com/UnderwaterApps/overlap2d) many years ago, I've had thoughts of engine-agnostic game development spinning in the back of my head. Overlap2D was a 2D level editor that exported game data that could be loaded into game frameworks like libGDX, HaxeFlixel, phaser.js and more. What's alluring about this is the idea that your game data is not tied to a specific game engine. In theory, this flexibility can allow you to develop your game sooner and worry about deployment later. If the need to switch game engines arises, perhaps due to licensing changes or platform support, you're safer with engine-agnostic game development strategies. 

![Screenshot of Overlap2D](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zr55bb1zsoztqzvjpibe.png)

What does this have to do with Inkle's [Ink](https://www.inklestudios.com/ink/)? Well, Ink is a form of engine-agnostic game data creation. At heart, Ink is a narrative scripting language but because it was conceived as middleware, it can be used by many game development stacks. The primary integration is Unity which supports many platforms on its own but Ink scripts can also be run in the browser, Defold, Godot, Unreal and [more](https://github.com/inkle/ink-library?tab=readme-ov-file#ink-engine-ports-wrappers-and-integration). You can write Ink once, test it using Inky or Inklecate and deploy it using your desired framework. I can personally attest to running the same Ink script in the browser with ink.js and in the Defold, Godot and Unity game engines.

At first glance, Ink looks like it's just a narrative design tool, something you would use to build multi-linear stories like the ones found in Choose-Your-Own-Adventure books. But because of its advanced scripting features, Ink can be used for game design as well! With support for functions, variables, sets, loops and more, it's possible to simulate various [games](https://github.com/inkle/inky/blob/master/app/main-process/ink/longer-ink-snippets/pontoon_example.ink) purely in Ink.

![Oregon.bas ported to Ink](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lh85miqxpnv75fhta0o0.png)

It has been said that games are all about interesting choices and what is Ink but a framework for setting up decision trees. If you're interested in learning more about Ink, I've written some articles [here](https://docs.goldenxp.com/ink/).  Some of these include:

* [Making a World Map in Ink](https://docs.goldenxp.com/ink/worldmap): learn how to make a navigable world
* [Prototyping a Card Swiping Game in Ink](https://docs.goldenxp.com/ink/cardswiping): if you want to make a game like Reigns, check this one out!
* [Testing Strategies using Inky Web Export](https://docs.goldenxp.com/ink/testinginkweb): stress test your game's numbers using automated choices.

{% embed https://youtu.be/ysbJcaQ_YF4 %}

To conclude, Ink can be a powerful toolset for game design. Thanks for reading and stay tuned for more!
Submission for the Coze AI Bot Challenge:
Tags: cozechallenge, devchallenge, ai, machinelearning
Published: 2024-04-28 16:29:53

Submission for the Coze AI Bot Challenge: Bot Innovator.
What I Built

I have built an empathetic chatbot that assists users in understanding their own thoughts, values, behaviors, emotions, and actions. The purpose of this bot is to guide individuals towards personal growth and self-improvement by encouraging self-awareness and exploring new perspectives.

Demo


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

Your Configuration

My configuration include features such as Personality assessment, Emotional intelligence training, Goal setting and tracking, Mindfulness and stress reduction techniques, Positive reinforcement and Resource recommendations to name a few. All this has been achieved using open-ended questions, active listening techniques, and by providing insightful feedback.

Journey

Creating this bot has been a journey of deep understanding not only about the technicalities but about empathy and human emotions. I am particularly proud of the way my bot's understand, analyze and respond to user queries, showing genuine empathy and offering appropriate guidance. Next, I hope to further enhance this bot's interactive abilities, perhaps extending its capabilities to include more interactive experiences.
Once completed, I look forward to sharing a comprehensive view of my process, the things I learned, and elements of my creation that I am particularly proud of. It'll be an honor to have my work recognized by the community. I am excited to partake in the Coze AI Bot Challenge, and for the opportunity to contribute to the evolving landscape of AI technology.
I hope this gives a glimpse of what I have been working on. Awaiting for more experiences and learning on this journey
AI Tools of the 21st Century: Humanoid Robots
Tags: ai, innovation, webdev, security
Published: 2024-04-28 16:24:54

Let’s delve into some remarkable humanoid robots that have graced the 21st century:

## 1. [ASIMO: A New Kind of Robot](https://global.honda/en/newsroom/news/2000/c001120b-eng.html)

![ASIMO](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/codsnrquuo6d8tjymuof.png)

ASIMO, introduced by Honda, revolutionized humanoid robotics. Unlike its predecessors, ASIMO was designed to function in society, interact with people, and serve as a partner.

## 2. [Boston Dynamics’ New Atlas: All-Electric Agility](https://bostondynamics.com/atlas/)


![BostonDynamics](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qbychcoh05vwmsopwl23.png)

Another notable contender is Boston Dynamics, a pioneer in robotics that is renowned for pushing the boundaries of robotics.  Unlike its predecessors, the all-electric Atlas is sleek, lightweight, and designed for commercial applications.

## 3. [Ameca: The World’s Most Advanced Human-Shaped Robot](https://www.engineeredarts.co.uk/robot/ameca/)

![Ameca](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cg4byjsfkx0bnff1h6pq.png)



Developed by Engineered Arts, Ameca represents the forefront of human-robot interaction. As a platform for future robotics innovations, Ameca showcases seamless communication between humans and robots. 


## Conclusion

As we move forward, AI will continue to evolve, pushing boundaries and transforming our lives. Whether they assist us, entertain us, or challenge us, they are tools that will shape tomorrow’s world.
This is a submission for the Coze AI Bot Challenge
Tags: cozechallenge, devchallenge, ai, machinelearning
Published: 2024-04-28 16:23:18

**This is a submission for the Coze AI Bot Challenge: Bot Innovator.
What I Built**

I have developed an AI system architecture manager bot. This bot structures the main functionalities of an AI system into several modules, each designed to perform specific tasks such as data processing, model training and evaluation, prediction, and user interface management. This tool is for AI developers and it effectively helps them in building and managing AI projects following a systematic and organized process.
Demo

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

Your Configuration

The configuration of my bot involves setting up several modules:
Data Processing Module for preprocessing and cleaning input data.
Model Training Module for training the AI system using various algorithms.
Model Evaluation Module for assessing the performance of the trained models.
Prediction Module which utilizes the trained models to make new predictions.
User Interface Module which allows users to interact with the AI system.

Journey

Building this bot has been an amazing journey. Combining different modules and ensuring that they work synchronously was a challenge, but it was worth it. During this process, I learned the importance of structuring and division of tasks in large system development. The most rewarding aspect was being able to create a bot that simplifies and streamlines the AI system development process. I hope to continue improving this bot and add more customizable features in the future
Demystifying Promises: A Beginner's Guide to Asynchronous JavaScript Operations
Tags: webdev, javascript, beginners, promises
Published: 2024-04-28 16:04:53

Understanding promises can be hectic. 

[](https://tenor.com/G9rE.gif)


but fear not! This guide will break down the concept step by step, making it easy to grasp even for beginners.

**Introduction:**
Asynchronous operations are common in JavaScript, whether it's fetching data from a server or reading a file. However, managing these operations traditionally with callbacks can lead to complex and hard-to-read code. This is where promises come in. Promises provide a cleaner and more organized way to handle asynchronous operations in JavaScript. Let's dive into what promises are and how they can be used effectively.

**What is a Promise?**
A promise is an object that represents the eventual completion or failure of an asynchronous operation and its resulting value. It serves as a placeholder for the result of an asynchronous operation, allowing you to perform actions once the operation is complete.

[](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExajloZjV2dGhodWx3dXk2YXJob2tyeW91Zmw4NGlxMmo5NTJtMWZwcSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/bA4RSRKwaSMlW/giphy.gif)


**States of a Promise:
A promise has three states:**

1.Pending: The initial state of a promise. It represents that the asynchronous operation hasn't completed yet.
2.Resolved: The promise has been resolved successfully, and it returns data to the `then()` method for further processing.
3.Rejected: The promise has been rejected, indicating that an error occurred during the asynchronous operation. The error is returned to the `catch()` method for error handling.

[](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExZWVyOTl4dHI0dWV5djV4enlld2VjMHZ1enpnZW81aGdiN3JiN2ZsaCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/tIBJPRABdjvYdlBv00/giphy.gif)

**Example of Using a Promise:**

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


**Handling Data Returned by the Promise:**
Data returned by a promise can be handled using chaining of `then()` and `catch()` methods. Here's how you can do it:

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

**Conclusion:**
Promises provide a powerful way to handle asynchronous operations in JavaScript, offering a cleaner and more organized approach compared to traditional callbacks. By understanding how promises work and how to use them effectively, you can write more efficient and maintainable asynchronous code in your JavaScript applications.

[](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExcG9nNmVmeHZweWR5aWNmazZ2b3Rka3psZWhoaTl0dGsxNXRra2plbSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/cMNkMjWJ4mB3LvB5DR/giphy.gif)
Landing Page for Earth Day Celebration
Tags: devchallenge, frontendchallenge, css, javascript
Published: 2024-04-28 15:51:47

_This is a submission for [Frontend Challenge v24.04.17](https://dev.to/devteam/join-us-for-the-next-frontend-challenge-earth-day-edition-52e4), Glam Up My Markup: Earth Day Celebration Landing Page_

## What I Built

I'm assuming that the landing page is a pop-up window that appears in some platform. This format is much more efficient than a traditional landing page. 

I break the text into small chunks that can be read in a few seconds. And added a navigator that can be used to see the current location and jump to some position.

I also made a mobile and desktop adaptation of the landing page and drew a small illustration.

## Demo

{% codepen https://codepen.io/bearv5/pen/OJGGbwZ %}

## Journey

Browser implementations of CSS are not quite uniform, such as adaptive layout. I had to test it across browsers in my project.


Code License: MIT License

Copyright (c) [2024] [Bearv5]
Turn FHIR Dosage into human readable text in your wanted language and much more with fhir-dosage-utils
Tags: fhir, opensource, javascript, typescript
Published: 2024-04-28 15:46:08

## TD;LR

```js
import FhirDosageUtils from "fhir-dosage-utils";

// See https://jy95.github.io/fhir-dosage-utils/api/interface/Params for more info about config
const config = {
  language: "en",
};

// A FHIR Dosage example
const dosage = {
  timing: {
    repeat: {
      frequency: 1,
      period: 8,
      periodUnit: "h",
    },
  },
};

// Prepare utility class
let dosageUtils = await FhirDosageUtils.build(config);

// 1. You can turn dosage(s) to text
// display "1 time every 8 hours"
console.log(dosageUtils.fromDosageToText(dosage));
console.log(dosageUtils.fromMultipleDosageToText([dosage]));

// 2. You can extract part(s) of dosage, to your liking
// display "every 8 hours"
console.log(
  dosageUtils.getFields(dosage, "periodPeriodMax" /*, other parameters*/),
);

// 3. You can detect if Dosage objects contains only "sequential" instructions
// display "true"
console.log(dosageUtils.containsOnlySequentialInstructions([dosage]));

// 4. Turn this array of Dosage objects into a data structure useful to handle "sequential" and "concurrent" instructions (cf. "sequence" property).
// Display "[ [dosage] ]"
console.log(dosageUtils.groupBySequence([dosage]));

// ... And many things
// Read https://jy95.github.io/fhir-dosage-utils/api/class/default for more info
```

## Key Features

* **Compatible**: Works with [Dosage R4](https://hl7.org/fhir/R4/dosage.html) and [Dosage R5](https://hl7.org/fhir/R5/dosage.html)
* **Extensibility** Easily adaptable and extendable to accommodate your requirements
* **Internationalization** Seamlessly extendable to other languages with i18next
* **Integration** Ease Works effortlessly in various environments like the browser, Node.js, ...

Read more on : https://jy95.github.io/fhir-dosage-utils/
With ServBay, I Got an Early Taste of PHP 8.4.
Tags: webdev, beginners, tutorial, php
Published: 2024-04-28 15:27:22

PHP 8.4 (Dev) has been released, and ServBay is leading the market in supporting the latest version of PHP.


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



One of the hallmarks of PHP 8.4 is its focus on performance enhancements. These improvements are designed to speed up execution times, reduce memory consumption, and make PHP applications more responsive and efficient. For developers, this means being able to build web applications that perform better under load, offering a smoother user experience.


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



With [ServBay](https://www.servbay.com), I got an early taste of PHP 8.4, made my testing more convenient.