teleren/devto huggingface dataset:
C++ da switch case operatori haqida.
Published: 2023-01-25 12:11:55

Shart operatorining yana bir turi haqida



Vanihoyat bugun shart operatorining eng ohirgisi haqida gaplashib o'tamiz va shu bilan shart operatorini yakunlaymiz. Bu operatorimiz **if va else if** operatorlariga o'xshab ketadi. Lekin imkoniyati cheklangan hisoblanadi. Istalgan joyda ishlatolmaymiz. Bu operatorimizni ham dastur bilan tahlil qilib o'tamiz.

```cpp
#include <iostream>

using namespace std;

int main() {

  int n;
  cin >> n;
  switch(n){
    case 1: cout << "Dushanba";
    break;
    case 2: cout << "Seshanba";
    break;
    case 3: cout << "Chorshanba";
    break;
    case 4: cout << "Payshanba";
    break;
    case 5: cout << "Juma";
    break;
    case 6: cout << "Shanba";
    break;
    case 7: cout << "Yakshanba";
    break;
    default: cout << "Haftada 7 kun bor holos";
    
  }
  
  return 0;
}
```
Ko'rib turganingizdek bitta butun son o'qidik va nechi raqam kiritsak o'sha raqamdagi hafta kunini ekranga chiqaradi. eng oson tomoni bu operatorda tartib bilan yozish shart emas. Chalkash qilib yozgan taqdiringizda ham o'sha raqam ni topib borib keyin o'sha yerdan jarayon boshlanadi. `default` esa oldingi maqoladagi `else` vazifasini bajarib beradi.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zv7gsjukzty9o69cia2g.png)
Endi biz 1 dan 7 gacha bo'lgan raqamlardan boshqa raqam kiritib `default` ni vazifasini ham ko'rib olamiz

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8mnjymsowpx2a66aalrv.png)
Huddi mana shu narsani default deb ataymiz. _Switch case_ unchalik ham qiyin emasligi uchun maqolamizni yakunlaymiz. O'quvchi odam uchun foydasi tegdi degan umiddamiz.
Tursunboev Jamshidbek

@dawroun
The Simple SQL Question You May Be Asked on Interview and Fail
Tags: sql, index, database, mssql
Published: 2023-01-25 12:04:43

At the interview, you may be asked a question about database indexes. And here is a very simple question that even an experienced developer can stumble on.

## Question

**The table has an index(IX_Salary) on the Salary column. Will it work for this SQL Statement?**
`SELECT Count(1)
FROM [YarkulTestDb1].[dbo].[Person]
WHERE Salary + 50 > 1000`

## Answer
**No**, because index does not work in case there is an operation on column in _WHERE_ expression. It will not be able to use that index to optimize the query because it is not filtering on the salary column directly. Instead, it is performing a calculation on the salary column (Salary + 50) and then filtering on the result of that calculation (> 1000). In this case, the query optimizer will likely have to scan the entire table to find the rows that match the condition.

## Case IX_Salary works well

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

## Case IX_Salary does **not** do its job

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

## About Me
I am a Full Stack Developer with +15 years of experience. Learning new concepts and always looking for new challenges. Visit my personal blog [https://yarkul.com/](https://yarkul.com/) to learn .NET, SQL, and Web Development.
Music for focusing and coding - Part #1
Published: 2023-01-25 11:48:52

---
title: Music for focusing and coding - Part #1
published: true
description: Here I share the links that first come to my mind when I need to find music for work
tags: 
# cover_image: https://media.licdn.com/dms/image/C4D22AQFFf5Zj98QQ2Q/feedshare-shrink_800/0/1674505682371?e=1677715200&v=beta&t=rjcn_K6SnzmdV-gKImtcMWno8_lI9M6hy4n_YLnjjAc
# Use a ratio of 100:42 for best results.
# published_at: 2023-01-24 15:19 +0000
---

**Generative FM**, my favorite music created by the algorithm, ambient textures and great minimalistic design. It's free.

🔗 [https://play.generative.fm/browse](https://play.generative.fm/browse)

**My ambient playlist** with 150+ tracks on Spotify

🔗 [https://open.spotify.com/playlist/2kIoUajgPhfxOZfh3Yc5L4?si=2e61092d023c4cbe](https://open.spotify.com/playlist/2kIoUajgPhfxOZfh3Yc5L4?si=2e61092d023c4cbe)

Too boring? Let's add more expressive and engineering inspiration! 🔩🔥 There are you'll find tons and tons my lovelyyyyy music: drum and bass, techstep, techno, breakbeat and experimental electronic:

**NOISIA (archive) radio**

🔗 [https://www.noisia.nl/radio](https://www.noisia.nl/radio)

**VISION radio (fresh project!)**

🔗 [https://www.visionrecordings.nl/radio](https://www.visionrecordings.nl/radio)

Need more dreams, inspiration in the spirit of travel and long roads, night cities? Please, enjoy with Shoegaze and Indie Rock

**DKFM Shoegaze Radio** 🎸

🔗 [https://decayfm.com/](https://decayfm.com/)

And, a special playlist that name "Saint-Petersburg atmosphere" ⚓. My personally associations from each track with my hometown, which I will miss for a long time and love from a distance.

🔗 [https://open.spotify.com/playlist/6GK4ByhiZTykOEr1RtpUGj?si=61e7f2863bd947ae](https://open.spotify.com/playlist/6GK4ByhiZTykOEr1RtpUGj?si=61e7f2863bd947ae)
What is CMMS?
Tags: cmms, software, webdev, programming
Published: 2023-01-25 11:31:15

A Computerized Maintenance Management System ([CMMS](https://worktrek.com/)) is a software program that is designed to help organizations manage and track their maintenance operations and assets. The system is used to schedule, plan, and track maintenance activities, as well as to manage inventory and purchasing. CMMS software is used in a variety of industries, including manufacturing, healthcare, and facilities management.

CMMS software is a powerful tool that can help organizations improve their maintenance operations and reduce costs. It allows organizations to schedule and track maintenance activities in a centralized location, making it easy to see what needs to be done and when. The software also allows organizations to track inventory and purchasing, making it easy to see when parts and materials are running low.

One of the key benefits of CMMS software is that it allows organizations to track and analyze maintenance data. This can help organizations identify patterns and trends in their maintenance operations, which can then be used to improve efficiency and reduce costs. For example, if an organization notices that a particular piece of equipment is frequently breaking down, they can use this information to schedule preventative maintenance or to replace the equipment.

Conclusion:

A CMMS is a valuable tool for any organization that wants to improve their maintenance operations and reduce costs. It allows organizations to schedule, plan, and track maintenance activities in a centralized location, making it easy to see what needs to be done and when. The software also allows organizations to track inventory and purchasing, making it easy to see when parts and materials are running low. Additionally, the data analysis feature of CMMS can help organizations identify patterns and trends in their maintenance operations, which can then be used to improve efficiency and reduce costs. Overall, a CMMS is an essential tool for any organization looking to improve their maintenance operations and reduce costs.
C++ da if(shart) operatori haqida
Tags: cpp, beginners, programming, coding
Published: 2023-01-25 08:10:28

   

-  C++ da shart operatori haqida boshlang'ich tushinchani olib keyin uning turlari haqida gaplashamiz.

Dastlab **If** shart operatori haqida gaplashib chiqamiz. Demak if so'zi inglizchada _agar_ degan ma'noni anglatadi. Yani avval qo'yilgan qandaydir shart bajariladi keyin esa amal bajariladi. Misol uchun bir dastur yozib ko'ramiz. 
_Shart shunday agar n son 0 dan katta bo'lsa bu musbat son deb ekranga yozuv chiqarilsin._

```cpp

#include <iostream>

using namespace std;

int main () {

int n;
cin >> n;

if(n>0){
cout << "Bu musbat son!!!";
}

return 0;
}
```

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

Ko'rib turganizdek **if(shart)**  if so'zidan keyin qavs ichida shart yoziladi. Undan keyin {} figurali qavs ichida bajarishi kerak bo'lgan amal yoziladi.

Endi salgina murakkabroq holatini ko'ramiz. **if va else** holatini ko'ramiz. Bu ko'rinishi haqida gapiradigan bo'lsak. operatorning if qismi tepadagi bilan bir xil else qismi esa sal boshqacharoq. Yuqoridagi misolni shartini o'zgartiramiz.
   Shart shunday n son 0 dan katta bo'lsa bu musbat son deb chiqarsin aks holda bu manfiy son deb chiqarsin.

```cpp
#include <iostream>

using namespace std;

int main () {

int n;
cin >> n;

if(n>0){
cout << "Bu musbat son!!!";
}
  else {
    cout << "Bu manfiy son";
  }

return 0;
}
```

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

Natijani ko'rdingiz. Jarayonni tushintiraman. Agar siz 0 dan katta son kiritsangiz birinchi sharta tushadi va u Bu musbat son deb ekranga chiqaradi. Endi else esa if da berilgan sharrtga tushmaydigan barchasini ekranga chiqaradi, yani -4 kiritsangiz bu birinchi shartga tushmaydi shuning uchun dastur avtomatik tarzda else dagi amalni bajarib yuboradi. Hozircha shu yerda yakunlaymiz. Chunki qolganlarini ham bir joyga yozsak chalkashib ketishingiz mumkin.   Tursunboev Jamshidbek.

@dawroun
Singly LinkedList vs Doubly LinkedList
Tags: programming, cpp, linkedlist, career
Published: 2023-01-25 11:28:12

A singly linked list is a data structure that consists of a sequence of elements, each of which contains a reference to the next element in the sequence. A doubly linked list, on the other hand, is similar to a singly linked list, but each element (referred to as a "node") contains references to both the next and the previous elements in the sequence.

Here are some key differences between singly linked lists and doubly linked lists:

Traversal: In a singly linked list, you can only traverse the list in one direction (from the head to the tail), as each node only contains a reference to the next node. In a doubly linked list, however, you can traverse the list in both directions (from the head to the tail and vice versa), as each node contains references to both the next and previous nodes.

Insertion and Deletion: In a singly linked list, inserting or deleting a node requires updating the next pointer of the previous node, which can be time-consuming. In a doubly linked list, on the other hand, inserting or deleting a node requires updating both the next and previous pointers of the adjacent nodes, which can be slightly more efficient.

Memory: In a singly linked list, each node only requires one reference, whereas in a doubly linked list, each node requires two references. Because of this, doubly linked lists typically use more memory than singly linked lists.

Reverse Traversal: In a singly linked list, you can only traverse the list in one direction, so it's not easy to traverse the list in reverse order. In a doubly linked list, you can easily traverse the list in reverse order, as each node contains a reference to the previous node, which makes it simple to traverse the list in reverse order.

In summary, singly linked lists are simpler and use less memory than doubly linked lists, but they can only be traversed in one direction and insertion/deletion operations are more difficult. Doubly linked lists are more versatile, as they can be traversed in both directions and insertion/deletion operations are more efficient, but they use more memory.
Google font not working in my react and tailwind cas project
Tags: react, tailwindcss
Published: 2023-01-25 11:21:02

Hello, I am trying to add a google font in my react project but it's not working, below are the images of how I tried to did it but the "abc" Class which have the font is not showing in suggestions,please tell me what am I doing wrong 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dlfcka1wo5f7ocwjh4x9.jpeg)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sb9pk0hugpwl6ckzfgw9.jpeg)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yn9plaf60te3yzmlt5lg.jpeg)****
Solutions for Error Code 0x80070422 Windows 10 Update
Published: 2023-01-25 11:20:51

Error code 0x80070422 is caused by installing incompatible or outdated drivers. You can fix this error by uninstalling the drivers, updating the drivers, or using the Windows method .

Secondly , this Error Code 0x80070422 windows is commonly caused due to the .NET framework installation failure. These are following ways in which you can attempt to correct this error.
https://www.winchatsupport.com/0x80070422-windows-update-error/
Wednesday Links - Edition 2023-01-25
Tags: java, jvm, performance, springboot
Published: 2023-01-25 10:38:29

Performance Pathologies in OpenJDK's BigInteger Implementation (6 min)🤒
https://nervous-systems.github.io/java-unsigned-integers/

Create better Spring libraries with @Enable… Annotations (3 min)🧩
https://gorkemgok.medium.com/enable-annotations-for-better-spring-libraries-5a467a028e06

Examples of problems with integers (11 min)💥
https://jvns.ca/blog/2023/01/18/examples-of-problems-with-integers/

Interesting new filters on Spring Cloud Gateway 4.0 (5 min)🧭
https://spring.io/blog/2023/01/18/interesting-new-filters-on-spring-cloud-gateway-4-0
Callback in JavaScript
Tags: webdev, javascript, callback, beginners
Published: 2023-01-25 10:31:19

A **callback** in JavaScript is a function that is passed as an argument to another function and is executed after the outer function has completed its task.

For example, let's say we have a function called "getData" that retrieves data from a server. We want to display this data on the page after it is retrieved, so we pass a callback function as an argument to "getData" that will handle the display of the data.



`
function getData(callback) {
    // code to retrieve data from server
    let data = "Retrieved Data";
    
    // execute callback function with data as the argument
    callback(data);
  }
  
  function displayData(data) {
    console.log(data);
  }
  
  getData(displayData); // logs "Retrieved Data" to the console
`
  


In this example, the "displayData" function is passed as a callback to the "getData" function. When "getData" retrieves the data from the server, it executes the "displayData" function, passing the retrieved data as an argument. This allows us to separate the logic of retrieving the data from the logic of displaying the data, making the code more modular and easier to maintain.
Add a new Gluster node to existing cluster
Published: 2023-01-25 10:23:17


Ansible job for installing GlusterFS package on the new node (node4):
```
---
- name: Install dependencies for GlusterFS
  apt:
    name: software-properties-common
    update_cache: yes
    state: present

- name: Add GlusterFS repo
  apt_repository:
    repo: ppa:gluster/glusterfs-10
    state: present

- name: Install GlusterFS package
  apt:
    name: glusterfs-server
    update_cache: yes
    state: present
```

Start glusterd service if not running:
```
sudo systemctl start glusterd.service
```

Discover and register a remote node as a peer in the cluster (run on any existing node in a cluster):
```
sudo gluster peer probe node4
```

Confirm peer status with:
```
sudo gluster peer status
```

Confirm existing volume status:
```
gluster volume info
```

Add a fourth brick to an existing volume _my_gluste_vol_:
```
sudo gluster volume add-brick my_gluste_vol replica 4 app01:/my-gluster_brick force
```

You can check replication status with:
```
sudo gluster volume heal _my_gluste_vol_ info
```
GitHub Pages
Published: 2023-01-25 10:19:29

Hosting your website/portfolio on Github pages (gp) can give you a clean URL to send people to. You can even use a custom domain.  

### Pre-requisites:
* An account on [Github.com](http://Github.com)
* Have your Github Username handy
* Create a new repository and name it `<your_github_username>.github.io`
* Upload files/assets for website there

[More in depth guide](https://pages.github.com/)

Github is basically hosting static pages for free, it's quite a nice feature. 

Normal repo's hosted on gp will give a URL like the following:

`https://<your_username>.github.io/<your_repo_name>`
e.g.:
`https://izzlenizzle.github.io/ReadoutAssistant/`

But with a special eye for cleanliness, you can get a url like this:

`https://<your_username>.github.io/`
e.g.:
`https://izzlenizzle.github.io/`
Looking good 👌💅
Buying Custom Domain
Published: 2023-01-25 10:19:13

It’s a little scary if you’ve never done it before, but with todays modern web it’s very easy. There are many tools and sites you can buy domains from. 

Some popular choices :
- [Go daddy](https://www.godaddy.com/domains) 
- [Google domains](https://domains.google/get-started/domain-search/)
- [Name cheap](https://www.namecheap.com/domains/domain-name-search/)

Their checkout flows are top notch, hard to mess up. They will ask for name and address and that info may be public as part of owning the domain. Some sites have protections for that, there’ll surely advertise that features as part of their signup flow. 

Check unique domain names, look for urls that will look safe and familiar. .com .co .dev .io are my personal favorites.
Understanding the Differences between $request->name, $request->input() and $request->has() in Laravel
Tags: laravel, webdev, programming, http
Published: 2023-01-25 10:16:33

In Laravel, the `$request` object is used to access data sent in an HTTP request. This object provides a convenient way to access request data, such as headers, query parameters, and form data. In this article, we will explore the differences between three common methods used to access request data: `$request->example_field_name`, `$request->input("example_field_name")`, and `$request->has("example_field_name")`

The first method, `$request->example_field_name`, is used to access the value of a request input field with the name "example_field_name". This method is a shortcut for $request->input("example_field_name"), and it is used to access the value of a request input field. For example, if a form is submitted with a field named "email" containing the value "hello@example.com", the following code would return "hello@example.com":

`$email = $request->email;`

Similarly, the `$request->input("example_field_name")` method is also used to access the value of a request input field with the name "example_field_name". However, this method allows you to retrieve values from the request using "dot" notation. This means that you can access nested values in an array or object by specifying the key or property name separated by a dot. For example, if a form is submitted with a field named "user" containing an array with a key "name" and a value "John", the following code would return "John":

`$name = $request->input('user.name');`

The third method, $request->has("example_field_name"), is used to check if the request contains an input field with the name "example_field_name". This method returns a boolean value (true if the input field exists, false if it does not). This method can be used to check if a required field has been filled in or to check for the existence of a specific input field before attempting to access its value.

In conclusion, all three methods are used to access request data in **Laravel**, but they have different purposes. The `$request->example_field_name` and `$request->input("example_field_name")` methods are used to access the value of a request input field with the name "example_field_name", while `$request->has("example_field_name")` is used to check if the request contains an input field with the name "example_field_name".
Getting started with Ethereum development
Tags: blockchain, etherium, webdev, beginners
Published: 2023-01-25 08:18:16


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/30cn9cc2bm9q9o5cm95y.png)
Ethereum is a popular blockchain platform that enables developers to build decentralized applications (dApps) and smart contracts. He
re's an in-depth guide for getting started with Ethereum development:

Learn the basics: Start by learning about the underlying technology and concepts of Ethereum, such as its consensus algorithm (Proof of Work), its virtual machine (Ethereum Virtual Machine), and its native cryptocurrency (Ether). You can find a variety of resources online, including the Ethereum website, the Ethereum Yellow Paper, and the Solidity programming language documentation.

Choose a development environment: To begin developing on Ethereum, you'll need to set up a development environment. There are several options to choose from, including local development environments like Geth and Parity, as well as cloud-based development environments like Truffle and Embark.

Learn Solidity: Ethereum primarily uses the Solidity programming language to write smart contracts. Start by learning the basics of the language, such as syntax, data types, and contract structure. You can find a variety of resources online, including the Solidity documentation, tutorials, and online courses.

Build your first contract: Once you have a solid understanding of Solidity, you can start building your first contract. Try to start with a simple contract and build upon it as you gain more experience. Some popular tools for contract development include Truffle and Embark.

Test and deploy your contract: Before deploying your contract to a live network, it's important to test it thoroughly to ensure it works as intended. You can use tools like Truffle and Embark to test your contract on a local testnet or a cloud-based testnet like Rinkeby. Once you're satisfied with the results, you can deploy your contract to the main Ethereum network.

Interact with your contract: Once your contract is deployed, you can interact with it using a web3 enabled browser like MetaMask or Mist, or using a web3 library like web3.js. You can also use tools like Truffle and Embark to easily interact with your contract.

Stay updated: Ethereum is constantly evolving, so it's important to stay up-to-date with the latest developments and best practices. Join online communities, attend meetups, and follow industry leaders to stay informed.

It's important to note that Ethereum development can be complex and it can take time to become proficient. Be patient and keep learning, and you'll be able to develop innovative decentralized applications and smart contracts in no time.