teleren/devto huggingface dataset:
Como criar uma conta na UpHold e ganhar 20$
Tags: contadigitalcréditoe, contadigital, dólar
Published: 2023-11-06 20:08:59

---
title: Como criar uma conta na UpHold e ganhar 20$
published: true
date: 2023-01-08 17:50:26 UTC
tags: ContaDigitalCréditoe,CONTADIGITAL,DÓLAR
canonical_url: https://astronautsdevelopers.com/como-criar-uma-conta-na-uphold-e-ganhar-20/
---

A UpHold é uma plataforma de pagamentos e câmbio de moedas virtuais, como Bitcoin e Ethereum. Além disso, a UpHold oferece uma série de outros serviços, como cartões de débito pré-pagos e contas bancárias virtuais. Neste artigo, vamos ensinar como criar uma conta na UpHold e como ganhar 20$ ao se cadastrar. Agora que você …

[Como criar uma conta na UpHold e ganhar 20$ Leia mais »](https://astronautsdevelopers.com/como-criar-uma-conta-na-uphold-e-ganhar-20/)
Nest.js integration with Kafka
Tags: kafka, microservices, node, nestjs
Published: 2023-01-08 17:38:02

The following repository demonstrates a simple microservice app which integrates NestJS with Apache Kafka.
https://github.com/rezahazegh/kafka-nestjs

## Project Description

1. Producer receives two number via `REST API`.
2. Producer sends numbers to kafka `sum` topic.
3. Consumer subscribes to `sum` topic and receives numbers and returns sum of numbers.

## Directory Description

* `infra` directory includes `docker-compose` to setup kafka
* `producer` directory includes a projects which send payloads to kafka
* `consumer` directory includes a project which receives payloads from kafka

## Run and Test

After setup kafka and running `producer` and `consumer` you can call `localhost:3000` by `POST` method.

**Sample Payload:**
```
{
    "num1": 7,
    "num2": 9
}
```

**Sample Response:**

```
Sum of 7 and 9 is: 16
```

## List of Kafka Topics

By running `npm run topic-list` inside `infra` directory, you can see list of kafka topics.

Sample Response:
```
__consumer_offsets
sum
sum.reply
```
654. Maximum Binary Tree
Tags: java, leetcode, 100daysofcode
Published: 2023-01-08 17:29:32

**Problem Statement:**

You are given an integer array nums with no duplicates. A maximum binary tree can be built recursively from nums using the following algorithm:

Create a root node whose value is the maximum value in nums.
Recursively build the left subtree on the subarray prefix to the left of the maximum value.
Recursively build the right subtree on the subarray suffix to the right of the maximum value.
Return the maximum binary tree built from nums.

 

**Example 1:**
**Input:** nums = [3,2,1,6,0,5]
**Output:** [6,3,5,null,2,0,null,null,1]
**Explanation:** The recursive calls are as follow:
- The largest value in [3,2,1,6,0,5] is 6. Left prefix is [3,2,1] and right suffix is [0,5].
    - The largest value in [3,2,1] is 3. Left prefix is [] and right suffix is [2,1].
        - Empty array, so no child.
        - The largest value in [2,1] is 2. Left prefix is [] and right suffix is [1].
            - Empty array, so no child.
            - Only one element, so child is a node with value 1.
    - The largest value in [0,5] is 5. Left prefix is [0] and right suffix is [].
        - Only one element, so child is a node with value 0.
        - Empty array, so no child.

**Example 2:**
**Input:** nums = [3,2,1]
**Output:** [3,null,2,null,1]
 

**Constraints:**

- 1 <= nums.length <= 1000
- 0 <= nums[i] <= 1000
- All integers in nums are unique.

**Solution:**
**Algorithm:**
1. Find the maximum value in the array.
2. Create a node with the maximum value.
3. Recursively build the left subtree on the subarray prefix to the left of the maximum value.
4. Recursively build the right subtree on the subarray suffix to the right of the maximum value.
5. Return the maximum binary tree built from nums.

**Code:**
```
public class Solution {
    public TreeNode constructMaximumBinaryTree(int[] nums) {

        return constructMaximumBinaryTree(nums, 0, nums.length - 1);
    }

    public TreeNode constructMaximumBinaryTree(int[] nums, int left, int right) {
        if (left > right) {
            return null;
        }
        int maxIndex = left;
        for (int i = left; i <= right; i++) {
            if (nums[i] > nums[maxIndex]) {
                maxIndex = i;
            }
        }
        TreeNode root = new TreeNode(nums[maxIndex]);
        root.left = constructMaximumBinaryTree(nums, left, maxIndex - 1);
        root.right = constructMaximumBinaryTree(nums, maxIndex + 1, right);
        return root;
    }
}
```
Create a simple chatbot using Amazon Lex
Tags: aws, cloud, awscommunity, 100daysofcloud
Published: 2023-01-08 10:11:56

[8/100] #100DaysOfCloud Today, I created a simple chatbot using Amazon Lex and taught the bot how to respond to utterances.

<u>Amazon Lex :</u>

Amazon Lex is a fully managed artificial intelligence (AI) service with advanced natural language models to design, build, test, and deploy conversational interfaces in applications.


<u>Use cases :</u>

- Build virtual agents and voice assistants
 - Enable self-service capabilities with virtual contact center agents and interactive voice response (IVR). Users can change a password or schedule an appointment without speaking to a human agent.

- Automate informational responses
 - Design conversational solutions that provide responses to frequently asked questions. Improve Connect & Lex conversation flows for tech support, HR benefits, or finance with natural language search for FAQs powered by Amazon Kendra.

- Improve productivity with application bots
 - Automate basic user tasks in your application with powerful chatbots. Seamlessly connect with other enterprise software through AWS Lambda and maintain granular access control through IAM.

- Maximize the information trapped in transcripts
 - Design chatbots using existing contact center transcripts. Reduce design time from weeks to hours and accelerate bot deployment.

You can try to create a simple chatbot using Amazon Lex yourself by following the steps from the link below :
[GitHub](https://github.com/aaditunni/100DaysOfCloud/blob/main/Journey/008/Readme.md)
After 5 years of development, I am releasing The Citadel Protocol
Tags: rust, cryptography, rsa, p2p
Published: 2023-01-08 17:02:11

---
title: After 5 years of development, I am releasing The Citadel Protocol
published: true
description: 
tags: rust, cryptography, rsa, p2p
---

Given the recent news of China (potentially) breaking RSA encryption and thus posing a direct threat to our communications, I decided that this project was now needed by engineers.

[GitHub](https://github.com/Avarok-Cybersecurity/Citadel-Protocol)

[Company Website](https://avarok.net)

[Rustdocs](https://avarok-cybersecurity.github.io/Citadel-Protocol/docs/)

[Whitepaper](https://github.com/Avarok-Cybersecurity/Citadel-Protocol/blob/master/The_Citadel_Protocol.pdf)

The Citadel Protocol is a high-performance asynchronous signal-like protocol written in rust that extends upon the ratcheting algorithm by using multi-layered ratcheting, multi-layered encryption, post-quantum key exchange, configurable **true** perfect forward secrecy (each packet gets a unique encryption key via re-keying) or best-effort modes, file-transfer encryption, built-in NAT traversal (no libp2p), configurable credentialed authentication (via argon-2id), device-dependent authentication, or passwordless authentication, amongst other features.

The Citadel Protocol is built on top of an underlying transport protocol. Either TCP, TLS, or QUIC may be used for transport (Default TLS for hybrid cryptography). The Citadel Protocol is used to communicate between nodes in the network.

The network topology contains a central globally-reachable node that is, by default, used for peer discovery and NAT traversal (this node can have application logic endowed unto it, but is not required).  Peers connect to this central server, and, upon registration and connection, are able to then message pass amongst each other and even the central server.

Since NAT traversal is easier to perform with UDP, the QUIC protocol is used for P2P connections as this is complimentary. For Client to server connections, the server can choose to use TCP, TLS, or QUIC as an underlying protocol.

Using the Citadel SDK, rust developers can easily create hyper-secure post-quantum applications that are suitable for client-to-server and p2p applications.

I have been the only developer for the past 5 years. I am now inviting others to come and help improve and guide this project to build an ecosystem of security-aware rust engineers living in the future, for the future.
📱 SMS API for developers!
Tags: api, tools, webdev, devops
Published: 2023-01-08 16:57:55

**👋 Hi everyone**

Just a quick one!

I hope you all had a great Christmas and New year holiday, we're back in action following the seasonal period now.

Over the past two weeks I've spent close to 100 hours building a new product, an SMS API called [Snapi SMS](https://snapisms.io/)

The idea behind Snapi SMS was to create a simple API with just a handful of API endpoints, they are:

1. Send message
2. Check message delivery status
3. Get API key credit balance

And...

To provide a simple, yet cost-effective solution to sending text messages globally.

I'm pleased to announce that the project is now live, and can be accessed at the following link: [snapisms.io](https://snapisms.io/)

Check it out and let me know what you think!
Skater Private Keys Depot. How to manage Keys?
Published: 2023-01-08 16:22:35

Rustemsoft presents a modern key management system that provides cloud data encryption approaches to secure your data keys.

A usual problem for developers is managing secret keys used to protect communication between applications and services. Skater Private Keys that are managed identically, rule out the need for developers to manipulate with these credentials.

App developers can safely add the keys into Skater Private Keys Depot, and then apps can access Skater Private Keys Depot to retrieve stored credentials. Managed Private Keys Depot provide an automatically managed secret Key in Skater Private Keys Depot for applications to use when connecting to specific resources. [Applications can use managed Skater Depot to obtain Keys without having to manage any credentials.](https://qr.ae/prKg7h)
how to fix image in CSS
Tags: css, webdev, html, frontend
Published: 2023-01-08 16:22:06

To fix an image in CSS, you can use the position property and set it to fixed. This will position the image relative to the browser window, and it will not move even if the page is scrolled.

Here's an example of how you can fix an image in the top-left corner of the browser window:

```
img.fixed {
  position: fixed;
  top: 0;
  left: 0;
}
```
You can also use the bottom and right properties to position the image in other parts of the window.

```
img.fixed {
  position: fixed;
  bottom: 0;
  right: 0;
}
```
To apply this style to an image, you can give the image a class name (e.g., "fixed") and then use that class name in the CSS selector (e.g., "img.fixed").

```
<img src="my-image.jpg" class="fixed">
```
I hope this will be helpful in your projects. If you like it then do share it.
Declarative approach for creating a service
Tags: kubernetes, devops, tutorial, opensource
Published: 2023-01-08 16:21:44

Service.yml:
```
apiVersion: v1
kind: Service
metadata:
  name: <name_of_service>
spec:
  selector:
    <labelkey_of_pod_that’s_supposed_to_be_part_of_service>: <labelvalue_of_pod_that’s_supposed_to_be_part_of_service>
  ports: <value_entered_is_as_list>
    protocol: ‘TCP’
    port: 
    targetPort:
  type: 
protocol: <by_default_value_is_TCP>
port: <port_number_at_which_service_will_be_exposed> i.e. outside_world_port
targetPort: <port_at_which_container_will_be_exposed> i.e. port_inside_container
  type: <clusterIP / Nodeport / Loadbalancer> 
```

//refer “Exposing a deployment in kubernetes” blog for getting detailed idea of type.  

> .kind: Defines the type of k8s object being created
> .metedata.name: Assigns the name to the service object.
> .spec: Defines the specification of service object
> .spec.selector: Here, the value of selector is always set to “Matchlabels” by default and hence, we don't define it.
> What is does is, it basically looks for the pods that have the labelkey and labelvalue pair as defined under selectors, and then controls those pods under this service.
So, for e.g. if key value pair is, 
```
spec:
  selector:
    app:backend 
```
So, it will look for all the pods having this key,value pair as label. Now, if backtracking to the origin of pods, we find that pods are created via deployment. Therefore, now on joining the dots we can conclude that, the value in selector should be same as:
.spec.selector.matchLabels

> .spec.ports: The value accepted here is in list format as we can enter more than one value and hence its defined as portS.
> .spec.ports.protocol: By default is ‘TCP’
> .spec.ports.port:
>  port_number_at_which_service_will_be_exposed

To apply this service, run:
```
kubectl -f apply service.yml
```
VIM - Insert and Change
Tags: learning, vim
Published: 2023-01-08 16:18:33


As I mentioned in the post before, VIM is one of the techs I want to learn this year. VIM has been always present since my early days in tech but I never spend time on it. I guess now it is time to make an amend with the past. 😅

## Insert Mode:

<kbd>i</kbd> - insert before the cursor 
<kbd>I</kbd> - insert in the beginning of the line 
<kbd>a</kbd> - insert after the cursor 
<kbd>A</kbd> - insert in the end of the line 
<kbd>o</kbd> - insert below the line 
<kbd>O</kbd> - insert before the line 
<kbd> <kbd>[count]</kbd> <kbd>[motion]</kbd> <kbd>text</kbd> </kbd> - repeat the motion [count] times

> Examples:
<kbd> <kbd> 8 </kbd> <kbd> i </kbd> <kbd> * </kbd> </kbd> - insert the character **\*** 8 times in the same line 
<kbd> <kbd> 8 </kbd> <kbd> o </kbd> <kbd> # </kbd> </kbd> -  create 8 new lines starting with **#**

### Change:

<kbd>R</kbd> - overwrite the existing text 
<kbd>r</kbd> - Replace one character 
<kbd> <kbd>c</kbd> <kbd>w</kbd> </kbd> - change the word 
<kbd> <kbd>c</kbd> <kbd>c</kbd> </kbd> - Change the entire line 
<kbd> <kbd>c</kbd> <kbd>$</kbd> </kbd> or <kbd>C</kbd> - replace from your current cursor to the end of the line 
<kbd> ~ </kbd> - Switch character from upper/lower case. 
<kbd> <kbd>g</kbd> <kbd>~</kbd> <kbd>w</kbd> </kbd> - Switch a letter from upper/lower case. 
<kbd> <kbd>g</kbd> <kbd> ~ </kbd> <kbd> $ </kbd> </kbd> or <kbd> <kbd>g</kbd> <kbd> ~ </kbd> <kbd> ~ </kbd> </kbd> - Switch the line to upper/lower case.
<kbd> <kbd>g</kbd> <kbd>U</kbd> <kbd>w</kbd> </kbd> - make the word uppercase 
<kbd> <kbd>g</kbd> <kbd>U</kbd> <kbd>U</kbd> </kbd> - make all the line uppercase 
<kbd> <kbd>g</kbd> <kbd>u</kbd> <kbd>w</kbd> </kbd> - make the word lowercase 
<kbd> <kbd>g</kbd> <kbd>u</kbd> <kbd>u</kbd> </kbd> - make all the line lowercase 

### Joining lines:

<kbd>J</kbd> - Join lines with a space by the end of the current line. 
<kbd> <kbd>g</kbd> <kbd>J</kbd> </kbd> - Join lines without a space be the end the current line. 
<kbd><kbd>[count]</kbd> <kbd>J</kbd> </kbd> -  Joint **[count]** lines together
Controlli e azioni di un agente
Tags: webdev, computerscience
Published: 2023-01-08 16:18:28

In questo articolo andiamo a vedere nello specfico la logica del corpo di un agente, daremo un'occhiata alla sua architettura e come agisce, ovvero come usa le regole definite nel precedente articolo all'interno del suo ragionamento.

[Link Post](https://www.federicocalo.dev/Controlli-e-azioni-di-un-agente)
Get Your Spin On: A Guide to the CSS Loader Websites
Tags: css, loader, programming, productivity
Published: 2023-01-08 16:12:20

{% embed https://www.youtube.com/embed/6xWKQQJIk7Q %}
CSS loaders are those nifty little spinning things that you see on websites while they're loading content. They're like the digital equivalent of a bouncer at a trendy nightclub, standing at the door and letting you know that the party is happening, but you have to wait just a little bit longer before you can get in on the fun.

And just like there are tons of different nightclubs to choose from, there are also tons of different CSS loader websites to check out. Here are six of them:

- [cssloaders.github.io](https://cssloaders.github.io/)

- [whirl.netlify.app](https://whirl.netlify.app/)
- [loading.io/css](https://loading.io/css)

- [cssportal.com/css-loader-generator](https://www.cssportal.com/css-loader-generator/)
- [codepen.io/vank0/pen/mrRwLg](https://codepen.io/vank0/pen/mrRwLg)
- [10015.io/tools/css-loader-generator](https://10015.io/tools/css-loader-generator)

So whether you're looking for a simple spinning circle or a work of art, these CSS loader websites have got you covered. Happy loading!
All'interno di un agente: architettura e le funzioni agenti
Tags: webdev, computerscience
Published: 2023-01-08 16:10:28

Dopo aver spiegato lo spazio di progettazione di un agente, andiamo a comprendere la sua architettura, ovvero come come un agente intelligente può percepire, ragioanre e agire nel tempo in un ambiente. Andremo ad ispezionare la gerarchia all'interno di un agente e i modi in cui esso può essere costruito.

[Link Post](https://www.federicocalo.dev/All-interno-di-un-agente:-architettura-e-le-funzioni-agente)
Spazio di progettazione e applicazioni prototipiche
Tags: webdev, computerscience
Published: 2023-01-08 16:09:26

In questo articolo andremo ad approfondire lo spazio di progettazione degli agenti, con le relative proprietà e limiti. Infine definiremo alcune applicazioni in cui l'intelligenza artificiale può essere applicata, descrivendo in maniera generale alcuni esempi.

[Link post](https://www.federicocalo.dev/Spazio-di-progettazione-di-un-agente)
Technologies I want to learn or keep improving in 2023
Tags: programming, career, learning
Published: 2023-01-08 16:08:03

It is 2023 already! I wanna to keep growing as a software engineer. Here are some of the technologies I would like to learn/improve this year.

- VIM
- AWS
- TailwindCSS
- React / Typescript (Keep improving in these techs)
- tRPC
- Machine Learning
Is code refactoring always necessary?
Tags: webdev, programming, beginners, tutorial
Published: 2023-01-08 16:01:06

Some developers argue that code refactoring is a waste of time and that it is preferable to simply write clean code from the start. Others consider code refactoring to be an important part of the development process.  

I want to ask, is code refactoring always necessary, or are there times when it isn't worth the effort?
Intelligenza artificiale e agenti
Tags: computerscience, webdev
Published: 2023-01-08 16:00:38

Introduzione all'ingegneria della conoscenza, andando a definire che cos'è l'intelligenza artificiale, gli agenti e l'ambiente in cui essi operano. Vedremo i vari algoritmi che vengono applicati in questo settore, in quali casi e le varie metodologie di ricerca della soluzione.

[Link post](https://www.federicocalo.dev/Introduzione-ingegneria-della-conoscenza)
Conoscere l'utente
Tags: computerscience, webdev
Published: 2023-01-08 15:59:29

All'interno dello sviluppo incentrato sull'utente, possiamo visualizzare l'utente da molteplici punti di vista. E' fondamentale analizzare i processi cognitivi, le caratteristiche personali e il ruolo dei singoli utenti che interagiscono con il sistema. Il progettista di sistemi interattivi non deve perdere di vista questi obiettivi, vediamo come.

[Link post](https://www.federicocalo.dev/Interazione-uomo-macchina-Conoscere-l-utente)
Coding a WhatsApp AI assistant
Tags: bot, calendar, whatsapp, gpt
Published: 2023-01-08 15:45:18

---
title: Coding a WhatsApp AI assistant
published: true
description: This bot sends WhatsApp messages with Google Calendar event description for today. You can integrate OpenAI to generate messages with an artificial intelligence to get these messages like "Write a birthday greeting for Peter" as summary event.
tags: bot, calendar, whatsapp, gpt
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-01-08 15:33 +0000
---

Have you also forgotten to congratulate a friend on WhatsApp? I do, and I'm not proud of it, but I am capable of solving it.

As a result of this problem I had the idea of schedule in my Google calendar all the birthdays of my friends and thus receiving a notification on the appointed day. However, when the day comes, I am able to read the notification but postpone sending that message or call and forget for the rest of the day that this task was pending.

I usually use WhatsApp to congratulate my contacts, so one day I decided to integrate all this so that when the time comes it is sent automatically. Well, that project had a problem and it was that I had to write the different messages, each and every one of them, if I didn't want all my friends to receive the same congratulations. But artificial intelligence knows how to generate messages, so it had a solution to everything: remember the day, generate a personalized greeting and send it automatically.

![schedule a event in google calendar](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u67chf4ya0h34a5mclvx.png)

![delivered automatic message](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x47yh0afxqlaxo3iz9xs.png)

This is how I created [this open source project](https://github.com/sergiogragera/whatsapp-calendar-gpt-bot) where given an event with the subject "Write a birthday message for my friend Peter" and when the day of the event arrives, it is processed by an artificial intelligence that composes a message like "Happy birthday Peter! I wish you a day full of joy, love and laughter..." and is sent by WhatsApp to the contact or list of contacts assigned to the event. If one day I want to send a specific message, I just have to write it in the description and nothing will be generated automatically. That message will just be sent.

![start script command](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o1j2humf831lyl3gwpgp.png)

We have an assistant on WhatsApp scheduled from a calendar! Next steps? Well, in the roadmap I have to process the messages that arrive in my personal chat (the one that I keep with myself) and respond with the generated message, thus creating a personal assistant. I think with a few more lines I could transcribe the audio message to text to create a more natural user interface and even output the response as audio so I can speak and listen directly to the assistant. I hope you like it!
I due tipi di commutazione
Tags: computerscience, community
Published: 2023-01-08 15:28:36

Analizziamo come le applicazioni si scambiano i pacchetti, esaminando la commutazione di circuito e la commutazione di pacchetto. Confrontiamo i due tipi di commutazione ed esminiamo le varie problematiche di ciascuno.

[Link post](https://www.federicocalo.dev/Reti-di-Calcolatori-Vari-Tipi-Di-Commutazione)
Diagramma Entità Relazione
Tags: webdev, computerscience
Published: 2023-01-08 15:39:08

In relazione al caso di studio del gestionale associativo, in questo articolo entriamo nel dettaglio di uno schema entità relazione delle entità e delle relazioni che dovranno essere implementate all'interno del database e che rappresentano una prima fotografia di com'è organizzata l'associazione in questa fase.

[Link Post](https://www.federicocalo.dev/Gestionale-associazione-diagramma-entita-relazione)