teleren/devto huggingface dataset:
Clean Code - Anotações interessantes sobre o prefácio e os 3 primeiros capítulos
Published: 2023-07-12 22:31:19

Oioi besties, tudo bem? 
Este é o primeiro de uma série de artigos sobre o livro Clean Code - Robert C. Martin, em que pretendo trazer, de forma sucinta, anotações e comentários sobre o que aprendi com a leitura.

Logo no prefácio, é citada a metodologia 5S - até então, eu só conhecia o 5S utilizado em ambiente industrial, graças ao trabalho do meu pai - cujos conceitos são:



* Seiri (ou utilização, em português);
* Seiton (ou organização, em português);
* Seiso (ou limpeza, em português);
* Seiketsu (ou normalização);
* Shutsuke (ou disciplina);

Já no primeiro capítulo (Clean Code), o autor nos faz pensar sobre o que é o código limpo, como deve ser feito e sua função. Gosto bastante do trecho que diz que o código limpo pode ser lido, compreendido e alterado por um desenvolvedor diferente do autor. Além disso, o código deve possuir testes de unidade/unitários/de aceite, possuir nomes significativos e poucas dependências. Ademais, evitar duplicidade de código também é importantíssimo.

No segundo capítulo (Meaninful Names), é abordada a importância de nomes bem definidos para classes, atributos, métodos e responder questionamentos importantes, como: "Por que existe?", "O que faz?" e "Como é usado?"; deve evitar desinformação; o nome de uma classe deve conter um substantivo e evitar verbos; em contrapartida, métodos devem possuir verbos em seu nome; manter um contexto significativo e evitar o excesso de informação gratuita.

O assunto tratado é função (Functions) e acredito que o principal ponto trazido é: funções devem fazer apenas uma coisa, fazê-la bem e apenas isso. Ademais, devem ser curtas, evitar misturar abstrações pois pode dificultar a leitura e compreensão do que é feito.

Bom, por hora esses são os pontos que acho interessante ressaltar - e são coisas que eu tenho certeza que vou consultar várias vezes - então espero que seja útil pra quem deseja um brevissimo resumo ou instigue a curiosidade para ler o livro e aprender de modo mais detalhado. 

**Fontes utilizadas:**

- [O que é 5S](https://rockcontent.com/br/blog/metodologia-5s/)
- [Link do ebook](https://www.amazon.com.br/Robert-Martin-Clean-Collection-English-ebook/dp/B00666M59G)
Calculating the Average Execution Price of MARKET Orders on the Binance API
Tags: binance, api, crypto, trading
Published: 2023-07-12 21:50:08

---
title: Calculating the Average Execution Price of MARKET Orders on the Binance API
published: true
description: Learn how to calculate the average execution price for market orders using the Binance API
tags: binance, api, crypto, trading
---

![binance](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vafkezfj7n56rl6kd8s2.jpg)

**Table of Contents**

- [Introduction](#introduction)
- [What is a Market Order?](#what-is-a-market-order)
- [Example of Binance API Response](#example-of-binance-api-response)
- [How to Calculate the Average Execution Price](#how-to-calculate-the-average-execution-price)
- [Practical Example](#practical-example)
- [Conclusion](#conclusion)

---

## Introduction

In this tutorial, we will understand how to calculate the average execution price for market orders in the Binance API.

## What is a Market Order?

A market order is a request to buy or sell an asset (in this case, a cryptocurrency) at the best available market price.

## Example of Binance API Response

Here is an example of a response from the Binance API after executing a market order:

```json
{
    "symbol": "BNBUSDT",
    "orderId": 4741809903,
    "orderListId": -1,
    "clientOrderId": "Pk4WeE2X5OduzaabLI7vTn",
    "price": "0.00000000",
    "origQty": "0.05400000",
    "executedQty": "0.05400000",
    "cummulativeQuoteQty": "12.97620000",
    "status": "FILLED",
    "timeInForce": "GTC",
    "type": "MARKET",
    "side": "BUY",
    "stopPrice": "0.00000000",
    "icebergQty": "0.00000000",
    "time": 1688580085707,
    "updateTime": 1688580085707,
    "isWorking": true,
    "workingTime": 1688580085707,
    "origQuoteOrderQty": "13.15000000",
    "selfTradePreventionMode": "NONE"
}
```

## How to Calculate the Average Execution Price

To calculate the average execution price, you can use the data provided in the API response after executing a market order.

Note the following fields in the response:

1. `cummulativeQuoteQty`: The total amount of the quote currency (in this case, USDT) used to execute the order.
2. `executedQty`: The amount of assets (in this case, BNB) actually bought/sold.

The average execution price can be calculated by dividing `cummulativeQuoteQty` by `executedQty`.

## Practical Example

Consider the following values in an API response:

```
"executedQty": "0.05400000"
"cummulativeQuoteQty": "12.97620000"
```

To calculate the average execution price, do the following:

```
Average Price = cummulativeQuoteQty / executedQty
Average Price = 12.97620000 / 0.05400000
Average Price ≈ 240.302 USD
```

Therefore, the average execution price of the buy order was approximately 240.302 USDT per BNB.

## Conclusion

Remember that this calculation is valid only for market orders (MARKET) on Binance and depends on the values provided by the API. In other types of order or different situations, additional calculations or approaches may be required.
Simple tutorial on how to uppercase (capitalize) the first letter of a word with JavaScript.
Tags: webdev, javascript, beginners, tutorial
Published: 2023-07-12 22:20:01

Hello! This is a post made by a beginner to beginners! In this article I'm going to explain in simple terms how to uppercase the first letter of a word using JavaScript. 
This is a technique that I recently learned when I was building an app for my first project at the [Flatiron School](https://flatironschool.com/), and I thought it was going to be a good idea to explain to other beginners the 'how-to', in easy steps. Let's get started!

To capitalize the first letter of a word with JavaScript, we will need three string methods: charAt, toUpperCase and slice.

### Step 1 - charAt string method

The charAt method returns the character at a specified index (position) in a string. The index of the first character is 0, the second 1, and so on. With this method we can retrieve the first letter of a word.

![charAt](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7y5g2b0bwoyrst1iy70c.png)

### Step 2 - toUpperCase string method

The toUpperCase method converts a string to uppercase letters.  We will use this to capitalize the first letter.

![toUpperCase](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/96cjkrf2hfuie671q4dp.png)

### Step 3 - Slice string method

The slice method extracts a part of a string. The start and end parameters specifies the part of the string to extract. The first position is 0, the second is 1, and so on. 
We will use this method to cut out the remaining part of a word (excluding the first letter).

![Slice](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2befogr122fr2tak143y.png)

### Step 4 - Joining everything together

By using the three string methods above, we will get the first letter of the word, capitalize it, then join it with the remaining sliced part of the word.

![Joining everything](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nip25x6jyeykf2nu67cw.png)

The short version for the code above is:

![Short version](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wyx6e93hm09gdzcjvq3f.png)

Thanks for reading!


Source: [W3Schools](https://www.w3schools.com)
The 32nd Day of the 100 Days of Code Challenge
Published: 2023-07-12 21:30:36

Hey everyone!
Today, I tried to combat the audio tranmission issue in my real-time transcription app some more but unfortunately, I couldn't do it. I then met up with my first client as a freelancer to discuss the implementation of the project, excited to be working with them and it seems to be a great first job! I only asked for five dollars, I clearly undervalued myself but all I wanted was one oppourtunity to get started with, I didn't want to limit my reach with the price.

So now, I'm hoping to gain some experience with this job and reach more people looking for freelancers in the domains I constantly explore and learn about.

Since I really want to implement the Diart library in my project, as it seems to do what I need it to quite perfectly in a much more thought-out approach than mine, I opened a new issue on GitHub and I'm hoping to fix that part as soon as possible.

As I've reached a small blockade, I'll move on to another personal project, which is the assistant that makes restaurant reservations on its own. It's time to make it an end-to-end application by making it capable of actually making calls and adding a summary element that will serve as output to the user.

Really excited about what's to come,
Happy coding everyone!
Simplifying Data Conversion with the toIntegerList() Function
Tags: apacheag, postgres, internship, softwareengineering
Published: 2023-07-12 21:28:21

## Introduction
This is a short blog about the toIntegerList() function, we'll explore a function that takes a list of values and produces a new list containing only integer values. 

## About toIntegerList()

The toIntegerList() function is designed to efficiently convert values in a list to integers. It scans each element in the input list and attempts to convert it to an integer. If successful, the converted integer value is added to the new output list. However, if the conversion fails, the corresponding element in the output list is set to null.

## Regression Tests

To improve the understanding, dive into the regression tests!

```sql
! -- toIntegerList()
! SELECT * FROM cypher('expr', $$
!     RETURN toIntegerList([1, 7.8, 9.0, '88'])
! $$) AS (toIntegerList agtype);
!  tointegerlist 
! ---------------
!  [1, 7, 9, 88]
! (1 row)
! 
! SELECT * FROM cypher('expr', $$
!     RETURN toIntegerList([4.2, '123', '8', 8])
! $$) AS (toIntegerList agtype);
!  tointegerlist  
! ----------------
!  [4, 123, 8, 8]
! (1 row)
! 
! SELECT * FROM cypher('expr', $$
!     RETURN toIntegerList(['41', '12', 2])
! $$) AS (toIntegerList agtype);
!  tointegerlist 
! ---------------
!  [41, 12, 2]
! (1 row)
! 
! SELECT * FROM cypher('expr', $$
!     RETURN toIntegerList([1, 2, 3, '10.2'])
! $$) AS (toIntegerList agtype);
!  tointegerlist 
! ---------------
!  [1, 2, 3, 10]
! (1 row)
! 
! SELECT * FROM cypher('expr', $$
!     RETURN toIntegerList([0000])
! $$) AS (toIntegerList agtype);
!  tointegerlist 
! ---------------
!  [0]
! (1 row)
! 
! -- should return null
! SELECT * FROM cypher('expr', $$
!     RETURN toIntegerList(["false_", 'asdsad', '123k1kdk1'])
! $$) AS (toIntegerList agtype);
!    tointegerlist    
! --------------------
!  [null, null, null]
! (1 row)
! 
! SELECT * FROM cypher('expr', $$
!     RETURN toIntegerList([null, ['A', 'B'], 'one'])
! $$) AS (toIntegerList agtype);
!    tointegerlist    
! --------------------
!  [null, null, null]
! (1 row)
! 
! -- should fail
! SELECT * FROM cypher('expr', $$
!     RETURN toIntegerList(123, '123')
! $$) AS (toIntegerList agtype);
! ERROR:  toIntegerList() argument must resolve to a list or null
! SELECT * FROM cypher('expr', $$
!     RETURN toIntegerList([12]12)
! $$) AS (toIntegerList agtype);
! ERROR:  syntax error at or near "12"
! LINE 2:     RETURN toIntegerList([12]12)
!                  
```

- This feature is under review in [Apache AGE](https://github.com/apache/age) master branch.

- You can reach it by this following link: [Added the toIntegerList() function #1025](https://github.com/apache/age/pull/1025)
Calculando o preço médio de execução de ordens MARKET na Binance API
Tags: binance, api, crypto, trading
Published: 2023-07-12 21:25:12

---
title: Calculando o preço médio de execução de ordens MARKET na Binance API
published: true
description: Aprenda a calcular o preço médio de execução para ordens de mercado usando a API Binance
tags: binance, api, crypto, trading
---

![binance](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vafkezfj7n56rl6kd8s2.jpg)

**Índice**

- [Introdução](#introdução)
- [O que é uma ordem de mercado?](#o-que-é-uma-ordem-de-mercado)
- [Exemplo de Resposta da API Binance](#exemplo-de-resposta-da-api-binance)
- [Como calcular o preço médio de execução](#como-calcular-o-preço-médio-de-execução)
- [Exemplo Prático](#exemplo-prático)
- [Conclusão](#conclusão)

---

## Introdução

Neste tutorial, vamos entender como calcular o preço médio de execução para ordens de mercado na API Binance.

## O que é uma ordem de mercado?

Uma ordem de mercado é um pedido para comprar ou vender um ativo (neste caso, uma criptomoeda) ao melhor preço de mercado disponível.

## Exemplo de Resposta da API Binance

Aqui está um exemplo de uma resposta da API Binance após a execução de uma ordem de mercado:

```json
{
    "symbol": "BNBUSDT",
    "orderId": 4741809903,
    "orderListId": -1,
    "clientOrderId": "Pk4WeE2X5OduzaabLI7vTn",
    "price": "0.00000000",
    "origQty": "0.05400000",
    "executedQty": "0.05400000",
    "cummulativeQuoteQty": "12.97620000",
    "status": "FILLED",
    "timeInForce": "GTC",
    "type": "MARKET",
    "side": "BUY",
    "stopPrice": "0.00000000",
    "icebergQty": "0.00000000",
    "time": 1688580085707,
    "updateTime": 1688580085707,
    "isWorking": true,
    "workingTime": 1688580085707,
    "origQuoteOrderQty": "13.15000000",
    "selfTradePreventionMode": "NONE"
}
```

## Como calcular o preço médio de execução

Para calcular o preço médio de execução, você pode usar os dados fornecidos na resposta da API após a execução de uma ordem de mercado.

Observe os seguintes campos na resposta:

1. `cummulativeQuoteQty`: A quantidade total da moeda de cotação (neste caso, USDT) usada para executar a ordem.
2. `executedQty`: A quantidade de ativos (neste caso, BNB) realmente comprados/vendidos.

O preço médio de execução pode ser calculado dividindo `cummulativeQuoteQty` por `executedQty`.

## Exemplo Prático

Considere os seguintes valores em uma resposta da API:

```
"executedQty": "0.05400000"
"cummulativeQuoteQty": "12.97620000"
```

Para calcular o preço médio de execução, faça o seguinte:

```
Preço médio = cummulativeQuoteQty / executedQty
Preço médio = 12.97620000 / 0.05400000
Preço médio ≈ 240.302 USD
```

Portanto, o preço médio de execução da ordem de compra foi de aproximadamente 240.302 USDT por BNB.

## Conclusão

Lembre-se de que esse cálculo é válido apenas para ordens de mercado (MARKET) na Binance e depende dos valores fornecidos pela API. Em outros tipos de ordem ou situações diferentes, podem ser necessários cálculos ou abordagens adicionais.
Day 781 : My Pen And Pad
Tags: hiphop, code, coding, lifelongdev
Published: 2023-07-12 21:23:08

_liner notes_:
- Professional : Whew... what a day. Had a pair programming session with some from the engineering team to verify what's coming from the endpoint matches what I'm writing in the docs. It was a good productive session. To get more insight on my own, I wanted to get access to the code itself. That was a journey in of itself. haha It's in the hands of an administrator now. Also, found out that the plans that was determined yesterday have shifted so I had to change up what I'm working on. Spent the rest of the day making changes and getting things working.

- Personal : Got the images placed on the HTML canvas. Worked it out to where as more images get added they all get centered. Had to pull out my pen and pad to do some algebra to get it to work. haha.

![Mountainous landscape in Kalampaka, Greece with a building in the mountain side with a road and a lot of trees in a valley](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kxuq70y8nmkyry78t40w.jpg)

Going to go through tracks for the radio show. For my side project, I want to get saving the session with an image to the backend working and if I have time, get pulling the data so that I can edit the session started. Side note: I had a doctor's appointment that I made MONTHS ago in the beginning of the year to get a check up. The office called me to say the doctor had to cancel and to call them to reschedule. Guess when the next time I would be able to see the doctor? EFFIN DECEMBER!!! WTF?!? haha Literally like a year to get a check up. I scheduled an appointment with another doctor the earliest time I could get was August. Got to love the American Healthcare system.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube T9wMe6lHuhA %}
What is Data Scientist ?
Tags: datascience, scientist
Published: 2023-07-12 21:17:49


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0h2u4oe6b5me5cr5dzp7.jpg)](https://www.indiantechnologyskills.tech/2023/07/what-is-data-scientist.html)

[What is Data Scientist ?](https://www.indiantechnologyskills.tech/2023/07/what-is-data-scientist.html) In today's digital age, the field of data science has emerged as a powerful force, driving innovation and driving change across industries. At the heart of this rapidly growing field lies the data scientist – a professional equipped with the skills and expertise to understand massive amounts of data and extract valuable insights. But who exactly is a data scientist, and what do they do? Let's delve deep into this captivating role and explore its intricacies.

[Read more...](https://www.indiantechnologyskills.tech/2023/07/what-is-data-scientist.html)
The Impact of Social Media on Mental Health
Tags: socialmedia, mentalhealth, impact
Published: 2023-07-12 21:12:33


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bs693n5jbm3pj1ck0z79.jpg) ](https://www.indiantechnologyskills.tech/2023/07/the-impact-of-social-media-on-mental.html)

[The Impact of Social Media on Mental Health.](https://www.indiantechnologyskills.tech/2023/07/the-impact-of-social-media-on-mental.html) In today's digital age, social media has become an integral part of our lives. The Impact of Social Media on Mental Health. Although it allows us to stay connected with friends and family, share experiences and discover new things, there is growing concern about its impact on mental health. The Impact of Social Media on Mental Health. The purpose of this article is to explore the various ways in which social media can affect our well-being. The Impact of Social Media on Mental Health.

[Read more...](https://www.indiantechnologyskills.tech/2023/07/the-impact-of-social-media-on-mental.html)
Top 10 Programming Languages
Tags: programming, coding, javascript
Published: 2023-07-12 21:00:50


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p4c3a1dw8rne5f29149o.jpg)](https://www.indiantechnologyskills.tech/2023/07/top-10-programming-languages.html)

[Top 10 Programming Languages.](https://www.indiantechnologyskills.tech/2023/07/top-10-programming-languages.html) With new programming languages constantly emerging, it can be overwhelming to determine which languages are worth your time and effort to master. Top 10 Programming Languages. To help you navigate this vast ocean of choices, we have compiled a list of the top 10 programming languages that are currently reshaping the world of technology. Top 10 Programming Languages.

[Read more...](https://www.indiantechnologyskills.tech/2023/07/top-10-programming-languages.html)
Importance of Entrepreneurship
Tags: socialmedia, career
Published: 2023-07-12 20:54:56


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j4mnaxjniqfor67v5zl4.jpg)](https://www.indiantechnologyskills.tech/2023/07/introduction-entrepreneurship-is.html)
[
Importance of Entrepreneurship.](https://www.indiantechnologyskills.tech/2023/07/introduction-entrepreneurship-is.html) Entrepreneurship is a powerful force that drives innovation, economic growth and social progress. Importance of Entrepreneurship. In this article, we highlight the importance of entrepreneurship, exploring how it fosters creativity, creates job opportunities and spurs economic growth. Importance of Entrepreneurship. We discuss the major benefits of entrepreneurship for individuals, communities and the global economy. Importance of Entrepreneurship.

[Read more...](https://www.indiantechnologyskills.tech/2023/07/introduction-entrepreneurship-is.html)
Pieces of advice I'd give to my younger self as a developer 🦉
Tags: beginners, programming, career, discuss
Published: 2023-07-12 20:51:34

I was going through some old photos earlier today and was thinking a bit about my first years in tech. So if I were to start over now what words of advice would I give to my younger self?

📌  **Keep It Short and Simple (K.I.S.S.).**

If it gets too long, then you're probably doing something wrong. A generic rule of thumb is that functions and methods should be self-describing and do **only one** thing. If your function becomes too long or needs more than 2 parameters then you already know that you got to split it into multiple functions.

📌  **Make sure you will be able to understand that function of yours in 5 years from now.**

As a beginner you’re always thinking that building things fast is way more important than anything else. It took me lots of nonsense code and forgotten implementations to realise that I should write well-documented code for my colleagues, but most importantly for my future self.

📌  **Don’t implement the first solution you think of.**

Once again, faster is not always better. If you’re about to build something, come up with two or three alternative solutions, and understand when and how some are better or worse than each other. Even for small things, like iterating an array, don’t forget to look up for alternatives to your solution before diving into it. You will be surprised with how many fundamental things you don’t know.

📌  **You don’t have to say you’re “Done” unless you really are.**

This was one of my biggest mistakes back then. I always wanted to show off and finish my task earlier than expected. The result was missing documentation, unwritten tests and an increasing technical debt that I had to pay off some weeks later. In general take your time, don’t rush. Even life is a marathon, not a sprint, don’t you agree?

📌  **Enjoy your new superpower and have some fun with it.**

Being able to write code and implement UIs and/or functionalities is a superpower. You will make use of it during your 9-5 job to make a living, but don't forget to have fun with it too. Every now and then, develop apps or automations in order to solve every day problems of yours or to make the lives of your beloved ones easier. Not only you will love the process, but you will also extend your knowledge set.

👉🏻  Do you have any piece of advice that you'd give to your younger self?
TIL 1st Week
Tags: beginners, codenewbie, learning
Published: 2023-07-12 20:49:58


We are learning **HTML**
Here are somethings that I feel like would be good to keep in mind
`````
<p> is used to start a paragraph, this has to be closed
<em> is used to write a word in italics
<strong> is used to make words in bold
<br> is to make breaks, this does not have to be closed

<ul> stands for unordered list, so bullet points 
<ol> stands for ordered list, so numbered
Each listed item must start and end with <li>
to put in an img you use <img and then close it with / >
href means you are creating a path from the code to another file
rel describes the relationship between the connection
```
![different css words](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fp3rb7x89b0mw5mqla1g.png)