teleren/devto huggingface dataset:
Ou Isso ou Aquilo: Exemplos com Switch / Case (Parte 4)
Tags: javascript, algorithms
Published: 2021-09-08 14:58:41

Vamos ver dois exemplos com `Switch / Case`.

## Exemplo 1

### Criar um algoritmo que leia um número inteiro entre 1 e 7 e escreva o dia da semana correspondente. Caso o usuário digite um número fora desse intervalo, deverá aparecer uma mensagem informando que não existe dia da semana com esse número.

Vou criar uma variável para colocar esse número.

```javascript
const diaDaSemana = Number(prompt("Digite um número inteiro entre 1 e 7:"));
```

De acordo com o número digitado, o usuário recebe uma mensagem com o dia da semana.

```javascript
switch (diaDaSemana) {
   caso 1:
      console.log(`domingo`);
      break;
   caso 2:
      console.log(`segunda-feira`);
      break;
   caso 3:
      console.log(`terça-feira`);
      break;
   caso 4:
      console.log(`quarta-feira`);
      break; 
   caso 5:
      console.log(`quinta-feira`);
      break;
   caso 6:
      console.log(`sexta-feira`);
      break;
   caso 7:
      console.log(`sábado`);
      break;
   default:
      console.log(`Não existe dia da semana com esse número. Favor digitar um valor entre 1 e 7.`);
}
```

## Exemplo 2

### Criar um algoritmo que leia um número inteiro entre 1 e 12 e escreva o mês correspondente. Caso o usuário digite um número fora desse intervalo, deverá aparecer uma mensagem informando que não existe mês com esse número.

Vou criar uma variável para colocar esse número.

```javascript
const mes = Number(prompt("Digite um número inteiro entre "));
```

De acordo com o número digitado, o usuário recebe uma mensagem com o mês.

```javascript
switch (mes) {
   caso 1:
      console.log(`janeiro`);
      break;
   caso 2:
      console.log(`fevereiro`);
      break;
   caso 3:
      console.log(`março`);
      break;
   caso 4:
      console.log(`abril`);
      break;
   caso 5:
      console.log(`maio`);
      break;
   caso 6:
      console.log(`junho`);
      break;
   caso 7:
      console.log(`julho`);
      break;
   caso 8:
      console.log(`agosto`);
      break;
   caso 9:
      console.log(`setembro`);
      break;
   caso 10:
      console.log(`outubro`);
      break;
   caso 11:
      console.log(`novembro`);
      break;
   caso 12:
      console.log(`dezembro`);
      break;
   default:
      console.log(`Não existe mês com esse número. Favor digitar um valor entre 1 e 12.`);
}
```
E aí? Gostaram? Até a próxima anotação! 😊
Installing Kubernetes cli client in Windows
Tags: kubernetes
Published: 2021-09-08 14:33:52

1. Open CMD in Administrator Mode. This is important to pay heed. Otherwise kubernetes commands won't work.
2. curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.18.20/bin/windows/amd64/kubectl.exe
3. Test installation using "kubectl version --client"
![Installing Kubernetes cli client in Windows](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5xpn1ke49m7r7ujeiff7.PNG)
How ReactJS uses LAN
Tags: react
Published: 2021-09-08 14:31:27

I used the latest version of react (https://github.com/facebook/react/releases/tag/v17.0.2).

Used the command：
```shell
npx create-react-app my-app
```

My directory tree：

![ksnip_20210908-222541](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/68vxz19npup3lwww77cf.png)
 
I ran the following command:
```shell
yarn
yarn start
```

A local service is running in the browser: `localhost:3000`
Now, I want to run on the LAN, for example: `1xx.1xx.xx.xx:3000`, how should I set it?
The start of Open-Source development 🚀 
Tags: opensoucre
Published: 2021-09-08 14:30:54

# Hello World…

My name is Minh Hang Nguyen. I’m an international student from Hanoi, the capitol city of Vietnam and currently located in Markham, Ontario. I’m in my fifth semester with a hope to put my focus on web development. 

Last summer, I was lucky to secure a co-op placement as a Quality Assurance Engineer. Even though I didn’t get to work directly with the source code, I had the chance to be exposed to a large codebase which got me so overwhelmed. I was wondering if there’s any way to get myself more familiar with this reality and got some recommendations from my friends that I might take this course. Before making my decision, I looked up some information about Open Source and found that I could have a chance to learn from various programmers with different logic and different coding styles. For this term, my goal is to be able to use Git effectively and make meaningful contributions to some Javascript open-source project. I also hope to be able to learn new technologies through different projects from other developers.

I’m interested in using React so [react-use](https://github.com/streamich/react-use) caught my attention right away. This repo provides various custom hooks that are very useful and widely used for us developers. There are also a lot of rooms for even more development.

Really looking forward to starting my journey with Open Source development from here!
Happy coding!!!!
249: #TechIsHiring + eSports and Software Engineering with Chad Stewart
Tags: podcast, career, gamedev
Published: 2021-09-08 14:29:44

[Chad Stewart](https://twitter.com/Chad_R_Stewart) talks about starting the #TechIsHiring hashtag on Twitter to use networking for good and amplify others with not as big of reach.

We then pivot to nerding out about gaming! Drawing comparisons and connections between playing fighting games and software development and engineering. Bringing experience from one realm to another.

{% podcast https://dev.to/greaterthancode/249-techishiring-esports-and-software-engineering-with-chad-stewart %}

Check out more awesome episodes (with transcripts!) at [GreaterThanCode.com](https://greaterthancode.com)!
Perfection is the first step to Failure!
Tags: softwaredevelopment, agile, teamwork
Published: 2021-09-08 14:27:42

---
title: Perfection is the first step to Failure!
published: true
date: 2021-09-08 14:25:36 UTC
tags: softwaredevelopment,agile,teamwork
canonical_url: https://medium.com/chingu/perfection-is-the-first-step-to-failure-ca2afe3dc404
---

#### Sprint 2 — Wednesday

![](https://cdn-images-1.medium.com/max/1024/1*NnmAoXerlVSATAQT7_-Syw.jpeg)<figcaption>Photo by <a href="https://unsplash.com/@anniespratt?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Annie Spratt</a> on <a href="https://unsplash.com/s/photos/ocd?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption>

### Start simple and add complexity as needed!

Developers are by nature very detail-oriented individuals. It’s a required trait since the apps we create must meet the requirements imposed on us by both users and the technologies we use.

But, the downside occurs when your attention to detail turns into **_perfectionism_**. Our definition of _perfectionism_ is devoting attention and attention to details associated with a task, **before** they are needed.

This is where the _Agile Methodology_ can be your best friend since it values “ **_Responding to change over following a plan_** ”.

One of the 12 Agile Principles is:

> Welcome changing requirements, even late in development.

Agile processes harness change for the customer’s competitive advantage. Timing is critical since it’s important to _do the right thing at the right time_.

Some practical tips to help include:

- Create simple app components based on what you currently know and add to them as new details surface in later sprints.
- Don’t let what you’ve already created lead to resistance to change. Your code is the means to a goal, **not** the goal itself.
- Design and write your code assuming that it will need to be modified and enhanced.
- Treat your backlog as a “living” document. Continuously groom it in each sprint as new details are found.
- Don’t hide your status from the team. Information should be freely and openly shared (including problems!) since all teammates are equally responsible for delivering a minimum viable product (MVP) to your users.

![](https://cdn-images-1.medium.com/max/600/1*yfV2MsmezcJNrLdQxEm06Q.png)

### Before you Go!

Chingu helps you to get out of “_Tutorial Purgatory_” by transforming what you’ve learned into experience. The experience to boost your Developer career and help you get jobs.

You can learn more about **Chingu** & how to join us at [https://chingu.io](https://chingu.io/)

* * *
规范姓名格式
Published: 2021-09-08 14:23:30

请把用户输入的不规范的英文名字，变为首字母大写，其他小写的规范名字。输入：['adam', 'LISA', 'barT']，输出：['Adam', 'Lisa', 'Bart']。
```
const list = ['adam', 'LISA', 'barT'];
const normalizeStr = str=>str.slice(0,1).toUpperCase()+str.slice(1).toLowerCase();
const normalize = list=>list.map(x => normalizeStr(x));
console.log(normalize(list));
```
💥Non-standard way to use more space of screens in your Flutter app💥
Tags: flutter, dart, android, github
Published: 2021-09-08 14:10:58

I create my first package for Flutter
The package allows you to combine a BottomSheet and a BottomNavigationBar. In addition, you can use this combination on every screen.
 

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

😳Custom bottom Sheet under Bottom Navigation Bar😳
😩Sounds sucks? 😉First of all look at [screens in repository](https://github.com/Frezyx/bottom_bar_with_sheet)!

Show some ❤️ and star the repo to support the project!
Automating your Azure infrastructure with Pulumi
Tags: beginners, tutorial, devops, azure
Published: 2021-09-08 14:03:21

---
title: Automating your Azure infrastructure with Pulumi
published: true
description: Pulumi allows developers to do infrastructure as code using their favourite programming language.
tags: #beginners #tutorial #devops #azure 
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/614pfmm3knxf7vhj7h4u.png
---

Pulumi allows developers to do infrastructure as code using their favourite programming language. 

If you don't know what Pulumi is or haven't gave it a try yet, then join me for a kick start:

https://www.youtube.com/watch?v=eH8-Z_j6lvQ


## This session is presented to you by Azure Back To School 2021:
The Azure Back To School event compiles an awesome list of Azure content created by wonderful people and I had the great pleasure to be part of it. 

See the full schedule here: https://azurebacktoschool.tech


## Let's keep in touch
You can reach me on [Twitter](https://twitter.com/tidjani_b).

See you soon !
What is the difference between REST and GraphQL? An Introduction
Tags: graphql, rest, api
Published: 2021-09-08 14:02:26

Let's start by saying that REST and GraphQL are two API design styles that can achieve the same thing: transferring data over the internet. 

Despite this common goal, the way they go after it differs greatly. Here are three main differences that you should know:

## 1. REST is an architectural pattern and GraphQL is a query language

This is the first major difference and it stems from the problem that each wants to solve. 
- REST was first introduced in 2000, when internet was still a baby. During those times, many things were wild so REST aimed at standardizing different ways of creating URLs across applications. Therefore, we needed an architectural pattern and REST brought a standard in the Wild Internet! 

- GraphQL was open-sourced in 2015. During those times, REST was reliable and popular but applications grew bigger and bigger and so the amount of data that gets transferred. Sometimes, REST fetched unneccesary data from a server (e.g. over-fetching) so we needed a way to precisely define the data we wanted to fetch. What about a query language? 

Lee Byron, Director of the GraphQL Foundation on GraphQL:
> When we first created GraphQL, we set out to make product development easier with APIs driven by the needs of mobile and app developers
 
## 2. While REST hits multiple endpoints to retrieve data, GraphQL uses a single request

REST APIs allow fetching information in a simple way. However, if you want to get information from two or more objects, you need to perform two or more requests.

GraphQL uses a query language to tailor the request to fetch exactly what you need, from the whole dataset to specific objects or fields within each object. 



## 3. While REST is prone to over-fetching, GraphQL defines what to fetch

REST is prone to fetch too much data (over-fetching) or too little data (under-fetching). While GraphQL allows clients to precisely define the data to fetch. 

### Other differences between REST and GraphQL

As you can imagine, there are some other differences between the two API design styles. You can find a quick reference on other differences in [this article](https://www.vitainbeta.org/2021/09/07/what-is-the-difference-between-rest-and-graphql/).


## So, what is best?
The answer, of course, is: it depends.
As [discussed in this article](https://www.vitainbeta.org/2021/09/07/what-is-the-difference-between-rest-and-graphql/), despite GraphQL being more and more important, REST is still the industry standard.

REST endpoints are mature and this is a very strong point in some industries like finance and banking. While GraphQL simplifies data consumption, REST design standards are strongly favored by many sectors due to cache-ability features, security, tooling community, and ultimate reliability.
Wednesday Links - Edition 2021-09-08
Tags: java, jvm, spring, api
Published: 2021-09-08 14:01:34


Distributed tracing: find bottlenecks in complex systems (~4min)🔍
https://nurkiewicz.com/48

On metrics (6 min)📈
https://blog.frankel.ch/metrics

Practical API Design - Using Protobuf FieldMask (8 min)🎭
https://netflixtechblog.com/practical-api-design-at-netflix-part-1-using-protobuf-fieldmask-35cfdc606518

Choosing an API technology: gRPC, REST, GraphQL (7 min)🧲
https://speedscale.com/2021/07/20/choosing-an-api-technology-grpc-rest-graphql

Java 17 and IntelliJ IDEA (24 min)🪢
https://blog.jetbrains.com/idea/2021/09/java-17-and-intellij-idea

A Java 17 and Jakarta EE 9 baseline for Spring Framework 6 (3 min)🌠
https://spring.io/blog/2021/09/02/a-java-17-and-jakarta-ee-9-baseline-for-spring-framework-6

Playtika Testcontainers helper library (40 sec)💁🏻
https://twitter.com/piotr_minkowski/status/1432970631893733376

Resource Bundle Look-ups in Modular Java Applications (8 min)🖼️
https://www.morling.dev/blog/resource-bundle-lookups-in-modular-java-applications

Extreme HTTP Performance Tuning: 1.2M API req/s on a 4 vCPU EC2 Instance (1h)🚄
https://talawah.io/blog/extreme-http-performance-tuning-one-point-two-million

A practical look at JEP-412 in JDK17 with libsodium (85 min)🦙
https://blog.arkey.fr/2021/09/04/a-practical-look-at-jep-412-in-jdk17-with-libsodium

Announcing new AWS SDK for Kotlin alpha release (3 min)🍅
https://aws.amazon.com/blogs/developer/aws-sdk-for-kotlin-alpha-release

OpenSSL 3.0 GA (30 sec)🔒
https://twitter.com/kennwhite/status/1435231069675180035

Speed up your CI/CD jobs in Kubernetes (7 min)🏃
https://blog.codecentric.de/en/2021/09/ci-cd-jobs-speed-up-in-kubernetes

A primer on the OpenAI API - Part 1 (5 min)🤖
https://blog.scottlogic.com/2021/08/31/a-primer-on-the-openai-api-1.html

Software development topics I've changed my mind on after 6 years in the industry(2 min)🤔
https://chriskiehl.com/article/thoughts-after-6-years

How Docker broke in half (23 min)🐳
https://www.infoworld.com/article/3632142/how-docker-broke-in-half.html

Is Spring WebFlux a Myth? (8 min)🏺
https://blog.devgenius.io/is-spring-webflux-a-myth-4526c2f92413

Challenges & Solutions for Migrating Java Apps to Reactive(16 min)🐪
https://www.capitalone.com/tech/software-engineering/migrating-java-apps-to-reactive/

Saving Time with Structured Logging(12 min)📝
https://reflectoring.io/structured-logging/

WebAssembly port of FFmpeg (1 min)🎥
https://ffmpegwasm.netlify.app

Jakub Nabrdalik book picks on software architecture (1 min)📚
https://twitter.com/SolidSoftBlog/status/1431380024767172618
Finishing up: Self-Aware Software Artisan
Tags: productivity, beginners, webdev
Published: 2021-09-08 13:58:54

**Thank you for reading.**

---

# Find this useful?

##### 👏 Clap so more people see the story.


##### ❤️ Support your friends and colleagues at work — share this essay with them!


##### 🚀 Use it as a, Company or Personal, Manifesto! [Fork and Adapt on GitHub](https://github.com/moltouni/self-aware-software-artisan)!

---

{% youtube -TVXfw5f30w %}
###### 📹 Intro video: Hunter S Thompson: Life

---

> ## 📣 Coming soon!

> I’m continually refactoring [this series](selfawaresoftwareartisan.com).
>
> **Subscribe to receive a single-page Manifesto**: Scalable Software Development distilled to the ultimate truths; from the viewpoint of an Software Artisan.

---

> Do your own mistakes and successes. Do you. We are all here, eager to see how your unique life perspective, with all bolts and twitches, pans out.

You can always pass the enthusiasm to someone else, so mentor people around you, that’s all that is needed to spark something great in someone.

**If you have any questions, suggestions, or interesting challenges, feel free to leave a comment or [get in touch with me](https://marionovak.com/)**.

---

> Join state-of-the-art Emotions, Habit tracker and Journal — [Habitus App](https://habitus.today/).

> Written in TypeScript, Koa.js, and Vue.js.

> Anonymous and Open-Source.

---

> Just launched: “[Whatodoo — Events near you](https://whatodoo.com/)” platform!

> Check it out to see all of the things happening near you!

---

All the best,

Mario Novak

---


# 🏆 Your progress 🌏 🏄‍♂️

1. [Intro](https://dev.to/moltouni/self-aware-software-artisan-4ehf)

2. [You — A Human Being](https://dev.to/moltouni/self-aware-software-artisan-you-a-human-being-132o)

3. [Your Health](https://dev.to/moltouni/your-health-self-aware-software-artisan-9d6)

4. [Question Everything](https://dev.to/moltouni/question-everything-self-aware-software-artisan-1pcd)

5. [Deep work](https://dev.to/moltouni/deep-work-self-aware-software-artisan-1igi)

6. [Joining a Software Company](https://dev.to/moltouni/joining-a-software-company-self-aware-software-artisan-3eon)

7. [Starting a Software Company](https://dev.to/moltouni/starting-a-software-company-self-aware-software-artisan-1c4i)

8. [Team Artisanship](https://dev.to/moltouni/team-artisanship-self-aware-software-artisan-58an)

9. [Product Artisanship](https://dev.to/moltouni/product-artisanship-self-aware-software-artisan-2nmf)

10. [Code Artisanship](https://dev.to/moltouni/code-artisanship-self-aware-software-artisan-222p)

11. [Finishing up](https://dev.to/moltouni/finishing-up-self-aware-software-artisan-1glj) — 🎉 You are here.


----

[Cover image source](https://www.pinterest.com/pin/711639178609305638/)
Welcome Thread - v141
Tags: welcome
Published: 2021-09-08 13:55:34

---
title: Welcome Thread - v141
published: true
description: Welcome to DEV! A thread of hellos and intros.
tags: welcome
canonical_url: 
---

![Radish saying hello](https://media.giphy.com/media/26xBwdIuRJiAIqHwA/giphy.gif?cid=ecf05e47u5ffs28zwycy9zwz1tiuksw5hfww4dn729tqsv30&rid=giphy.gif&ct=g)

### Welcome to DEV!

1. Leave a comment below to introduce yourself! You can talk about what brought you here, what you're learning, or just a fun fact about yourself.

2. Reply to someone's comment, either with a question or just a hello. 👋 

**Great to have you in the community!**
Listen to S6E5 of DevDiscuss: "When You Should Start Thinking About Performance" with Todd Underwood
Tags: discuss, podcast
Published: 2021-09-08 13:52:46

---
title: Listen to S6E5 of DevDiscuss: "When You Should Start Thinking About Performance" with Todd Underwood
published: true
description: Listen to S6E5 of DevDiscuss!
tags: discuss, podcast 
series: DevDiscuss Season 6
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e2nvdau16685ycunn5j4.png
---

## Listen to DevDiscuss S6E5 right here on on DEV:

{% podcast https://dev.to/devdiscuss/s6-e5-when-you-should-start-thinking-about-performance %}

_DevDiscuss is the first original podcast from DEV all about the burning topics that impact all our lives as developers._

**This week, we talk about web performance: from its history to present-day processes** 

### Hosts:
- @ben — Creator of DEV & Co-Founder of Forem
- @jgaskins — Head of SRE @ Forem
  
### Guest: 
- [Todd Underwood](https://twitter.com/tmu), Director at Google where he leads machine learning for site reliability engineering (SRE). Todd is also the engineering site lead for Google’s Pittsburgh office.

Enjoy this week's episode of DevDiscuss! Let us know your thoughts in the comments below — or on Twitter ([@thepracticaldev](https://twitter.com/thepracticaldev) ).

![Speakers](https://media.giphy.com/media/qZelsWAXfWpAA/giphy.gif?cid=ecf05e47ddu6jql6tkj8kvdmj4z5ofal65l38f235ruuinlo&rid=giphy.gif&ct=g)

---

_You can [follow DevDiscuss](dev.to/devdiscuss) to get episode notifications and listen right in your feed_ — or subscribe on your platform of choice! Plus, if you leave us a review, we'll send you a free pack of thank-you stickers. Details [here](https://airtable.com/shr8oKAIMZgdYnBxx). 

## Quick Listening Links
- [Apple Podcasts](https://podcasts.apple.com/us/podcast/s6-e5-when-you-should-start-thinking-about-performance/id1513053883?i=1000534674918)
- [Spotify](https://open.spotify.com/episode/004qpDsS4RSbulJBIs1YaH)
- [Google](https://podcasts.google.com/feed/aHR0cHM6Ly9mZWVkcy5kZXZwb2RzLmRldi9kZXZkaXNjdXNzX3BvZGNhc3QueG1s/episode/aHR0cHM6Ly9kZXZwb2RzLmRldi9wb2RjYXN0cy9kZXZkaXNjdXNzLzQ2?sa=X&ved=0CAQQkfYCahcKEwionb3Lwu_yAhUAAAAAHQAAAAAQQg)
- [Listen Notes](https://www.listennotes.com/podcasts/devdiscuss/s6e5-when-you-should-start-01SCKw_29qi/)
- [TuneIn](https://tunein.com/podcasts/Technology-Podcasts/DevDiscuss-p1324596/?topicId=165656085)
- [RSS Feed](http://feeds.codenewbie.org/devnews_podcast.xml)
- [DEV Pods Site](http://devpods.herokuapp.com/podcasts/devdiscuss/episodes/221)

---
_Acknowledgements_ 
- _@levisharpe for producing & mixing the show_
- _Our season six sponsors: [CockroachDB](cockroachlabs.com/devdiscuss) & [Scout APM](https://www.scoutapm.com/devdiscuss)!_
UI Dev Newsletter #73
Tags: html, css, javascript, webdev
Published: 2021-09-08 13:45:55

## Links


[Reducing Carbon Emissions On The Web](https://bit.ly/3n7I3Su)
Berwyn Powell shares his thoughts and experiences about making websites environmentally friendly.


[Understanding Z-Index in CSS](https://bit.ly/3zPYQwG)
Ahmad Shadeed shares a visual guide on how z-index and stacking contexts work in CSS.


[Exploring the CSS Paint API: Blob Animation](https://bit.ly/2WYPh0b)
Temani Afif explains how to use the powerful Paint API and math to make a blob animation.


[Creating Accessible CSS Art](https://bit.ly/3BPCXyl)
Álvaro Montoro shares some tips and best practices to make CSS art more accessible for everyone.


[Element diversity](https://bit.ly/3BJbv5d)
Manuel Matuzović shares a list of reasons why we use divs and explains why we shouldn't use divs so much.


[Stop! Put Down That Ternary, Lines Are Free](https://bit.ly/3jKYkuk)
Simon Barker explains why we should strive to write code that is understandable to the team's newest and least experienced members by writing more readable code.


[High performance bracket pair colorization](https://bit.ly/3n6dDjx)
Visual Studio Code starts to support native bracket pair colorization in the last update.


[Wavy Dividers Generator](https://bit.ly/2X2oqAm)
Eugene Zolotarenko shares a tool for generating wavy dividers with ease.


## Self-promotion

[You want enabling CSS selectors, not disabling ones](https://bit.ly/3tiqgZA)
Chris Coyier shares one of my articles about a selector that does a job without disabling the particular rule.


**Happy coding!**

[Subscribe to the newsletter here!](https://buttondown.email/starbist)