teleren/devto huggingface dataset:
Follow Friday: SQL Edition (8 July 2022)
Tags: watercooler, meta, database, sql
Published: 2022-07-08 18:14:35

---
title: Follow Friday: SQL Edition (8 July 2022)
published: true
description: 
series: Follow Friday
tags: watercooler, meta, database, sql
---

_Happy Friday, friends! 🎉 Follow Friday is your weekly opportunity to shout out fellow DEV Community members doing awesome work. Check out the comments and follow someone new!_

If you were at #CodeLand22, you may have heard this…

{% embed https://twitter.com/CodeNewbies/status/1537470822956388353 %}

And the general consensus?

{% embed https://twitter.com/dev_hulk/status/1537472653988085760 %}

So, devs: who are your favorite DEV community members writing about SQL?

_**Formatting tip**: to populate a card with a follow button, use the liquid tag syntax `{% embed https://... %}` and insert the URL of your favorite author's profile._

Join in on the #FollowFriday fun by @mentioning your favorite author to follow for SQL explainers (and letting us know why you love their posts!) ⤵️
HurdleRace Solution on Hackerrank - Javascript
Published: 2022-07-08 20:15:39

function hurdleRace(k, height) {
    // Write your code here
let tallest=height[0];
let result=''
for (let i=0; i<height.length; i++){
    if (height[i]>tallest){
        tallest=height[i];
    }
}
if (tallest>k){
    result = tallest-k;
}else {
    result = 0;
}
return result;
}
Day 90: Refactoring and deadline
Published: 2022-07-08 19:54:00

Hi!
Day 90 huh! 3 fully months down! how cool is that? let's  get to it...
So you should not be refactoring when you have a tight deadline ahead of you they say and that I think is true because I experienced it. let me tell you a story. yesterday I was surfing through the code base and I noticed how ugly and messy everything well said I should do some code refactoring getting everything where it should be you know the excitement that comes with a new flesh start, so I went ahead and raised a PR but there is much effort that goes into refactoring even a single block of good to make sure everything still works as expected and as clean as possible. 4 hours I wished I could just get everything the way it was before, at least it worked, Generally the Refactoring itself is not the issues since I already knew even if it's so satisfying it would take a lot of time the issues is the Deadlines. What I realized is that when you have a deadline to meet the main focus should be how much cleaner the codebase is as long as everything works as expected you can focus to the delivery and plan a proper code refactoring as a separate task. So I ended up dropping the PR for now at least and get back to adding more garbage hahhahah :)

I don't have any plan for Tomorrow I think I will go wherever the weekend takes me. we will see updates about that 
Anyway Day 90 babyyy... getting there slowly by slowly....

Signing off......
Cómo instalar y crear un entorno virtual con pyenv en ubuntu 22.04 LTS
Tags: webdev, programming, python, spanish
Published: 2022-07-08 19:33:19

Pyenv es una herramienta que nos facilita utilizar distintas versiones de paython.

En este post crearemos, activaremos y desactivaremos entornos virtuales con pyenv.

Utilizaré el intérprete de comandos (shell) [zsh](https://github.com/ohmyzsh/ohmyzsh)

## Desinstalar pyenv

1.- Antes de empezar voy a desinstalar porque ya vengo utilizando pyenv. 

Abrimos `.zshrc`
```
vim ~/.zshrc
```
Luego eliminamos las siguientes líneas:

```
# pyenv
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
"~/.zshrc" 128L, 4564B 
```
 y guardamos los cambios

```
:wq

```
2.- Eliminar la carpeta  `.pyenv`

```
rm -rf ~/.pyenv
```
Listo!, ahora toca instalar.

## Instalar pyenv

Hay varias maneras de instalar, pero voy a utilizar el script que recomiendan en la documentación de [pyenv installer](https://github.com/pyenv/pyenv-installer)

```
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | zsh
```

![Instalacion de pyenv](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uopimeps5v0ypomtotkt.png)
 
Después de instalar nos indica que debemos agregar algunas lineas en `.zshrc`

```
// vim ~/.zshrc

export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

```
 
`pyenv -v` no existe todavía porque falta actualizar `zsh`, asi que ejecutamos el siguiente comando.
 

```
source ~/.zshrc 
```
Resultado!
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kjzgkvr8wch6gynhl2ze.png)
 

## Crear entornos virtuales

Crear entorno virtual **company** con python 3.8.2

Instalamos la versión de python 3.8.2
```
pyenv install 3.8.2
```

Creamos el entorno virtual **company** con python 3.8.2
`pyenv virtualenv [python_version] [virtualenv_name]`
```
pyenv virtualenv 3.8.2 company

```

Activamos el entorno virtual **company**
```
pyenv activate company
```

Desactivamos el entorno virtual **company**
```
pyenv deactivate
```
![virtualenv with pyenv](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rjwmjqjtk7rpqk7fbnet.png)
 
```
source ~/.zshrc 
```

Si queremos un entorno virtual con python 2.7.18 seguimos los mismo pasos.

Listo! :rocket:
A 21 century office in Mexico
Published: 2022-07-08 19:22:53

My grandma is in the hospital right now. I used my lunch hour to see her, before a fearless race from the hospital to the Office. I've been here almost 4 years, sick, sad, in the worst and best moments. I said goodbye to my best friend and had to come back to finish the day. Even when I'd covid they asked me for a phone extension and even a manual to solve problems that anyone could do, and that wasn't that urgent.

I said goodbye to her, in the middle of an atmosphere of pain and suffering, and then I ran as fast as I could to check before the clock says that I'm out of time. Now I'm crying, I can't handle myself but I'm here. 

During the pandemic, they were tracking everything we do, questioning and researching, all the time, how we made our work from home. I'm a developer, I could do my work from anywhere with just an internet connection and a computer. I don't want to sound arrogant but I can handle a lot of stuff,   for my age. But I'm here, with my low salary and my grandma is in the hospital with all my family (who are not slaves like me).

Why I didn't change to another job? I've plenty of offers, but with my low salary, I can't stand a single week without income. There's always something, somebody at home getting sick, an emergency in the house, debt from the car. Also, I feel bad about quitting, idk why I feel like I'm in debt with this job. 
Maybe just with my boss. In all the time I've been here I never heard support or caring words from anyone but her. They can see you dying but they never care haha from each other. So weird. 

My biggest debt is with the 80% of people who tells me that, with the money that I gain, all their problems would get solved. All that people who work 10-12 hours for the minimum, eating whatever and without a single day of rest. Sometimes I feel so bad, so selfish, and otherwise so dumb cause I've 2 or 3 job offers to wait for a yes in the door. 

Maybe with remote and flexible work nowadays I could be there, with my family, or when my dog passed away I could stand in front of her graveyard, saying "thank you for a lifetime with you" instead of running with my heart in intense pain to be here, always here.
React native background task.
Tags: reactnative
Published: 2022-07-08 19:11:21

Hi Guys,
I am a trying to execute code in a screen after I run navigation.goBack(), it was working completely fine for a couple of releases but now it suddenly stopped executing the code after the navigation.goBack(). It is supposed to work something like this:
1. Call function
2. function () {
navigation.goback()
// The code under that should be excused
await graphql Lazy Query
call another function
}
How to troubleshoot browser network call using har file ?
Tags: learning, browsers, debugging, logging
Published: 2022-07-08 18:58:28

Hello Devs, 

In this blog we will learn about how to get API network log and debug those for triaging issues if any. Few days back my client was facing some issues with the website. On this issue I wasn't able to debug on the client machine. For this I ask the client to export the `.har` file from the chrome browser network call tab. Then I used that file to triage issues and it helped me to triage requests and responses for particular use cases. 

Let's see what is the `.har` file and what is it ? 

### What is the .har file format ? 
har is a short form of HTTP ARchive format, which tracks all network logs from the browser console ( chrome, firefox, safari ). This can be used to troubleshooting follow issues : 
- Performance issue 
- Triage API request and response
- Page rendering

Below are the HAR files generated depending on the browser variant you are using. 

- Chrome
- Firefox
- Internet Explorer
- Microsoft Edge
- Safari

### How to get this har file ? 
1. Go to webpage right click and select inspect or press F12
![Screenshot 2022-07-08 at 11.54.54 PM.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1657304659459/lVg12AKVi.png)
2. Go to network tab 
3. Click the export button or label. 
![Screenshot 2022-07-08 at 11.56.42 PM.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1657304769099/GOp5bXn1n.png)

### How to access or open this file ? 
1. har file can open in any text file 
2. can import to the same empty browser tab. By doing inspect element -> Network tab -> Import 
![Screenshot 2022-07-09 at 12.03.49 AM.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1657305220709/zrRUPINF4.png)

### How does this help ? 
This file helps us to debug or troubleshoot API request call request and response. After importing this API calls look exactly similar to the way it shows while loading the page. It includes everything: wait time, response time, initiator etc. 

I hope this blog helps you to troubleshoot such issues if you come across them. Feel free to reach out to me on my twitter handle @aviboy2006 or comment in the blog. If you like my blog please don't forget to like the article. It will encourage me to write more helpful articles.
HTML Tutorial
Tags: html, beginners, webdev, tutorial
Published: 2022-07-08 18:14:07

HTML is the standard markup language for creating Web pages.
<hr>
## What is HTML?

HTML stands for Hyper Text Markup Language
HTML is the standard markup language for creating Web pages
HTML describes the structure of a Web page
HTML consists of a series of elements
HTML elements tell the browser how to display the content
HTML elements label pieces of content such as "this is a heading", "this is a paragraph", "this is a link", etc.

## A Simple HTML Document

### Example

```
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>

</body>
</html>
```

## Example Explained

The `<!DOCTYPE html>` declaration defines that this document is an HTML5 document
The `<html>` element is the root element of an HTML page
The `<head>` element contains meta information about the HTML page
The `<title>` element specifies a title for the HTML page (which is shown in the browser's title bar or in the page's tab)
The `<body>` element defines the document's body, and is a container for all the visible contents, such as headings, paragraphs, images, hyperlinks, tables, lists, etc.
The `<h1>` element defines a large heading
The `<p>` element defines a paragraph

## Web Browsers

The purpose of a web browser (Chrome, Edge, Firefox, Safari) is to read HTML documents and display them correctly.

A browser does not display the HTML tags, but uses them to determine how to display the document:

## HTML Page Structure

Below is a visualization of an HTML page structure:

```
<html>
<head>
<title>Page title</title>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
</body>
</html>
```
Note: The content inside the <body> section (the white area above) will be displayed in a browser. The content inside the <title> element will be shown in the browser's title bar or in the page's tab.

[Full course](https://educatque.online/html/)
Fitness and code
Tags: health, code
Published: 2022-07-08 18:37:33

Hello developers! I am looking to fully dedicate my time into learning C# but also help you guys build leaner body by not sacrificing your favorite snacks while you're coding. I know I am little bit out of topic but I know how this topic can affect people's life's in a positive manner. Who is interested into people saying to you "I never thought you are a developer"? 😄
Ktor でルーティングを増やしてテストする。
Tags: ktor, kotlin
Published: 2022-07-08 18:32:18


## 別のルーティングを作る

https://jp.ktor.work/quickstart/index.html#hello-world

ktor jp のクイックスタートを参考にする

Routing.kt に

```kotlin
    routing {
        get("/") {
            call.respondText("Hello from root")
        }
        get("/demo") {
            call.respondText("Hello from /demo ")
        }

    }
```

/demo に Hello from /demo のテキストを当てる

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

/ へのアクセスで Hello from root

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bd878fz3jfindy45zree.png)
  
/demo へのアクセスで Hello from /demo 

これらが表示された。

```kotlin
        val response = client.get("/")
        assertEquals(HttpStatusCode.OK, response.status)
        assertEquals("Hello from root", response.bodyAsText())
        val response2 = client.get("/demo")
        assertEquals(HttpStatusCode.OK, response2.status)
```

/demo でも 200 で返ってきているかだけをテストする。

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

全て通った。
2 つめを /demodummy のような存在しないルーティングにすると

| expected:<200 OK> but was:<404 Not Found>

400 だよって落ちる。

## 実行結果が見にくい問題。

しかし、デフォルトの kotlin.test, io.ktor.server.testing
これらのテストだと、通ったときに左側に進行状況が表示されない。

本当は testRoot OK ってでてほしい。

これは別のテストライブラリを使うことで解決できるらしい。

しかし、追加は失敗したので素直に kotlin.test を使うことにする。

## 今後

https://qiita.com/fisherman08/items/3879341ffd5aea8d02b2#should-spec

kotlintest を導入して should でかけるようにする。

https://qiita.com/kawano_fumihiko/items/4253e63f0c136fce0aef

HTML を Selenide でテストする。
Introduction to Confusion matrix in Machine Learning
Tags: machinelearning, ai, python, beginners
Published: 2022-07-08 18:25:59

Today we will be talking about confusion matrix
1. What is a Confusion Matrix 
2. Why we use confusion Matrix
3. How Confusion Matrix Works

**What is a Confusion Matrix**

Confusion Matrix is a Performance Measuring Technique.

**Why we use confusion Matrix**
Confusion matrix is a technique used to measure the Accuracy/Performance of the Classification Model based on the dataset given to the model

**How Confusion Matrix Work**
The confusion matrix visualizes the accuracy of a classifier by comparing the actual and predicted classes. The binary confusion matrix is composed of squares
![Binary classification Confusion Matrix](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/65jg7mmjrc4j11up0bin.png)

**Code**

```
#Example of a confusion matrix in Python
from sklearn.metrics import confusion_matrix
 
expected =  [1, 1, 0, 1, 0, 0, 1, 0, 0, 0]
predicted = [1, 0, 0, 1, 0, 0, 1, 1, 1, 0]
results = confusion_matrix(expected, predicted)
print(results)
```
**Code Explanation**

```
from sklearn.metrics import confusion_matrix
```
This Line is used to import the Sklearn package 
in sklearn there are different function we only want matrix functionalities so imported matrix and in matrix class we want to use confusion matrix so we only imported that particular part from from whole sklearn package

```
expected =  [1, 1, 0, 1, 0, 0, 1, 0, 0, 0]
```
In this Line we declared an array with all the expected values (what we are expecting)

```
predicted = [1, 0, 0, 1, 0, 0, 1, 1, 1, 0]
```
In this Line we declared an array with all the Predicted values that our model has predicted

```
results = confusion_matrix(expected, predicted)
```
here we are just using a confusion matrix function that is pre-defined in sklearn package

```
print(results)
```
It is just a simple print statement used to print results
Can you guess how many programming languages exist in this world without googling ?
Tags: webdev, beginners, programming, discuss
Published: 2022-07-08 18:20:16

Can you guess without searching on google
1. How many computer programming languages exist in this world ? 
2. How many of them are popular ? 

Make a guess and look for the answer here along with top 10 most loved programming languages in 2022 and which companies use each of them. 

[https://tipseason.com/top-10-most-loved-programming-languages-2022/](https://tipseason.com/top-10-most-loved-programming-languages-2022/)
Ever Wondered, based on which part of image does Classifier of Convolution makes decision.!
Tags: deeplearning, machinelearning, datascience, computerscience
Published: 2022-07-08 18:12:47


Check this out: https://github.com/Mr-negroni/Heatmap-visualisation-of-Convnet-Classes-CAM_GRAD/blob/main/Heat_Map_Visualisation_of_Classes_predicted_by_Convolutions.ipynb
Rot13
Tags: programming, python, codewars
Published: 2022-07-08 18:02:41

ROT13 is a simple letter substitution cipher that replaces a letter with the letter 13 letters after it in the alphabet. ROT13 is an example of the Caesar cipher.

Create a function that takes a string and returns the string ciphered with Rot13. If there are numbers or special characters included in the string, they should be returned as they are. Only letters from the latin/english alphabet should be shifted, like in the original Rot13 "implementation".

Please note that using `encode` is considered cheating.

Solution- ###Python

```
def rot13(message):
    alpha="abcdefghijklmnopqrstuvwxyz"
    string=''
    for i in message:
        if i in alpha:
            if alpha.index(i)<13:
                string += alpha[alpha.index(i)+13]
            else:
                string += alpha[alpha.index(i)-13]
        elif i in alpha.upper():
            if alpha.upper().index(i)<13:
                string += alpha.upper()[alpha.upper().index(i)+13]
            else:
                string += alpha.upper()[alpha.upper().index(i)-13]
        else:
            string +=i
    return string
```
OverTheWire - Bandit 6 to 11
Tags: linux, beginners
Published: 2022-07-08 17:52:45

**Note:-**Don't forget to logout before moving to next level
**Level5 -> Level6**
Question:-The password for the next level is stored in a file somewhere under the inhere directory and has all of the following properties: 
- human-readable 
- 1033 bytes in size
- not executable
Answers:- use find command to when the properties of files are known
```
cd inhere
ls
find -size 1033c ! -executable
ssh bandit6@bandit.labs.overthewire.org -p 2220
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l4e0rrjd9yattw13x3vy.png) 
**Level6 -> Level7**
Question:-The password for the next level is stored somewhere on the server and has all of the following properties:
- owned by user bandit7
- owned by group bandit6
- 33 bytes in size
Answers:- 
```
cd /
find / -user bandit7 -group bandit6 -size 33c
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tkljn00nlidch7gjv00a.png)
have to put rest of the thing is error so use **2>**for stderr and send to **dev/null**
```
find / -user bandit7 -group bandit6 -size 33c 2>/dev/null
cat /var/lib/dpkg/info/bandit7.password
ssh bandit7@bandit.labs.overthewire.org -p 2220
```
**Level7 -> Level8**
Question:-The password for the next level is stored in the file data.txt next to the word millionth.
Answer:- use Grep for filtering the lines according to the word in the quotes, -n will display the line and line number 
```
ls
grep -n “millionth” data.txt 
ssh bandit8@bandit.labs.overthewire.org -p 2220
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3jxjkbwt9z2if285ty60.png) 
**Level8 -> Level9**
Question:-The password for the next level is stored in the file data.txt and is the only line of text that occurs only once.
Answer:- use piping for combining commands
```
cat data.txt | sort | uniq -u
ssh bandit9@bandit.labs.overthewire.org -p 2220
```
**Level9 -> Level10**
Question:-The password for the next level is stored in the file data.txt in one of the few human-readable strings, preceded by several ‘=’ characters.
Answer:- "-E"indicates extended Grep that the pattern can symbols can repeat.
```
Strings data.txt | grep -E “=+”
ssh bandit10@bandit.labs.overthewire.org -p 2220
```
**Level10 -> Level11**
Question:-The password for the next level is stored in the file data.txt, which contains base64 encoded data.
Answer:- "-d" to decode the base64
```
Base64 -d data.txt
ssh bandit11@bandit.labs.overthewire.org -p 2220
```
What was your win this week?
Tags: discuss, weeklyretro
Published: 2022-07-08 17:35:38

---
title: What was your win this week?
published: true
description: Got to all your meetings on time? Started a new project? Fixed a tricky bug?
tags: discuss, weeklyretro
cover_image: https://cl.ly/188e843c2985/download/Image%202019-02-15%20at%202.36.37%20PM.png
---

Hey there! 


Looking back on this past week, what was something you were proud of accomplishing?

All wins count — big or small 🎉

Examples of 'wins' include:

- Starting a new project
- Fixing a tricky bug
- Enjoying the outdoors... or whatever else might spark joy ❤️ 

---

Have a wonderful weekend!


![Man flying with the caption "winning"](https://media.giphy.com/media/3ohryhNgUwwZyxgktq/giphy.gif)
Difference Between 'for...in' and 'for...of' Loop s
Published: 2022-07-08 17:27:51

This blog summarizes when to use 'for...in' and 'for...of' loops in JavaScript.

###Difference
The '**for...in**' loop is used for **objects**. The '**for...of**' loop is used on data structures like **arrays** and **strings**.

It is possible to use a **for in** loop with arrays and strings. However, per JavaScript's [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of#difference_between_for...of_and_for...in), the **for of** loop is preferred for strings and arrays as it returns the index as a number, whereas the **for in** loop will return the index as a string.

###How to remember? 
Think about **for in** loops as being **inside** an object. Since objects have no order, every item is associated _inside_ it, all together. It's like a purse containing all your items - no order, everything is just inside. 

Since arrays and strings have order, think about **for of** loops as in every item **of** an **array** or **string**. If you were reading a book (array) with chapters (indexes), you would say you're currently "reading <u>chapter 3 **of** 30</u> in the book". So, think of it as  'for X index **OF** an array'.

#For...in
**For...in** loops iterate through an **object**. 

From the [MDN Web Doc](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in):
```
for (const variable in object) {
  statement
}
```

####Examples
```
const object = { a: 1, b: 2, c: 3 };

for (const property in object) {
  console.log(`${property}: ${object[property]}`);
}

// "a: 1"
// "b: 2"
// "c: 3"
```

```
const obj = { a: 1, b: 2, c: 3 };
for (var i in obj) {
  console.log(i);
}

// "a"
// "b"
// "c"
```

#For...of
**For...of** loops iterate over an **array** or **string**.

From the [MDN Web Doc](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of):
```
for (variable of iterable) {
  statement
}
```

####Examples
```
const array1 = ['a', 'b', 'c'];

for (const element of array1) {
  console.log(element);
}

// "a"
// "b"
// "c"

```

```
const string = 'boo';

for (const value of string) {
  console.log(value);
}
// "b"
// "o"
// "o"
```