teleren/devto huggingface dataset:
Clean Code Tip: Avoid mental mappings
Tags: cleancode
Published: 2022-03-11 11:52:43

---
title: Clean Code Tip: Avoid mental mappings
published: true
date: 2022-01-25 00:00:00 UTC
tags: cleancode
canonical_url: https://www.code4it.dev/cleancodetips/avoid-mental-mappings
cover_image: https://www.code4it.dev/static/f78120efe4b04ba6a823df20ec4b0fdd/77647/cover.png
---


Every name must be meaningful and clear. If names are not obvious, other developers (or your future self) may misinterpret what you were meaning.

Avoid using mental mapping to abbreviate names, unless the abbreviation is obvious or common.

Names should not be based on mental mapping, even worse without context.

## Bad mental mappings

Take this **bad** example:

```cs
public void RenderWOSpace()
```

What is a *WOSpace*? Without context, readers won't understand its meaning. Ok, some people use *WO* as an abbreviation of *without*.

So, a better name is, of course:

```cs
public void RenderWithoutSpace()
```

## Acceptable mappings

Some abbreviations are quite obvious and are totally fine to be used.

For instance, standard abbreviations, like *km* for *kilometer*.

```cs
public int DistanceInKm()
```

or variables used, for instance, in a loop:

```cs
for (int i = 0; i <; 100; i++){}
```

or in lambdas:

```cs
int[] collection = new int[] { 2, 3, 5, 8 };
collection.Where(c => c < 5);
```

**It all depends on the scope**: the narrower the scope, the *meaningless* (don't get me wrong!) can be the variable. 

## An edge case

Sometimes, a common (almost obvious) abbreviation can have multiple meanings. **What does DB mean?** **Database? Decibel?** It all depends on the context!

So, a `_dbConnection` obviously refers to the database. But a `defaultDb`, is the default decibel value or the default database?

## Conclusion

As usual, clarity is the key for good code: a name, may it be for classes, modules, or variables, should be explicit and obvious to everyone. 

So, always [use meaningful names](https://www.code4it.dev/cleancodetips/choose-meaningful-names "Clean code tips: use meaningful names - Code4IT")!

Happy coding!

🐧

This article comes from [Code4IT](https://www.code4it.dev/cleancodetips/avoid-mental-mappings)
New Years Resolution - Dev Log 12
Tags: webdev, programming, computerscience, beginners
Published: 2022-01-24 23:48:51

Personal note: So some big news in terms of the job board. I have come to the decision that SEO is going to be critical in terms of actually getting people to use the site, I am going to make the switch over to NEXT. I do not have a complicated enough app yet in React to make the switch difficult. So I might as well do it now before I get any further. I also now feel that Vercel is the way to go in terms of deployment. That service will auto-scale which will save me a headache. Top that with Redis cloud that should take care of the DB scaling for me, I should be able to set it and forget it. That will give me time to focus on marketing and adding features. The final decision I have made regarding the job board is that I am going to pay someone to design the UI for me. I would like to produce an amazing-looking product, I am not too egotistical to understand my design skills are poor at best.

If you have not checked out the video discussing the basic UI, please do:

https://www.youtube.com/watch?v=jvH9iTYzUbQ

Idea 1 - Job Board: Due to santa ana winds in SoCal, where I live, there are more trees in the street than the ground lol. So I have not been able to work on the project for a couple of days. Working as a delivery driver is not fantastic right now, but I do have some time off today and tomorrow, so the grind begins again; this time with NEXT.

Idea 2 - Paid Plugins: Scratched

Idea 3 - SaaS: I have a solid idea for a SaaS company I believe, but will not start on this till my job board is out and functional, even though I'm really excited about it.

Idea 4 - Paid API: Just learned about how you can build an API and market it easily through rapid API. I am thinking that this might be something I want to try.
Why an Autistic Developer is Your Next Great Hire w/ Matt Nigh of UW Medicine
Tags: inclusion, podcast, techtalks, career
Published: 2022-01-24 23:44:25

Like most fast-growing companies, LinearB spends WAY too much time trying to hire developers.

So when we came across a [brilliant article about hiring autistic talent](https://medium.com/leading-literally/now-is-the-time-to-hire-autistic-talent-932d4f291644), we knew we had to have its author Matt Nigh on the podcast. Matt is one of the most prominent thought leaders on neurodiversity in the workplace.

Matt himself was diagnosed with autism late in life following a very unique job interview at Google. He’s since spent countless hours researching, writing and talking about how companies can not only bring neurodiverse talent into the fold, but why engineering teams thrive when they do.

In this episode of Dev Interrupted we talk with Matt about best practices in recruiting, hiring and working with neurodiverse coders, how his interview at Google interview led to an autism diagnosis, the ways Matt’s data team at the University of Washington is helping combat COVID and what private companies can learn from the ROI metrics of universities and public institutions.

Dan and Matt also took some time to geek out about GitLab.

We hope this conversation was as enlightening for you as it was for us and we hope it helps you find your next great hire.

{% spotify spotify:episode:4ZYGEMqBFzdfDi31Tdxqqa %} 

## Episode Highlights Include:
* How Matt’s [autism diagnosis](https://www.autismspeaks.org/what-autism) changed his career
* [Hiring](https://hbr.org/2017/05/neurodiversity-as-a-competitive-advantage) neurodiverse talent
* Inclusive interview best practices for [neurodiverse](https://devinterrupted.com/adhd-in-the-workplace-3-ways-you-can-help/) candidates
* ROI metrics: public sector vs private sector
* [UW’s](https://www.uwmedicine.org/coronavirus) data team and its efforts to combat COVID

## [You're Invited to INTERACT on April 7th](https://devinterrupted.com/event/interact/)

Join engineering leaders from Netflix, Slack, Stack Overflow, American Express & more at LinearB's virtual engineering leadership conference, [**INTERACT**](https://devinterrupted.com/event/interact/) on **April 7th, 2022.**

**1 day, 20 speakers, 1,000s of engineering leaders - all driven by the Dev Interrupted community.** If you are a team lead, engineering manager, VP or CTO looking to improve your team, this is the conference for you!

[**Learn more here**](https://devinterrupted.com/event/interact/)


![Join INTERACT at https://devinterrupted.com/event/interact/](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2xhtonct1vkpjhrtzfl3.png)
Want to learn something new? Consistency is the key
Tags: programming, career, productivity, learning
Published: 2022-01-24 23:20:56

If you've ever taken a fitness class, you've heard the instructor talk about **_consistency_**. It's not about how fast you pedal or how much weight you lift. It's about showing up, doing your best and not giving up. Regularly.

It's the same for your brain. If you are learning a new framework, a new programming language, or working on a side project to expand your skills, you are **_much_** better off doing a small amount every day, or several times a week, as opposed to bingeing. When I hear a friend say something like "I'm dedicating this coming weekend to learning React" I cringe because I fear they will go back to their day job and forget everything from the weekend by the next weekend. 

But don't take my word for it. The science backs this up.

## Frequency
In a 2011 study at University of California Irvine’s Center for the Neurobiology of Learning and Memory, researchers proved that when neurons interact frequently the bonds between them grow stronger and more information is retained for later use:

"When learning new things, memory and recall are strengthened by **_frequency_** and **_recency_**. The more we practice and rehearse something new and the more recently we have practiced, the easier it is for our brain to transmit these experiences efficiently and store them for ready access later. This process is called fluency." [1](https://trainingindustry.com/articles/content-development/how-the-brain-learns)

In short, think about something frequently and it will stick. 

## Recency
The concept is simple. Our brains retain the information we have received most recently, but only for a short time. This makes sense given the huge about of incoming information the brain has to process. Why retain the license number of the car in front of you for more than 10 seconds?

But if you want to deliberately retain new information, the trick is **_cumulative review_**. Every time you start a reading session, or coding session, spend the first 5 or so minutes reviewing what you did in the last session. Once a week, review something from much earlier that you might now be fuzzy on. So simple but it will return huge dividends. This technique has long been known to educators but can be challenging to implement when self-guided.

When I was first learning backgammon (a game that is wonderfully complex when you get past the basics) I proved that this technique works and I still use it today. I start every study session with a short review of what I did in the previous session. Once a week I review concepts I haven't looked at for awhile. This has helped my game tremendously.

The same technique works for all learnings - technical and in life. Follow these two simple rules consistently:

1. Study frequently, every day if you can manage it
1. Review regularly

Good luck with whatever you are seeking to learn!
100 días de código: 59, comenzando con el diseño de una pagina de hotel
Tags: spanish, webdev, design, 100daysofcode
Published: 2022-01-24 23:17:46

¡Hey hey hey!

Aunque no he escrito en el fin de semana si que le he dedicado tiempo al desarrollo y ahora comencé un proyecto para crear una landing page para hoteles como prueba de mis habilidades para comenzar con entrevistas y asi conseguir el sueño dorado (mi primer empleo como desarrollador).

He comenzado mi proyecto creando los wireframes basicos, los cuales puedes encontrar en el [repositorio del proyecto](https://github.com/Darito97/pagina-de-hotel).

Y ahora estoy en la sección de diseño y lo estoy realizando con [figma](https://www.figma.com/file/bZ07lc5ASIf3ahRZFZoNP5/Hotel?node-id=2%3A51).

Realmente estoy emocionado y aun conservo la motivación de haber terminado con mi [portafolio personal](https://github.com/Darito97/portafolio3) asi que creo que puedo terminar bastante rápido este proyecto.

Eso es todo por hoy, espero que les vaya super bien en sus proyectos y animo con todo.

¡Adiós mundo!

Foto cover de [Luca Bravo](https://unsplash.com/@lucabravo?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) en [Unsplash](https://unsplash.com/s/photos/monkey-laptop?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText).
Joining the DEV Team (again)!
Tags: meta, career, personal
Published: 2022-01-24 22:08:23

---
title: Joining the DEV Team (again)!
published: true
description: You wouldn't believe it, but I'm not an intern anymore!
tags: meta, career, personal
//cover_image: https://direct_url_to_image.jpg
---
Hey again, all! 

If you frequent DEV Community or have ordered from our shop, you have likely seen me around. I originally joined the DEV Team in June of 2019 as a Business Development and Growth Intern. Although I had been an intern for some time, my colleagues have always respected me as a significant part of the team through-and-through. 

Two-and-a-half years later, I graduated from The College of New Jersey with my Bachelor's in English. **Now, I'm becoming a part of the DEV Team full-time as a Developer Marketing Associate**! It's a really exciting change and I'm looking forward to every part of it. 

Between work and school, I have not had a lot of time to improve my programming skills and engage with the community on a personal level. I hope to change this over the course of the next few months. I'm certain you will all be seeing more of me as I tackle this new position. Wish me luck!

If you have any questions or comments — or just want to chat — don't hesitate to reach out! Shoot me an email or a DM on the DEV Community Discord (Where I'll be waaaaay quicker to respond to you. [Join](https://discord.gg/rxVwWrR8jb) if you haven't yet!).
#AzureML – How to create a dataset with images to be used on the AzureML Designer DenseNet samples
Tags: englishpost, azuremachinelearning, azuremldataset
Published: 2022-01-26 14:57:43

---
title: #AzureML – How to create a dataset with images to be used on the AzureML Designer DenseNet samples
published: true
date: 2022-01-24 22:06:05 UTC
tags: EnglishPost,AzureMachineLearning,AzureMachineLearning,AzureMLDataSet
canonical_url: 
---

Hi ! I didn’t found this online, so I decided to write it down. How to create a dataset with images to be used on the Azure Machine Learning designer, when training a model using the DenseNet prefab and samples. Let’s start defining which Azure Storage Account we will use. I’ll use the default one.… [Continue reading #AzureML – How to create a dataset with images to be used on the AzureML Designer DenseNet samples](https://elbruno.com/2022/01/24/azureml-how-to-create-a-dataset-with-images-to-be-used-on-the-azureml-designer-densenet-samples/)
Access "file name" From Origin 'null' has been Blocked by cors Policy: Cross Origin requests are only supported for Pro
Tags: cors, javascript, console
Published: 2022-01-24 21:44:40


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1zxuwddsrjzx1uwe5e3k.jpg)

whenever I try to import files in JS&TS I got this error.


Solutions :

Open the CMD, globally execute that command line.
```cmd
npm install anywhere -g
```

To run the server 
```cmd
anywhere
```

and then, run your  server at [https://192.168.1.8:8001/](#)
Thank you Faker. Now it’s Time to Move On.
Tags: javascript, angular, react, vue
Published: 2022-01-24 21:36:37

TL;DR — [Falso](https://github.com/ngneat/falso) is a modern, tree-shakeable, well-documented replacement for Faker.js

You probably know [what happened](https://www.theverge.com/2022/1/9/22874949/developer-corrupts-open-source-libraries-projects-affected) to Faker.js around two weeks ago.

In collaboration with [Netanel Basal](https://twitter.com/NetanelBasal), I created a new mock data generator lib to provide a quick, suitable replacement for those relying on Faker (including us).

## Meet Falso 🎩
✅ 160+ Functions ( at the time of writing)
✅ Tree Shakable
✅ Fully Typed
✅ Entity Functions
✅ Well documented with live previews
✅ Single and Array Results

There was a lot of community effort put into building this library. In just two weeks, we accomplished:

✨ A whopping 1.6k Github Stars
💪 59 Merged pull requests
🎁 58 New Features

I want to thank everyone who took part in this, you rock!

Give Falso a try and let me know what you think 🌟

{% github https://github.com/ngneat/falso %}

See the [docs](https://ngneat.github.io/falso/):

![The [Falso docs](https://ngneat.github.io/falso/) and live preview](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wxvkom80pn9k2ovfj7ej.gif)

We’re just getting started.
## What’s Next?
🌐 Locale support
💪 More Generators
🎯 Improve data accuracy

You are welcome to [contribute](https://github.com/ngneat/falso/blob/main/CONTRIBUTING.md)! Let us build the next generation of mock data together!

For those looking to contribute for the first time to an open-source, Falso is an excellent choice!
Quick Tips and Tricks for Auth0 Actions
Tags: webdev, programming, tutorial
Published: 2022-01-24 21:27:05

### Here’s a collection of Actions that you can write quickly to perform useful tasks.

### <br>

[Actions](https://auth0.com/docs/actions) make it possible for you to customize the way Auth0 works. They do this by letting you insert scripts — called *Actions* — into various Auth0 workflows to add functionality and enhance your users’ experience.

Actions can be complex, but they don’t need to be. In this article, I’ll show you a handful of Actions that can you can enter in a minute or two, but perform tasks that you’ll find useful in the day-to-day running of your applications.


## Redirect Users to a “Downtime” Page

Sooner or later, your application will have downtime. If all goes well, it will be *scheduled* downtime, but there will likely be *unscheduled* downtime too. In either case, it’s useful to have a web page where you can redirect users to inform them that your application is unavailable and provide additional details.

You can do this by adding the following Action to the [Login flow](https://manage.auth0.com/#/actions/flows/login/), replacing `{SYSTEM DOWNTIME PAGE URL}` with the location of the web page explaining the downtime:

```javascript
// Login flow

exports.onExecutePostLogin = async (event, api) => {
  api.redirect.sendUserTo("{SYSTEM DOWNTIME PAGE URL}");
};
```

When your application is down, drag this Action into your tenant’s Login flow. It uses the `api.redirect.sendUserTo()` method to redirect the user to the given URL after they log in.

Keep in mind that users will see the downtime page only after logging in successfully.

[Read more...](https://auth0.com/blog/quick-tips-tricks-auth0-actions/?utm_source=content_synd&utm_medium=sc&utm_campaign=actions)
Monolith vs Microservices Architecture - 100 Days of CSH #3
Tags: programming, javascript, node, beginners
Published: 2022-01-24 20:55:13

Hello on Monday :wink:! In today's quick session I want to share some knowledge from the course I'm currently attending on daily basis. 
As I said before I'm working as a **JavaScript Developer** and there is right now **a big interest from my side on the architecture part of any application.** It's a time for me I really want to dive deep into it and this course might helps me achieving that.
The first couple of lectures are concentrated basically on the theory behind microservices.

The first question is... 

## What is a microservice? 

To better understand the answer let's compare this architectural approach with commonly known monolith pattern.

Side note: Most of the outlined resources (including diagrams) come from _[Stephen Grider's course Microservices with Node.js and React](https://www.udemy.com/course/microservices-with-node-js-and-react)_ 

![Monolith approach diagram](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d6csk8iz6hhj0colk3sd.png)

Application built as **Monolith** includes **all of the routing, middlewares, business logic and database access to implement all upcoming features**.
Everything is tightly coupled, depended on each other. If any part of the app fails, the whole app is broken.

On the other building **microservices infrastructure gives you the power of independence. App built that way is scalable and reliable**. 

![Microservices approach](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bp5osdrhcmx7ocrm8ef8.png)

In Monolith application there may be a huge database that stores the whole app data.
When it comes to microservices, each service keeps its own data storage and there is no way to access that data from the other service.

![Databases in microservices](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yakvejxdjarv1j5n41ec.png)

This approach is known as **Database Per Service**.

The challenge that occurs in microservices app architecture is data management between services, basically the way in which we store data inside of a service and how we communicate that data between different services.

This problem is addressed and covered in great detail in the course I'm currently following. I'll be touching more on this in the next articles.

According to the work I've done today:

I've practice some Ankies (general stuff about js fullstack),
I've added user auth session logic to my personal project,
I've created 1 article on dev.to
I've spent 8 full 25/5 pomodoro interval sessions following Stephen Grider course on Udemy 

Tomorrow I'm going to:

Spend at least 1 full hour our focusing on my project
Spend at least 25 mins preparing flashcards on holacracy topic
Spend at least 25 mins preparing flashcards on fullstack topic
Study at least 20 Anki flashcards
Spend at least 1 hour on Stephen Grider course on Udemy
Read 1 full article on Medium.com
Read book for at least 30 mins - Cut Off the Tension (polish translation: `Odetnij napięcie`) written by Rebekkah LaDyne (from page 50)

See you in the next one! 😉
Electronic Boarding pass
Tags: codepen
Published: 2022-01-24 20:49:44

<p>For this week challenge, I tried to implement this great design: <a href="https://dribbble.com/harunpehlivan" target="_blank">HARUN PEHLİVAN</a></p>

{% codepen https://codepen.io/harunpehlivan/pen/vYWBQrE %}
Invalid href passed to next/router on"next": "12.0.7"
Tags: nextjs, typescript, webdev, programming
Published: 2022-01-24 20:36:16

Environment: 
- Windows 11
- "next": "12.0.7"
- TypeScript ( Js should have same issue).
- Dynamic router link

I met an error "
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ebo18vedcs77ukqd937t.png): \, repeated forward-slashes (//) or backslashes \ are not valid in the href", which always shown on VScode & web browsers!

The root cause is that I joined "/" with my each url string when I generate dynamic links. (nextjs V9 looks should do it!)

```
href: join('/', slug), 
```

```
slugRoot = "/"
slugAbout = "/about"
```

Solution: Do NOT add "/" on head of your url string, and then add "/" on your <Link> tag.

```
// href: join('/', slug), 
href: slug,
```
```
slugRoot = ""
slugAbout = "about"
```
```js
// <Link href={`/${yourPath}`} ></Link>
<Link href={`/${href}`} key={href} prefetch={false} passHref>
```
Happy Coding!