teleren/devto huggingface dataset:
Less is More
Tags: programming, webdev, javascript, tutorial
Published: 2022-10-02 09:25:28

Recently, I covered a story on why scalable, flexible and extensible are the new currencies for any open-source product to make trade among developers.

The most we read about the future frameworks, open-source tools, and agenda's plan of action the more we can connect dots where the world is proceeding.

Of course, we can't predict the future, meaning, we can't say which framework or package will crash the market and which one will get crashed.

But one thing we have to understand is that less is more.

## Headless UI is the first backed example
We are heading towards less now, Headless UI is the best example. Earlier we use to have a UI components library giving all sorts of components with in-built themes and logic being injected but now we are headless/unstyled and have to change the conventional methods for UI library.

Now giving less is giving more, UI libraries are only concerned about giving UI components without styling just the logic to be attached.

If want more here are a bunch of examples to get yourself a better understanding.

## Qwik - No JS frameworks 
Next, we have this new JS framework developed by the founder of Angular JS. Ironically, he found a way to make a comeback in the JS market.
Qwik is no JS framework, as we all know javascript is the most costly and expensive language to run on a browser which makes websites a bit slow when it comes to making the website dynamic.
The conventional methods work in the way that bundles are downloaded from the server followed by parsing, compiling and then execution where event handlers are attached to the DOM elements to make the website interactive or dynamic. 

This entire process is costly and expensive and time-taken so Qwik comes with a completely different approach called resumability.

## [Game Change JS framework?](https://dev.to/shreyvijayvargiya/game-changer-js-framework-21de)

Coming back to the point we now trying to remove JS from the actual websites to load them better and faster.
Again less is more, less javascript fast websites.

## [Astro - the all-in-one framework](https://www.ihatereading.in/t/1DUa7ZPeCj3VQrWLXzRc/5-things-to-know-about-all-in-one-framework---Astro)
Astro is a cross-compatible framework that writes React, Vue, and Svelte in a single repository. 
In future, we don't have to argue among React, Vue or static pages we just use the single framework to add any of them as per requirements.
Again, Less is More!!

## Conclusion
Well, I don't know what's next we have on the plate but I am certainly looking forward to this new approach of minimalistic. Well, I am also a nig fan of minimalism so it's good to have less which is again enough.

Keep developing
Shrey
[iHateReading](ihatereading.in)
Is object a HashMap in Javascript?
Tags: javascript, programming, tutorial, beginners
Published: 2022-10-02 08:59:19

Maps, dictionaries, and associative arrays all describe the same data type a.k.a hash table data structure. A Hash table is a data structure that maps keys to values.

Hashtables and hashmaps are data structures that store data in an array-like format, using key/value pairs, where the (hashed) key corresponds to the index in the array. One of the primary benefits that a hashtable has over a hashmap is the native ability to handle synchronous updates. This means that a hashtable can be shared by multiple threads without introducing desynching errors.

Hashmaps offer the same key/value functionality and come native in JavaScript (ES6) in the form of the Map() object (not to be confused with Array.prototype.map()). While hashmaps are limited to single-threaded code, they do have some benefits, for instance the allowance of null values which allows for greater flexibility.

JavaScript Objects: Similar but Different
You might be thinking, “but JavaScript objects already keep track of key/value pairs.” While you can use JS objects to serve the same function of a hashmap, a hashmap does offer some benefits. For instance, hashmaps offer greater flexibility. The key in a hashmap can be any datatype, this includes arrays and objects. Meanwhile, objects can only use integers, strings, and symbols as their keys.

Hashmaps are organized as linked lists, so the order of its elements is maintained, which allows the hashmap to be iterable. Also, unlike key/value pairs stored in an Object, the number of items in a hashmap can be determined by the size property.

Note: One of the primary pitfalls to be aware of when it comes to hashmaps in JavaScript, is that they cannot be directly translated to JSON.

Objects are similar to Maps in that both let you set keys to values, retrieve those values, delete keys, and detect whether something is stored at a key. Because of this, Objects have been used as Maps historically; however, there are important differences between Objects and Maps that make using a Map better.

Originally Published at: https://www.codedolt.com/blog/2022-10-02-is-object-a-hashmap-in-javascript/
A Nice Developer Joke For Today
Tags: jokes, dailydeveloperjokes
Published: 2022-10-02 08:00:08

---
title: "A Nice Developer Joke For Today"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258c20b362.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q:___ Why did the computer keep sneezing?

___A:___ It had a virus!
 -->
Stack Using SLL for beginners
Tags: stack, dsa, beginners, c
Published: 2022-10-02 07:55:56

**Let us write the code for implementing stack using linkedlist**
_Pre-requisites_ : brief knowledge of linkedlist operations.
Before we get started let us know what is Stack? 
A stack is a data structure which follows the LIFO principle. It is abbreviation for Last-In-First-Out. Technically, the last item that is inserted into the data structure can be taken out first.
Applications for stack can be seen in real life, such as a stack of books, files, the cylindrical container for ping pong balls, the biscuit wrapper,etc.

The operations that can be performed on Stack data structure are push(insertion), pop(deletion) and peek(top element).

The code : 
1.**Defining the structure for our nodes**
```
#include <stdio.h>
#include <stdlib.h>

struct Node{
	int data;
	struct Node* next;
};
// global top pointer
struct Node* top=NULL;
```
2.**Writing print function for printing the elements**
We traverse through the list from top until we reach null and print all the data for the nodes.
```
void print(){
	struct Node *traverse = top;
	while(traverse!=NULL){
		printf("%d ",traverse->data);
		traverse = traverse->next; // iterate
	}
	printf("\n");
}
```
3.**Addition(push) of new element(node) to our stack(list)**
Pushing new element to stack is same as insertion of node in the beginning of the list.
```
void Push(int x){
	struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
	newNode->data = x;
	newNode->next = NULL;
	if(top==NULL){
		top = newNode;
		print();
		return;
	}
	// link fix with first node
	newNode->next = top;
	top = newNode;
	printf("Stack after insertion : \n");
	print();
}
```
4.**Deletion(popping) element(node)from the stack(list)**
Popping from stack is same as deleting node from the beginning of the list.
```
void Pop(){
	if(top == NULL){
		printf("Stack is empty!!\n");
		return ;
	}
	struct Node *temp = top->next;  // one node skipped i.e., deleted
	top->next = NULL;
	top = temp;
	printf("Stack after deletion: \n");
	print();
}
```
5.**Peek(show top) element(node)**
Peeking is showing the top element of the array if it exists else the stack is empty
```
void peek(){
	if(top == NULL) printf("Stack empty!\n");
	else printf("Top element is: ",top->data);
}
```
6.**Now we write the main function and interface for the user interaction using switch case**
```
int main(){
	top = NULL;
	int choice;
	printf("Enter 1 for push, 2 for pop, 3 for peek: ");
	scanf("%d",&choice);
	// switch statement
	switch(choice){
		case 1:
			int value;
			printf("Enter the value for insertion : ");
			scanf("%d",&value);
			Push(value);
			break;
		case 2:
			Pop();
			break;
		case 3:
			peek();
			break;
		default: 
				printf("Wrong choice!");
				break;

	}
	return 1;
}
```
Now, run the program in your editor and make sure to try out different values of insertion and deletion to make sure the edge cases are being followed. If you find any bug, comment down below!
Thank you 👋
How Internet works ?
Tags: internet, besics, beginners
Published: 2022-10-02 07:46:06

## In simple word

Internet is conections of computer. where one computer can ask for data of another computer.     all the computer of world are connected throught optical fiber cable. where data is converted to analog signal then that optical fiber cable get connected to a router that convert it in to digital or electromegnetic signal.

mostly this optical fiber cable are connected whith you ISP (Internet Service Provider) ex. Jio,BSNL.

from there router they convert it in to electromegnetic signals.

## lets take example of youtube video 

A youtube videos is stored in Data center of Google. In data center it stored in server which also a computer having SSD (Solid State Drive) inside it where data is stored.

it is possible that more then one web site are stored in one server then we can differentiate them by host header. sometimes it also happanes that entire data center is alloted one webite like google,fb.

every digital device in this world have unique IP address including your phone and server of google.

## IP → Internet Protocol 

IP address is like your post address from they companies located where they have send data. and from where.

your video is sended you in binary formate . and in small packets example 6 bits in each packet     all this packet will be sended to use they all might arive from different routes . according to most efficient path any perticular package at that time.

when a package i arived to router that it get reassemble. suppose any packet is lost they response is sended to server and again that part is sended.

for wesite first its load html , css , js , then your video…

so thats how you watch your video.
Hole in Highchart Stacked Chart
Published: 2022-10-02 07:44:12

## Sample problem

Let's imagine we want to create a stacked chart showing a state of a group of 30 robots. Some robots are working (live state), some are switched off (dead state). 
Let's have two series for both states:
* Live series: [[t1, 30], [t2, 0], [t3, 30]]
* Dead series: [[t2, 30]]

We want to catch on the graph the moment t2, when robots are in dead state. Let's see what we get on the graph:
![No data painted for red series?](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e8k278argloxxwe9ghxp.png)
We don't see any data for red "dead" series. When we hover over the chart we can find the point when all robots are in dead state, but it's not visible for us at the first glance.

[Link to live example](https://codesandbox.io/s/area-chart-with-hole-problem-5cov88?file=/src/index.js)

## Reason
Let's analyze our points on the following picture.
![Reason - the series has only one data point](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k3h8l6u4fdvlkr4w5nil.png)
By default, Highcharts don't show single data points. That's why the red "dead" series is not visible. 

## Solution 
If we have in one series more than one point, then it will be displayed. For example, we could add to red series the follwing points to get the desired shape:
* Dead series: [[t1, 0], [t2, 30], [t3, 0]]
Or - to distinguish points added by ourselves:
* Dead series: [[t1, Number.EPSILON], [t2, 30], [t3, Number.EPSILON]]

Number.EPSILON is used here, because it's a number near zero that would never ever be in our dataset, thus it would be easy to filter it out in tooltip if necessary (we add some data here only for visualization, so in some cases it's not good to show it to the user in a tooltip). 
![If a red series have more than one data point - area will be printed](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hl2p8d0ot444bacdhaw6.png)


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


[Link to live example](https://codesandbox.io/s/stacked-area-chart-with-hole-problem-fixed-qrde4h?file=/src/index.js:418-460)

Now we can see clearly when all 30 robots were not working.
Game changer JS framework?
Tags: programming, webdev, javascript
Published: 2022-10-02 07:43:03

Qwik - new JS framework works different in the era of JS frameworks. 

Still exploring but seems like the Founder of Qwik, ironically, who was the founder of Angular JS found the new way to make a comeback in the market.

Attaching the interesting read to understand why Qwik is different - [Hydration is pure overhead](https://www.builder.io/blog/hydration-is-pure-overhead)

My last story on [The Cost of Javascript](https://dev.to/shreyvijayvargiya/why-our-websites-are-slow-importance-of-bundle-size-1le4) where I cover the same issues about website performances. 

I put the focus on bundles and their sizes whereas the Qwik teams completely shift the focus on much bigger issues on the entire frameworks running website on SSR. I will cover a detail story soon. 

Stay tuned 
Keep developing
Shrey
[iHateReading](ihatereading.in)
How do I check/uncheck all checkboxes with a button In React Js using useRef() Hook ?
Tags: react, checkbox, useref, beginners
Published: 2022-10-02 07:38:17

**How do I check/unchecked all checkboxes with a button  In React Js using useRef() Hook ?**

In this Post, we will learn about how check/unchecked all checkboxes 
using useRef() React Hook.

**1>App.js**


```
import logo from './logo.svg';
import './App.css';

import { useRef } from 'react';

function App() {

    const ref = useRef([]);

    const checkboxvalue = (e) => {
        console.log(e.target.value)
    }

    const Unchecked = () => {

        console.log(ref.current.length)
        for (let i = 0; i < ref.current.length; i++) {

            ref.current[i].checked = false;
        }
      
    }
    const Checked = () => {

        console.log(ref.current.length)
        for (let i = 0; i < ref.current.length; i++) {

            ref.current[i].checked = true;
        }
      
    }

    return (
        <>
            <div style={{ width: '50%', backgroundColor: '#f7f4f3', marginLeft: '150px', marginTop: '100px', padding:'50px 0px 100px 50px' }}>
            <input ref={(element) => { ref.current[0] = element }} value='12' type='checkBox' onChange={checkboxvalue } /> <br />
            <input ref={(element) => { ref.current[1] = element }} value='123' type='checkBox'  onChange={checkboxvalue } /> <br />
            <input ref={(element) => { ref.current[2] = element }} value='1' type='checkBox'    onChange={ checkboxvalue } /> <br />
            <input ref={(element) => { ref.current[3] = element }} value='1234' type='checkBox' onChange={checkboxvalue } /> <br />

            <button style={{ padding: '5px', backgroundColor: 'green', border: 'none', margin:'5px 5px 5px 5px' }}onClick={Unchecked}>Unchecked</button>

            <button style={{ padding: '5px', backgroundColor: 'red', border: 'none', margin: '5px 5px 5px 5px' }} onClick={Checked}>Checked</button>
            </div> 
        </>
);
}

export default App;

```
Well done! You now have Done this using useRef() React  Hook !

Drop some love by liking or commenting ♥


**_Reference [w3schools](https://www.w3schools.com/react/default.asp)_**

**[Download Source Code from GitHub Repository](https://github.com/BIHARISOFT/EduBox/tree/master/checked_unchecked_checkbox)**
Cheat Sheet To All Bash Shortcuts You Should Know!!
Tags: bash, productivity, beginners, webdev
Published: 2022-10-02 07:00:59

The Linux Bash is commonly used by developers, though it may seem fairly difficult to navigate at first. The use of arrow keys to navigate between commands is obviously a hassle and often becomes a major challenge.

However, in general, Bash is quite easy to use. If you’re going to use it on a VPS, it’s important that you know about the different shortcuts that Bash has to offer. Here’s a full list of different Bash shortcuts that you can use, divided in separate categories. 

## Editing
The following list of shortcuts will allow you to easily edit commands. 

### Shortcut	Action

- CTRL + x, CTRL + e
	
Edit the current command in $EDITOR
- CTRL + _
	
Undo
- ALT + DEL
	
Delete word before the cursor
- ALT + d
	
Delete word after the cursor
- CTRL+ y
	
Paste the last item
- CTRL + d
	
Delete character below the cursor
- CTRL + h
	
Delete character before the cursor
- CTRL + w
	
Cut the word just before the cursor to clipboard
- CTRL + d
	
Cut the word after the cursor to clipboard
- CTRL + u

Cut the line before the cursor to clipboard
- CTRL + k
	
Cut the line after the cursor to clipboard

## Navigation

These are the shortcuts that you can use to navigate Bash.

### Shortcut	Action

- CTRL + e
	
Go to the end of the line
- CTRL + a
	
Go to the start of the line
- CTRL + x
	
Toggle between the current position of the cursor or to the start of the line
- CTRL + f
	
Move cursor forward by one character
- CTRL + b
	
Move cursor back by one character
- ALT + f
	
Move cursor forward by one word
- ALT + b
	
Move cursor back by one word

## History

You can use these shortcuts to check your history or bring up a history search.

### Shortcut	Action

- CTRL + g	

Exit history search
- CTRL + r	

Open history search
- CTRL + p	

See previous commands
- CTRL + n	

See the next commands in history

## Control 

These are commands that you can use to control processes in Bash.

### Shortcut	Action

- CTRL + l	

Clear your entire screen
- CTRL + z	

Suspend currently running processes and move them in the background
- CTRL + c	

Kill currently running processes
- CTRL + d	

Exit current shell
- Enter	

Exit a suspended SSH session

After Action Report – Use These Commands to Simplify Bash 
These are some of the many commands that you can use to simplify your use of Bash and move between commands more easily.

## Happy Coding!!!

**Thank You for reading till here. Meanwhile you can check out my other blog posts and visit my** [Github](https://github.com/devarshishimpi).
Dart Immutable Collections
Tags: flutter, dart, immutability
Published: 2022-10-02 06:58:22

[Link](https://link.medium.com/dhazVqi8Mtb)

Immutability is an important Dart concept. The immutable annotation marks a class as being immutable, but if the class has mutable properties, it is not really immutable. This is true in the case of collections. This article discusses why and how to use immutable collections on your Dart classes.
Unity gradele build eror
Tags: unity3d, csharp, android
Published: 2022-10-02 06:03:17

Hello i am facing eror in unity game engine when i build android apk it says gradle build eror 


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


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

Some body can help what is the solution for these eror
How to install older rubies using RVM on Ubuntu 22.04
Tags: ubuntu, rvm, ruby
Published: 2022-10-02 05:50:36

```bash
$ sudo apt install build-essential
$ cd ~/Downloads
$ wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz
$ tar zxvf openssl-1.1.1g.tar.gz
$ cd openssl-1.1.1g
$ ./config --prefix=$HOME/.openssl/openssl-1.1.1g --openssldir=$HOME/.openssl/openssl-1.1.1g
$ make
$ make test # you might get a few tests failing but just ignore
$ make install
$ rm -rf ~/.openssl/openssl-1.1.1g/certs
$ ln -s /etc/ssl/certs ~/.openssl/openssl-1.1.1g/certs
$ cd ~
# let us install older rubies now by using RVM. Hurray!
$ rvm install ruby-3.0.4 --with-openssl-dir=$HOME/.openssl/openssl-1.1.1g
```

Originally posted on - [https://blog.chetanmittaldev.com/how-to-install-older-rubies-on-ubuntu-2204-using-rvm](https://blog.chetanmittaldev.com/how-to-install-older-rubies-on-ubuntu-2204-using-rvm)
Python Polymorphism
Tags: python, programming, 100daysofcode, beginners
Published: 2022-10-02 05:43:20

Polymorphism is from the greek roots "poly" (many) and "morphe" (form). 

In the context of programming, Polymorphism means that a single type entity (method, operator, or object) can behave in multiple ways. 

## Polymorphism in additional operator.
For integer data types, `+` operator is used to perform arithmetic addition operation
```python
num1 = 1 
num2 = 2
print(num1+num2) # this program outputs '3'
```
For string data types, `+` operator is used to perform concatenation
```python
string1 = "Good"
string2 = "Morning"
print(string1+string2) # this prints 'Good Morning'
```
We can see that a single operator `+` has been used to carry out different operations from distinct data types. 

## Function Polymorphism
There are some functions in Python which are compatible to run multiple data types. 

One of Python's built-in functions is `len()`, it returns the length of an object

```python
string = "python"
print(len(string)) # this prints 6

list =[1,2,3,4]
print(len(list))# this prints 4
```
## Class and Method Polymorphism
```python
class Pig:
   def diet(self):
      print("Pigs are omnivors")

class Rabbit:
    def diet(self):
        print("Rabbits are herbivors")
        
obj_pig = Pig()
obj_rabbit = Rabbit()

obj_pig.diet() #Returns "Pigs are omnivors"
obj_rabbit.diet() #Returns "Rabbits are herbivors"

```
Here we created 2 classes. `Pig` and `Rabbit`. Although both classes use the same method name `diet`, they define those methods differently and wont interact. Objects instantiated from the class will use the method defined in that class.
Emails with Python using App Password
Tags: python, hacktoberfest, opensource, github
Published: 2022-10-02 05:30:22

## what is App password ?
Before Google's security update a feature known as "less secure apps" was used to send mails with python but due to security concerns Google disabled this feature and as a replacement to it Google introduced new feature i.e, App password with 2-FA security

## About this project
![example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0qc0o3xvixlfsea4d1qx.png)
[email bomber](https://github.com/coderatul/emailbomber) is an open source project, beginner open-source enthusiastics  participating in hacktoberfest can use this as the starting point of their open-source career.

features
- Open source & beginner friendly
- with detailed readme.md file 
- works 100% uses latest Google feature

STAR(⭐) this repo for further reference.