teleren/devto huggingface dataset:
Short-Circuit Evaluation
Tags: javascript, webdev, programming, tutorial
Published: 2022-03-02 10:49:55

It is always awesome to use a quick way to write simple like ternary operator.
```js
// example 1:
let x = 3;

let answer = x > 5 ? true : false; // false since 3 is less than 5

// example 2:
let y = [1,2,3];
let z = [4,5];

let answer = y.includes(5) ? (z.includes(5) ? true : false) : false; // true
```

Ternary operator is good to use but not always. So javascript introduced a way to evaluate expressions. This are `&&` (AND) and `||` (or).

## How Does it Work?
**1. &&** - this will return the first `falsy` value. If all are true, return the last value;
```js
console.log(5 && 6 && null && false && 0);
/** 
result: null 
- because the null is the first `falsy`.
*/

console.log(true && 1 && 4); 
/** 
result: 4 
- because everything is `truthy`. 
*/

let a = [1,2,3].includes(3) && 5 && 'good';
/**
result: 'good'
- because everything is truthy
*/
```

**2. ||** - next is the || operator. Using || will return the first true or ‘truthy’ value. If every operand evaluates to false , the last evaluated expression will be returned.

```js
console.log(5 || 6 || null || false || 0);
/** 
result: 5
- because the 5 is the first `truthy`.
*/

console.log(false || 6 || null || false || 0);
/** 
result: 6
- because the 6 is the first `truthy`.
*/

console.log(true || 1 || 4); 
/** 
result: true 
- because true is thruthy. 
*/

let a = [1,2,3].includes(3) || 5 || 'good';
/**
result: true
- because the first condition is truthy.
*/
```

This is very useful to make conditional statement smaller. Something Like This:
```js
    if (data) {
        return data;
    } else {
        return 'No Data';
    }
```
can be converted to:
```js
return (data || 'No Data');
```


__________
thanks for Reading Short Reads. If you like to donate, click the image.

[![Buymecoffee Donate to Bro Jenuel](https://i.imgur.com/jnnBYBem.png)](https://www.buymeacoffee.com/BroJenuel)
The Best Way to Create Photography Business Cards
Published: 2022-03-02 10:47:33

n this two section series about making your own **[photography business cards](https://photoadking.com/templates/business-card/photography/
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ps8rfz8sw0dhnjopcva.jpg))**, we will walk you through the plan and printing processes. Over the recent years that we have cooperated as a spouse and wife picture taker group, we've tested a ton with our business cards to make them champion when we pass them out to clients, their companions and family, and others we've met in the photograph business.

What you can hope to escape this business card creation instructional exercise for picture takers:

Address why you need a business card in any case
Figure out how to plan your business card for an extraordinary initial feeling
Distinguish what things are critical to remember for your business card
Show you the best business card printing choices for incredible quality
Before the end, you will be learned and equipped for making your own photography business card without any problem.

## **How do picture takers manage business cards?**
sea photographyBefore telling you the best way to plan your photography business card, we need to initially discuss why you would even need one.

If you somehow happened to venture once more into the 80's and 90's, experts in practically any industry had business cards. We sat in a burger joint and there being a "business card wager" where individuals could drop in their card to attempt to win a free supper. This actually could occur every now and then, however significantly less often. One thing we can all settle on, however, is that...times have changed!

A ton of our business collaborations today happen on the web. The vast majority learn about our photography administration through web-based media and online inquiries that turn up with our site and portfolio. So where carry on with work cards fit in with the general mish-mash?

As we have learned throughout the long term, while observing a picture taker has become unimaginably simple to do on the web - it is regularly exceptionally indifferent. Indeed, there are steps you can take to more readily interface with individuals carefully, yet it actually will continuously miss the mark on sensation of a genuine, actual association.
Web2 Vs Web3- what's different?
Tags: web3, blockchain, news
Published: 2022-03-02 10:46:13

The web has been around for a while, since it's invention by Tim Berners-Lee in 1989.Since the inception of the web we've had three(3) different versions and these versions have been classified based on how users of the web interact with it.

## Web 1.0
 Web 1.0 was a static kind of web where content was rendered for users to read and it was difficult for users to interact with it.

## Web 2.0 
 Web 2.0 is the web of the present, with the arrival of web 2.0, users of the web could now interact with the web. The web was now dynamic and with it came different use-cases we see nowadays like social media, e-commerce e.t.c

## Web 3.0
Web 3.0 brings a new dimension of decentralization to the web. As successful as web 2.0 was, it was very centralized in nature and was built on top of centralized entities like google, amazon, facebook e.t.c. The centralized structure of web 2.0 enabled these centralized entities to abstract most of the value of the internet for themselves. With Web 3.0 which is built on top of blockchain technology, the internet will be decentralized and each entity that participates have authority over their content.

## Key Differences: How is web 3 different?

**-Open:**
 Web 3 is Open i.e every software is open to the outside world
**-Trustless:**
 It will allow participants to interact publicly or privately without any trusted third party.
**-Permissionless:**
Neither users nor suppliers need any authorization from a governing body for participating.


CC: [BlockGames](https://blockgames.gg/), [Zuri] (https://zuri.team/), [Nestcoin](https://nestcoin.com/).
Web 2.0 and Web 3.0 - The Difference
Tags: web3, blockchain
Published: 2022-03-02 10:45:08

As a tech enthusiast and one interested in blockchain, I recently enrolled for [Blockgames](https://blockgames.gg/). It is a program run by [Nestcoin](https://nestcoin.com/) in partnership with [Zuri Team Limited](https://zuri.team/).

My first task in the program is to write an article about the major difference between web 2 and web 3. 

**What is Web 2.0?**
Web 2.0 is a successor of web 1.0 also known as the Static Web - It was the first and most reliable internet in the 1990s despite only offering access to limited information with little to no user interaction. 
Web 2.0 is simply the improved version of web 1.0, it is distinguished specifically by the change from static to dynamic or user-generated content. Examples of web 2.0 features include social networking sites (e.g Facebook), video sharing sites (e.g YouTube), blogs(WordPress), etc


**What is Web 3.0?**
Web 3.0 is the next stage of the web evolution. It is an idea for a new iteration of the World Wide Web based on blockchain technology, which incorporates concepts including decentralization and token-based economics.
In web 3.0, information is processed with near-human-like intelligence through the power of AI systems that could run smart programs to assist users.


**Differences between Web 2.0 and Web 3.0**

- In web 2.0, information is gotten speedily whereas in web 3.0, information is available anywhere at anytime
- The framework is owned and looked after by a corporation or governing body in web 2.0 while it is decentralized ie it is not owned or looked after by anyone in web 3.0

Thanks for reading!
How to Load Test your API?
Published: 2022-03-02 10:18:38

As a programmer it is useful to know if the software you have written will perform well enough while on heavy load. What if a bunch of users will upload files all at the same time? What is an exceptional load and when will it crack?

Performance testing is simulating load and measuring how your software handles it. These tests are NOT about finding bugs, vulnerabilities, security hotspots or code smells. 

## Load Testing
It is best to start with a Load Test. A Load Test is to test the performance on expected load during daily usage. This is your starting point in order to benchmark and determine how far you can push your system in other tests: stress and spikes.

The goal of a loadtest is to find metrics for system performance under high load, not to break the environment.

## Testing Tool
In this case we will make use of [k6 from Grafana Labs](https://k6.io/). Easy to install for multiple Operating Systems.

If k6 is installed, create a JavaScript file named `load_test.js`:

```
import http from `k6`/http;

export const options = {
    vus: 10, // max. number of virtual users
    duration: '30s', // max. duration in seconds
};

export default function () {
    http.get('http://your_api.com/my_endpoint');
}
```

To run this script, enter this commando in the terminal in the root of your JavaScript file:

```
$ k6 run script.js
```

## Output
A possible output could look something like this:

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

Mainly I check these two variables to see what is up, but I would say: Eat your heart out!

## Bonus
If you are running an Apache webserver and you notice messages "internal dummy connection" in your logs, checkout your 'workers' in the settings of Apache. By default they are set to a maximum of 2 which are similar to 'vus'.
New Years Resolution - Dev Log 20
Tags: webdev, beginners, programming, computerscience
Published: 2022-03-02 10:16:04

I have done it! Geospatial search works! If you can not tell, I am pretty happy about it. I am so close to having the MVP done. I just need to integrate Stripe and a mail sending API. Then after that, it's basically all polishing.

A friend that I made through my blogs actually sent a link to all the math required to actually calculate distance based on latitude and longitude. So once I had that I figured all I needed to do was find an easy way to convert addresses into latitude and longitude. So even though I said that I would not use it, I ended up using the Google Geo-Coding API. As it turns out, as long as you do not need like million API requests a month, the pricing is very budget-friendly. If I actually end up spending money on API requests, it means the website is doing very well, so that would be a problem that I would be more than happy to have.

One thing I learned while creating the Geospatial search functionality is middleware. I already knew how middleware worked and have used some out-of-the-box middleware before. However, this was my first time actually writing my own non-trivial middleware. I am excited that I am still learning on this project even though I intentionally picked technologies that I was already fairly familiar with.

Because I am proud of it, here is the code that I am using for the geospatial search:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z1ea6f30c88i68629zl7.PNG)
It is probably not perfect, but it is mine, and it works. So I love it as is.

Glory to Ukraine!
Browsers are the most targeted platform type among third-party ecosystem app developers
Tags: thirdparty, programming, 3rdparty, apps
Published: 2022-03-02 10:06:56

---
title: Browsers are the most targeted platform type among third-party ecosystem app developers
published: true
description: After the introduction of APIs in the early 2000s, other companies across multiple industries started to do the same.
tags: #thirdparty #programming #3rdparty #apps
//cover_image: https://direct_url_to_image.jpg
---
After the introduction of APIs in the early 2000s, other companies across multiple industries started to do the same. 

Our data suggests that 43% of third-party ecosystem developers are creating applications and extensions for web browsers, making them the most targeted platform category. 

If we only look at the world’s most popular web browser, Google’s Chrome, it has more than 2.6B global users and over 137K extensions. 

![most targeted platform type
among third-party ecosystem app developers](https://i.ibb.co/dGzX9wW/Screenshot-2022-03-02-115102.png)

The total addressable market alone is good cause to target web browsers, regardless of their functional versatility. Looking at the past two years of data, browser interest has seen a slight decrease among third-party developers, but larger shifts in interest are taking place in other types of platforms.

Source: [State of the Developer Nation 21st Edition](https://developernation.net)

What do you think?

**Do you wanna help us understand 3rd party apps development a bit better?**

We are running a small, 5 minute survey for developers involved in collaboration platforms. Complete the survey and win amazing prizes such as JetBrains All Products Subscriptions, Heroku annual dynos and Udemy vouchers.

**[Help us understand 3rd party apps devs](https://survey.developernation.net/name/dn22-comm?utm_medium=post&utm_source=dev_to&utm_campaign=dev_to_post2)**
Cart Limit for WooCommerce

Tags: webdesign, programming, webdev
Published: 2022-03-02 09:57:40

Add cart limitations to control the inventory and quality with [WooCommerce set maximum quantity.](https://woocommerce.com/products/cart-limits-for-woocommerce/) Admin can put limitations on the product count or total amount spent by the customer. When the cart limit is reached then it stops customers from adding more products they can only replace products. Customers can only replace the first or last item added to the cart. [WooCommerce Cart Quantity](https://woocommerce.com/document/cart-limits-for-woocommerce/) allows composing a message to communicate with the customer when a product is replaced. Admin can put custom text to the cart-limit message box to tell customers why they can’t add more products.
Build a Messenger Clone with MERN Stack (MongoDB, Express, React, Node JS) + Socket.io (Day 4)
Tags: javascript, webdev, tutorial, react
Published: 2022-03-02 09:36:16

In this Facebook Messenger   Clone  Tutorial series, we will learn to build an Awesome Full Stack  Facebook Messenger Project with realtime messaging functionality with socket.io . We have one on one chat as well as group chatting functionality in this app.

In this video, we will be Creating User Model


{% youtube 1Ne_WuO50TI %}
Build a Messenger Clone with MERN Stack (MongoDB, Express, React, Node JS) + Socket.io (Day 3)
Tags: javascript, webdev, react, tutorial
Published: 2022-03-02 09:34:40

In this Facebook Messenger   Clone  Tutorial series, we will learn to build an Awesome Full Stack  Facebook Messenger Project with realtime messaging functionality with socket.io . We have one on one chat as well as group chatting functionality in this app.

In this video, we will be connecting to our Database


{% youtube cOFRAkLNaDc %}
Name your price WooCommerce
Tags: webdev, webdesig, woocommerce
Published: 2022-03-02 09:29:34

Get more sales and compete with the competitor’s prices with [WooCommerce name your price](https://woocommerce.com/products/price-guaranteed-for-woocommerce/).This plugin enables the customers to share the prices of the competitors with the store owners.The store owners can manage the price requests by using the dashboard. [Name your price WooCommerce ](https://woocommerce.com/document/price-guaranteed-for-woocommerce/)allows users to create coupons codes with the offered price and expiration date. This plugin promotes trust-building among customers and saves money. The store owner can generate coupons against the desired product and can also set the term of its usage. Both registered users and guest users can avail themselves of a coupon code with this plugin. Set size,fields, and color of popup according to your store theme.
Wednesday Links - Edition 2022-03-02 🇺🇦
Tags: java, jvm, groovy, microservices
Published: 2022-03-02 09:22:08


The War in Ukraine (2 min)🇺🇦
https://blog.allegro.tech/2022/03/war-in-ukraine.html

Spring Cloud Gateway CVE reports published (30 sec)☠️
https://spring.io/blog/2022/03/01/spring-cloud-gateway-cve-reports-published

Functions vs. containers – which is better? (10 min)⚔️
https://blog.codecentric.de/en/2022/02/functions-vs-containers-what-is-better/

Seven Ways to Fail at Microservices (15 min)💥
https://www.infoq.com/articles/microservices-seven-fail/

Creating Virtual Threads with project Loom (4 min)🧵
https://www.davidvlijmincx.com/posts/create_virtual_threads_with_project_loom/

Groovy 4.0.0 Introduces Switch Expressions and Sealed Types (5 min)🦭
https://www.infoq.com/news/2022/02/groovy-4-0-0

16 artifacts to capture when there is a production problem -Montreal 2022 (3 min)🏆
https://blog.ycrash.io/2022/02/23/16-artifacts-to-capture-when-there-is-a-production-problem-montreal-2022/

No, your pull request does not need a review (4 min)👁️
https://jeroenmols.com/blog/2022/02/23/pull-request-reviews/

n.times in Groovy (30 sec)🔁
https://twitter.com/wololock/status/1497206720828956679
Major difference between web 2 and web 3
Tags: blockchain, web3, web2, blockgames
Published: 2022-03-02 09:05:26

It seems like web 3 is the latest trend, most devs seem to be talking about it, and probably all have heard of it.
This article is a way for me to put my thoughts on the difference between web 2 and web 3 into writing (or typing? 😅).
I'll give a brief discussion on both first in order to make the differences more visible.

## what's web 2?
Web 2 refers to the version of the internet most commonly known today. It is an evolution of web 1 which was simply static pages.
In web 2 content is dynamic and based on the user.
Web 2 is focused on user interaction and socialization.

## what's web 3?
This is the latest and upcoming version of the internet. It is focused on decentralization. Data is no longer controlled by big companies and there is no need for an intermediary of any sort, which leads to a greater security of data.

## Main Differences

- **Data**
  In web 2 data is owned and controlled by large organisations or trusted intermediarys whereas in web 3 data is owned by an entity.

- **Security**
In web 2 you have to give out private information in order to access services and place your trust in intermediaries when carrying out transactions.

Web 3 is focused on improved security and privacy, transactions do not require intermediaries and therefore requires no trust.


There are a lot of pros to web 3 and no real cons. I believe there will be many major changes to the internet over the coming years and wish to be a part of that.

I'm currently taking part in the first cohort of [blockgames](https://blockgames.gg/), A highly competitive game competition focusing on blockchain technology by [Nestcoin](https://nestcoin.com/) and [Zuriteam](https://zuri.team/).

Thanks for taking the time to read this, bye.
Javascript Array Methods Ep.3
Tags: javascript, webdev, beginners, programming
Published: 2022-03-02 08:41:01

Hey There 👋
Welcome to Episode 3 of my Array Methods Explain Show.

as always, if you are here then i suppose you must have pre knowledge of javascript and arrays.

we will be discussing only one method on this episode which is : **SLICE**

**slice** does not alter the original array. It returns a copy of elements from the original array.

the syntax of slice method is : 

![Slice Syntax](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wr2t4gbkk5nv0zpdlkqq.png)

- **beginIndex (optional)** : 
```
The starting index from which you want to start the extraction. 
If beginIndex > length of array, then empty array is returned. 
If start is negative, then it starts from last of array.
```

- **endIndex (optional)** : 
```
The ending index at which you want to stop the extraction. 
If endIndex > length of array, then whole array is returned. If start is negative, then it starts from last of array.
```

It returns new array containing the extracted elements.

Now, lets look at examples : 

- return a sub array with given start index

```javascript
let colors = ["Red", "Blue", "Yellow", "White", "Black"];

let newColors = colors.slice(2); // return a sub array from index 2
console.log(newColors); // ["Yellow", "White", "Black"]
```

- return a sub array with given start index and end index

```javascript
let colors = ["Red", "Blue", "Yellow", "White", "Black"];

let newColors = colors.slice(2,4); // return a sub array from index 2 to 4
console.log(newColors); // ["Yellow", "White"]
```

- return a sub array without any argument

```javascript
let colors = ["Red", "Blue", "Yellow", "White", "Black"];

let newColors = colors.slice(); // return whole array
console.log(newColors); // ["Red", "Blue", "Yellow", "White", "Black"]
```

- return a sub array with negative start index

```javascript
let colors = ["Red", "Blue", "Yellow", "White", "Black"];

let newColors = colors.slice(-2); // return a sub array from index 2 (from last)
console.log(newColors); // ["White", "Black"]
```

- return a sub array with negative end index

```javascript
let colors = ["Red", "Blue", "Yellow", "White", "Black"];

let newColors = colors.slice(1, -2); // return a sub array from index 1 to 2 (from last) 
console.log(newColors); // ["Blue", "Yellow"]
```


## <u>BEHIND THE SCENES</u>

**slice** does not alter the original array. It returns a copy of elements from the original array. The copying takes place as - 

- For objects, **slice** copies object references into the new array. Both the original and new array refer to the same object. If an object changes, the changes are visible to both the new and original arrays.
- For strings, numbers and booleans (not String, Number and Boolean objects), **slice** copies the values into the new array. Changes to the string, number, or boolean in one array do not affect the other array.

If a new element is added to either array, the other array is not affected.