teleren/devto huggingface dataset:
DSA by Mitul in C++, Python, and Java : Selection Sort
Tags: dsa
Published: 2022-11-11 00:27:05

**Selection sort**

Here we repeatedly find the minimum element and move it to the sorted part of an array to make unsorted part sorted.


Here is our unsorted array

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

First we will divide it in 2 parts. Sorted and Unsorted.


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

We will look for every element in the unsorted array to find the minimum value

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

It is 1 here.

Then we will swap it

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

Then we will assign it in the sorted array 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rh6uc4lftu4sa35rxmcr.png)
Again, after the 2nd iteration and swapping we will have:

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

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

After the whole iteration , this is what we will be left out

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

The benefit of selection sort is : it is a inplace sort and thus we don't need any extra space. 
Code for the Selection Sort:
```
def selectionSort(customList):
    for i in range(len(customList)):
        min_index = i
        for j in range(i+1, len(customList)):
            if customList[min_index] > customList[j]:
                min_index = j
        customList[i], customList[min_index] = customList[min_index], customList[i]
    print(customList)
```

**Complexity Analysis**

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

**When to use Selection sort?**
1. When we have insufficient memory.
2. Easy to implement.


**Why to avoid Selection Sort?**
When time is a concern.
DSA by Mitul in C++, Python, and Java : Insertion Sort
Published: 2022-11-11 00:26:52

Here we first divide the given array into 2 part. Then we take first element from unsorted array and find its correct position in sorted array. Finally we repeat until unsorted array is empty.

Assume we have this array:

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

Lets divide it into 2 parts (Sorted & Unsorted):

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


Now we will take the first element from the unsorted array which is 5 and place it in the sorted array:


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

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


Again we will take the 1st element from the unsorted array which is 3. We will move it to the sorted array. But for sorting, we have to compare it with element in the sorting array. And then keep it in the sorting order.

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



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


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

Done!

We will repeat this process until the unsorted array is empty.

Gradually we will have:

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


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


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


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

Finally , we have:

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



**Code for Insertion sort**

```
def insertionSort(customList):
    for i in range(1, len(customList)):
        key = customList[i]
        j = i-1
        while j>=0 and key < customList[j]:
            customList[j+1] = customList[j]
            j -= 1
        customList[j+1] = key
    return customList
```

**Complexity Analysis**


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

**Why to use Insertion Sort?**
1. When we have insufficient memory.
2. Easy to implement.
3. When we have continuous inflow of numbers and we want to keep them sorted.

**Why to avoid Insertion Sort?**
When time is a concern.
Review: Data Visualization with Python and JavaScript: Scrape, Clean, Explore & Transform Your Data
Tags: books, programming, python, flask
Published: 2022-11-15 00:30:26

---
title: Review: Data Visualization with Python and JavaScript: Scrape, Clean, Explore & Transform Your Data
published: true
date: 2022-11-11 00:19:00 UTC
tags: Books,programming,python,Flask
canonical_url: https://www.ericsbinaryworld.com/2022/11/10/review-data-visualization-with-python-and-javascript-scrape-clean-explore-transform-your-data/
---

[Data Visualization with Python and JavaScript: Scrape, Clean, Explore & Transform Your Data](https://www.goodreads.com/book/show/26544391-data-visualization-with-python-and-javascript) by [Kyran Dale](https://www.goodreads.com/author/show/14348047.Kyran_Dale)  
  
My rating: [4 of 5 stars](https://www.goodreads.com/review/show/4072335589)  
  
  
While a book about web technologies is undoubtablely going to get out of date (especially when Javascript is involved), I would definitely recommend this book if you want to do some data visualization either as part of your job or for an undergrad, grad, or PhD project. While I would probably use FastAPI rather than Flask, I heard recently that the Javascript library the author uses, D3, is still one of the best in class libraries for this kind of work.  
  
The author guides you through the process by building a website to visualize Nobel Prize winners. The early steps where the author teaches you how to obtain and how to clean data are very important and, to some extent, will never go out of style. The same can be said of the author’s section explaining how to select the best visualizations.  
  
It’s very well written and I highly recommend.  
  
  
  
[View all my reviews](https://www.goodreads.com/review/list/4737124-eric-mesa)
Where has 1 month of learning how to code have gotten me...
Tags: webdev, javascript, beginners
Published: 2022-11-10 23:22:51

Hello, I am new here. Btw, my name is Nomer. My friends call me Nomer. 

A month ago I realized I needed to learn a new skill. So, I went on google and typed "skills to learn in 2022", and no surprise most of the skills that is listed in every blog or article that I've read involves computers. Coding, data-analytics, machine-learning, UI/UX design, so on and so forth. So I decided to go with coding, try it out for 6 months and see where it leads. 

It's been a month now, and I have been learning HTML, CSS and javascript. The first project that I completed all by myself, without any help from any tutorials, (yes, I googled stuff), is a random number generator. I just learned about Math.random, and Math.floor, and I figured I want to try it out. 

My first idea was to create a code that will generate 6 random numbers simultaneously, not just one. But, I couldn't figure it out so I had to be satisfied with just generating one random number for now. i am not giving up, I'll make this better as I go, as I learn new things I'll definitely apply it to this project, and improve my skills at the same time. 

You might ask "why 6 numbers though?". I wanted to generate lotto numbers, because you never know. It saves me from thinking about 6 random numbers to bet on, I guess you could say, I wanted to "automate" a part of my life to make it less time consuming. LOL

The code itself is ugly. It probably has a bunch of random irrelevant stuff in there but it is what it is.
Leading Engineers in Uncertain Times
Tags: devops, techtalks, leadership, podcast
Published: 2022-11-10 23:06:00

It's no secret this has been a difficult year for many companies in tech. The truth is, it's easy to be a leader when times are good. It's less easy in the midst of a storm.

That's why we assembled a panel of some of the smartest engineering leaders we know at Interact to talk about the leadership principles that help guide an engineering organization no matter what is happening in the world.

Today's episode of Dev Interrupted features Michael Stahnke, VP of Platform at CircleCI; Lewis Tuff, VP of Engineering at Blockchain.com; and Carolyn Vo, Partner & Head of Engineering at Oliver Wyman. 

{% spotify spotify:episode:2nFsgyxhk9K20OF4RTdOPO %}

## Episode Highlights Include:
* (2:16) The current economic climate
* (8:50) Engineers complaining about too many meetings
* (14:36) Maintaining morale
* (22:43) Building a culture that's actually fun
* (27:40) The importance of experimentation
* (34:36) Owning your own message
* (41:44) Seeking out mentors
* (44:13) Acquiring new top talent
* (51:00) Is now a time to be more or less aggressive when hiring?

***While you’re here, check out this video from our [YouTube channel](https://www.youtube.com/c/DevInterrupted?sub_confirmation=1), and be sure to like and [subscribe](https://www.youtube.com/c/DevInterrupted?sub_confirmation=1) when you do!*** 

{% youtube 9nJ8OdYpYsc %}

### *Engineering Insights before anyone else....*
*The Weekly Interruption is a newsletter designed for engineering leaders, by engineering leaders.*

*We get it. You're busy. So are we. That's why our newsletter is light, informative and oftentimes irreverent. No BS or fluff. Each week we deliver actionable advice to help make you - whether you're a CTO, VP of Engineering, team lead or IC  - a better leader.*

*It's also the best way to stay up-to-date on all things Dev Interrupted - from our podcast, to trending articles, [Interact](https://devinterrupted.com/event/interact/) & our [community Discord.](https://discord.com/invite/devinterrupted)*

[***Get interrupted.***](https://devinterrupted.com/subscribe/)

![Subscribe to the Weekly Interruption](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/81b4hu463juqwf1bixfe.png)
¿Por qué deberías considerar las RESTful APIs para la arquitectura de tu aplicación?
Tags: webdev, beginners, programming, spanish
Published: 2022-11-10 23:02:22

Acrónimos que encontrarás en la lectura:

| Acrónimo  | Significado   |
|------|---------------------------------|
| SOA  | Service Oriented Architecture   |
| SOAP | Simple Object Access Protocol   |
| ROA  | Resource Oriented Architecture  |
| REST | Representational State Transfer |

A lo largo del tiempo se han desarrollado estándares para el diseño y desarrollo de servicios web que permitan integrar diferentes sistemas y garantizar la interoperabilidad.

Los servicios web pueden clasificarse por su tipo de arquitectura entre los que destacan SOA y ROA. El framework basado en SOA es SOAP el cual sienta su base en servicios web, mientras que el framework basado en ROA es REST que también sienta su base en servicios web (Wagh y Thool, 2012).

Algunos expertos dicen que SOAP no está hecho para dispositivos móviles de recursos limitados. Los mensajes de SOAP tienen una carga pesada, por el contrario los mensajes del framework REST son de carga ligera por lo que lo hace el más adecuado para utilizarlo en dispositivos y redes móviles.

En la última década, se ha popularizado un estilo de arquitectura Software REST. Los Servicios Web que funcionan bajo REST (servicios Web RESTful) se presentan como una alternativa prometedora distinta a los servicios basados en SOAP por su simplicidad y naturaleza liviana, además de la capacidad de transmitir datos directamente sobre HTTP.

Para brindar escalabilidad e interoperabilidad a una plataforma es clave implementar una herramienta tecnológica que tenga la capacidad de ser reutilizada dentro de otra plataforma tecnológica que se requiera. Una arquitectura de software orientada a la recuperación de recursos como REST permite que una aplicación pueda ser invocada como servicio brindando la capacidad de poder acceder a sus funciones desde otra plataforma.

Sin importar el lenguaje de programación o framework en que sea desarrollado, un REST API permite comunicar diferentes sistemas y plataformas gracias al uso de HTTP. En la actualidad estas arquitecturas se pueden implementar tanto en infraestructura “On-Premise” como en una nube pública como Azure, AWS o GCP e incluso en un modelo híbrido que combine los 2 enfoques.

REST se coloca como una alternativa idónea si se desea implementar una aplicación multiplataforma, ya que tiene potencial para crear aplicaciones escalables así como la característica del escaso uso de recursos, características esenciales para el desempeño de una aplicación web y/o móvil.

**Referencias**

Wagh, K., & Thool, R. (2012). A comparative study of soap vs rest web services provisioning techniques for mobile host. Journal of Information Engineering and Applications, 2(5), 12-16
How I Plan to Write
Published: 2022-11-10 22:09:42

This is my first post on dev.to, and I intend to share a few thoughts on how I want to write and what I want to write about. 

## What I want to write about
I spend a lot of time reading about emerging software and trends within software. Sometimes I try them out, other times I think about how I can integrate these new tools into the work I do day-to-day. I'm hoping to put some of these thoughts in this blog. I also want add tutorials, and one day soon, some videos too. Lastly, I think I'd also like to add my thoughts on being a software engineer thus far, and my ideas on where I want to take my career.

## How I plan to write
Like most others, I have a long list of draft ideas. Instead of wanting to perfect the draft and publish it (this is a good thing btw), I want to try and write more and polish later (and if I never get around to polishing, that's okay too).

Hope you, the reader, find something interesting and useful here. Welcome :)

Ibrahiem
For in
Tags: dart
Published: 2022-11-10 21:43:50

## - Na imagem abaixo:


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

O loop for in é usado para percorrer as propriedades de um objeto




Resultado:
 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gcb7b6f188qgxfm3sioq.png)
Javascript Testing
Tags: opensource, github, javascript, testing
Published: 2022-11-10 21:18:06

This week we are going to have **Lab 8**  and along with the lab 
it is also introducing a new tool to our SSG project. In **lab 8**, we are going to add testing functions for several functions that we have in our SSG. I somewhat have experience with this because one of my other course **CCP555** has a lot of testing involved. The testing framework that was used in the program was Jest.

### Procedure

After watching the videos and reading through the lab instruction. I just chose the testing framework that I'm going to use in this Lab 8, which is Jest. And then I just install the Jest to my program by using the command `npm install jest`. I updated the "test" command in the package.json file in order for it to run correctly.

I then extracted the `htmlGen` function and placed is into its own file that being htmlGen.js, and modified `my-button.js` to import `htmlGen` as an external function. 

I then started coding the testing functions. At first all I coded was the html good value functions. So I set up a total of 7 tests where for `htmlGen()`:

- test would generate a html result with a string html argument
- test where it generates  a html result with a string html argument
- test the `htmlGen()` function with bad or empty value types `(lang, title, html, string, footer)`

In CCP555, I have already learned about coverage using `npm run coverage`. But what was new was setting it up so that coverage would print out a report. 

#### Thought
There were several things I was already aware of since I have done some of this in previous labs in a different course. Though what was new to me was the capability of being able to print coverage 
files into a report. I will probably make more use of this on different projects.

**NOTE**: I didn't squash it correctly therefor having several commits.

[Test Function](https://github.com/LostButton/my-button-ssg/commit/99a9534fc255a54a6d1d866e78322e5feb5dca4f)
[htmlGen file](https://github.com/LostButton/my-button-ssg/commit/4bdef45b89f5298e6bd94640bd8bed6dfde01ed9)
[Adding Jest](https://github.com/LostButton/my-button-ssg/commit/bf8342d76ec862500466d973b504be416fa0a5ac)
[Updatting my-button.js](https://github.com/LostButton/my-button-ssg/commit/de7221f9dcba9f1a17d093192d77c288b190b103)
[Coverage Files](https://github.com/LostButton/my-button-ssg/commit/4f1b2e742c932c72ee8441adc77992fe0d8fa841)
For
Tags: dart
Published: 2022-11-10 21:15:54

## - Na imagem abaixo:

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

for permite que um certo trecho de programa seja executado um determinado número de vezes.


Resultado: 

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

Podemos também fazer como na imagem abaixo:



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

Resultado:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qv190wfazi5p75rfjaqt.png)
Map
Tags: dart
Published: 2022-11-10 21:11:11

## - Na imagem abaixo:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2z2l1g7ho61qka7r49ou.png)
Map é o armazenamento no formato chave-valor, onde cada valor estará relacionado a uma chave. Com essa estrutura, há casos em que precisamos obter o valor de uma determinada chave.

Resultado:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v0l2bl9amg27tc9p169r.png)
Working on weekends is not "different management style" #twitter
Tags: watercooler
Published: 2022-11-10 21:08:47

This is gonna be just a short one.

I was seeing a couple of very, very toxic reactions to developers having to demo something they have learnt about on Saturday on the next Monday. The reactions were talking about how _"lazy"_ these people were, and _"everything took ages to release"_ and now somebody finally holding the whip and things will happen on time.

> Let's cut the bullshit of inexperienced folks who only saw corporations in comic books or Hollywood.

## Impossible deadlines are management failure
Would you live in a skyscraper that was designed, given permission and built in 2 months?

When people are facing impossible deadlines, they freak out, their ability to think in the big picture is being replaced with a severe tunnel vision. They might be going the hardest, longest path... They cannot correct themselves as the tunnel-vision and the urge to produce blinds them.

Impossible deadlines are recipe for a disaster later. The euphemism will be later _"unforeseen critical bugs"_. And for high amount of burn-out and resignation (euphemism: _"high turnover associated with high performance situations_").

Did **Tesla** achieve self-driving cars in 3 years? Guess what! They still did not. Let's not celebrate vision when it is detached from reality! 🫣

## User volume equals edge-case amount
I cannot express it more: 

> The more users you have, the more established a software is the more edge-cases you will have.

It's very easy to test on latest Android. When you have millions of users you have to test tons of Android versions, iOS versions, MacOS and Windows versions, tablet formats, etc.

You would have all sorts of _names_, like two character full names: 李明 or very-very long names: Margarita María de la Victoria Esperanza Jacoba Felicidad Perpetua y Todos los Santos de Borbón y Borbón-Dos Sicilias

You would need to operate in all sorts of timezones. And so on.

People are not slow in big corporations because they are morons. They have a lot to break and they need to move carefully.

The professional way of this is layers of QA, gradual rollout, monitoring and before all of that careful UX research and UX design knowing that you are going to deliver value and not just some haphazard gimmick.

## Summary
This will be my most personal opinion on this matter, but I think you are a _loonie_ if you are a software developer and you side with this type of management. Mental and physical health, seeing your family and lastly commitment to your users are non-negotiable in my opinion. If you think people are tricking you because they work from home, you have control issues, my friend, you also tell me that you have absolutely no way to measure performance objectively.

Be considerate, be professional, understand the complexity of world and stop celebrating scammers promising false shortcuts to greatness.
How to use FontAwesome in Next.js?
Tags: nextjs, webdev, javascript, codenewbie
Published: 2022-11-10 21:05:07

Before we jump to the steps to add FontAwesome to Next.js screens, let's first know what FontAwesome is. 

**FontAwesome** is an icon library and toolkit that provides a range of free solid, social and outline icons. It comes in handy when building websites for personal use. 
It has a list of scalable vectors that are highly customizable.

## Adding Font Awesome to Next.js

1. Run the following command in the terminal:
```
npm install @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icons @fortawesome/react-fontawesome
```
2. Create and edit _app.js file
3. Add the following piece of code in the file:
```
import "@fortawesome/fontawesome-svg-core/styles.css"
import { config } from "@fortawesome/fontawesome-svg-core"; 
config.autoAddCss = false;
```
4. Now you can directly import the icons you want to use in your component and use them.

Happy Coding!

Follow us on [Instagram ](https://www.instagram.com/commitandpush/)

[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hqmyq1twcon9ndguelyd.png)](https://www.buymeacoffee.com/hardiquedasore)
How to use Mailhog (Docker) with Laravel 9
Published: 2022-11-10 19:42:18

Get Mailhog going with:
`docker run -d -p 1025:1025 -p 8025:8025 mailhog/mailhog`

Update your Laravel env file to have:

```
MAIL_MAILER=smtp
MAIL_HOST=0.0.0.0
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
```
View your mailbox at http://localhost:8025.
Wordle Clone
Tags: codepen, showdev, javascript
Published: 2022-11-10 19:34:26

I got bored during a non-work meeting last night and decided to build something fun. I don't know how I settled on ripping off wordle. But, here we are. Take a look and have some fun. You can copy it and add your own words if you want. 

{% codepen https://codepen.io/brentvdalling/pen/BaVWdYL %}

Feel free to comment any suggestions or criticisms.