teleren/devto huggingface dataset:
Here's a list of some commonly used Linux commands:
Published: 2023-02-13 02:58:10

Here's a list of some commonly used Linux commands:

    ls - list the contents of a directory
    cd - change the current working directory
    pwd - print the current working directory
    mkdir - create a new directory
    rmdir - remove an empty directory
    touch - create a new empty file
    cat - concatenate and print the contents of files
    echo - display a message or the contents of a variable
    cp - copy files or directories
    mv - move or rename files or directories
    rm - remove files or directories
    chmod - change the permissions of files or directories
    chown - change the owner of a file or directory
    man - display the manual page for a command
    df - display disk usage information
    du - estimate the disk space used by a file or directory
    top - display information about the running processes
    ps - display information about the currently running processes
    kill - terminate a process
    sudo - run a command with superuser privileges
    apt-get - package manager for Debian-based systems
    yum - package manager for Red Hat-based systems
    pacman - package manager for Arch-based systems
    ln - create a symbolic link
    find - search for files that match specified criteria
    grep - search for patterns in text files
    sort - sort the contents of a file
    uniq - remove duplicate lines from a file
    wc - count the number of lines, words, or characters in a file
    tar - create or extract compressed archive files

This is by no means an exhaustive list, but it should give you a good starting point for exploring the world of Linux commands.
Instalando o JDK 17 ou 21 no Windows 11
Tags: java, jdk
Published: 2023-02-13 02:04:08

Update: 03/04/2024: O último LTS é a versão 21. Estou atualizando o post, pois, o processo de instalação será o mesmo tanto para a versão 17 LTS quanto para a versão 21 LTS.


Para começar, vamos baixar o pacote MSI para Windows. 

Acesse o link para baixar a versão que você precisa:

[Download JDK 17 LTS](https://adoptium.net/temurin/releases/?os=windows&arch=x64&package=jdk&version=17)

[Download JDK 21 LTS ](https://adoptium.net/temurin/releases/?os=windows&arch=x64&package=jdk&version=21)

Em seguida, execute o programa de instalação. A tela abaixo deverá aparecer e então clique em next:

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

Em seguida, precisamos habilitar duas configurações. A primeira, irá adicionar a variável JAVA_HOME automaticamente ao PATH do Windows. 

Para isso, clique em **Set JAVA_HOME variable** e selecione a opção **Will be installed on local hard drive**, conforme a imagem abaixo: 


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


A próxima configuração adicionará ao registro do Windows a localização do local de instalação do JDK. Clique em **JavaSoft (Oracle) registry keys** e selecione a opção **Will be installed on local hard drive**, conforme a imagem abaixo: 

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

Clique em next.

Na próxima tela, clique em Install, lembrando de aceitar que as alterações sejam feitas no computador.

No final, a seguinte tela irá aparecer:

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

Ao clicar em **Finish**, você já estará pronto para usar seu JDK.

O próximo passo que sugiro é instalar o Visual Studio Code para ser seu editor de código e configura-lo para trabalhar com Java.

Para isso, fiz um tutorial completo para lhe ajudar, basta clicar [aqui](https://dev.to/cezarmezzalira/instalando-o-visual-studio-code-para-programar-em-java-no-windows-5a0i).

Se esse post te ajudou, deixe um like ou comente aqui embaixo se você estiver tendo algum problema.
Instalando o JDK (Java Development Kit) no Windows 11
Published: 2023-02-13 01:59:34

Para começar, vamos baixar o último LTS do JDK, que no momento do post está na versão 17.

Acesse o link e clique no botão **Latest LTS Release**, conforme imagem abaixo:


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

Em seguida, execute o programa de instalação. A tela abaixo deverá aparecer e então clique em next:

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

Em seguida, precisamos habilitar duas configurações. A primeira, irá adicionar a variável JAVA_HOME automaticamente ao PATH do Windows. 

Para isso, clique em **Set JAVA_HOME variable** e selecione a opção **Will be installed on local hard drive**, conforme a imagem abaixo: 


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


A próxima configuração adicionará ao registro do Windows a localização do local de instalação do JDK. Clique em **JavaSoft (Oracle) registry keys** e selecione a opção **Will be installed on local hard drive**, conforme a imagem abaixo: 

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

Clique em next.

Na próxima tela, clique em Install, lembrando de aceitar que as alterações sejam feitas no computador.

No final, a seguinte tela irá aparecer:

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

Ao clicar em **Finish**, você já estará pronto para usar seu JDK.
problem when using ng serve
Tags: angular, javascript, react, linux
Published: 2023-02-13 01:31:31

`main/udagram-frontend/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /home/eslam/Downloads/Untitled Folder/Last Projects/Hosting-FullStack-App-AWS-CircleCI-main/udagram-frontend/node_modules/loader-runner/lib/LoaderRunner.js:203:19
    at VirtualFileSystemDecorator.readFile (/home/eslam/Downloads/Untitled Folder/Last Projects/Hosting-FullStack-App-AWS-CircleCI-main/udagram-frontend/node_modules/@ngtools/webpack/src/virtual_file_system_decorator.js:46:13)
    at processResource (/home/eslam/Downloads/Untitled Folder/Last Projects/Hosting-FullStack-App-AWS-CircleCI-main/udagram-frontend/node_modules/loader-runner/lib/LoaderRunner.js:202:11)
    at iteratePitchingLoaders (/home/eslam/Downloads/Untitled Folder/Last Projects/Hosting-FullStack-App-AWS-CircleCI-main/udagram-frontend/node_modules/loader-runner/lib/LoaderRunner.js:158:10)
    at runLoaders (/home/eslam/Downloads/Untitled Folder/Last Projects/Hosting-FullStack-App-AWS-CircleCI-main/udagram-frontend/node_modules/loader-runner/lib/LoaderRunner.js:365:2)
    at NormalModule.doBuild (/home/eslam/Downloads/Untitled Folder/Last Projects/Hosting-FullStack-App-AWS-CircleCI-main/udagram-frontend/node_modules/webpack/lib/NormalModule.js:292:3)
    at NormalModule.build (/home/eslam/Downloads/Untitled Folder/Last Projects/Hosting-FullStack-App-AWS-CircleCI-main/udagram-frontend/node_modules/webpack/lib/NormalModule.js:438:15)
    at Compilation.buildModule (/home/eslam/Downloads/Untitled Folder/Last Projects/Hosting-FullStack-App-AWS-CircleCI-main/udagram-frontend/node_modules/webpack/lib/Compilation.js:702:10)
    at /home/eslam/Downloads/Untitled Folder/Last Projects/Hosting-FullStack-App-AWS-CircleCI-main/udagram-frontend/node_modules/webpack/lib/Compilation.js:944:14 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}`

if an one can help
Tips for Responsiveness in Flutter
Tags: flutter, code, mobile, design
Published: 2023-02-13 01:28:01


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



Here are some tips to help make your Flutter app responsive:

- Use screen size as a basis for element size: You can use the screen size to determine the size of elements in your app.

- Use LayoutBuilder: LayoutBuilder allows you to change the layout based on the screen size.

- Use MediaQuery: MediaQuery allows you to access information about the screen size, such as the width and height.

- Use FractionalOffsetting: FractionalOffsetting allows you to position elements with precision, regardless of the screen size.

- Use proportional aspect: You can use proportional aspect to maintain the proportion of elements in your app, regardless of the screen size.

- Remember to always test your app on devices with different screen sizes to ensure responsiveness.
Extensiones para Visual Studio Code 🦾
Tags: html, css, javascript, react
Published: 2023-02-13 01:26:01

## HTML:
- Live Server
- Auto Close Tag
- open in browser
- Path Intellisense
- html tag wrapper
- Auto Rename Tag

## CSS:
- CSS Peek
- css-auto-prefix
- IntelliSense for CSS class names in HTML

## JS:
- Quokka.js
- Code Runner
- Babel JavaScript
- Rainbow Brackets
- JavaScript (ES6) code snippets

## ReactJS:
- ES7+ React/Redux/React-Native snippets
- ES7 React/Redux/GraphQL/React-Native snippets

## Git:
- Git Graph
- GitHub Copilot
- GitLens — Git supercharged
- GitHub Pull Requests and Issues

## Utils:
- Todo Tree
- Bookmarks
- TODO Highlight
- Better Comments
- Code Spell Checker
- Markdown All in One
- ESLint
- Prettier ESLint
- Prettier - Code formatter
- SVG
- Image preview
- Material Icon Theme
- Import Cost
- Settings Sync
- Live Share
- Snapcode
- indent-rainbow
- json
- REST Client
- RapidAPI Client
- Paste JSON as Code

## Themes:
- Karma
- Monokai Pro
- Codey Midnight
Set an expiration tine React Native AsyncStorage
Tags: reactnative, javascript, beginners, tutorial
Published: 2023-02-13 01:20:05

Today, I will show you how to quickly set an expiration time/date with React Native AsyncStorage.

By default, similar to `localStorage` on the Web, AsyncStorage is designed to only handle storage and nothing more. That's why there is no built-in expiration time.

However, there are some use cases where it can be useful to have an expiry date.

To do so, you will need to store in a JSON object an expiration date along with the actual data you wish to store.

For instance, here is an example with an expiration time in minutes.

```javascript
import AsyncStorage from '@react-native-async-storage/async-storage';

// …

const storageKeyName = "storageWithExpiry";
const storageExpirationTimeInMinutes = 30; // in this case, we only want to keep the data for 30min

const now = new Date();
now.setMinutes(now.getMinutes() + storageExpirationTimeInMinutes); // add the expiration time to the current Date time
const expiryTimeInTimestamp = Math.floor(now.getTime() / 1000); // convert the expiry time in UNIX timestamp
const data = {
  itemId: 4325 // example of data you need to store
  expiryTime: expiryTimeInTimestamp
};

// store the data with expiration time in there
await AsyncStorage.setItem(
  storageKeyName,
  JSON.stringify(data)
);
```

Then, we will retrieve the item from AsyncStorage, and clean it up if the expiration time has reached

```javascript
import AsyncStorage from '@react-native-async-storage/async-storage';

// …

let savedData = async AsyncStorage.getItem(
  storageKeyName
);
if (savedData !== null) { 
  // check if we got a valid data before calling JSON.parse
  savedData = JSON.parse(savedData);
}

const currentTimestamp = Math.floor(Date.now() / 1000); // get current UNIX timestamp. Divide by 1000 to get seconds and round it down

// Remove the saved data if it expires.
// Check if expiryTime exists with the optional chaining operator `?`
// then, we check if the current ‘now’ time is still behind expiryTime
// if not, it means the storage data has expired and needs to be removed
if (currentTimestamp >= savedData?.expiryTime) {
  async AsyncStorage.removeItem(storageKeyName);

  return; // if needed, you can leave the function here depending of your function’s logic
}
```

**Note**: To keep the examples clear and small, I have purposely omitted the `try`/`catch` blocks. However, when dealing with `AsyncStorage`, you would need to handle and catch the potential thrown errors.



Feel free to comment below if you have questions 💡

---

🤖 Side-Projects on GitHub 👉 https://github.com/pH-7


Happy coding! 🤠
Monitor & Detect - schema changes, broken dashboards etc
Tags: database, python, dataengineering, data
Published: 2023-02-13 00:41:28

As a data engineer, one of the challenging and sometimes frustrating task is to handle messy information or weird data points passing the pipeline.

Business teams are always firefighting with Data team on accuracy, dashboards not correct or no updated etc.

There are multiple options whether its opensource or closed ones. 

Would like to intro with all about [decube](https://decube.io), not only it helps in managing the data quality or writing tests but also in managing the data catalog which is out of the box option.

It has community edition too (free-forever) with no cap on tables for catalog and lineage.

I strongly suggest to give it a try.
A Short Intro to Doubly Linked Lists
Tags: beginners, programming, ruby, codenewbie
Published: 2023-02-13 00:33:45

Every single day, there is a programmer who is struggling with mountains of data and the proper way to organize it all. If only there were efficient ways to organize and sort all of this data so that they could access it and use it in a meaningful way... Lucky for us, computer scientists have figured out ways to do this using **Data Structures**. There are a lot of different types of data structures, but today I'm writing about a really simple one. Introducing, the doubly linked list (written in Ruby).

![linked list code in ruby](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n1ggbmgzecaf4wriy6dh.png)

Okay, okay, I'll admit that it doesn't really look like anything special right now, but allow me to explain what this data structure is. A doubly linked list is a structure made up of nodes. 

![node code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ekyflnu98a97hxatlvh0.png)

Each of these nodes contains a link to the previous node, the data stored within the current node, and a link to the next node. Please, have a look at this diagram I've made. 

![linked list diagram](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9qc2v7aq9h97pnutc6o2.png)

My amazing art skills aside, this is what a very short doubly linked list would look like if we made it into a tangible object. The start of a linked list (also called the head) has a previous value of nil and the final node in the linked list (also called the tail) has a next value of nil. I will now show you a basic method for creating a new item in our linked list.

![linked list push method](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9zvpsqitvnuxac1d7g9l.png)

This function starts by creating a new Node object with whatever data you have being passed into it. If this linked list is empty, this brand new node becomes the head and the tail of our list. Now, if there are already nodes in the list, it will simply make your new node the tail of the list and increment the list length by one.

Now, I'm not going to go over all about traversing linked lists and other methods you can create in this blog post, but this has just been a very basic overview of a doubly linked list. Hopefully you're able to get some use out of this data structure.
Functions: The Building Blocks of Efficient and Effective Code
Tags: webdev, javascript, beginners, programming
Published: 2023-02-13 00:15:46

As software developers, our primary goal is to make our lives easier. We aim to simplify our work, avoid repetitive tasks, and make our code easier to maintain. Functions play a significant role in achieving these goals, and they make our lives easier in several ways.

**Reusability:** Functions allow us to write a piece of code once and use it multiple times. This reduces the need for repeating the same logic in different parts of the code, making the code cleaner and easier to maintain.

**Modularity:** Functions allow us to break down complex problems into smaller, manageable pieces. This makes it easier to write, test, and debug code, as we can focus on one function at a time. Additionally, it allows other developers to understand and use our code more easily.

**Abstraction:** Functions allow us to hide the implementation details of a particular logic and expose only the necessary information to the outside world. This makes our code more maintainable and flexible, as we can change the implementation details without affecting the rest of the code.

**Easier Readability:** Functions give a clear structure to our code and make it more readable. They allow us to organize our code into smaller, self-contained blocks, making it easier to understand the purpose of each piece of code.

**Parameterization:** Functions allow us to make our code more flexible by accepting parameters. This means we can reuse the same function for different inputs and produce different results. This makes our code more versatile and efficient.

**Peer-to-peer Adaptation:** Functions not only improve our quality of life, they also greatly benefit our peers who read our code. Imagine having your code written in a single document without any functions. In this scenario, making changes would require editing several lines of code, if not more. This is not efficient at all. Imagine if our peers want to make changes or just try to locate a specific value or formula. It would definitely not be enjoyable.

In conclusion, functions are essential in making our lives easier as software developers. They allow us to write clean, maintainable, and efficient code that can be reused and modified easily. By breaking down complex problems into smaller, manageable pieces, functions make our code more readable, flexible, and versatile. So, the next time you write code, don't forget the power of functions!
Hadoop version
Published: 2023-02-13 00:09:40

Hi all,

Can you provide your inputs please. Currently in our Hadoop cluster ,we are using Apache hadoop open source(version - 2.4)  which is running on CentOS 6.10

Now OS is being upgraded to rhel 8.4.

1. Can I use same Apache Hadoop version. 2.4 on rhel 8.4?

2. Can you suggest which version of hadoop version can be used if 2.4 doesn't support please.

Regards,
Venu.Ch
O que é variável?
Published: 2023-03-01 18:46:59

---
title: O que é variável?
published: true
date: 2023-02-13 00:00:00 UTC
tags: 
canonical_url: https://mariosouto.com/posts/o-que-e-variavel
---

Eai, tem uma explicação mais curta?

<iframe width="560" height="315" src="https://www.youtube.com/embed/3ZQmfyGyrew" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen=""></iframe>

* * *

Link para assistir direto e compartilhar: [https://youtu.be/3ZQmfyGyrew](https://youtu.be/3ZQmfyGyrew)

* * *
Weekly Challenge 202
Tags: perl, python, theweeklychallenge
Published: 2023-02-04 05:56:56

[Challenge](https://theweeklychallenge.org/blog/perl-weekly-challenge-202/), [My solutions](https://github.com/manwar/perlweeklychallenge-club/tree/master/challenge-202/sgreen)

## Task 1: Consecutive Odds

### Task

You are given an array of integers.

Write a script to print `1` if there are THREE consecutive odds in the given array otherwise print `0`.

### My solution

This task is pretty straight forward, so doesn't need much explanation. I have a variable `odds`. As I iterate through the array, I add one to the `odds` variable if it is an odd number. If it is even, I reset `odds` value as zero.

If at any time the `odds` value is 3, I print `1` and exit. Otherwise I will print `0` if we have exited the loop without finding three consecutive odd values.

### Examples

```bash
$ ./ch-1.py 1 5 3 6
1

$ ./ch-1.py 2 6 3 5
0

$ ./ch-1.py 1 2 3 4
0

$ ./ch-1.py 2 3 5 7
1
```

## Task 2: Widest Valley

### Task

Given a profile as a list of altitudes, return the leftmost widest valley. A valley is defined as a subarray of the profile consisting of two parts: the first part is non-increasing and the second part is non-decreasing. Either part can be empty.

### My solution

This is a really interesting challenge, and I had a few attempts at trying to come up with the best solution. Often, the best solution is just try everything to get the correct solution. That's what I did here.

For this task, I have a variable `valley` that iterates from 0 to one less than the length of the array. This is the deepest point in the valley.

From this I calculate the start point of the valley. I do this by setting `start` at the current position, and working backwards until we find a decreasing number or hit the start of the array. Likewise, I calculate the `end` value by doing the same rightwards.

Once I have the `start` and `end` point, if the difference between these values is greater than or equal to the length of the current `solution`, I replace the `solution` variable.

Why equals? The difference between start and end is one less than the numbers of elements it contains. For example if start is 7 and end is 9, it contains three items (7, 8 and 9), even though the difference is two.

I'll be first to admit that this could actually be optimised a lot. For example if the previous or next value is lower than the current point, we know that we aren't at the bottom of the cliff. However, when dealing with such a short list, the benefits are negligible, and adds unnecessary complications. YMMV.
 
### Examples

```bash
$ ./ch-1.py 1 5 3 6
1

$ ./ch-1.py 2 6 3 5
0

$ ./ch-1.py 1 2 3 4
0

$ ./ch-1.py 2 3 5 7
1

$ ./ch-2.py 1 5 5 2 8
1, 5, 5

$ ./ch-2.py 2 6 8 5
2, 6, 8

$ ./ch-2.py 9 8 13 13 2 2 15 17
13, 13, 2, 2, 15, 17

$ ./ch-2.py 2 1 2 1 3
2, 1, 2

$ ./ch-2.py 1 3 3 2 1 2 3 3 2
3, 3, 2, 1, 2, 3, 3
```
AWS Academy Cloud Architecting Capstone project
Tags: aws
Published: 2023-02-12 23:28:13

I have recently finished the AWS Academy Cloud Architecting Capstone project, which involved applying my AWS cloud computing skills and knowledge to a real-world scenario. The main objective was to design, build, and deploy an application or infrastructure using various AWS services.

The project's specific requirements were to ensure secure hosting of a MySQL database, secure access for an administrative user, anonymous access for web users, run the website on a t2.micro EC2 instance with Secure Shell (SSH) access to administrators, ensure high availability of the website through a load balancer, store database connection information in the AWS Systems Manager Parameter Store, and provide automatic scaling using a launch template.

Image screenshots of the project:


Connecting to Database and checking content:

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

Storing database connection information in the AWS Systems Manager Parameter Store: 

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

Checking database connection to website using query:

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

Result from the query:

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

Diagram which illustrates the solution:

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

Submitted the completed project and received full marks :)

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



After meeting all requirements, the final solution was able to deliver a secure and highly available web application that met the specified project goals. It was a challenging but rewarding experience that allowed me to gain valuable practical knowledge and skills in AWS cloud computing.