teleren/devto huggingface dataset:
Should I quit my career?
Published: 2022-02-17 15:18:06

I need some suggestion regarding my career as a front end developer?
SHOULD I QUIT MY CAREER AS A FRONTEND DEVELOPER?

(Read please and give your valuable feed back)

In frontend development i know HTML, CSS, Bootstrap, sass, WordPress, and i know little bit of javascript and currently learning react js. 
I think i can't able to do logical thinking as other's doing in react as reactjs developer or js devloper like my other friends do. 
So thinking to quit my current job. 
Any suggestions ????
How to Write Unit Test Cases for Golang
Tags: go, programming, test
Published: 2022-02-17 15:04:42

**What is Unit Test?**
Unit test is a way to test a unit. A unit can be a function or multiple function.

**Why Test cases are important?**
Test Cases are important because they give us and operation team confidence that our code will perform the way we want it to be performed. It is also good way to test our code with given input and expected output.

**Test Cases in Golang**
Golang has in-built testing library for the unit testing.
We can run the command `go test`. We can also this command `go test ./...` to run test cases for the whole project.

Find below example for writing the unit test case:

file: `sum.go`

```go
package main

func Sum(a, b int) int {
	return a + b
}
```

file: `sum_test.go`
We need to create test file with given format `{{filename}}_test.go`

```go
package main

import (
	"testing"
)

func TestSum(t *testing.T) {
	result := Sum(10, 12)
	if result != 22 {
		t.Error("result is not equal")
	}
}

```



## Tabular Test Case
The better approach is to use tabular test cases because this is more elegant way to write the test cases.

```go
package main

import (
	"testing"
)

func TestSum(t *testing.T) {
	tests := []struct {
		a      int
		b      int
		result int
	}{
		{
			a:      5,
			b:      6,
			result: 11,
		},
		{
			a:      3,
			b:      4,
			result: 7,
		},
		{
			a:      2,
			b:      8,
			result: 10,
		},
		{
			a:      9,
			b:      6,
			result: 15,
		},
		{
			a:      15,
			b:      666,
			result: 681,
		},
	}

	for _, testCase := range tests {
		result := Sum(testCase.a, testCase.b)
		if testCase.result != result {
			t.Errorf("Test case failed for given input a:%d & b:%d", testCase.a, testCase.b)
		}
	}
}
```

## Commands to Run the Test cases
1. `go test ` - to run the test cases for current package
2. `go test ./...` - to run the test cases for whole project
3. `go test -v` - to run the cases in verbose/detailed mode 
4. `go test -cover` - to show the test coverage
5. `go tool cover -html=c.out -o coverage.html ` - to generate the coverage in html file
Git cheat sheet
Tags: beginners, git, tutorial, webdev
Published: 2022-02-17 15:01:11

###Git configuration
```
git config --global user.name "Your Name"
git config --global user.email "Your Email"
```

###Starting a project
```
git init [project name]
git clone [project url]
```  

###Remove file from directory
```
git rm [file name]
```

###Status of working directory
```
git status 
```

###Add a file to the staging area
```
git add [file name]
```
 

###Discard changes in working directory
```
git checkout --[file name]
```

###Commit to local
```
git commit
```

###Revert your repository
```
git reset [file name]
```

###List all local branches
```
git branch [-a]
```

###Fetch changes from the remote and merge current branch with its upstream
```
git pull [remote]
```

###Join specified from name branches
```
git merge [from name]
```

###Create new branch
```
git branch [branch name]
```

###Push local changes to the remote 
```
git push [--tags] [remote]
```

###Remove selected branch
```
git branch -d [branch name]
```

###Fetch changes from the remote
```
git fetch [remote]
```

###Switch current branch to specified branch 
```
git checkout [-b] [branch name]
```

####Git cheat sheet image

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

All the best to you.
Is a full stack job worth it for you ?
Tags: fullstack, discuss, webdev, career
Published: 2022-02-17 14:50:12

---
title: Is a full stack job worth it for you ?
published: true
description: 
tags: fullstack, discuss, webdev, career
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n1944q4zwporcpbn7oys.png
---
I have been a full stack developer for 4 years, and through this time I have worked as a main frontend and as a main backend another times، and as a full stack most of the time. 
And until this day I find that the hustle of maintaining this is just not worth it. 
So, I want to hear the experience of another developers, Is full stack development worth the hustle for you, and would you recommend it to other people ?
Coding challenge on sight!
Tags: programming, opensource, challenge, coding
Published: 2022-02-17 14:49:10

Hi! My peers at work and I have created a **coding challenge** and I thought some programming wizards of this community would be curious to solve it! These are the steps we planned for this Star Trek edition:

1. Follow [our coding instructions on GitHub](https://github.com/wunderdogsw/wundernut-vol11).
2. Develop a program to decipher the Morse code message.
3. Fill in the form [on our site](https://www.wunderdog.fi/wundernut) with your solution attached –latest on March 11th.

We have decided to give away **BookBeat subscriptions** as rewards! The **winners** will be selected by a jury of our team of software developers (we work for a company named Wunderdog) by March 31st, 2022. The best three solutions in the terms of code quality metrics will be rewarded with subscriptions to the online content service BookBeat. 

You use BookBeat for:

- Revisiting ebooks and audiobooks
- Developing your programming skills further
- Finding hundreds of other fictional and non-fictional ebooks and audiobooks for fun and/or self-learning!

Looking forward to seeing and reviewing all the different coding solutions!
What is your Supabase workflow? - Beginner question
Tags: supabase, help, discuss, database
Published: 2022-02-17 14:27:55

I'm a beginner who just started using Supabase (and postgres). I love it and for my needs, it feels like a step up from Firebase.

# How do you work on Supabase with bigger projects? 
- What external tools can you recommend?
- What best are the best practices when it comes to Supabase development?

So many of the articles I find are just about simple authentication or adding one function with basic row level security, but not too many dig much deeper than that.

I am finding it difficult to keep track of my functions, row level security rules etc.
Your Thoughts on Design as a Developer
Tags: discuss, beginners, css, design
Published: 2022-02-17 14:24:19

---
title: Your Thoughts on Design as a Developer 
published: true
description: A discussion about the parts of design that frustrate or confuse developers. 
tags: discuss, beginners, css, design
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dssae5rqf576xlox82jl.png
---

For better or worse, developers are often asked to make design decisions – this may be during a side project you're working on alone, at a startup that only has one (very busy) designer on staff, or filling in things that weren't specified in a design-team-provided wireframe. 

As a designer turned developer (turned developer advocate), one of my goals has been to try and bridge the gap between design and development. I've been writing and speaking about it a lot recently, and to that end: **I'm curious to hear the areas where you, as a developer, struggle with design.**

This could be very specific ("I have trouble picking the right font for my UIs", "Color schemes just really confuse me"), or it could be more broad ("What happens during the design process?", "We have a design system at work and I don't get how to use it"). You can also totally **just vent about things that irritate you re: the design side of things!** I want to hear it all, and maybe help where I can. 

**What do *you* find frustrating or confusing about design in your day-to-day work, that you wish someone could explain to you?**
How to add folders to python modules search path?
Tags: python, path
Published: 2022-02-17 14:11:55

---
title: How to add folders to python modules search path?
published: true
description: A developer will be often faced with a situation to add custom module search path for python to find the code.
tags: python, path
//cover_image: https://direct_url_to_image.jpg
---
Consider you have development folder structure like this:
```
.
├── app
│   └── piccolo_conf.py
├── poetry.lock
├── pyproject.toml
├── README.md
└── work
```
In this folder structure, app is the main application development folder. You want it to be clean. And you also want to write some experiment codes and test them to ensure that the code is meeting the requirement. While doing so, often it is required to refer to the code inside the app folder.

How to refer to the code inside the app folder while having the experiment code in the work folder? 

Following code address that:

```
import sys
from pathlib import Path
# Path.cwd() - Get the current working directory
# Path(Path.cwd()).parent - Get the current working directory parent
# glob("app/**") - Get all the folders inside the app folder 
p = list(Path(Path.cwd()).parent.glob("app/**"))
sys.path.append(str(p[0].parent.absolute()))
for x in p:
    pth = str(x.absolute())
    # Exclude the folders that starts with __
    if not x.name.startswith("__"):
        sys.path.append(pth)
```
What is the difference between ES5 and ES6?
Tags: javascript, programming, vue, react
Published: 2022-02-17 14:07:38

**1. ECMAScript 5 (ES5P) : **
     The first major modification to JavaScript was ECMAScript 2009, sometimes known as ES5.Contractors who focus on how objects are instantiated are known as function contractors. In ES5, you must use the function keyword and return to define the function, just as you would in any other JavaScript language.
**2. ECMAScript 6 (ES6) : **
The second major change to JavaScript was ECMAScript 2015.Its class allows developers to create an object with the new operator and an arrow function if they don't need to use the function keyword to specify the function, and they can also avoid using the return keyword to get the computer value.
**Difference between ES5 and ES6 : **

- String, integer, boolean, null, and undefined are all primitive data types supported by ES5.
But In ES6, there are some additions to JavaScript data types. It introduced a new primitive data type ‘symbol’ for supporting unique values.

- Only the var keyword can be used to define variables in ES5. In ES5,let and const are two new ways to define variables.

- When compared to ES6, the performance of ES5 is lesser.

- In ES 6 Object manipulation is less time-consuming then ES5.

- To define a function in ES5, both the function and return keywords are used. An arrow function is a new feature introduced in ES6 by which we don’t require the function keyword to define the function.
Follow Me : [Twitter](https://twitter.com/Bilalniaz15)  [LinkedIn](https://www.linkedin.com/in/bilal-niaz-147792214/)
#OpenCV – Access a local camera 🤳in F# 📝
Tags: englishpost, facedetection, fsharp
Published: 2022-02-17 15:41:22

---
title: #OpenCV – Access a local camera 🤳in F# 📝
published: true
date: 2022-02-17 14:00:00 UTC
tags: EnglishPost,EnglishPost,FaceDetection,FSharp
canonical_url: 
---

Hi !

NET is in anniversary mode, and in Dev.to blog, someone asked about these samples in F#. It’s been a while since I wrote some F# code, and this is the perfect excuse to start.

**_Today Post:_** Access a local camera and show the camera frames in an OpenCV window. In following posts we will have a face detection demo in F#, like this one:

![face blur demo in csharp using dnn](https://brunocapuano.files.wordpress.com/2022/02/face-blur-cs-dnn.gif?w=450)

Easy to implement, and also easy to read:

#### Code Sample

{% gist https://gist.github.com/elbruno/afaef05e301d7a09a058d7cd68914818 %}

[Original post](https://elbruno.com/2022/02/17/opencv-access-a-local-camera-%f0%9f%a4%b3in-f-%f0%9f%93%9d/)

Happy coding!

Greetings

El Bruno

* * *
How to import a local module dependency in Elixir
Tags: elixir, functional, beginners
Published: 2022-02-17 13:27:47

When you’re in the process of developing a package, it can be useful to be able to import it into another project locally without having to publish it first. By doing this, you can test it within the context of a larger project instead of relying entirely on unit tests.

This guide will show you how to take an Elixir package you’ve made locally and import it into another project using the file path.

## Name the dependency

Open the `mix.exs` file. Look for the project definition, which should look like this:

```elixir
def project do
  [
    app: :my_dependency,
    version: "0.1.0",
    ...
  ]
end
```

Make sure to update the name of the `app` property to whatever you would like to import this package as in other projects.

## Get the file path

Copy the complete file path to the root of your package.

## Import the package

In the project you’d like to import the package, open your `mix.exs` file.

Find `deps` and add your package to the array using the `path` property:

```elixir
defp deps do
  [
    {:word_list, path: "/path/to/your_dependency"}
  ]
end
```

## Test with iex

Now you can test whether your project has access to the dependency. Run an `iex` shell for your project.

```bash
iex -S mix
```

Then, check that you have the ability to run functions from your dependency.

```elixir
iex> MyDependency.hello
:world
```

## More content

* [I published my first Elixir package to hex!](https://www.brewinstallbuzzwords.com/posts/my-first-hex-package/)
* [What's the best questions you've been asked in a job interview?](https://dev.to/brewinstallbuzzwords/whats-the-best-question-youve-been-asked-in-a-job-interview-4a1j)
* [What was the first program you wrote?](https://dev.to/brewinstallbuzzwords/what-was-the-first-program-you-wrote-1gjp)
* [The weird quirk of JavaScript arrays (that you should never use)](https://www.brewinstallbuzzwords.com/posts/js-arrays-are-objects/)
* [Does Elixir have for loops?](https://www.brewinstallbuzzwords.com/posts/does-elixir-have-for-loops/)
* [Learn Elixir with me!](https://www.brewinstallbuzzwords.com/posts/learn-elixir-with-me/)
* [Project Tours: Bread Ratio Calculator](https://www.brewinstallbuzzwords.com/posts/bread-ratio-calculator/)
* [Changing Emoji Skin Tones Programmatically](https://www.brewinstallbuzzwords.com/posts/emoji-skin-tone/)
* [I made my first svg animation!](https://dev.to/brewinstallbuzzwords/i-made-my-first-svg-animation-29j3)
* [5 tips for publishing your first npm package](https://www.brewinstallbuzzwords.com/posts/tips-for-first-npm-package/)
* [4 Hugo Beginner Mistakes](https://www.brewinstallbuzzwords.com/posts/hugo-beginner-mistakes/)
How to Crop Videos Quickly
Tags: howto, videoediting, tipsandtricks
Published: 2022-02-17 13:24:09

In this article, I will tell you how to crop videos quickly by adopting several methods, software, or tools that enable you to select the parts of a video clip you wish to add and see. It can be useful for removing lines at the boundaries of a clip, removing unnecessary components from a video clip, or resizing a video to a different aspect ratio or dimensions.

Please keep in mind that crop videos are not the same as cutting, zooming, or modifying a video clip's dimensions (aspect ratio). Here I will give step-by-step details about the easy-to-use methods to crop video online free below. Read it out and pick one which you like the most to crop video size.

**1. How to crop videos quickly by Clipchamp?**

Clipchamp is a modern tool to cut videos quickly with the best quality. It is easy to use the software. To crop videos using Clipchamp, create a new project.

**2. How to crop video quickly with Movavi Video Editor Plus?**

[Movavi](https://www.movavi.com/) Video Editor Plus is a wonderful video cutter by which you'll ever need to cut videos according to your choices and preferences. It'll only take a few moments. Everything is free, including filters, ambient transitions, titles, and prepared intros.

**3. How to crop videos with Filmora video editor?**

Wondershare Filmora is a simple yet sophisticated video tool to [crop videos quickly](https://www.easydownload.io/how-to-cut-video-quickly-and-free/). You can simply crop and resize your video clip using this tool, and apply various effects. You may crop in any dimensions like (16:9, 4:3, 1:1, 9:16). You may also use advanced functions like Chroma Key, Audio Editing, Split Screen, and Color Correction to improve the video clip. Download it right now and share it on social media.
 
**4. How to crop videos quickly by Veed?**

It's an online tool that may enable you in creating professional and high-quality video clips without the big learning curve of professional software and it doesn't take up any space on your PC.

**5. How to crop videos quickly by Adobe Creative Cloud Express?
**
Adobe Creative Cloud Express allows users to perform high-quality video cropping in a few moments for free. Customize the dimensions of your video clip quickly so you may post it on any social media platform. Choose a square, landscape, or portrait size for your movie, then drag it to suit the new format. You can use the Adobe tool on your Android, iPhone, or smartphones, as well as your PC, including Windows and Macs.

**6. How to crop videos quickly by Clideo?**

One of the most popular tools for quickly cutting movies, which prepare sizes that are defined by default on several prominent social media, so you don't have to waste time creating squares. It can support various formats MPG, AVI, MOV, MP4, WMV, and any other video file you have. [Clideo](https://clideo.com/) is a web-based software, so there is no need to download anything to your PC or phone.
Enable Cross-Origin requests on ASP.NET Core 3.1
Tags: cors, webdev, dotnet, csharp
Published: 2022-02-17 13:19:07


In these days I’m working on an angular application that has .net 3.1 as a backend.

In this specific case I’m just working on frontend but I want to share with you the basic configuration you have to do if you want to allow different origins in a .net core 3.1 service.

Why? Because I always forget how to do it (🤦🏻‍♂️) so it’s a good way to take a note for the future.

# Startup class setup

Enable cross origin requests is very easy, most of the setup is done in the Startup class.

First of all you have to register a named policy in the **ConfigureServices** method.

```csharp
public void ConfigureServices(IServiceCollection services)
        {
            
            services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();

            services.AddCors(options => {
                options.AddPolicy(Startup.AllowAllCorsPolicy, builder => {
                    builder.AllowAnyHeader()
                    .AllowAnyOrigin();
                });
            });

        }
```

Now you can use the newly created policy in the **configure method.**

You should add the middleware after the UseRouting and UseCors middleware.

```csharp
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
           
            app.UseHttpsRedirection();
            app.UseRouting();
            app.UseCors(Startup.AllowAllCorsPolicy);
        }
    }
```

In the previous code snippet I omitted all the other configurations.

It’s not a good practice to allow any origin and headers but this could be a starting point where you can allow just specific domains or headers.

# Controller class setup

Finally you have to enable the policy at controller level.

I suggest you to extend your controllers with a base controller class if you wanna apply the policy to all your routes.

```csharp
[Microsoft.AspNetCore.Cors.EnableCors(Startup.AllowAllCorsPolicy)]
    public class YourBaseController<T> : ControllerBase where T : class
{

}
```

More informations here:

[Enable Cross-Origin Requests (CORS) in ASP.NET Core](https://docs.microsoft.com/en-us/aspnet/core/security/cors?view=aspnetcore-6.0#np)
The real image tag: <image> vs <img>
Tags: html, webdev, beginners
Published: 2022-02-17 12:26:23

The image tag is used to tell the web browser to display an image.
It is usually written as `<img />` and can have attributes such as (but not limited to) `src` - used to specify the path to the image, `alt` - holds a text description of the image, important for accessibility, `width` - the intrinsic width of the image(in pixels).

Now you're wondering what about the `<image />` tag right? Well the `image` tag is (or was) used to display images also! But its infact not an HTML element!(as written in the spec):
![an image of the html parsing spec about the image tag not being an html element](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pi2vb5836g17wq0m55nx.png)
 

Browsers alias it to the `<img>` element but differently;
- Firefox aliases it during parse time;
- Chrome & Safari aliases it during element-creation time;
- IE (Internet Explorer) aliases it throughout runtime;

as seen in the html parsing spec:
![an image of the html parsing spec about how browsers should handle the image tag](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6alkwmdwmmfgy7cnrm9i.png)
https://html.spec.whatwg.org/multipage/parsing.html

So you can use it in your code and the browser will do what needs to be done(convert it to `<img>`) and process your code but is it valid HTML? No.

Well what about its behaviour during DOM manipulation?

Assigning its `src` value the path to an image:
```js
document.querySelector('image').scr  = 'https://source.unsplash.com/random/150*150';
```
doesn't work in Edge, Chrome, & Firefox but works in IE.

Creating the element and appending it to the DOM:
```js
const image = document.createElement('image');
image.src = 'https://source.unsplash.com/random/150*150';
document.body.appendChild(image);
```
Edge & Chrome & Firefox treats it as an unknown element and doesn't load the image but it works in IE.

So the real image tag is the `<img>` tag and the `<image>` tag is a tag that browsers aliases to `<img>` element.
Primeiros passos em Dart, como instalar Dart SDK no Linux e compilar Hello World!!
Published: 2022-02-17 12:13:12

Como instalar Dart SDK no Linux

Instalar usando `apt-get`:

``` 
sudo apt-get update
sudo apt-get install apt-transport-https
sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
```
Em seguida instalar Dart SDK:

```
sudo apt-get update
sudo apt-get install dart
```

Verificar a versão instalada:

`dart --version`


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

Como compilar Hello World em Dart:

Criar arquivo com extensao `.dart`

`touch hello_world.dart`

Criando Hello World em Dart:

```
void main() {
  print("Hello, world");
}
```

Como compilar o arquivo `hello_world.dart`

`dart run hello_world.dart`


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

Conclusão:

Simples de compilar dart.