teleren/devto huggingface dataset:
👀 var, let, const in javascript . just 30sec
Published: 2022-09-25 19:51:29

| | redeclare | reassign | scope | initialize
| --------- |:---------:| -------:| -------:| -------:|
| **let** | ⛔ | ✅ | 🗳 block | ⛔ |
| **const** | ⛔ | ⛔ | 🗳 block | ⛔ |
| **var** | ✅ | ✅ | function | "undefined" |

### 💎 const
the word `const` comes from constant, so it shouldn't change at all.
- redeclare  -> NO❗
- reassign   -> NO❗
- scope      -> block! We protect const in block !!
- initialize -> of course NO❗

### 💎 let 
`let` is actually almost `const` except one thing
- reassign -> OK ✅

## 💎 var
`var` is so much freedom man, it's not recommended now

---

▼ and difference of **hoisting**, I've wrote about it in other article
{% link https://dev.to/kaziusan/hoisting-and-var-let-const-1b6m %}
Operators...
Published: 2022-09-25 19:46:45

 

1. Operatorlar nima?  

2. Biz yozgan kodimizga nima uchun kerak? 

3. Nima vazifalarni bajara oladi? 
 
  
    

- Operatorlar bizga C++ dasturlash tilida yoki boshqa bir ixtiyoriy dasturlash tilida ham matematik amallarni amalga oshirganimizda ishlatimiz mumkin.
  Operatorlarga bazi misollarni keltirib o'tsam, "+" , "-", "*" ,
"/" , "%"  kabi amallar asosiy operatorlar turlari sanaladi.
  Quyidagi sanab o'tilgan operatorlarning har biri bilan yaxshiroq tanishtiradigan bo'lsak:

-  "+" , "-", "*" operatorlari bizga ma'lum bo'lgan vazifalarni bajarishadi.

- "/" operatori siz bilgan berilgan ikkita qiymatni birini ikkinchisiga bo'lish uchun ishlatiladi degan fikr qisman to'g'ri lekin faqat bu emas."/" operatorini nima vazifa bajarishi va C++ da qanday ishlashini  masalalar orqali ko'rib o'tamiz.

```cpp
#include <iostream>
#include <cmath>
using namespace std;

int main(){

int a,b;
float c,d;
cin>>a>>b;
cout<<"Natija1:"<<a/b<<endl;
cin>>c>>d;
cout<<"Natija2:"<<c/d;

return 0;
}

Console:
a=5
b=2
Natija1: a/b=2

c=5.5
d=2.2
Natija2: c/d=2.5
```
Yuqoridagi masalada Natija1 xato ishladimi? yoki aslida shunaqa ishlaydimi? 
 
 **`integer`** - butun, float

 **`double`** = aralash kasr son.

 
`integer`/`integer` = `integer`
 `integer`/`float`,`double` = `float`,`double`
 `float`,`double`/`integer `= `float`,`double`
 `float`,`double`/`float`,`double` = `float`,`double`

Yuqorida "/" operatorini vazifasi unga nisbatan ishlatilayotgan o'zgaruvchilatning tipiga bog'liq ekanligini bilishimiz mumkin.

- "%" - operatori nomi qoldiqli bo'lish operatori deb ataladi.
Aytishimiz mumkin-ki ushbu operator faqat integer tipidagi o'zgaruvchilari uchun ishlaydi.

 **Masalan:**

```cpp

#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main() {

int a,b,c;
cin>>a;
cin>>b;
cin>>c;
cout<<a%b<<endl;
cout<<b%c<<endl;
cout<<a%c<<endl;
/* Ushbu dastur bir sonni ikkinchi 
songa bo'lganda qolgan qoldiqni topish
 uchun zarur bo'lgan koddir.
   79 sonini 12ga bo'ladigan bo'lsak
 butun qismi 6 ga qoldiq qismi esa 7
 ga teng bo'ladi ushbu kod esa aynan
 7 soni yani qoldiq qismini consolega
 chiqarish amalini bajarib beradi. */

  return 0;
  }

Console:

a = 125
b = 30
c = 7
a % b = 5
b % c = 2
a % c = 6

```

 Yuqorida qisqacha operatorning bazi turlari haqida ma'lumot berishga harakat qildim. Operatorlarning boshqa turlari haqida yana boshqa maqolada tanishtirib o'tishga harakat qilaman.

[Telegram](https://t.me/meyliyev_blog)

[GitHub](https://github.com/JamolMeyliyev)
How fast is your site?
Tags: beginners, webperf
Published: 2022-09-25 18:16:20

Web performance and Core Web Vitals is both fun and rewarding to work on.

Share your Lighthouse scores below.

I will start:

[Todmorden Digital](https://todmordendigital.co.uk/) usually scores 100 for both mobile and desktop using [PageSpeed Insights](https://pagespeed.web.dev/report?url=https%3A%2F%2Ftodmordendigital.co.uk%2F).

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

Some web perf strategies I employed to get the site to load quickly:

1. Light-weight theme and minimal CSS/JS
2. Litespeed server + LiteSpeed for WordPress Cache plugin
3. HTTP/3 powered CDN and site
4. SVG inline favicon/site icon
5. Minimal number of WordPress plugins

Do you have a Core Web Vitals question? Feel free to ask below.
Day-14 of Machine Learning
Tags: beginners, machinelearning, tutorial
Published: 2022-09-25 17:59:58

Day-14 of Machine Learning:
- Learnt about **Underfit**, **Generalization** and **Overfit**.
and how to address overfit:
     1. Collect more data / training sets.
     2. Feature selection.
     3. Regularization.

- Learnt how to apply **regularization** on **linear regression** and **Logistic Regression** and to **penalise or shrink features** that will help to build a simpler model.
This week
Tags: creativity, beginners, productivity
Published: 2022-09-25 17:42:30

I'm facing my own "demons" a bit this week -- things that I've struggled with for years

- BLANK PAGE EFFECT - WHERE TO START, WHAT TO WRITE, HOW TO MAKE IT LOOK (EVEN MILDLY) ATTRACTIVE: 

In our web dev bootcamp, we have an assignment to make a portfolio page.  It seems they're important for showcasing skills and future employability.  Sure, go ahead an raise the bar of expectation on me!!  :).  

I'm finding it difficult to decide how to layout and decorate a page.  I have the basic HTML structure and content.  Not a real problem there - html, head, body, header, nav links, bio, projects links, etc.  I've even met most of the basic requirements for the site.

But, I want the site to look good (if possible).  Seeing the "inspiration portfolios" of experienced web devs is cool, but intimidating at the same time.

I'll do my best.  I'll probably score a passing grade on the assignment.  But, there's a component of pride/ego (I want it to look good, and want others to like it) and I'm stuck between that and a bit of "writer's block", not knowing really how "best" to proceed.

The only thing I can really think of is: iterate, iterate, iterate.
Sqlite Lock
Tags: java, algorithms
Published: 2022-09-25 17:33:34

How To avoid sqlite database lock ?
- keep singleInstance for DatabaseHelper
if you decieded to use multiple thread in your application
-make this instance is synchronized to avoid race condition

because use multiple instance for database causes database lock because
you may try two write  multiple time at same time this also happens when use multiple thread without synchronized


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7u7eagwqykjvm0b8m78o.png)
Go Scrape Json and get value response
Published: 2022-09-25 17:26:35

Im trying to create a app that scrapes given urls to a function and returns the key/value but i dont get that data here is my code

package main

import (
	"encoding/json"
	"fmt"
	"net/http"
)

// Which sites to scrape for health
// Get request

type response struct {
	Name  string `json:"key"`
	Value string `json:"value"`
}

func getData(x string) string {
	var data response

	resp, err := http.Get(x)
	if err != nil {
		fmt.Print(err)
		return x
	}
	defer resp.Body.Close()
	err = json.NewDecoder(resp.Body).Decode(&data)
	if err != nil {
		fmt.Print(x, data.Value, err)
		return x
	}

	return x
}
func main() {

	x := "http://127.0.0.1:8080/health"
	result := getData(x)
	fmt.Printf(result)
}
Day 0 - JavaScript - Statements, Expressions
Tags: javascript, beginners, programming, tutorial
Published: 2022-09-25 16:54:28

## In the beginning there was code 

A series of instructions that can be tell a computer to do stuff is code. I am all against text-book definitions. The ability to build stuff out of thin air is perhaps a superpower and programming/coding enables us to do just that. 

### Statements 

A statement is a line of code that tells computer to do a specific task. 

In JavaScript, you might encounter such statements. 

`x = y + 5;`

The above is a statement in JavaScript. Let's distill it down to the very basics. 

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

Now we can see that we have used letters, x and y. These are variables. Think of variables like buckets where you can store a value (Same as the ones we use in algebra). 

The number 5 is quite literally 5. Its called a literal value ( No pun intended.) The = and + symbols are operators. + is used for addition and = is the assignment operator.
The statement simply adds the value 5 to whatever the value of y is and assigns it to x. 

### Expressions 

A group of expressions make a statement. 

`a = b * 2;`

Here there are 4 expressions here, 
1. 2 is the literal value expression. 
2. b  is the variable expression. 
3. b * 2 is the arithmetic expression.
4. a = b * 2 is the assignment expression.

Please note that b * 2 is also an expression and can independently be a statement at the same time. 

_There is also something called a call expression which we will encounter in further posts._

### Is JavaScript Compiled or Interpreted?(IMP!)

This is a common interview question and one that is widely misunderstood. You'll see that many blogs and videos on the internet talk about JS being an interpreted language. Before we look into that let's talk about interpreters and compliers, just to  give some context for budding programmers. 

As seen above `x = y + 5` is easily understood by a human. But underneath the hood the computer translates the code to what it can understand. Some computer languages run the code top to bottom, line by line - this is called 'Interpreting' the code. 

There are other computer languages where the translation is done ahead of time. Hence, when the program runs, it actually runs the compiled code. 

JavaScript in reality uses a compiler, which goes against the popular notion that it is an interpreted languages. It compiles code and immediately runs the compiled code. 

### Starting coding with a basic statement 

Type the below code in the console (Or use jsfiddle): 

```
a = 5;
b = a * 4; 
console.log(b);
```
1. Assign the literal value 5 to the variable a.
2. Now multiply the literal value 4 to whatever the value of variable a is (in this instance, 5) and assign the product to the variable b.
3. Print the value of b. (We will be discussing console.log() later)

You will get an output 20.
Gumstore - Responsive Gumroad Store Template
Tags: tailwindcss, htmltemplate, gumroadstore
Published: 2022-09-25 16:38:26

---
title: Gumstore - Responsive Gumroad Store Template
published: true
description: Gumstore is a responsive Gumroad store template built with Tailwind CSS. It consists of 2 static responsive template.
tags: #tailwindCSS #HTMLTemplate #GumroadStore
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yndurw34rmn0iuflbh4z.png
# Use a ratio of 100:42 for best results.
---

**Gumstore** is a responsive Gumroad store template built with Tailwind CSS. It consists of 2 static responsive template.

**Gumint** - Product card with modal option to buy Gumroad product without leaving the web page.

**Gummie** - Simple product card page CTA link which redirect to Gumroad page.

##Template Features:

- Build with Tailwind CSS v3.1.8
- Light and dark mode
- Fully Responsive and easy to customize
- Compatible with all modern browsers
- W3C Validated Code
- Clean code with comments
- Product card with Alpine JS Modal
- Detailed documentation 

Download the [Gumroad store template](https://vigowebs.gumroad.com/l/gumstore) for **free** now
MagnoliaJS (Virtual)
Published: 2022-09-25 16:11:26

MagnoliaJs conference was held in Jackson, Mississippi last week. I attended virtually. They streamed the talks and had a discord. There were two days of great talks and it was cool to see people at an event even if I couldn't go.


The talk that stood out the most was @bekahhw 's Community building talk. She is co-organizer of Virtual Coffee and along with the VC leaders had done an amazing job building a great online community.

Place to explore community are Twitter spaces, Meetup, newsletters, live streams and community challenges.

 Bekah touched on why people want to join a community. The reasons include:


* Support
* Friendship
- Opportunity for growth and learning
* Enthusiasm
* Collaboration
* Sense of belonging.

She explained the importance and impact of communities.

This was a great talk you should look to see if she's presenting near you. 
MagnoliaJs was great this year, they'll be back next year so follow them and look for announcements. [twitter](https://twitter.com/MagnoliaJSconf)
Krumzi - A platform where you can passively receive job opportunities from recruiters
Tags: job, hiring, career
Published: 2022-09-25 16:06:56

I am proud to announce that [Krumzi](https://www.krumzi.com) has been launched in the open beta testing program! 🚀

Krumzi is a recruitment platform where, as a **job seeker**, you can receive job opportunities directly from the recruiters based on your skills, track your job applications, download your resume in a PDF format and more.

As for the **recruiters**, it is a complete platform, providing everything they need in order to find and manage talents for their job openings, such as calendar, jobs pipeline, chat, professional dashboard, companies administration, talent search and many more.

Any recruiter that wishes to join this program can sign up until the end of the month.

After that, every early believer will receive a free lifetime offer, which gives access to all the features of the application.

**Useful links**:

Krumzi Website - https://www.krumzi.com/
Jobs - https://www.krumzi.com/product/jobs
Feedback - https://feedback.krumzi.com/
Twitter - https://twitter.com/krumzi_official

Let me know what you think!
switch case of if, if else and else as default
Published: 2022-09-25 15:57:48

```
_**//switch case of if, if else and else as default **_
function Major(Engineering){
    switch(Engineering){
        case 'Software Engineering':
            return 'Its a course of heroes, You can be proud of!' 
        case 'Cevil Engineering' :
            return 'Oops! that deals with construction!'
        default : 
            return `Which type of ${Engineering}?`
    }
}
```
The use of if else statement in JavaScript
Published: 2022-09-25 15:29:08

```
function Major(Engineering){
    if(Engineering === 'Software Engineering'){
        return'Its a course of heroes, You can be proud of!';
        }
    else if(typeof Engineering === String){
        return `Which type of ${Engineering}?`
        }
    else
        {
            return'please parse in the type of Engineering for this case';
        }
}
```
Checkbox group styled as tiles fork
Tags: codepen
Published: 2022-09-25 15:11:28


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i9gihbsy9h94o2psl0n8.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ioi5uhyfm7gji57gr4kc.png)<p>A demonstration of how to create checkboxes that doesn't necessarily looks like... well, checkboxes. </p>

<p>Icons by <a href="https://phosphoricons.com/" target="_blank">https://phosphoricons.com/</a> </p>

{% codepen https://codepen.io/shashamura/pen/MWGOozo %}
MY JOURNEY INTO TECH
Published: 2022-09-25 15:06:08

On a particular day while researching on the internet I came across a video game named San Andress. I loved this game so much that I played it often. I decided to check on the internet how the game was made, while researching I came across Software products. I was confused because I don't know anything about software. I went further to check, then I finally knew what it was. 
I was so excited to know more, this made me decide to explore software engineering. I came across an Online School that teaches software. I registered for admission, but I failed. I was not happy, but I tried my best. One day my brother introduced me to CodeLab, an innovation hub which had a software engineering training program that would help me become a software engineer. He wasn’t aware of my interest in software development. He shared the opportunity to get me gainfully engaged. I decided to apply, and I was selected into the program, was so happy. My cousin said it would be nice going into coding. Finally, In July I started my journey. I was taught coding, markup languages, JavaScript and more. I am glad I found the opportunity and took the step into tech.
Newbie in the fire
Tags: webdev, html, aws, wordpress
Published: 2022-09-25 15:02:31

First post and it’s gonna be great!!
I’ve been on this coding, problem solving journey for a while now. Started at a full stack boot camp, went off course, then quit my former career and went full throttle on learning technology, computer programming, cloud infrastructure, creating and breaking websites. Taking tons of courses and learning by throwing myself in the fire.
Bit Testing Functions in C
Tags: c, cpp
Published: 2022-09-25 14:41:09

---
title: Bit Testing Functions in C
published: true
description: One-liner functions that test bits and bit sets.
tags: #c #cpp
---

## Introduction

There are many sites giving lots of [bit twiddling](https://en.wikipedia.org/wiki/Bit_manipulation#Terminology) expressions or functions in C, but none that I’ve found that give a concise set of _bit testing_ functions, so here is a set I’ve written.  (These are used as [part](https://github.com/paul-j-lucas/cdecl/blob/master/src/util.h) of [**cdecl**](https://github.com/paul-j-lucas/cdecl/).)

## The Functions

### Does _n_ have either 0 or exactly 1 bits set?

```c
bool is_01_bit( uint64_t n ) {
  return (n & (n - 1)) == 0;
}
```

### Does _n_ have exactly 1 bit set?

```c
bool is_1_bit( uint64_t n ) {
  return n != 0 && is_01_bit( n );
}
```

### Does _n_ have exactly 1 bit set that is among the bits set in _set_?

```c
bool is_1_bit_in_set( uint64_t n, uint64_t set ) {
  return is_1_bit( n & set );
}
```
Note: There may be other bits set in _n_ that are **not** in _set_.  This function tests only whether exactly 1 of them is in _set_.

### Does _n_ have exactly 1 bit set that is only among the bits set in _set_?

```c
bool is_1_bit_only_in_set( uint64_t n, uint64_t set ) {
  return is_1_bit( n ) && is_1_bit_in_set( n, set );
}
```

### Does _n_ have either 0 or exactly 1 bit set that is only among the bits set in _set_?

```c
bool is_01_bit_only_in_set( uint64_t n, uint64_t set ) {
  return n == 0 || is_1_bit_only_in_set( n, set );
}
```

### Does _n_ have 0 or more bits set that are only among the bits set in _set_?

```c
bool is_0n_bit_only_in_set( uint64_t n, uint64_t set ) {
  return (n & set) == n;
}
```

### Does _n_ have 1 or more bits set only among the bits set in _set_?

```c
bool is_1n_bit_only_in_set( uint64_t n, uint64_t set ) {
  return n != 0 && is_0n_bit_only_in_set( n, set );
}
```
How to deactivate your Slack account on a Workspace
Tags: slack
Published: 2022-09-25 14:37:39

---
title: How to deactivate your Slack account on a Workspace
published: true
description: 3 simple steps to deactivate your Slack account on any workspace
tags: slack
cover_image: https://www.howtogeek.com/wp-content/uploads/2019/06/slack_logo.png?width=1198&trim=1,1&bg-color=000&pad=1,1
# Use a ratio of 100:42 for best results.
---

I was trying to deactivate my old Slack accounts on different workspaces and I was kind of confused about how I should go about doing that. Since I was not able to figure it about going through the Slack docs, I thought that I would write a mini blog post with steps to go about deactivating your account.

Steps:

1. Click on the icon at the top right corner and select 
**Profile**
![Profile](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yuiewrnsfrocjokyu9zv.png)
2. Click on the button with three vertical dots and choose **Account Settings** from the dropdown menu
![Account Settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ji7xqakw0byxzahw7pt9.png)
3. Click on the **Deactivate your account** button after scrolling down the page, all the way to the bottom.
![Deactivate your account](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/scrjv4tn8ga65ul0j3gd.png)
dopollit: create new polls, share, get responses
Tags: javascript, nextjs, mongodb, webdev
Published: 2022-09-25 14:28:24

Launched a new product called dopollit

https://dopollit.vercel.app

On how to use watch the below video
https://youtu.be/RI0MtoXjVos

The producthunt post https://www.producthunt.com/posts/dopollit
Add custom fonts (Google Fonts) to React native(>= 0.70)
Published: 2022-09-25 14:24:00

Here, we will know how to add custom fonts to our react native app.
- Go to Google Fonts website and select the font family (e.g: Montserrat)
- For a particular family, we can select multiple styles (e.g: Montserrat-Regular, Montserrat-Bold).After selecting, we click the "Download family" to download the font in a zip.

![select-styles](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o2da7ce1evkv597ik1v0.png)
- We extract the zip file and inside the `static` folder, we will get a list of styles with extensions .ttf . We copy the required fonts and create a folder in our react native project:  PROJECT ROOT/assets/fonts and paste the .ttf files there.
![fonts folder](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j1634x4pxuzh0u8cr4d4.png)

- Inside our project root create a file: `react-native.config.js` and paste the following, to let know react-native where to get the fonts from. 
```
module.exports = {
    project: {
        ios:{},
        android:{}
    },
    assets:['./assets/fonts/'],
}
```

- **One more step before starting your app build**, you need to link the asset, using `npx react-native-asset` (enhancement over react-native link). This will automatically create assets/fonts folder (for android) and make a custom font entry in Info.plist (for ios).

- Now, you can create a text style, by adding the newly added font.
```
const styles = StyleSheet.create({
  title:{
    fontFamily: 'Montserrat-Regular',
  }
})
```

**Results:**
Before
![Before](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q54icdhwdet82rm78xim.png)

After
![After](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2b4jw48u5ucex4jm1w3f.png)

---
How tough is Freelancing?
Tags: discuss, webdev, help, freelance
Published: 2022-09-25 14:21:00

I have decided to start freelancing for a little income in college, but before starting out I would like to know how tough it is to get a gig, how to negotiate pay, whether I should try to get paid hourly or per project, and what are some difficulties you have faced. Also, if you have any tips please let me know.
Most commonly used library with react
Tags: javascript, react, webdev, npm
Published: 2022-09-25 14:09:48



🔥Typescript
🔥Scss(Prefer), TailwindCss
🔥Animation - Framer motion/ gsap(Prefer),
🔥React-spring, Anime.js (not to be used for simple animations)
🔥Redux (Not to be used with Next JS)
🔥useContext
🔥Redux Toolkit(Prefer), Redux Saga,
React-query
🔥Formik for Forms, React Hook Form(Prefer)
🔥MaterialUI(Prefer), AntD (use only one library )
🔥Axios
🔥For date formatting - date-fns(prefer), moment
🔥For Carousel - React-slick, react-responsive-carousel
🔥For toast - React-hot-toast(Prefer), React-toastify if not using mui or antd
🔥Share things Socially - React-share
🔥For icons - react-icons, @mui/icons-material
🔥For Videos - react-player
🔥For intersection - react-intersection-observer
🔥For pagination - react-paginate (if not using mui or antd)
🔥Onclick scroll particular section - react-scroll
🔥For conditional classes - clsx(prefer), classnames
🔥React-select for select component if not using mui or antd
🔥For GraphQL - apollo
Webpack Bundle Analyzer - @next/bundle-analyzer
🔥For google spreadsheet integration - google-spreadsheet
🔥For file upload and drag and drop - react-dropzone
🔥Form validation - yup

#react #frontend #redux #softwareengineer
Payments Made Easy
Tags: razorpay, javascript, webdev, react
Published: 2022-09-25 14:08:09

🔥Payments Made Easy🔥

Merchant services: (razorpay, stripe,etc)


We initiate a payment ( frontend ).

🎈 Make Requests for token from the merchant server.

🎈 When token is received on the frontend, you need to send it to your server (backend).

🎈 Only your server can communicate to the merchant server for actual payment.

🎈 Once actual payment is done, the merchant server sends a success message to your server, and your server can send it to your website.