teleren/devto huggingface dataset:
Something short about MongoDB
Tags: mongodb, nosql, database, rdbms
Published: 2022-03-29 19:45:36

I have worked with relational databases particularly MySQL and later on MariaDB.

So recently I decided to check out MongoDB and test the NoSQL world for a bit. Still there is much for me to learn.

MongoDB is a NoSQL, document oriented, cross platform database program. MongoDB uses  JSON-like (Binary JSON - BSON)  documents with optional schemas. Apparently the word MongoDB is derived from two words Humongous Database 

NoSQL databases store data differently than relational tables, specifically they don’t have tables.

MongoDB stores data records as documents (specifically BSON documents) which are gathered together in collections. A database stores one or more collections of documents. Collections are analogous to tables in relational databases.

According to Wikipedia MongoDB comes in three editions MongoDB Community Server, MongoDB Enterprise Server and MongoDB Atlas

**MongoDB Community Server**
The MongoDB Community Edition is free and available for Windows, Linux, and macOS.

**MongoDB Enterprise Server**
MongoDB Enterprise Server is the commercial edition of MongoDB, available as part of the MongoDB Enterprise Advanced subscription.

**MongoDB Atlas**
MongoDB is also available as an on-demand fully managed service. MongoDB Atlas runs on AWS, Microsoft Azure, and Google Cloud Platform.

**Restrictions on Database names**
Database names are case-sensitive in MongoDB but they must also differ on more than just case otherwise you will get an error.
Database names for deployments running on Windows systems cannot contain any of the following characters: **/\. "$*<>:|?** While those deployed on Linux/Unix systems cannot contain any of the following characters: **/\. "$**
Database names cannot be empty and must have fewer than 64 characters.

**Restriction on Collection Names**
Collection names should begin with an underscore or a letter character, and cannot: contain the **$**, be an empty string, contain the null character, and begin with the system prefix.

**Restrictions on Field Names**
Field names cannot contain the null character.
The field name **_id** is reserved for use as a primary key; its value must be unique in the collection, is immutable, and may be of any type other than an array. If the **_id** contains subfields, the subfield names cannot begin with a ($) symbol.

The MongoDB Shell a.k.a **mongosh** is an interactive environment for interacting with MongoDB deployments, from here you can issue commands to query and interact with your database.



**References**
https://www.mongodb.com/docs
https://en.wikipedia.org/wiki/MongoDB
Entry Web Devs
Tags: webdev, beginners, productivity, career
Published: 2022-03-29 19:42:24

Hey everyone i am a web developer and am opening a discord server to help and give advice to developers out there or those trying to break into the industry


I will be covering topics such as 

Career Advice
Day in life of a dev
Imposter syndrome
Interview Q+A
Building / Networking yourself

if interested join below or message me for an invite

https://discord.gg/4vqE6pRB
Template for creating a typescript Hardhat-based repository for EVM smart contract development
Tags: smartcontract, ethereum, arbitrum, hardhat
Published: 2022-03-29 19:39:43

gm everyone,

I have just published a scaffold repository template I have used for [our project](https://flair.finance) so that folks don't need to reinvent the wheel and get straight to writing code and deploying on the blockchain.

The repository is called **[0xflair/evm-contract-scaffold](https://github.com/0xflair/evm-contract-scaffold)**, you can use it as a template.

Here are some of the features that might be interesting:
* Uses [hardhat-deploy](https://github.com/wighawag/hardhat-deploy) to keep track of deployments (upgradable or normal)
* Uses [typechain](https://github.com/dethcrypto/TypeChain) to auto-generate typescript bindings for compiled contracts, useful for auto-completion in your frontend dApps
* Uses [semantic-release](https://github.com/semantic-release/semantic-release) and commitlint for a streamline CI
* Uses Github Actions to **publish** versioned contracts to NPM, along with their Typescript bindings, **ABIs** (useful for interacting from your dApp) and **bytecodes** (useful when deploying contracts using ethers.js or web3).
* Supports multiple chains
* **Gas cost** reporter using CoinMarketCap APIs for your contract deployment and each interaction
* **Contract size** calculator plugin for Hardhat
* Automated [Etherscan](https://etherscan.io/) verification for deployed contracts

Feel free to give feedback or create PRs.

Cheers!
Linux Commands to boost productivity
Tags: linux, terminal
Published: 2022-03-29 18:51:03

# Linux Commands to boost productivity 

I have been using the terminal for quite a long time. And few of these commands which I recently came across have changed the way I use the terminal. Hope you guys will find these useful as well.

Let's get started with the commands,

## Quickly navigating directories

One quick tip is to navigate to home, we can use
```bash
->cd ~
```
Similarly, we can use - to navigate back to the previous working directory
```bash
->cd -
```

## Clear screen

We usually type clear to clear the screen, alternatively just press **Ctrl + L** to move the prompt to the first line. This just moves the prompt to the top of the screen. This is quite quick and I started using this quite frequently compared to clear.

## Minimize a program

Okay, technically we are not minimizing in the sense. But we can press **Ctrl + Z** to move the code to pause the program. So, we can be editing in vim and press Ctrl + Z and pause it, do something else, then get back to editing by using the **fg** command.

## Repeating the last command with sudo

We missed adding sudo to a command. This happens so often that it's frustrating to hit home and type sudo or retype the entire command after sudo. One simple way to get over it is to use the following command.

```bash
->sudo !!
```

!! is referred to as bang bang. So this command is referred to as *sudo bang bang*.

## Review command history

We know about history command. But press **Ctrl + R** to open up a search. This is far more convenient and easier to search. Press Ctrl R to cycle through the commands.

## Run command from history

Execute the history command, note the number before the command you want to run. Type bang followed by the number to execute the command.

```bash
->history
1 apt get update 
2 apt get upgrade
->!2
```

## Clear line

Press **Ctrl + U** to clear the entire line.

## Go to start and end of line

Press **Ctrl + A** to go to start of the line
Press **Ctrl + E** to go to end of the line

## Chaining commands

We can use ; or && chain commands.

```bash
->ls -a test; echo hello
ls: cannot access 'test': No such file or directory
hello
->ls -a test && echo hello
ls: cannot access 'test': No such file or directory
```

As you can see the key difference is that; doesn't care about the output of the previous command. Whereas, when we chain with & it needs the previous command to complete successfully for the second command to execute.

## Column command

This is just to prettify columnar outputs. Any jumbled output can be made easier to read with a column command. This can be used to format output as required as well.

```bash
mount| column -t
```

## Increase and decrease font size

This is one thing I have seen new developers struggle with. A quite intuitive command set to increase and decrease font sizes are 

**Ctrl + +** to increase font size
**Ctrl + -** to decrease font size

I will be on the look out for more commands that can help me in my daily work flow. Please feel free to let me know in the comments below about any more commands that might be useful.
Remove double imports with regular expression
Tags: tutorial, regex, beginners
Published: 2022-03-29 18:41:04

One thing I learned about imports is that they can become really messy when dealing with git conflicts. The more imports there is, the more time is required to sort them out. Imagine merging a branch and ending with something like:

```typescript
import { Baz } from 'baz';
import { Foo } from 'foo';

import { 
    BOHICA, 
    FUBAR, 
    FUBU, 
    SNAFU, 
    SUSFU, 
    TARFU } from 'slang';

import { Baz } from 'baz';
import { 
    BOHICA, 
    FUBAR, 
    FUBU, 
    SNAFU, 
    SUSFU, 
    TARFU } from 'slang';
    
import { Baz } from 'baz';
```

That's over 20 lines, nothing critical, but once you need to split screen/scroll to remove duplicates, it's no fun. Need some superpowers to remove duplicates. You just need to use ~~ancient elven magic~~  regular expression and an IDE with replace function that supports it.

Check out this ~~spell~~:
```regex
(import [^;]+;\n)(?=(.*\n)*\1)
```

Paste it into search field, enable regex and run replace, whoosh! All import duplicates are gone, you might have some extra blank lines, but a prettier will fix that with a single hotkey command.

```typescript
import { Foo } from 'foo';

import { 
    BOHICA, 
    FUBAR, 
    FUBU, 
    SNAFU, 
    SUSFU, 
    TARFU } from 'slang';
    
import { Baz } from 'baz';
```

Pretty neat, eh?
C++ maxsus belgilari
Tags: beginners, cpp, uzbek, dasturlash
Published: 2022-03-29 18:37:35

##`\n`##
###Backslash n###
Ushbu belgi `string` ichiga yoziladi. Bu belgi bor joydan yangi qatorga yoziladi. Masalan ⬇️

``` py
 cout << "Salom\n dunyo." << endl;

Salom
  dunyo.
```
##`\t`##
###Backslash tab###
Bu ham `string` ichida yoziladi va bu bo'lgan joy tab tugmasi bosilgada chiqadigan masofada joy bo'sh qoldirib ketiladi. ⬇️
```py
cout << "olma\tbehi\tanor"

olma   behi   anor
```
##`\b`##
###Backslash b###
```py
cout << "olma\b bexi" << endl;

olm bexi
```
Bu `\b` oldingi 1 dona belgini o'chirib yuboradi
#Day 10 of solving 450 questions [32/450]
Tags: programming, python
Published: 2022-03-29 18:36:27

Question solved:


## [TRAPPING RAIN WATER]
(https://leetcode.com/problems/trapping-rain-water/)

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

[minimum-operations-to-reduce-x-to-zero](https://leetcode.com/problems/minimum-operations-to-reduce-x-to-zero/)
How to connect Apache tomcat to Apache Netbeans IDE
Tags: java, tomcat, netbeans
Published: 2022-03-29 18:30:21

## What is Apache tomcat

it's an open-source Java servlet and Java Server Page container that lets developers implement an array of enterprise Java applications. **Tomcat also runs a HTTP web server environment in which Java code can run.** 


## What is Apache Netbeans

It's a IDE that is use to develop any kind of application like Java EE application, PHP, Java SE application and many more. It provide many tools and plugin that will productive developers works.


Before move further download apache tomcat and netbeans

[Download apache tomcat version 9 ](https://tomcat.apache.org/download-90.cgi)

[Download Apache Netbeans version 12](https://netbeans.apache.org/download/archive/index.html)

you can download any version right now for the tomcat 10 version is available but for this blog we will use tomcat 9 version and Netbeans 12 version you can also download Netbeans version 13.

Download Apache tomcat file and **unzip** it.


## Open the Netbeans IDE

Click on **Services** tab

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


Now right click on **Servers** and **add server**

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


Click on **Browse** button and Select tomcat folder that you downloaded

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


Now config username and password and should be remember because when you will run the server it will ask you to enter username and password.


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



Now your server will create on **server tab** and select server and do right click on created server and **start server**. It will ask you to enter username and password.


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


To check your server run successfully or not run below link on browser.

[http://localhost:8080/](http://localhost:8080/)
Top 7 Featured DEV Posts from the Past Week
Tags: top7
Published: 2022-03-29 18:14:24

---
title: Top 7 Featured DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week
tags: icymi 
cover_image: https://thepracticaldev.s3.amazonaws.com/i/sfwcvweirpf2qka2lg2b.png
---

_Every Tuesday we round up the previous week's top posts based on traffic, engagement, and a hint of editorial curation. The typical week starts on Monday and ends on Sunday, but don't worry, we take into account posts that are published later in the week._ 

## Your tools can be wrong, sometimes

We all want our sites to be fast and it takes a lot of small wins in order to add up to this outcome. @mlrawlings points out two performance factors that are often overlooked and how your devtools may mislead you into believing them unimportant. 

{% embed https://dev.to/mlrawlings/your-ssr-is-slow-your-devtools-are-lying-to-you-3056 %}


## Must-read books for developers

Choosing a career in tech is choosing an endless life of learning. One person doesn’t have time to read all of the books out there, so @tmchuynh put together a shortlist of her favorite books for developers.

{% embed https://dev.to/tmchuynh/books-to-read-as-a-developer-33eh %}


## Pushing DEV posts to GitHub Pages

@brunodrugowick wanted a simple, static site with the list of posts from their DEV profile. Check out how he made it work using GitHub Pages!

{% embed https://dev.to/brunodrugowick/update-your-github-pages-website-with-posts-from-devto-ein %}


## Presto!

When you have a lot of side projects, it can be tough to manage all the issues that are sent to your email inbox. But now, every time a new issue is made, @aschmelyun gets a physical ticket printed out on his desk! 

{% embed https://dev.to/aschmelyun/i-built-a-receipt-printer-for-github-issues-51b7 %}


## For when you're aiming beyond "good enough" 

Thank you @trishathecookie for this helpful and indeed actionable guide to leveling up your impact as a frontend dev. Good stuff!

{% embed https://dev.to/trishathecookie/5-actionable-steps-to-becoming-a-better-frontend-developer-5444 %}


## Your inbox may not be as private as you think

When it comes to privacy and the law, the end ultimately justifies all means, and companies may change their conditions at any time. @jmau111 speaks on the ways in which email privacy has been breached. 

{% embed https://dev.to/jmau111/your-inbox-is-not-a-digital-safe-5921 %}


## Farewell, Nick ❤️ 

@nickytonline is moving on to the next chapter and all of us here at Forem will miss him dearly — the good news? Nick will continue to spread his positivity and skills across the tech landscape _and_ his impact will be felt here at Forem for a long time to come. Thank you for everything, Nick!

{% embed https://dev.to/nickytonline/my-impact-at-forem-23mj %}


_That's it for our weekly Top 7 for this Tuesday! Keep an eye on dev.to this week for daily content and discussions...and be sure to keep an eye on this series in the future. You might just be in it!_
React Native Conditional Rendering
Tags: reactnative, react
Published: 2022-03-29 18:08:29

In general, conditional rendering in React Native is the same as in [React](https://en.reactjs.org/docs/conditional-rendering.html). But be aware, that in React Native we can render strings only inside the `Text` component. So, for example, if we will try to put a string inside a `View` we will get an error.

## Inline if with logical `&&` operator.

```jsx
<View>
  {!!error && <ErrorMessage />}
</View>
```

☝🏻 Double negation `!!` operator is very important here (also we can use the `Boolean` function), because it ensures that the left part of the condition will be a boolean value.

Why it is important? Because logical “and” operator `&&` will return the right side of the condition if the left side is `truthy`. And will return the left side of the condition if the left side is `falsy`.

Imaging we have a component:
```jsx
<View>
  {error && <ErrorMessage />}
</View>
```

If the `error` variable will be an `object`, `null` or `undefined` everything will work as expected. But if we will get an empty string for the error (`error = ''`) then our component will brake, because we can’t render strings inside a `View` component.

```jsx
// error = ''
// {error && <something>} will return the error variable,
// which equals to the empty string and we will get:
<View>
  ''
</View>
// which will throw an error, because we 
// can't render strings inside a View
```

   
## Inline if-else with ternary `?` operator.

```jsx
{error ? <ErrorMessage /> : <SuccessMessage />}
```
or
```jsx
{error ? <ErrorMessage /> : null}
```

Here we can return `null` or `<></>` (React Fragment) depend on our component structure and return type.

## `if` statement

```jsx
...

const Error = () => {
  if (!error) {
    return null
  }

  return <ErrorMessage />
}

return (
  <View>
    <Error />
  </View>
)
```

## Code example

Please use [this Expo Snack](https://snack.expo.dev/@vladimir_vovk/conditional-rendering) to see the full code and play with it, press 💖 button and happy hacking! 🎉

## Credits

Photo by <a href="https://unsplash.com/@isaacstruna?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Isaac Struna</a> on <a href="https://unsplash.com/s/photos/condition?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>.
Get started with Bootstrap
Published: 2022-03-29 17:33:03

<!doctype html>

npm starter
Get started with Bootstrap
You've successfully loaded up the Bootstrap npm starter project! It's loaded up with Bootstrap 4, Bootstrap Icons, and tooling for compiling our Sass and JavaScript to your needs.

If this button appears blue and the link appears purple, you've done it!

Toggle example modal [Example link](https://github.com/jslinux43/testagain)
Success!
×
If you're seeing this modal after clicking the button on the page, Bootstrap's CSS and JS are both working properly.
Close Save changes
Adding Bootstrap Icons
Bootstrap Icons are included with the SVG sprite here, but there are other usage options, too. They're styleable with text utilities and more.

Guides
Read more detailed instructions and documentation on using or contributing to Bootstrap.

Bootstrap quick start guide
Bootstrap Webpack guide
[Contributing to Bootstrap](https://bbarlock.com/index.php?title=User:Jimlsfouncexc)
Created and open sourced by the Bootstrap team. Licensed MIT.
.forEach vs .map
Tags: javascript, webdev, beginners
Published: 2022-03-29 17:22:31

Working with JavaScript, especially starting out, has been quite the challenge. An entertaining one at that, but definitely quite an endeavor. To start off my beautiful blogging journey, what better a way to start of then explaining two array-manipulation techniques?

Let's start of with .forEach, a function that allows the user to transverse through an array and issue a callback function once for each element in an array. It does this in the order of the array, executing each element one at a time.

And for the second we have .map, which creates a new version of an array for you to execute a function on. Similar to .forEach, it will call a function on each element in the array.

In short, one large difference that took me one whole hour to internally process, is that .forEach will affect the original array and not return anything, whereas .map will create a new array that is a copy of the original to execute the function on and return the new array.
Add key event listener in React.
Tags: react, webdev, development, coding
Published: 2022-03-29 17:04:03

It is very simple in react, you can add any key event listener. I have used example of "Enter".

I have defined a sample function for the explaination.

```
    const handleInputEnter = (e) => {
        // You can 
        if(e.code === 'Enter') {
            console.log("Hello");
        }
    }
```

Add onKeyUp attribute in the element.
Example:
```
<input type="text" onKeyUp={handleInputEnter}  />
```

This will work completely fine.
Follow me on twitter: https://twitter.com/vedantj_03
taints, tolerations, nodeselector in aks (azure kubernetes services) explained in plain english
Tags: kubernetes, taints, aks
Published: 2022-03-29 17:01:04

---
title: "taints, tolerations, nodeselector in aks (azure kubernetes services) explained in plain english"
published: true
description: "taints, tolerations, nodeselector in aks (azure kubernetes services) explained in plain english"
tags: kubernetes, taints, aks
cover_image: https://www.azuremonk.com/assets/blogposts/video/taints.png
---

{% youtube aGT3UtZoiA0 %}

This is part 2 of a multi-part series explaining node pools in Azure Kubernetes Services AKS. For part 1 please click here - https://youtu.be/45UxnRj11_g

In this video we will talk about: 
1. How we can use taints and tolerations to schedule pods in AKS nodes with demo
2. How we can use NodeSelectors in AKS
3. Link to Blogpost - https://www.azuremonk.com/blog/kube-scheduler


#azure #aks #nodepools #taints #tolerations #nodeselector #kubernetesscheduler #scheduler

For more simplified video tutorials on Azure and Kubernetes - check out www.azuremonk.com/video
azure kubernetes services (aks) node pools explained in plain english
Tags: kubernetes, nodepool, aks
Published: 2022-03-29 16:59:43

---
title: "azure kubernetes services (aks) node pools explained in plain english"
published: true
description: "azure kubernetes services (aks) node pools explained in plain english"
tags: kubernetes, nodepool, aks
cover_image: https://www.azuremonk.com/assets/blogposts/video/nodepool-p1.png
---

{% youtube 45UxnRj11_g %}


This is part 1 of a multi-part series explaining node pools in Azure Kubernetes Services AKS. 

In this video we will talk about: 
1. What is a nodepool? Why do we need them? 
2. Difference between system node pools and user node pools
3. Walkthrough of how to create a nodepool in AKS


#azure #aks #nodepools #systemnodepools #usernodepools #simplified 

For more simplified video tutorials on Azure and Kubernetes - check out www.azuremonk.com/video