teleren/devto huggingface dataset:
A Solution: How to successfully fetch data from Firestore Database
Tags: beginners, firebase, programming
Published: 2022-03-27 21:27:49

When trying to fetch a set of data from Firestore Database, I stumbled into a pretty basic challenge: the data is not shown on the screen.

This article suggests a solution for those who are learning Firebase and got caught by a similar problem.

## What was the Situation?

When I was learning how to use Firebase V9 with a [Udemy course](https://www.udemy.com/course/build-web-apps-with-react-firebase/), I was struggling to get the data that I manually created on Cloud Firestore. 

I went through all the following processes twice just to make sure I don’t miss any essential steps to successfully fetch the data into my browser. 

- Create a Firebase Project
- Create a web app under the project
- Copy the config and paste on a file in my local project
- Initialise firebase in the file using the copied config
- Initialise firestore and export the particular database from the file
- Install the latest firebase 
- Run the application at localhost:3000

## Problem

No error message, all seems fine except that no data from the database was shown in the place that it should be.

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

## Solution

### Did All The Process Again

Scraping the project to the bin, I downloaded the course file again, wrote the code again by watching the course video very carefully, and made sure that I didn't miss any step.

### Checked if My Code Looks Exactly the Same as the Tutorial

No typo and no mistake. It’s impossible to be wrong.

### Solution: Firebase Rules

If my code is perfect, then the problem should be on the side of firebase. 

And here it is, the rules were written as below:

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

The 'if false' part was the cause of the problem.

If the part is false, no one can read and write the data.

For the sake of experimenting with data-fetching for this tutorial, I temporarily edited the sentence to 'allow read, write: if true'.

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

And now on the screen, I can see the data that I manually added on Firestore Database. This means the data is successfully fetched.

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

Please note that this is a bad practice if you’re actually developing an app with personal information as it allows any person can access and change the contents.

But if you’re just a beginner wanting to understand some basic functions of firebase and haven’t learned about the firebase rules yet, this could be a temporary solution.

You can always come back and modify the rules as you go.
Basic Linux Commands
Published: 2022-03-27 20:47:03

## Linux Shell Or Terminal

A shell is a program that receives commands from the user and gives it to the OS to process, and it shows the output. Linux's shell is its main part. Its distros come in GUI (graphical user interface), but basically, Linux has a CLI (command line interface). In this article, I am going to cover the basic commands that we use in the shell of Linux.

## Basic Linux Commands

 pwd: This command shows the current directory that you are in.
```
~$ pwd
```
 ls: This command lists folders and files.
```
~$ ls
```
cd [dirname]: This command opens a folder on the system

```
~$ cd Documents
```
mkdir [dirname]: This command creates a folder.

```
~$ mkdir python-project
```
touch [filename]: This command creates a file.

```
~$ touch main.py
```
rm[filename]: This command deletes a file.

```
rm main.py
```
cd..: This command navigates up a directory.

```
cd..
```
rm -r [dirname]: This command deletes a folder

```
~$ rm -r python-project
```
cd /: This command takes the user to the root folder

```
cd /
```
clear: This command clears the terminal

```
~$ clear
```
cd [dirname]/[dirname]/[dirname]: This command lets you navigate down the directories to a particular folder.

```
~$ cd usr/local/bin
```
cd ../..: This command moves two hierarchies up the file system

```
cd ../..
```
cd ~: This command takes the user back to the home directory

```
cd ~
```
ls /[dirname]/[dirname]: This command lists all the files in the directory name after navigating to that particular directory.

```
ls /etc/network
```
mv[dirname][new-dirname]: This changes the folder name

```
mv web-application java-app
```
cp -r [dirname][new-dirname]: This copies the content of a particular folder into another folder.

```
cp -r java-app my-project
```
cp [filename][new-filename]: This copies the content of a file into another file.

```
cp readme.md readme-test.md
```
mv[filename][filename]: This changes the filename

```
mv readme.md readme-dev.md
```
ls -r [dirname]: This shows the entire content of that directory.

```
ls -r Documents
```
history: Gives a history of all past commands typed in the current terminal session

```
~$ history
```
ctrl + r: This key combination searches for the history of a command a user recently used.

ctrl + c: This key combination stops the current command that is running.

history[number]: This shows the last set of commands that were typed. The last set is determined by the number the user inputs.

```
history 20
```
ls -a: It shows all files including hidden files

```
ls -a
```
cat[filename]: This displays the file content

```
cat main.py
```
uname -a: This displays the system information and the kernel

```
~$ uname -a
```
cat /etc/os-release: This shows the version of your operating system

```
~$ cat /etc/os-release
```
lscpu: This shows the cpu information

```
~$ lscpu
```
lsmem: This displays the memory information

```
~$ lsmem 
```

## References
1. Basic linux commands for beginners by Alok Naushad  " https://maker.pro/linux/tutorial/basic-linux-commands-for-beginners "
2. Techworld with Nana Devops Bootcamp
An Old Noob - Issue 1, The Cloud Resume Challenge
Tags: beginners, aws, cloud, cloudresumechallenge
Published: 2022-03-27 20:07:00

Pretty sure i'm in the right place, because it feels completely unknown.

First things first... i'm a little rusty on my creative writing.  While my purpose here is to document my journey as i complete the various tasks of the [Cloud Resume Challenge](https://cloudresumechallenge.dev/docs/the-challenge/), thus perhaps not entirely _creative_ writing, this is a bit less formal than the emails and a bit less structured than the scripts i'm used to writing these days.  

I've been in IT for a while and i'm finding myself inexplicably drawn to learning more about cloud architecture.  So, a bit of research later and i find myself tackling the Cloud Resume Challenge.  I've had a hobby site for years but it was mostly unkempt code that i hadn't looked at since first published.  But since i had a domain already, the rest should be a piece of cake  =]

My first couple days were spent going over the code in my existing pages before undertaking the task of writing a new .css and .html for the resume.  This is because i didn't realize how utterly ugly my code was.  Sure it rendered the way i expected in the browser, but in a code editor it was nothing short of Lovecraftian.  I should also admit here that I didn't write this previous code, it was borrowed and modified to fit my hobbyist needs.  (I also feel compelled here to assert that my resume HTML & CSS are my own, as i'm certain one can tell rather quickly).

As it turns out, this was a bit of a blessing.  Without realizing it, i had learned enough in my time away from my HTML of old that i could instantly see ways to improve it when i went back and looked. Plus it allowed me to update a few things that were well in need of updating - let's face it, i'm not the same person i was 14 years ago when i registered my domain.  In fact, thanks to projects like this one, i'm not the same person i was last week.

So in the interest of keeping these entries bite-sized but quasi-regular, how has the beginning of this project looked so far?  It looks familiar, yet foreign. Complex, yet completable.  Somewhat frightening, utterly fascinating.  

I'm still polishing the resume page but it's very close to releasing to the wild.  I've got a couple smaller things i've learned (which I intend to include in a future installment) and certainly a few larger things i've yet to learn.

Here's to the journey!

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/khq7fi3zcrovyxlygsj7.jpg)
Inspiring quotes for programmers
Tags: programming, beginners, 100daysofcode, inspiration
Published: 2022-03-27 19:40:48

Today I'd like to share some motivation for a developer out there who feels like giving up. Starting out in programming can be difficult, and on some days you might feel like you can't go on. Here are some motivational quotes by other developers to help you along your journey: 

1. 

> _In order to be irreplaceable, one must always be  different._ >Oscar Wilde

2.

> _Don't worry if it doesn't work right. If everything did, you'd be out of a job._ ~ anonymous 


3.
> _A good programmer is someone who looks both ways before crossing a one-way street._ ~ Doug Linder

4.

>_Every programmer is an author_ ~ Sercan Leylek

5.

> _A code is like love, it was created with clear intentions at the beginning, but it can get complicated_ ~ Gerry Geek

6.

> _Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live_ ~ Rick Osborne


![Quote](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uo2p4qwcmfy99qgymito.jpg)

I hope this inspires you as you begin your week. Happy coding!
#Day 8 of solving 450 questions [28/450]
Published: 2022-03-27 19:31:50

I wasn't in mood to code today(Sunday) ,but 

> Momma raised a soldier not a bitch!

📅Day 8 : March 27,2022
Problems solved today :
1. [product-of-array-except-self](https://leetcode.com/problems/product-of-array-except-self)
--Great question everyone should try this out.
MyLogic: hint: 1*n = n

2.[Longest consecutive subsequence](https://practice.geeksforgeeks.org/problems/longest-consecutive-subsequence2449/1)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i5dhui3n5hd9rp5z5ezy.png)
3.[the-k-weakest-rows-in-a-matrix](https://leetcode.com/problems/the-k-weakest-rows-in-a-matrix/) 

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

note:- Need to figure out how to fulfill the second condition.
Learn All About MDN Web Doc's Newly Redesigned Website
Tags: mdn, javascript, css, html
Published: 2022-03-27 19:23:58

MDN web docs (previously called Mozilla Developer Network or simply MDN) on March 1st, 2022 launched their newly redesigned website. This article will go over some of the exciting changes they made so you can get the most out of your future visits to their site. 

**A New Community-Centered Homepage**

Everything MDN does revolves around the community of developers that either contributes to it or use it as a reference point for their projects. The [homepage](https://developer.mozilla.org/en-US/) now reflects this through a centrally located search bar making it easily accessible for the MDN community as well as a featured articles section and a list of the newest additions to the Github content repo. Finally, at the bottom of the page, there is a contributor spotlight area that displays a personally written from a member of the MDN community. 

**Improved, User-Friendly Article Pages**

With a five-year gap between any major alterations to the design of the article pages, MDN felt it was crucial for a new look to be implemented. Now, for instance, there is a more homogeneous color scheme across all of the article pages, and larger display links to the most often searched subjects like CSS and Javascript. Another cool feature added is at the top right-hand corner of the screen you have the option of clicking on a button to change between a light or dark screen mode. You can check out an article page for yourself [here](https://developer.mozilla.org/en-US/docs/Learn/HTML).

**Community Picked New Logo**


MDN recognized that with a newly retooled website that it only fitting to include a new logo. MDN wanted a logo that was very contemporary but also showed the core essence of what they stood for as a brand. The MDN community had the opportunity to choose between 8 logo designs with the number one choice being the letter “M” in a monogram font with an underscore symbol to represent the process of code writing. 

Hope this article was helpful in learning some of the new features to the MDN site. You can check out some of my other posts [here](http://www.exceptionalprogramming.com/).
How To Embed Medium into Dev.to Post
Tags: beginners, webdev, wwwhowbeginnerscom, markdown
Published: 2022-03-27 18:54:20

I'm a beginner and I don't know how to Embed Medium into Dev.to Post. After checking out the guide here: https://dev.to/p/editor_guide

I have found the way.

So, I decided to make this post to help other beginners like me.

## How To Embed Medium into Dev.to Post

Medium is a popular online platform that helps users write articles, blog posts, and more. Embedding Medium into your Dev.to post is a great way to add additional content and provide readers with more information. 
Below will a guide on how to do that.
This process is just simple to complete by putting the Medium link inside the content like this: 

```
{% embed https://... %}
```
Here is the example of code
```

{% embed https://wwwhowbeginnerscom.medium.com/how-joining-a-blogging-community-can-help-boost-your-traffic-76afdcff4cbd %}

```
Render:
{% embed https://wwwhowbeginnerscom.medium.com/how-joining-a-blogging-community-can-help-boost-your-traffic-76afdcff4cbd %}

Thank you for reading this content. It means a lot to me that you took the time to read it. I hope you found it helpful. If not, please let me know so that I can improve my writing. Thanks again for taking the time to read this post!
i am our genius on this searching to end this bad ass worthy taking my stress away. hashtag ready
Tags: gasim, nontouch, covid19, sexlike
Published: 2022-03-27 18:33:25

when you think of an organism , you should start too think with picturing it in your own mind , Find something ecstatic with no one at all biting on your lip! yup you need to find out what secrets i withhold.
Add SEO to you 11ty website
Tags: 11ty, seo, webdev
Published: 2022-03-27 16:50:22

## Add Front Matter in all pages

```html
---
title: Page Title
metatitle: Page Meta Title
metadescription: Page Meta Description
image: Image Address
---
```

## Add Site Url in data

Make a `site.json` file in `_data`

```json
{
"url": "https://yoursiteurl.com"
}
```

## Primary Tags

Add these in your `base.njk` or your main `njk` in which you have added `<head>`

```html
<title>{{ title }}</title>
<meta name="title" content="{{ metatitle }}">
<meta name="description" content="{{ metadescription }}">
```

## Open Graph / Facebook

```html
<meta property="og:type" content="website">
<meta property="og:url" content="https://example.com{{page.url}}">
<meta property="og:title" content="{{ metatitle }}">
<meta property="og:description" content="{{ metadescription }}">
<meta property="og:image" content="{{ site.url + image }}">
```

If you want to automatically generate open graph images you can read this [post ](https://bnijenhuis.nl/notes/2021-05-10-automatically-generate-open-graph-images-in-eleventy/).

## Twitter

```html
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://example.com{{page.url}}">
<meta property="twitter:title" content="{{ metatitle }}">
<meta property="twitter:description" content="{{ metadescription }}">
<meta property="twitter:image" content="{{ site.url + image }}">
```

## SiteMap

Make `sitemap.njk` in your root directory. It will automatically become `sitemap.xml.`

```xml
---
permalink: /sitemap.xml
eleventyExcludeFromCollections: true
---
<?xml version="1.0" encoding="utf-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    {% for page in collections.all %}
        <url>
            <loc>{{ site.url }}{{ page.url | url }}</loc>
            <lastmod>{{ page.date.toISOString() }}</lastmod>
        </url>
    {% endfor %}
</urlset>
```

## Robots

Make `robots.txt`

```
Sitemap: https://www.yoursitename.com/sitemap.xml
User-agent: *
Disallow:
```
Terminal komandalari | Part 4
Tags: beginners, cpp, uzbek, terminal
Published: 2022-03-27 18:12:50

### `alias`
Bu komanda orqali konsolda tez-tez foydalanadigan komandalar uchun yangi nickname(taxallus) beradi.
- `alias datedir='mkdir $(date "+%d-%m-%Y")'` - ushbu komanda orqali bugungi sana nomi bilan papka yaratadigan *uzun* komandaga qisqa nom beradi. Endilikda `datedir` deyish orqali bugungi sana nomi bilan papka yaratsa bo'ladi.
- `alias` komandasi bitta terminal session uchun ishlaydi.

### `date`
Bu komanda hozirgi vaqtni chop etish uchun ishlatiladi.

### `#rashidovdev@home :~$ date` - 
Terminalga **date** komandasini yozish orqali `27 mart,2022 yil,Dushanba` degan habarni konsolda ko'rishimiz mumkin.

- `date '+%d-%m-%Y'` - komandasi orqali sanani chop etishda **dd-mm-yyyy** formatda chop qiladi. 27-03-2022.
- `date '+%d/%m/%Y'` - bu komanda 27/03/2022 ko'rinishida konsolga chop etadi.
Why did we replace Docker Desktop dependency from DECK? 🐳
Tags: webdev, docker, computerscience, programming
Published: 2022-03-27 17:56:15

**DECK** is free forever for individual developers, and we intend to keep that promise. We have started our journey with **Docker** and docker desktop as a dependency. But Docker has released subscription terms and conditions, a big blocker for **DECK** to keep the commitment of providing free access to developers.

**Quote from [Docker website](https://www.docker.com/pricing/):** 😔
_Docker Desktop can be used for free as part of a Docker Personal subscription for: small companies (fewer than 250 employees AND less than $10 million in annual revenue), personal use, education, and non-commercial open source projects._

So we started working on finding out an alternative for **Docker** Desktop on **DECK V4**. And we found four stable options.

- [Multipass](https://multipass.run/)
- [Podman](https://podman.io/)
- [Lima](https://github.com/lima-vm/lima)
- [Colima](https://github.com/abiosoft/colima)

Every option has its user base and good community support. But ultimately, Multipass was the best option considering its excellent cross-platform support and stability in release cycles. 
Also, for **DECK Windows**, we have used **WSL2** for the best performance.

So, now we can say that DECK is truly forever free for individuals. 🥳
We are committed to removing future blockers for **DECK** and server fast, smooth and straightforward development studio journey every day. 😊

[Try DECK today](https://get-deck.com/) 💕.

_If you find this article helpful please share and follow us on [Twitter](https://twitter.com/deckdevstudio)._
Questions/answers about software testing
Published: 2022-03-27 17:50:10

#### Follow me on Linkedin if you like provoking posts about software development. [Let's socialize!](https://www.linkedin.com/in/alexsandro-souza-dev/detail/recent-activity/shares/)

Here are some essential questions/answers when defining your system testing approach.

This post is a follow up to my article [We are testing wrongly.](https://dev.to/apssouza22/we-are-testing-software-wrongly-and-it-costs-a-lot-of-money-23o5)

## Why do we write automated tests?
The main reason to write automated tests is to bring confidence that our system still working as expected after adding new changes to the code. 

## What is unit testing?
Many engineers believe that for every public method of every class, they must create a corresponding "unit test.". That is wrong. That wasn't what many meant by "unit" when the term "unit testing" was first used.

Instead of writing unit tests for every public method of every class, write unit tests for every component (i.e., user, product, order, etc.), covering every behaviour of each component, focusing on the public interface of the unit.


## What is the right approach when testing software?
We learned that testing should begin "in the small" and progress toward testing "in the large"; Because that, we should focus more on the Unit testing - the aim is to test each part of the software by separating it. It checks that the component matches the expected behaviour. Remember, the UNIT here is not the method or class as most people think. 

Next comes the module testing; the aim is to test different packages to assess if they work correctly together. By testing the units in groups, any faults in the way they interact together can be identified.

And finally, End-to-end testing; in this testing phase, different software modules are combined and tested as a group to ensure that the integrated system is working correctly.

E2E test plans generally cover user-level stories like:
"A user can log in."
"A user can make a deposit."
"A user can see its balance."

## Can you test too much?
"Can you test too much? Sure you can. You are testing too much if you can remove tests while still having enough." - Martin Fowler

Kent Beck (Author of the book TDD By Example) answered the question how much unit tests a system should have

> I get paid for code that works, not for tests, so my philosophy is to test as little as possible to reach a given level of confidence...

Optimising for confidence is the key to effective testing!  Don’t over-testing and be careful to not cover the  same things across the different tests(Unit, module, E2E)

## More
You can find more about testing [here](https://dev.to/apssouza22/we-are-testing-software-wrongly-and-it-costs-a-lot-of-money-23o5)
Javascript to check all and uncheck all
Tags: javascript, bootstrap, jquery, programming
Published: 2022-03-27 17:43:45

I found this script to check all the boxes and uncheck all the boxes by capturing the event of checking and unchecking by finding the state of the check box.

$('button[id="dataview"]').on('click', function(event){
				alert(event.target.id);
				
				alert(event.target.name);
				
				text = event.target.name;
				
			 if (event.target.checked == true){
			  	  alert("checked")
			      selects(text)
			    } else {
			      deSelect(text)
			    }
				  
			  });
		$('button[id="analysis"]').on('click', function(event){
				alert(event.target.id);
				
				alert(event.target.name);
				
				text = event.target.name;
				
				
				
			 if (event.target.checked == true){
			  	  alert("checked")
			      selects(text)
			    } else {
			      deSelect(text)
			    }
				  
			  });