teleren/devto huggingface dataset:
Item 35: Use os campos de instância em vez dos valores ordinais
Tags: java, efectivejava, enums, development
Published: 2024-06-20 01:29:02

**1. Problemas com o Uso de Ordinais:**

- Manutenção Difícil:
 Reordenar as constantes de enum quebra a lógica dependente do método ordinal().

- Limitações de Valor Int:
 Não é possível associar múltiplas constantes ao mesmo valor int.

- Constantes Falsas Necessárias: 
Para valores int intermediários sem denominação, você precisa adicionar constantes não representativas.

**2. Exemplo de Problema:**

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

- Reordenar Constantes:
 Quebraria numberOfMusicians().

- Adicionar Constantes:
 Impossível sem conflitos de valores.

**3. Solução Recomendada:**

- Use Campos de Instância:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/60s6n1eqzv8lqul6wkjf.jpg)

**4. Benefícios da Solução:**

- Flexibilidade: 
Permite associar múltiplas constantes ao mesmo valor int.
Manutenção Simplificada: Reordenar constantes ou adicionar novas não quebra a lógica existente.

- Evita Constantes Falsas:
 Não há necessidade de adicionar valores intermediários desnecessários.

**5. Recomendação Geral:**

- Evitar Ordinais: 
A especificação do Enum sugere que o método ordinal() deve ser usado principalmente por estruturas de dados baseadas em enums, como EnumSet e EnumMap.

- Uso Restrito: 
Se não estiver criando tais estruturas, é melhor evitar o método ordinal().

**Conclusão:**
Utilize campos de instância em enums para armazenar valores associados, garantindo maior flexibilidade, facilidade de manutenção e evitando a criação de constantes artificiais.
Install Nginx in Ubuntu 20.04
Published: 2023-04-01 15:13:52

**1. Click on Launch Instances**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j3l8cin9d0o038t1jzaf.png)

**2. Add Server Details**

- Enter Server name
- Select OS Image here we select Ubuntu 22.04
- Create key pair file this will be use for SSH login

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

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

**Configure network setting**

- Select create security group if you have existing you can select your existing security group also
- Allow SSH traffic from Anywhere for security best practise allow your or specific List of IP   
- Select Allow both HTTP & HTTPS traffic from internet
 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ud0kp603yrs8xe5m8d0h.png)


**Create Elastic IP**
Normal EC2 server if restart or Reboot then there Public IP will always change there for we are creating Elastic IP separately
- Click on **Allocate Elastic IP address**
 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4vf6u22e0qciytgkmvul.png)


Click on **Allocate**

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

Click on **Assign Elastic IP**

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

Select that created Ec2 server from List 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zpwepsh9n44fsjhotygt.png)

Here you can check that Elastic IP
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9xm821q2cqm2l3oqsule.png)

**Connect to SSH**

`chmod 400 TestServer.cer`
`sudo ssh -i TestServer.cer ubuntu@54.205.12.196`

**Install Nginx**

`sudo apt update
sudo apt install -y nginx`



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rvmlzz089s6bgx84p5xm.png)
Experience completing LeetCode SQL 50 (1/?)
Tags: sql, leetcode
Published: 2024-06-20 01:20:37

In today’s post we are going to talk about the leet code study plan `SQL 50`  and my journey to completing this challenge.

The reason I’m taking this is because I want to improve my skills with sql, to be complete honest with you, It’s somethings that with the time as become one of my weaknesses,  one of the reasons is that I’ve been spending a lot of time working with orm such as `Eloquent`of laravel or `Typeorm` for nodejs.

But this need to end, so for that reason, I decide to take this challenge. Today post will be focus on the first section of this challenge.


![Section 1 of leetcode sql 50](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/805bo4284q5893tdnznp.png)



This first section was about the select statement, the challenges were perfect to warm up for the next sections, I think my favorite one was `Invalid Tweets` . This section took me around 30 minutes to complete, but it was perfect to start doing challenges of sql on leet code, Let’s see how this goes with the next sections.
Windows, fnm으로 node.js 설치
Tags: windows, fnm, node
Published: 2024-06-20 01:04:33

```
winget install Schniz.fnm
```

PowerShell에서
```
fnm env --use-on-cd | Out-String | Invoke-Expression
```

```
fnm install 설치버전
```

```
fnm use 설치버전
```

```
node -v
```
_참조 : https://blog.logrocket.com/fnm-rust-built-node-js-version-manager/_
Developing a Custom Content Management System with Laravel
Tags: javascript, beginners, programming, webdev
Published: 2024-06-20 00:32:05

## Introduction

Content Management Systems (CMS) play a vital role in the management of digital content for websites. While there are many popular CMS options available, developing a custom CMS with Laravel has gained significant attention in recent years. Laravel is a powerful and elegant PHP framework that provides developers with the necessary tools and features to create a high-performing CMS. In this article, we will explore the advantages, disadvantages, and features of developing a custom CMS with Laravel.

## Advantages

1. **Flexibility:** Laravel provides developers with the flexibility to add custom features and functionalities as per the specific requirements of the website.

2. **Scalability:** The modular architecture of Laravel makes it easier to scale the CMS as the website grows and evolves.

3. **Enhanced Security:** Laravel offers built-in security features, such as encryption and CSRF protection, making it a secure choice for developing a CMS.

4. **User-Friendly Interface:** With Laravel, developers can create a user-friendly interface for content creators, making it easy for them to manage and update website content.

## Disadvantages

1. **Steep Learning Curve:** Laravel is a complex framework, and developers may require some time to get familiar with its features and functionalities.

2. **Requires Technical Expertise:** Developing a custom CMS with Laravel requires technical expertise and experience in PHP and web development.

## Features

1. **Routing:** Laravel offers a robust routing feature that allows developers to define the structure of the CMS and map URLs to the corresponding controllers and methods.

    ```php
    Route::get('/posts', 'PostController@index');
    ```

2. **Database Migrations:** With Laravel's built-in database migrations, managing and making changes to the database structure becomes hassle-free.

    ```php
    php artisan make:migration create_posts_table --create=posts
    ```

3. **Blade Templating Engine:** Laravel's blade templating engine provides developers with a simple yet powerful way to create dynamic views for the CMS.

    ```php
    @foreach ($posts as $post)
        <div>{{ $post->title }}</div>
    @endforeach
    ```

## Conclusion

Developing a custom CMS with Laravel comes with its fair share of advantages and disadvantages. However, the benefits far outweigh the drawbacks, making it a popular choice among developers. Laravel's flexibility, scalability, and security features make it an ideal framework for creating a tailor-made CMS that caters to the unique needs of a website. With its extensive documentation and active community, Laravel provides developers with the necessary resources and support to build a robust and efficient CMS.
The First: D&A for beginners
Tags: data, analytics, analyticsbydesign, scrum
Published: 2024-06-19 23:25:19

‘First post here !’

"Do you like data and analytics? Or do you want to learn the essentials to apply in your daily work at your company? Favorite my website!" 

[](https://daguiadebolso-iwurln7.gamma.site/)

https://daguiadebolso-iwurln7.gamma.site/

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yksepoolojc8xnohfraz.jpeg)
Day 974 : Do It Right
Tags: hiphop, code, coding, lifelongdev
Published: 2024-06-19 23:15:22

_liner notes_:
- Professional : Sigh.... more visa stuff. haha Had a couple of meetings. Responded to a couple of community questions. Did some more refactoring of a project.

- Personal : Went through a bunch of tracks for the radio show. Picked out the projects I'm going to pick up on Bandcamp this week. Looked at some properties. Did some work on the logo for my side project. Also started a proof of concept for the View Transitions API for Multi-page Applications. It's pretty cool.

![Uluru, also known as Ayers Rock, is a large rock formation in the Northern Territory of Australia. It is a UNESCO World Heritage Site and is one.6 kilometers long, 2.4 kilometers wide, and 348 meters high. The rock is surrounded by desert and is a popular tourist destination. The scenery in the picture is very beautiful. The rock is a stunning sight, and the desert landscape is very unique. The colors of the rock and of the most iconic landmarks in the country. The rock is made of sandstone and is over 300 meters high. It is surrounded by desert and is the sky are very vibrant, and the picture is very atmospheric. a popular destination for tourists. The photo shows Uluru in the background with a large grass field in front of it. The sky is a clear blue and there are some clouds in the distance. The sun is setting and the rock is glowing red. There is a tree in the foreground and some grass is growing in the field.﻿﻿](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d6r6siurx2supzn0yitb.jpg)

Going to pick up the projects I picked last night on Bandcamp and prepare the social media posts. Going to place a sweatshirt order for a radio show listener. Really need to finalize this logo. Going to try another version. I want to make sure I do it right! haha Going to eat and get to work.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube p3jgei-Z0Vk %}
Explorando Linux Server
Tags: linux, ubuntu, devops
Published: 2024-06-19 22:50:24

## Linux Server

- `sudo`: comando para usar um comando com permissão de administrador
- `apt`: ferramente que faz gerenciamento de pacotes
- `update`: verifica quais pacotes estão disponiveis.

```bash
    sudo apt update
```

Esse comando verifica quais pacotes estão disponiveis para instalação.

- Ao utilizar o comando `help` será fornecido uma lista de comandos que podem ser utilizados no seu ambiente.

- Voce também pode utilizar help para comandos, por exemplo: `ls --help` que verifica quais comandos posso utilizar junto com ls

- `mkdir`: Comando para criação de diretorio/pasta

```bash
    mkdir devops
```

O comando acima cria um novo diretorio chamado devops

- `history`: Mostra todos os comandos que foram utilizados no ambiente em execução.

## Gerenciando arquivos

- `touch`: Cria um novo arquivo no caminho atual

```bash
    touch notas.txt
```

Cria o arquivo notas no formato txt

- `cat`: abre um arquivo no terminal:

```bash
    cat > notas.txt
```

Para verificar o que tem de conteudo dentro do arquivo, basta tirar o sinal de `>`

```bash
    echo trocando texto > notas.txt
```

Esse comando sobrescreve o que antes tinha escrito em notas.txt

*Instalando Editor de Texto*

```bash
    sudo apt-get install nano
```

Ao utilizar `nano notas.txt` um ambiente visual é apresentado para edição de texto do seu arquivo. Onde voce pode escrever livremente como se fosse um bloco de notas

- Para sair do ambiente de texto pressione `ctrl` + `x`
- O programa vai perguntar se você quer salvar os arquivos, você pressiona Y
- Em seguida vai ser perguntado o nome do arquivo se ele já tiver um, você pode simplesmente pressionar enter ou sobrescrever o nome atual.

```bash
    tar -czf compactado.tar.gz <arquivo1> <arquivo2>
```

O comando acima cria uma pasta compactada com dois arquivos criados recentemente, certifique-se de alterar o nome para o nome dos arquivos. 

```bash
    mv compactado.tar.gz /home/<usuario>/devops
```

Esse comando move a pasta compactada para a pasta de devops criada anteriormente. Podemos excluir os arquivos da pasta de usuario agora.

```bash
    rm <arquivo1>
```

Com esse comando, o arquivo criado anteriormente foi apagado do sistema.
amna 1
Published: 2024-06-19 22:18:58


<iframe width="560" height="315" src="https://www.youtube.com/embed/dRaAirc9sYM?si=fJfztC78tvcgv2r1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
Building Core Banking: A Blueprint for Modern Financial Systems - Introduction
Tags: microservices, corebanking, security, architecture
Published: 2024-06-19 22:15:21

The central nervous system of a bank’s operations is its core banking system. This vital component oversees crucial daily tasks, including monitoring cash flows, administering customer accounts, and maintaining smooth operations. It’s the foundation that enables efficient banking services for customers.

Core banking refers to a backend infrastructure that unifies various branches of a single bank. This system facilitates real-time operations, such as managing loans, processing withdrawals and deposits, and handling payments.

What is the meaning of core banking?

“**CORE**” in “Core Banking” stands for Centralised Online Real-time Environment:
C - Centralised: Consolidates all banking operations into one unified system.
O - Online: Provides 24/7 network-based access to banking services globally.
R - Real-time: Guarantees immediate processing and updating of all transactions.
E - Environment: Integrates the entire ecosystem of banking technology and protocols.

This system interconnects bank branches through a single platform, enabling customers to access services from any location. It enhances convenience, accessibility, and operational efficiency while ensuring secure practices across many channels (e.g. mobile, web, USSD, branch, 3rd party, etc.) within the banking network.

A lot of modules and services make up a modern banking experience in core banking, and for this series, we will only explore how we built three major services at the heart of every core banking solution.

1. Account Management Service
2. Transactions Management Service
3. Notifications Service

We will start with how the core banking system facilitates efficient customer onboarding and account opening. We’ll look at how it stores and manages all account-related information. This includes essential information like account numbers, balances, customer data and account details.

Next, we look at how the core banking system uses general ledger(s) to track all transactions across the network to create real-time, secure, and accurate transactional experiences (e.g. fund transfers, withdrawals, bill payments, deposits, etc.) for customers.

Finally, for this series, we’ll take a look at how the core banking system uses notifications to improve security and foster trust between the bank and its clients by keeping customers informed about their account activities and banking operations with real-time alerts, security notifications, status updates, multi-factor authentication, e.t.c

In each module, we look at the activities a customer can perform, the database design and architecture behind the scenes, and the considerations to make these activities safe and convenient.

Coming up next, meet the team.
key metrics to measure web perfomance; an short introduction
Published: 2024-06-19 22:01:26

Monitoring web performance is crucial for ensuring optimal user experience and business success. Here some key metrics to consider:

## 1. **Page Load Time**

Page load time measures how long it takes for a web page to fully load in a user's browser. Faster load times improve user satisfaction and engagement.


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



## 2. **Time to First Byte (TTFB)**

TTFB measures the time taken by the browser to receive the first byte of response from the server after requesting a web page. It indicates server responsiveness.


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

Practical Example:

_When a user visits a website, their browser sends a request to the server to fetch the web page. The server processes this request, retrieves the necessary data (HTML, CSS, JavaScript, images, etc.), and starts sending it back to the browser. TTFB specifically measures the time it takes from the moment the browser sends the request until it receives the first byte of data from the server._

_For instance, if a user accesses a news website, the TTFB can vary depending on server load and network conditions. A fast TTFB (e.g., under 200 milliseconds) means the server responds quickly, delivering the initial content promptly. A slow TTFB (e.g., over 1 second) indicates potential issues with server performance or network latency, leading to longer wait times for users._


## 3. **First Contentful Paint (FCP)**

FCP measures the time when the browser first renders any content on the screen, such as text, images, or non-white canvas. It gives a sense of when the user perceives the page as loading.

## 4. **Time to Interactive (TTI)**

TTI measures when the page is fully interactive and responsive to user input. It's crucial for determining when users can start engaging with the content.

## 5. **Total Blocking Time (TBT)**

TBT measures the total amount of time between First Contentful Paint and Time to Interactive when the main thread is blocked and unable to respond to user input.

## 6. **Load Distribution**

Load distribution metrics assess how resources (like images, scripts, and stylesheets) are distributed across different servers or Content Delivery Networks (CDNs) to optimize load times.

## 7. **Error Rate**

Error rate tracks the percentage of requests that result in errors, such as 404 (not found) or 500 (server error). High error rates can indicate issues with server configurations or network problems.

All this metrics influence influence conversion rate as we are human 



You can measure so many things using the performance API
`const resources = performance.getEntriesByType("resource");
        const paints = performance.getEntriesByType("paint");
        const navigations=performance.getEntriesByType("navigation");
`


        
useful
https://developer.mozilla.org/en-US/docs/Web/API/Performance

https://pagespeed.web.dev/
Iniciando em DevOps e Linux
Published: 2024-06-19 21:26:28

## Instalando uma Maquina Virtual

- [Link para download da VirtualBox](https://www.virtualbox.org/wiki/Downloads)
- Para instalar basta avançar até instalar

- Ao abrir a VirtualBox, basta clicar em Novo
- Preencha com o nome da sua maquina virtual
- Na imagem ISO, é necessário fazer o download se você ainda não tiver da imagem que quer subir na sua maquina. Para esse artigo, vou estar utilizando o Ubuntu
- [Link para instalação do Ubuntu para Server](https://ubuntu.com/download/server)
- Após isso, devemos selecionar a imagem baixada e colocar em Imagem ISO
- Nesse tutorial iremos pular a instalação desastissida, então pode-se marcar a opção abaixo do numero da versão. Em seguida clicar em Proximo (N)

- Na parte do Hardware, em memoria base, selecionei 4096MB de memoria nesse primeiro momento.
- Em processadores, alocar apenas 2 CPU's que é o necessário por enquanto. E selecionar a opção próximo

- Em Disco Rígido Virtual, Selecionamos a opção Default (Criar um novo disco rígido virtual)
- Em tamanho de Disco, deixo 25.00GB alocado e clicar em próximo e em Finalizar.

- Após criar a nova máquina, podemos clicar em Iniciar (T)

*Dentro da Grub*

- Selecione a primeira opção: Try or Install Ubuntu Server
- Em seguida, após a sequencia de codigos que é apresentado após selecionar essa opção iremos selecionar o idioma, nesse tutorial vou escolher o Português.
- Na parte do Layout do teclado, escolha o que for conveniente, vou manter o padrão de português
- Em Choose type of Install: Seleciono Ubuntu Server (minimized)
- Selecionamos utilizando a barra de espaço
- Depois descemos até Concluído
- Clique em concluído novamente
- Em configuração de Proxy, podemos clicar em concluído de novo. E aguardar o sistema instalar.
- Assim que disponivel clicar em continuar, e continuar novamente e após isso selecionar o nome que irá usar para a maquina, servidor, user e senha
- Aguardar o processo
- Reiniciar a maquina
a web perfomance introduction and why you should care;
Tags: webdev, perfomance, programming, webperfomance
Published: 2024-06-19 21:21:47

Improving the performance of your website/web product impacts several critical metrics:

- User Satisfaction and Retention
- Cost Savings
- Competitive Advantage
- [Improved SEO](https://developers.google.com/search/blog/2018/01/using-page-speed-in-mobile-search)
- High Conversion Rate

Before diving in, let's define two key metrics:

- **Bounce Rate:** Percentage of visitors who leave your website after viewing only one page, indicating engagement.
- **Conversion Rate:** Measures how effectively your site turns visitors into customers or leads.

## Impact of Page Load Time

As page load time increases, so does the bounce rate:

- Increasing load time from 1 to 3 seconds raises bounce probability by 32% 
- Deloitte found that a jump from 1 to 5 seconds increases bounce probability by 90%.
- A 10-second load time increases bounce probability by 123%.
_(Google/SOASTA, 2017)._

## Financial Implications

For example:

- eBay's 100-millisecond speed improvement increased add-to-cart rates by 0.5%, leading to 50,000 more monthly transactions.
- BMW's adoption of Progressive Web Apps (PWA) boosted traffic by 8 to 40%.
_(Milliseconds Make Million from Deloitte)_

## Strategies for Improvement

**Improving Conversion Rate:**

- Optimize User Experience: Simplify the user journey.
- Enhance Content Quality: Ensure relevance and persuasion.
- A/B Testing: Experiment with different versions for better performance.

**Reducing Bounce Rate:**

- Improve Page Load Speed: Ensure fast loading times.
- Enhance Content Relevance: Align content with visitor intent.
- Engage with Design: Create an intuitive and attractive layout.


if you are a web developer and need to know little more about [key metrics to measure web perfomance](https://dev.to/nosylasairaf/key-metrics-to-measure-web-perfomance-an-short-introduction-2dmp)