teleren/devto huggingface dataset:
The Best mouse For Programming👨‍💻 in 2022✨
Tags: webdev, programming, productivity, beginners
Published: 2022-07-05 09:08:19

Programmer, Gammers, and coders spend their whole day with computers. So they have comfortable things for use. A standard mouse is irritating to use for a long time. A mouse that puts your hand in an unprejudiced position is maybe the best way to reduce these problems you just have to find a vertical or trackball mouse. Here, I've listed the Best mouse for programming.


## **List of best mouse for programming /coding in India 2022**


1. Anker Wireless Ergonomic Optical Mouse
2. Logitech G402 Hyperion Fury Wired Gaming Mouse
3. Logitech MX Master 3 Wireless Mouse
4. Tecknet M003 2.4G Ergonomic Wireless Mouse
5. Microsoft Sculpt Ergo Mouse
6. Logitech Wireless M570 Trackball
7. Asus ROG Pugio Optical Wired Gaming Mouse


[visit this link to get all the details](https://cmsinstallation.blogspot.com/2021/05/7-best-mouse-for-developer-gaming-coding.html)
Best way to stay updated...
Published: 2022-07-05 09:24:19

Hi guys, how do you coup with being updated when for any reason you need to stop coding for a while?
since I started codig I have had to retire temporarily from computers many times, but everytime I return I find it dificult to catch up with everything evolving so fast.
I would like to read your tips and personal experiences regarding this. 
Thanks!
Kitty - a fast and sleek terminal emulator for Linux
Tags: programming, productivity, performance, linux
Published: 2022-07-05 08:55:39

If you are on a Linux system then there's a good chance that you will use the command line for a really long period. The Terminal (or the command line) is a huge part of the Linux experience (especially for developers). So it's important that your Linux terminal is convenient, customizable and fast.

The default terminal on various Linux distros are very neat but there are a lot of features that can make them more functional and effective. You can use terminal emulators for this purpose. Emulators basically provide additional functionalities on top of your classic terminal.

After spending a lot of time searching on the internet for quality terminal emulators, I came across **Kitty**. And oh boy, is it a hell of a terminal!

--------

## Why use Kitty?

Kitty (developed by [Kovid Goyal](https://github.com/kovidgoyal)) has got all the features that I really wanted when I was looking for emulators on the internet so I instantly fell in love with it. Here are some of them:

### Highly customizable:
Kitty has a configuration file `kitty.conf` which you can edit and it's very easy to adjust various parameters like fonts, keyboard shortcuts, scrolling, tab preferences, colors, etc according to your needs. 

It is highly customizable and you can look up all the details about it in the documentation: https://sw.kovidgoyal.net/kitty/conf/

### Tabs:
This is a very basic feature but a very big number of emulators don't support it. Kitty has shortcuts for creating tabs. You can also create a sub-tab which basically splits the terminal in half giving you two tabs one above the other. There are many layout options that you can choose from.

### It's fast and scriptable
It uses the GPU for fast rendering so the terminal runs very smoothly. It also uses threaded rendering for low latency.

Kitty has a framework for easily creating terminal programs called [kittens](https://sw.kovidgoyal.net/kitty/kittens_intro/) which is very handy. You can also control the terminal using scripts.

### Themes:
You can customize the colors of the terminal easily by creating your own theme and editing it in the `kitty.conf` file.

If your want to use an existing theme then just run: `kitty +kitten themes` in the terminal. This will open an interactive program through which you can select a theme that you like. I personally like the [Cyberpunk-Neon theme](https://github.com/Roboron3042/Cyberpunk-Neon/tree/master/terminal/kitty).

--------

Website of Kitty emulator: https://sw.kovidgoyal.net/kitty/

You can install Kitty from here: https://sw.kovidgoyal.net/kitty/quickstart/

Github page: https://github.com/kovidgoyal/kitty
if-else ,ternary Operator,switch statements in JavaScript
Tags: webdev, javascript, beginners, programming
Published: 2022-07-05 08:49:59

**if-else**

let age=16;

if(age===16)
{
    console.log("your age is  16");
}
else if(age<16)
{
    console.log("age is less than 16");
}
else if(age ==20)
{
    console.log("you are no longer a teen ager");
}
else
{
console.log("age is more than 16");
}

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

**Ternary Operator** 
console.log((age==16?"my age is 16":"my age is not 16"));

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

**switch** 
switch(age)
{
    case 16:
        {
            console.log("you are 16");
            break;
        }
    case 18:
        {
            console.log("you are 18");
            break;
        }
        case 20:
            {
                console.log("you are 20");
                break;
            }
        default:
            {
                console.log("you are not 16,18,20 , bhad mei jao");
                break;
            }
}
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pamh6hfijp6yo0953az5.png)
Arrays and Objects
Tags: webdev, javascript, beginners, programming
Published: 2022-07-05 08:44:02

**Arrays** 
let marks =[10,20,30,40,50,90];
const fruits =["orange","apple","banana","grapes"];

const mixed =[3,5,[6,"pushan"]];
const arr4 =new Array(23,144,"verma");  //new method to initialize array , just like java 

console.log(arr4);
console.log(marks);

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


**length of array** 

console.log(marks.length);
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hoymfcbkq02y7kyncwcs.png)
 

//changing value of array 
marks[1]=200000;
console.log(marks);
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1wfmhvdto8fi9xg2w9aa.png)
 
**indexof** 
console.log(marks.indexOf(30)); // present so gives index of array 
console.log(marks.indexOf(1000000000000));  // not present in array so gives -1
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gcawluvdfm2brk8l0ke8.png)
 
 
**Methods in Arrays** 


**push -add to last** 
marks.push(70);
console.log(marks);

 
**unshift -add to first** 
marks.unshift(100);
console.log(marks);

 

**pop - removes element from last of arra**y
marks.pop();
console.log(marks);

 
**shift-it will remove elements from begin**
marks.shift();
console.log(marks);

**splice - it removes the elements from given indexes**
marks.splice(1,3);
console.log(marks);


**reverse - it reverse the array **
marks.reverse();
console.log(marks);


**concat-concat the array with another array** 
marks2=[100,200,300,400,500];
marks=marks.concat(marks2);
console.log(marks);

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

      **All the properties are changing the whole array**
Customize Nano Text Editor
Tags: linux, programming, trick, terminal
Published: 2022-07-05 08:42:27


Nano is a great text editor that is available in every linux distros by default. Here's a few configs that would make your experience with nano even better!

To use the features listed below, you need to edit the `.nanorc` file in your home directory.
You can open the terminal and write `nano .nanorc` to access the configurations file.

## Position Cursor With Mouse Click
Mouse clicks can be used to place the cursor, set the mark (with a double click), and execute shortcuts. Text can still be selected through dragging by holding down the Shift key.

```bash
set mouse
```

## Set the Tab Size
Set the size (width) of a tab to number columns. The value of number must be greater than 0. The default value is 8.

```bash
set tabsize 2
```

**Replace Tabs With Spaces**

```bash
set tabstospaces
```

## Keep Track of Cursor Location for Recently Closed Files
For the 200 most recent files, log the last position of the cursor, and place it at that position again upon reopening such a file.

```bash
set positionlog
```

## Wrap Lines
Display over multiple screen rows line that exceed the screen's width. (You can make this soft-wrapping occur at whitespace instead of rudely at the screen's edge, by using `atblanks`.

```bash
set softwrap
set atblanks
```

## Auto Indentation
Automatically indent a newly created line to the same number of tabs and/or spaces as the previous line.

```bash
set autoindent
```

## Display Line Numbers
Display line numbers to the left of the text area.

```bash
set linenumbers
```

## Display Scrollbars
Display a "scrollbar" on the righthand side of the edit window.  It shows the position of the viewport.

```bash
set indicator
```
Leetcode Solutions: Longest Consecutive Sequence
Tags: programming, python, leetcode
Published: 2022-07-05 08:40:13

Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence.

You must write an algorithm that runs in O(n) time.


```py
class Solution(object):
    def longestConsecutive(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        
        nums, res, t = list(set(nums)), 0, 0
        heapq.heapify(nums)
		
        while nums:
            pop_val = heapq.heappop(nums)
            t += 1
            if nums == [] or nums[0] != pop_val + 1:
                res = max(t, res)
                t = 0
        return res
        
        
        

```
Common architectural principles
Tags: android, programming, productivity, computerscience
Published: 2022-07-05 08:36:00

**[Android] [AndroidDevelopment]**

## **1) Separation of concerns:**
A common mistake is to write all your code in an Activity or a Fragment.These UI-based classes should only contain logic that handles UI and operating system interactions.

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

You don’t own implementations of Activity and Fragment.
The OS can destroy them at any time based on user interactions or because of system conditions like low memory. It’s best to minimize your dependency on them.

## **2) Drive UI from data models:**
Data models represent the data of an app. They are independent of the UI elements and other components in your app. This means that they are not tied to the UI and app component lifecycle.

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

Persistent models are ideal for the following reasons:

- Your users don’t lose data if the Android OS destroys your app to free up resources.

- Your app continues to work in cases when a network connection is flaky or not available.

If you base your app architecture on data model classes, you make your app more testable and robust.
Strings in JavaScript and their Important Methods
Tags: webdev, javascript, beginners, programming
Published: 2022-07-05 08:20:46

**Strings**

**Standard Approach**
 let topic ="verma this is my name -> vermaji "; 

 console.log(topic);

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

**Concatination**

let adname ="aditi verma "
 topic =topic.concat("Pushan Verma ","chetna verma ",adname,"chandresh verma");
 console.log(topic);
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bpg9ejg1r2eu2b300ecp.png)
 

**character At method type in java **
 console.log(topic[0]);  // method to display the character present inside the string in js 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9ghcf9z0zs77an59blg0.png)
 

**indexOf,LastIndexOf,substring,slice,split,replace** 
console.log(topic);
 console.log(topic.indexOf('verma'));  // it will give the index of first character if it founds , otherwise it gives -1
 console.log(topic.lastIndexOf('verma'));
 console.log(topic.indexOf('Pushan'));
 console.log(topic.substring(1,6));
 console.log(topic.slice(-4)); // slice can give from back also , but substring cannot , if i write substring(-4 it will return the whole string )
console.log(topic.split(" "));
console.log(topic.replace("verma","rajput"));  // it only changes the first occurence not all the occurences

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h7yu4dy68tsc9varzp19.png)
 
**Template Literals(Displaying js in HTml )**
 let fruit1="Banana";
 let fruit2="Mango";

 let content1=`My favourite fruit is  ${fruit1} and  ${fruit2}`;

 document.body.innerHTML=content1;
Today's Fun Joke For Developers - Daily Developer Jokes
Tags: jokes, dailydeveloperjokes, watercooler
Published: 2022-07-05 08:00:04

---
title: "Today's Fun Joke For Developers - Daily Developer Jokes"
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, #watercooler
---

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/5e125969479bf.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:___ What did XHR say to AJAX when it thought it was being a Mean Girl?

___A:___ Stop trying to make fetch happen!
 -->
Donut bugs
Tags: html, javascript
Published: 2022-09-23 07:47:49

---
title: Donut bugs
published: true
date: 2022-07-05 07:31:00 UTC
tags: HTML,JavaScript
canonical_url: https://drmsite.blogspot.com/2022/07/donut-bugs.html
---

![Cheese Cake!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6vfhw61t47a3kl0xq02p.jpg)

(Cover image by [Ivan Naunov](https://scop.io/collections/vendors?q=Ivan%20Naunov))

I [noted before that my Donut Component](https://community.webcomponents.dev/annoyingmouse/doughnut-donut-chart-web-component-39k3) - check the comments - has a bug in it when it comes to drawing segments with a value over 50% of the total - such a pain!

~~I was hoping to avoid using SVGs for this component, but I think that is what I'll have to do - not such a bad thing, TBH, but still annoying!~~

[I've fixed it now](https://community.webcomponents.dev/annoyingmouse/fixing-the-donut-1fc1) ([npm](https://www.npmjs.com/package/wc-pie-chart))!
Introduction to syntax of Arrays and Objects
Tags: webdev, javascript, beginners, programming
Published: 2022-07-05 07:24:25

**Arrays declaration and Intialization **

let arr =[1,2,3,4,"pushan","chandresh","aditi","chetna"];

console.log(arr);

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

**Objects declaration and Initialization**


let myObj1={
    name2:"Verma",
    arr:["aditi","chetna","chandresh","pushan"],
    exercise:true,
    galatkaam:null
}
let myObj ={
    name1:"pushan",
    arr:[1,2,3,4,5],
    sach:true,
    myObj1
}

console.log(myObj);

ans ->![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ccdpriom9vl8kq0ouec9.png)
Data Types in JavaScript
Tags: webdev, javascript, beginners, programming
Published: 2022-07-05 07:18:33

We have two types of data types in JavaScript . One is _Primitive_ and other one is _Non -Primitive_ data types



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

**In Primitive Data Types , we have :**
1) Number (Unlike java , we dont have int,float,double,BigInteger we only have number )

2) Boolean(return True or false)

3)String 

4) undefined (when a variable is defined and not assigned a value 
 then it gives value as undefined)

5)null (absence of any value)

6)bigInt - used to store very large numbers

7) Symbol - Symbols are often used to add unique property keys to an object that won't collide with keys any other code might add to the object, and which are hidden from any mechanisms other code will typically use to access the object. That enables a form of weak encapsulation, or a weak form of information hiding




**Non -Primitive Data Types, we have :**
1)Array (collection of data of same data type, it is just like java)

2) Object (collection of several data types under a single heading called as Object)

3)Function (when some lines are to be executed several times , functions are used.)


**TypeOf:**
//typeof (number ,string , null,boolean , undefined)
console.log("data type is ->"+typeof name );
console.log("data type is ->"+typeof number );
console.log("data type is ->"+typeof sachkasamna );
console.log("data type is ->"+typeof nullval );
console.log("data type is ->"+typeof unde );

ans ->
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sclt28uzljxk8avi2do6.png)
Learn and Earn
Published: 2022-07-05 07:12:23

Hello! I'm Spencer from Tribe and we have launched StackUp.

StackUp is where developers get to level up, connect and engage with
other FAANG devs wor ldwide – al l whi le being rewarded for thei r time. Through this Learn-and-earn platform, complete learning ‘quests’ and
get ski l led in the hottest technologies used by Web2 and Web3
companies, and earn while doing so.


If you would like to join our open be ta, you can drop us a message or a PM on Twitter @SharapovaPo
WordPress Plugin
Tags: wordpress, plugin, php, beginners
Published: 2022-07-05 07:00:07

If we search WordPress plugin in google, we find that there are lots of free plugins available in the market. You can even create your own custom WordPress plugins. In this blog I will show you how to create a simple WordPress plugin, and how to begin your WordPress plugin development journey.

**Why do we require to create our own plugins?**
Creating your own instruments and effects is surely the best way to get a completely custom sound. WordPress plugins allow you to add custom features and offer a powerful way to add unique functionality to your website.

**What is a WordPress Plugin?**
WordPress plugins are like apps for your WordPress website. Just like apps on your phone, you can install plugins in WordPress to add new features.

**Simple steps to create WordPress plugin**
Before starting the development of a plugin, you should have the WordPress setup on your local environment or access to your site via FTP. Here I have created the plugin which will execute at the page load to display message. You can install WordPress on your local system using [this link](https://localwp.com/)

1. Navigate to the WordPress plugins folder. It is almost always located at /wp-content/plugins
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/logu1h30p1sg2metfnyk.png)

2. Create a new folder for your plugin with name my-first-plugin
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s9npaaws1h38h03zofgy.png)

3. Create the main PHP file for your plugin.
  ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tebrgfp9x58w2cvsd00p.png)
 
4. Setup your plugin's information
   You will need to open that PHP file with your editor.
    ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ckwwwk2tok3nd0xhlvj6.png)

5. Program Your Plugin to add functions 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ijfs7wj24ack9ok6f91u.PNG)
This code hooks into “the_content” action that fires when WordPress renders the post content for your site. When that action fires, WordPress will call our “my_content_text” function that is defined below the “add_action” call.

6. Activate Plugin: Click on activate plugin
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p6blb09ew7ersu4cn0mw.png) 
 
7. Browse WordPress site
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mco898393k5g3qj3qg2i.png)

For more details you can visit [this link](https://developer.wordpress.org/plugins/)

**Final Thoughts on WordPress Plugin Development**
There are tons and tons of things you can do with plugins and almost as many ways you can create them. In this tutorial on WordPress plugin development, we explored how you can create a simple plugin from scratch.
How to install, update and delete github cli in ubuntu / debian
Tags: github, cli, ubuntu, linux
Published: 2022-07-05 07:00:00

## How to install github cli
1. `curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg`
2. `sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg`
3. `echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null`
4. `sudo apt update`
5. `sudo apt install gh`

## How to update github cli
1. `First of download lastest github cli from` [lastest github cli relases](https://github.com/cli/cli/releases/)
2. `sudo apt install ./gh_linux_amd64.deb`

## How to remove github cli
1 `sudo apt remove gh`
Moving to Sourcehut
Tags: opensource, proprietary, ai, git
Published: 2022-07-05 06:55:25

Following the reports about GitHub using open source code to train its copilot AI code writing assistant, I am moving my puny code bases from both gitlab and GitHub and moving to [Sourcehut](https://sourcehut.org/).

The fact that Sourcehut supports mercurial is a benefit for me. I am paying for the service.

What do other Devs think think about GitHub and their treatment of open source?
Increase your productivity ⏱️ by using the `.new` links!
Tags: webdev, javascript, productivity, react
Published: 2022-07-05 06:49:55

### Do you know that you can open a new pen in CodePen just by going to [*pen.new*](https://pen.new)?

Or open a new React development environment by going to [*react.new*](https://react.new) !!

---

All thanks to the `.new` domains! These `.new` domains can be so helpful to increase your *productivity*!

There are tons of `.new` domains out there to help you out and make you more productive.

#### A few of them:
- `js.new` for new JavaScript environment
- `react.new` for new React environment
- `pen.new` for new CodePen pen
- `nodejs.new` for new Nodejs project
- `html.new` for new HTML project
- tons of more!

You can check out [this](https://whats.new/shortcuts/) page on Google Registry to find all of them.