teleren/devto huggingface dataset:
A fun detour is also progress in coding
Tags: codenewbie, beginners, coding, decodingcoding
Published: 2021-11-02 12:39:03

---
title: A fun detour is also progress in coding
published: true
description: Sometimes, when stuck debugging a bug, the best thing to do is to take a detour, away from the bug.
tags: codenewbies, beginners, coding, decodingcoding
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nvz88057kj8swsd27iqz.jpg
---

## *Sometimes, when stuck debugging a bug, the best thing to do is to take a detour, away from the bug.*

---

Once after working really hard for past 2-3 weeks learning and head-banging on a Rails API, I decided I needed to switch up and do something fun instead. Sometimes taking detours make all the difference, even though it sounds unproductive and not adding anything to the progress. 

### Progress is not lines of code written

But that’s the thing. What’s progress anyway? Measurable progress like lines of code written, revenue made, customers acquired – sure, that’s progress. But it’s also my job as an entrepreneur and a creative professional (I see myself as one) to stay inspired and motivated, in order to make this journey sustainable. And switching up the tasks like this is all about inspiration and motivation. In the end, if I don’t persevere in the future, whatever progress I make in numbers in the present will be for naught anyway, isn’t it?

Yeah, so this detour is actually still progress. I do see it as much more important work actually. Having fun and staying inspired is the real work, because downstream you get all sorts of goodies from it – better work quality, more productivity, fresh and innovative ideas, sustainability, and overall higher quality of life.

### How you know a detour worked

I want to jump out of bed in the mornings, not out of trepidation but excitement. And indeed, after spending time in my coding playground this morning, playing with Vue.js repos in Codepen; browsing cool shit that people make; learning how to make them myself; following my curiosity and playfulness, my fun tank was all topped up. I can feel it right in my heart. It sings. And I sang my way to lunch, spirits glowing, chest forward and head up high. 

What a difference a morning can make. Now that’s real progress.

---

Follow my daily writings on [Lifelog](https://golifelog.com/goals/30), where I write about learning to code, goals, productivity, indie hacking and tech for good.
Do you need programming knowledge to start bitcoin mining?
Tags: programming
Published: 2021-11-02 12:25:53

Considering the profit margins, Many freelancers and business owners have started bitcoin mining over the last few years. Bitcoin mining has increased 428% since September 2020. This shows how it has attracted different people's interest in bitcoin mining.

Do you need programming language knowledge for bitcoin mining?

The simple answer is "No". You do not need any kind of expertise in the field of computer programming. But you need technical knowledge to get started with bitcoin mining. Many of my friends have left their jobs just to make a career in bitcoin mining.

I talked to them about the same. They insisted to gain detailed knowledge about RAM, CPU, and the processor of a computer system. Along with that, electricity is also a requirement. You need 24*7 high electronics.

Read more about bitcoin mining from an expert: https://steemit.com/bitcoinmining/@denzelvieta/an-overview-of-bitcoin-mining-how-does-it-work
Full-stack monitoring in one solution or is it better to split out the functions between several applications?
Tags: monitoring, ai, devops
Published: 2021-11-02 12:25:09

Firstly, this question had my attention, now it has my curiosity :) Since I dig into the full-stack monitoring niche, I would appreciate your opinion about the question above.

On the one hand, it's always convenient to have a single monitoring solution for several purposes, e.g. IT infrastructure monitoring, log management, synthetic monitoring, etc. It doesn't matter if your company is a startup or enterprise, the benefits of an all-in-one solution are obvious:

- One place for monitoring, logging, user experience, etc., consequently, one console instead of multiple.

- Observability. Explore why an application or system behaves in a certain manner.

- Real-time metrics. Correlate application metrics, transaction metrics, and infrastructure metrics to see what’s going on in your apps.

Logically, such an option helps to save company's budget and manager's & DevOps mental health :)

But, on the other hand, the vast majority of people I know are sure that the existing B2B solutions are not always capable to face all the processes and produce expected results. I don't know why. Of course, we talk about solutions such as InsightCat, Elastic.co, Splunk, etc. The main argument is that "there is no decent “full stack” option".

Perhaps, it depends on the company budget and tech people's preferences. But, from my personal perspective, a single full-stack solution is a good option to think about, especially, if you have multiple clouds, SaaS, and a few hundred apps.

My company uses InsigthCat https://insightcat.com/ and we like it. So, I'm curious to know which side is preferable in your company and why.

Do you stick to all-in-one or splitting?

Thank you.
Machine learning intuition
Tags: watercooler
Published: 2021-11-02 11:00:14

Machine learning can seem like a daunting concept to learn and apply, but with the right framing and understanding of the process and algorithms, it can be interesting, useful, and fun. Let's explore apartment prices in a city.

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

Suppose that you’re looking for a new apartment. You speak to friends and family, and do some online searches for apartments in the city. You notice that apartments in different areas are priced differently.

A one-bedroom apartment in the city center (close to work) costs $5,000 per month. A two-bedroom apartment in the city center costs $7,000 per month. A one-bedroom apartment outside the city center, where you will need to travel to work, costs $3,000 per month.

You notice some patterns. Apartments in the city center are most expensive and are usually between $5,000 and $7,000 per month. Apartments outside the city are cheaper. Increasing the number of rooms adds between $1,500 and $2,000 per month.

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

This example shows how we use data to find patterns and make decisions. If you encounter a two-bedroom apartment in the city center with a garage, it’s reasonable to assume that the price would be about $8,000 per month.

Machine learning aims to find patterns in data for useful applications in the real world. We could spot the pattern in this small dataset, but machine learning spots them for us in large, complex datasets.

If you're interested in more details about ML algorithms, see Grokking AI Algorithms with Manning Publications: [http://bit.ly/gaia-book](http://bit.ly/gaia-book), consider following me - [@RishalHurbans](https://twitter.com/RishalHurbans), or join my mailing list for infrequent knowledge drops: [https://rhurbans.com/subscribe](https://rhurbans.com/subscribe).
Mobile testing boards
Published: 2021-11-02 12:16:15

Web page speed and user experience on mobile devices have become a standard and are critical for every business.

To perform a mobile test of a web application, you need a variety of devices of different operating systems (iOS and Android), different resolutions, etc.

You can use the [Blisk.io](https://blisk.io) application and services for such purposes. Recently, Blisk also provided the users with Kanban boards for Mobile testing and Responsive testing. These boards are available publicly, you can clone them and use them for your next web project.

Kanban boards for mobile testing and responsive testing:
* [Mobile testing board](https://trello.com/b/9nRL3o1Q) on Trello.
* [Responsive testing board](https://trello.com/b/Puuu5XwU) on Trello.
* [Mobile testing board](https://app.gitkraken.com/glo/board/YYAGtEIdUAlyCam8) on GitKraken.
* [Responsive testing board](https://app.gitkraken.com/glo/board/YYAG1kIdUAlyCaoN) on GitKraken.
How to make a Jest Test for Error Boundaries
Tags: jest, testing, errorboundaries, react
Published: 2021-11-02 13:30:50

---
title: How to make a Jest Test for Error Boundaries
published: true
date: 2021-11-02 12:01:04 UTC
tags: jest,testing,errorboundaries,react
canonical_url: https://relatablecode.com/how-to-make-a-jest-test-for-error-boundaries/
---

![Own your error](https://cdn-images-1.medium.com/max/1024/1*OqowO57kxsx4NmOT5Smonw.jpeg)

[Error boundaries](https://reactjs.org/docs/error-boundaries.html) are a nifty part of the React API to handle errors. Basically, an error that occurs within the error boundary propagates to said error boundary to control it.

With this functionality, you can choose what to do with the error as well as provide a fallback component to display to the user.

### Breaking it down

The error boundary is one of a handful of cases where you are required to use a class component.

At first glance, the error itself is provided by a callback within the lifecycle of React. componentDidCatch is what will receive the error and allow us to access the message and contents of said error.

The most basic functionality of this could be to simply console.error the message for debugging. However, more advanced use cases may include sending the error to a third-party service or displaying some kind of personalized message to the user.

The return of the component is what the sure will see instead of what was originally inside the error boundary. Example below:

![Error Boundary](https://cdn-images-1.medium.com/max/879/0*4Enj3BR0Oo9g6jEu)

This example is straight from the React docs and provides a simple text follow-up, in a lot of cases this specific portion of the app may become unusable due to said error so you can possibly indicate to the user to reset or retry.

The best way to think of this is a gigantic try catch for your components to handle any unexpected errors.

### The Test

I made a slight modification to the component that is returned by the Error Boundary:

```
<h1 data-testid="errorboundary">Something went wrong.</h1>
```

The following is an example of how to create the test:

```
import { render, screen } from '@testing-library/react'; 
import ErrorBoundary from './ErrorBoundary'; 
import '@testing-library/jest-dom'; 

describe('Error Boundary', () => {
  test('Error Boundary', () => {
    const ThrowError = () => {
      throw new Error('Test');
    };

  render(
    <ErrorBoundary fallback={<ErrorBoundary />}>
      <ThrowError />
    </ErrorBoundary>
  );

expect(screen.getByTestId('errorboundary')).toBeVisible();
  });
});
```

Essentially what we do is create a component whose sole purpose is to throw an error and make sure that it is correctly displayed. This is quite the basic test but the idea is that now you can expand upon it and test for anything else the error boundary may do!

Find more content at [Relatable Code](https://relatablecode.com)

_Originally published at_ [_https://relatablecode.com_](https://relatablecode.com/how-to-make-a-jest-test-for-error-boundaries/) _on November 2, 2021._
I made a git cheatsheet of useful commands like reverting commits, work between branches, manage PRs, and much more.
Tags: beginners, programming, git, github
Published: 2021-11-02 11:07:04

When I collaborate with others using Git, I often have to google to find right git commands for various situations.

Situations like how to pull changes without committing local files, save uncommitted changes in current branch and switch, add new changed to last commit, reset my local branch to main, revert last commit from local and remote, etc.

So, I decided to write these down at one place so that it's easier for me (and hopefully others) to recall and use.

here's the git cheatsheet: https://gourav.io/blog/git-cheatsheet

It's an [open-source cheatsheet](https://github.com/GorvGoyl/Personal-Site-Gourav.io/blob/main/content/blog/git-cheatsheet/index.md) so contributions are more than welcome to improve it and add more useful commands 🙏.
Tech Today Trends
Published: 2021-11-02 10:52:26

Tech Today Trends is a specialized Tech blogging Platform Technology Write for us for startups, entrepreneurs, Content writes and bloggers. It is also a hub where you can get all the latest trending Technology news and updates. Tech Today Trends is also seeing for original authors; if you are interested in becoming an author of our blog,you are always welcome to Guest bloggers.


Tech Today Trends is an online resource for Latest technology Updates and Trends for online users and we simply wanted to start a blog for a long time where we could resent and share our Great knowledge.

file ///sdcard/
https://www.techtodaytrends.com/file-sdcard/

Osmose Technology
https://www.techtodaytrends.com/osmose-technology/

linear model of communication
https://www.techtodaytrends.com/linear-model-of-communication/

fix Roblox errors
https://www.techtodaytrends.com/roblox-error/

Fix Error Code 0x0003 in NVIDIA GeForce
https://www.techtodaytrends.com/error-code-0x0003-nvidia-geforce/

What is Rediff Money
https://www.techtodaytrends.com/rediff-money-overview/

Technology Write for us
https://www.techtodaytrends.com/write-for-us/
HOW TO FIX “ERROR: COULD NOT FIND OR LOAD MAIN CLASS” IN JAVA?
Published: 2021-11-02 10:44:09

The main() method is required to run/execute programs developed in the Java programming language since it is where the program execution begins. When starting a [Java](https://www.codeleaks.io/category/java/) program, you could encounter the warning “error: Could not find or load main class.” You’re having this problem because you’re using the java command to run main() from within the class.

Note: You can also learn Errors and Exception in [Python](https://www.codeleaks.io/category/python/). 

**How to fix could not find or load the main class?**
There are many ways to solve this issue depending on the reason of occurring this error. We will discuss each reason one by one and try to fix this problem.

**What are the possible causes or reasons of this error?**
There are several reasons for this problem, which are listed below.

File Extension
Wrong Package
Classpath is not valid
The class name is incorrect

**File Extension**
We need to save the Java source code file with the extension .java to compile it. To compile a Java program, Java Compiler is being used as (javac command). After compilation, the .java file will be converted to a .class file.

As a result, your source code file will end in.java, while the produced file will end in .class. For compiling source code, we were using filename, but for running a compiled file, we cannot use the file name but the class name. Else it will throw an error like in the below example.

**Example: HelloWorld.java**
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}
How to Build an Accordion Component in Vue.JS
Tags: vue, javascript, webdev, opensource
Published: 2021-11-02 10:42:04

### How to create a reusable accordion component from scratch

This is my fourth **“How to”** article on **Vue.js** components, I have seen that they are the most read, probably because they are step-by-step tutorials that allow you to create something concrete and usable very fast.

So I decided to share with you one of the components that I use most often during the development of my projects: the **AppAccordion**.

The Accordion component is very useful and can be found in many libraries such as Bootstrap, for this reason, we can consider it one of the most used.

I have prepared a **demo** and you can have a look here 👇

{% codesandbox 1czqh %}

Check out the full article on Medium 👇

{% medium https://medium.com/notonlycss/how-to-build-an-accordion-component-in-vue-js-570ee594404c %}

_Ps. In the comments you will find the friends link if you have finished your monthly view on Medium_  ✌️❤️
How Shell Executes `ls -l *.c`
Tags: linux, beginners, programming, c
Published: 2021-11-02 10:28:33

---
In this post, we'll talk about how the shell executes the command `ls -l *.c`. Moreover, we'll also discuss how it is implemented under the hood.

We strongly advise you to have at least fundamental knowledge of C programming language and Linux system programming before you continue.

> **Note** that we skipped error checks and memory management for brevity. Refer to the [project](github.com/dere7/simple_shell/) implemention.

When we open a shell(_user perspective_) it prompts us to enter a line of command and when we enter the command it executes our command and prompts us to enter another command.

But there is more to this story. The following are simplified versions of the steps the shell takes.

## 1. Getline
The shell prints the prompt and waits for input. Let us assume we entered `ls -l *.c`. This is performed using `getline()`.

 ```c
 while(1) {
	char *line = NULL;
	size_t len = 0, nline;
	printf("$ ");
	nline = getline(&line, &len, stdin);
	if(nline == -1) return 0;
	// continues here
}
```

## 2. Tokenize
Then The shell splits this line of command into tokens. In our case `ls`, `-l` and `*.c`. this uses `strtok(command, DELIM)` where DELIM is string consisting whitespaces character(spaces, tabs and etc.).

```c
// continued
const char *DELIM =  " \t\a\r"
token = strtok(line, DELIM);
while(token != NULL) {
	tokens[pos++] = strup(token); // push to array of strings
	token = strtok(NULL, DELIM);
}
```
## 3. Expansion
After that the shell looks for expansion in our case token `*.c` matches every file ending in `.c`. So tokens will become:
```c
tokens = {"ls", "-l", "main.c", "util.c", "test.c"};
```

## 4. Alias
The shell checks if the first token is aliased. if it is it replaces it with the original expanded version. In our case `ls` is aliased to `ls --color=tty`.
```bash
ls: aliased to ls --color=tty
/usr/bin/ls
/bin/ls
```

## 5. Builtins
Then checks if the command is builtin(like `exit`, `cd`, `help` ... etc). `ls` is not builtin command.

## 6. PATH
If the command is not builtin command it searches the command in the `PATH` environmental variable. `ls` is found in path `/bin/ls`.

## 7. New Process
After that Create a new process using syscall `fork()`.

```c
int status;
pid_t child_pid = fork();
if (child_pid == -1)
	return (1);

if (child_pid == 0) // if this is child process execute
{
	if (execve(tokens[0], tokens, __environ) == -1)
		return (1);
} else // if it is parent wait for child
	wait(&status);
```

## 8. Execution

Finally, it executes it. It uses `execve(tokens[0], tokens, env)` system call. See step 7. and continue at step 1 again.

## Conclusion

This is just a simple illustration of how shell goes on executing commands like `ls -l *.c`. But nowadays shells have evolved to do many complex tasks like history, conditional statements, loops, and any other things programming languages support. It was quite a journey learning shell and we do believe you can benefit by implementing those concepts in yourself. You can find our implementation in **C** [here](github.com/dere7/simple_shell/). Thanks :+1:
Merge files in a path with goMerge
Tags: go, programming
Published: 2021-11-02 10:03:09

# goMerge
Merge some files in a path with custom extension in golang

{% github Ja7ad/goMerge %}

## Feature
- Walk in a path with a goroutine using parallelism
- Merge files with custom extension
- Remove unmerged files with remove flag

## Install goMerge

`go get -u github.com/Ja7ad/goMerge`

## Example

```go
package main

import (
	fileMerger "github.com/Ja7ad/goMerge"
	"log"
)

func main() {
	err := fileMerger.Merge("./test", ".log", "./test/merged.txt", true)
	if err != nil {
		log.Fatal(err)
	}
}
```
Top 15 Software Development Tools Enterprises Should Use
Tags: development, softwaredevelopment
Published: 2021-11-25 12:07:25

---
title: Top 15 Software Development Tools Enterprises Should Use
published: true
date: 2021-11-02 09:48:16 UTC
tags: Development,SoftwareDevelopment
canonical_url: https://www.botreetechnologies.com/blog/top-software-development-tools/
---

Modern software products and digital solutions require advanced tools for...

The post [Top 15 Software Development Tools Enterprises Should Use](https://www.botreetechnologies.com/blog/top-software-development-tools/) appeared first on [BoTree Technologies](https://www.botreetechnologies.com/blog).
Key factors to consider before legacy applications modernization
Tags: webdev, mobile, apps, cloud
Published: 2021-11-02 09:37:32

The legacy app modernization process requires to be more than just replacing or updating outdated technologies. Modernization of legacy apps includes re-engineering, re-imagining, re-hosting and transforming of older apps into newer, modern apps. But before initiating the process of app modernization, you must consider a few important factors.

**Let’s take a look at the top six considerations before modernizing legacy applications**

* Integration and compliance 
* Expenditure review 
* Risk factors 
* Existing budgetary resources 
* Time optimization
* Data management constraints 

## Benefits of legacy system modernization

1. IT agility
2. Better performance
3. Operational efficiency
4. Advanced security
5. Reduced IT expenses
6. Improved app usability

**Learn More** - [It’s time to start modernizing!](https://www.softwebsolutions.com/resources/legacy-applications-modernization.html)
Display a sticky feedback box with Vue.js
Tags: vue, javascript, webdev, beginners
Published: 2021-11-02 08:55:51

One of the first thing to implement with a **MVP** (minimum viable product) is a **feedback form** to know which feature the users are interested in.

The feedback form is also useful if a user has found a bug.

At first I have just made the contact form. The link to the contact form is in the footer of the Home page. I have got some feedbacks with that form but I want to get more. Not all the users are scrolling all the way to the footer section.

**What are sticky elements?**
Sticky elements are the features that appear to follow you down the page as you scroll. You can see an example on the bottom right corner of my website [Rollideo](https://rollideo.com/).

You can put a text like “Feedback” or “Need help?” on the sticky element.

To display a sticky element with Vue.js, you need to install [vue-sticky-directive](https://www.npmjs.com/package/vue-sticky-directive).

In the template, you can include the container element **sticky-container** at the beginning.

    <template>
    <div>
    <div sticky-container>

If you want the sticky element to be displayed at the bottom of the webpage you can put the sticky element after the footer section.

In the sticky element I have included a link to the contact page.

    <div v-sticky sticky-side="bottom">
    <div align="right" class="row-full">
    <span> 
    <a v-bind:href="apiUrl + '/contact'">Feedback</a>  
    </span>
    </div>
    </div>

In my particular case I want the sticky element to be displayed in the bottom right corner of the webpage, so I have added a CSS class **row-full** with a width of 100vw (100% width of the viewport).

To make the element looks like a box, we can add a span section with a background color and a border. In the CSS it’s defined as **.row-full span:first-child**.

    .row-full{
    font-size: 0.75rem;
    padding-bottom: 1rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    width: 100vw;
    position: relative;
    margin-left: -50vw;
    height: 25px;
    margin-top: 100px;
    left: 50%;
    }

    .row-full span:first-child {
    padding: 0.5rem;
    background-color: rgb(250, 255, 151);
    border-radius:5px;
    border:2px solid #c6c2be;
    border-bottom-left-radius:0;
    border-bottom-right-radius:0;
    border-bottom:0;
    }