teleren/devto huggingface dataset:
How Do You Stay Motivated When Facing Programming Problems?
Tags: discuss, beginners, codenewbie
Published: 2023-03-20 07:00:00

Programming can be tough, and when you hit a difficult problem, it can be hard to stay motivated. But don't worry! There are tons of seasoned coders on DEV who undoubtedly have tips to help you stay focused and motivated. Here are a few ideas:

1. **Take a break:** Sometimes, the best thing you can do is step away from the problem for a little while. 😌 When you come back to the problem, you may see it in a new light.
2. **Break. It. Down.** When a problem seems too big to tackle, try breaking it down into smaller pieces. This can make it feel more manageable and help you make progress. ✨
3. **Get help:** Don't be afraid to ask for help! ✋🏻 Reach out to a friend, classmate, or mentor for assistance. Or post your query here on DEV! 🌈  Sometimes, talking through the problem with someone else can help you see a solution.
4. **Celebrate small wins:** When you make progress, no matter how small, take a moment to celebrate! 🎉 Recognizing your accomplishments can help you stay motivated and keep going.
5. **Remember why you started:** When you're feeling discouraged, remind yourself of why you started programming in the first place. Keeping your goals in mind can help you stay focused and motivated.😎

What other tips can you share or elaborate on? Let’s keep each other motivated!
【MySQL】When using "NULL" in WHERE CLAUSE
Tags: mysql
Published: 2023-03-20 06:59:59

Do not write 

```
SELECT * FROM [table_name] WHERE [column_name]=NULL;
```

Use "IS" for **NULL**!!!!

```
SELECT * FROM [table_name] WHERE [column_name] IS NULL;
```

I wasted 2hours for this...
DOM Manipulation
Tags: javascript, webdev, beginners, tutorial
Published: 2023-03-20 06:58:48


# The Basics of DOM Manipulation

## Introduction

When it comes to web development, the Document Object Model (DOM) is an essential part of creating dynamic and interactive websites. DOM manipulation allows developers to modify the content and structure of a webpage in real-time, providing a more engaging experience for users. In this post, we will delve into the basics of DOM manipulation and how it can be used to enhance the functionality of web pages.

## Accessing and Manipulating DOM Elements

The DOM is essentially a tree-like structure that represents the content and structure of an HTML document. Each HTML element is a node in the DOM tree, and it can be accessed and manipulated using JavaScript. One of the most common ways of accessing an element is through its ID, which can be done using the `getElementById` method. For example, to change the text content of an element with the ID "myElement", you could use the following code:

```jsx
let element = document.getElementById("myElement");
element.textContent = "New text content";

```

In addition to changing text content, DOM manipulation can be used to modify attributes, add or remove classes, and even create new elements on the fly. By manipulating the DOM, you can make your web pages more interactive and responsive to user input.

## Event Handling with DOM Manipulation

Another powerful use of DOM manipulation is for event handling. Events are actions that occur on a web page, such as a button click, mouse movement, or keyboard input. By attaching event listeners to specific elements, you can make your web pages respond to these events in real-time. The `addEventListener` method can be used to attach an event listener to an element, like so:

```
let button = document.getElementById("myButton");
button.addEventListener("click", function() {
  alert("Button clicked!");
});

```

In this example, a click event listener is attached to a button element with the ID "myButton". When the button is clicked, an alert box will appear with the message "Button clicked!".

## Conclusion

DOM manipulation is a powerful tool for creating dynamic and interactive web pages. By accessing and modifying elements in the DOM tree, developers can create more engaging user experiences and respond to user input in real-time. Whether you're a beginner or an experienced web developer, understanding the basics of DOM manipulation is essential for creating modern web applications.
Hybrid Row-Column Store
Tags: opengauss
Published: 2023-02-23 07:26:07

Availability
This feature is available since openGauss 1.0.0.

Introduction
openGauss supports both row-store and column-store models. Choose a row-store or column-store table as needed.

Column-store is recommended if a table contains many columns (called a wide table) but its query involves only a few columns. Figure 1 shows the column-store model. Row store is recommended if a table contains only a few columns and a query involves most of the fields.

Figure 1 Column-store



Benefits
In a wide table containing a huge amount of data, a query usually only includes certain columns. In this case, the query performance of the row-store engine is poor. For example, a single table containing the data of a meteorological agency has 200 to 800 columns. Among these columns, only 10 are frequently accessed. In this case, a vectorized execution and column-store engine can significantly improve performance by saving storage space.

Description
Tables are categorized into row-store and column-store tables. Each storage model applies to specific scenarios. Select an appropriate model when creating a table.

Row-store table

Row-store tables are created by default. Data is stored by row. Row-store supports adding, deleting, modifying, and querying data of a complete row. Therefore, this storage model applies to scenarios where data needs to be updated frequently.

Column-store table

Data is stored by column. The I/O of data query in a single column is small, and column-store tables occupy less storage space than row-store tables. This storage model applies to scenarios where data is inserted in batches, less updated, and queried for statistical analysis. The performance of single point query and single record insertion in a column-store table is poor.

Selecting a storage model

Update frequency

If data is frequently updated, use a row-store table.

Data insertion frequency

If a small amount of data is frequently inserted each time, use a row-store table. If a large amount of data is inserted at a time, use a column-store table.

Number of columns

If a table is to contain many columns, use a column-store table.

Number of columns to be queried

If only a small number of columns (less than 50% of the total) is queried each time, use a column-store table.

Compression ratio

The compression ratio of a column-store table is higher than that of a row-store table. High compression ratio consumes more CPU resources.

Enhancements
None

Constraints
None

Dependencies
None
Promises vs Async callbacks
Tags: webdev, javascript, beginners, programming
Published: 2023-03-20 06:35:20

Promises and async callbacks are both ways to handle asynchronous operations in JavaScript, but they work in slightly different ways.

**Async callbacks**: In JavaScript, callbacks are functions that are passed as arguments to other functions, and are called when an operation is completed. For example, when making an HTTP request, you might pass a callback function that is called when the response is received. Callbacks can be used to handle asynchronous operations, but they can lead to _callback hell_, which can make code hard to read and maintain.

**Promises**: Promises were introduced in ECMAScript 6 as a way to handle asynchronous operations in a more readable and maintainable way than callbacks. A promise is an object that represents the eventual completion (or failure) of an asynchronous operation, and allows you to attach callbacks to handle those outcomes. Promises have three states: pending, fulfilled, or rejected.

Here are some key differences between promises and async callbacks:

1. Promises can be chained together using the `.then()` method, which makes it easy to perform multiple asynchronous operations in sequence.

2. Promises have a `.catch()` method, which allows you to handle errors in a more readable way than try-catch blocks with async callbacks.

3. Promises are composable, meaning you can pass them around like any other value, whereas async callbacks require the use of a function to handle the callback.

In summary, while both promises and async callbacks are ways to handle asynchronous operations in JavaScript, promises provide a cleaner and more maintainable approach that makes it easier to reason about your code.
Vite dev server: adding middleware
Tags: vite, webdev, middleware
Published: 2023-03-20 06:24:14

While working on apps that will be deployed to Vercel, I have run into this situation several times, where I wanted to be able to start my api middleware together with the Vite dev server for local development. Normally you would run the api middleware separately using an express server for example and proxy requests from your Vite app to that server. However, since the Vite dev server can use express middleware, I wondered if it would be possible to eliminate the need to run a separate express server:

```typescript
import express from 'express'
import { defineConfig, ViteDevServer } from 'vite'

const app = express()

app.get('/api', (req, res) => {
  res.send('Hello world!').end()
})

function expressPlugin() {
  return {
    name: 'express-plugin',
    configureServer(server: ViteDevServer) {
      server.middlewares.use(app)
    }
  }
}

export default defineConfig({
  plugins: [expressPlugin()]
})
```

By default, the Vite dev server won't pass on any requests to our middleware, so the code above will not work. However, with a little trick using the proxy config, we can tell the dev server to let a certain request be handled elsewhere, or in this case, by our middleware:

```typescript
import { ProxyOptions, ViteDevServer } from 'vite'

const proxy: Record<string, string | ProxyOptions> = {
  '/api': {} // proxy our /api route to nowhere
}

function expressPlugin() {
  return {
    name: 'express-plugin',
    config() {
      return {
        server: { proxy },
        preview: { proxy }
      }
    },
    configureServer(server: ViteDevServer) {
      server.middlewares.use(app)
    }
  }
}
```

Now if we run our dev server and go to the `/api` route, it will display our `Hello world!` response.
Clean Up Your Workspace with npkill: An Essential Tool for Managing Old and Heavy node_modules Folders
Published: 2023-03-20 06:20:37

Hi everyone,

I recently came across a really useful npm package that I wanted to share with you all. It's called npkill, and it makes it easy to find and remove old and heavy node_modules folders that are taking up space on your machine.

With npkill, you can list any node_modules directories in your system, as well as the space they take up. You can then select which ones you want to erase to free up space. It's a great way to clear out clutter and optimize your workspace.

One thing I really like about npkill is how easy it is to use. You don't even need to install it - simply run the command npx npkill, and you're good to go. And if you do want to install it, it's as simple as running npm i -g npkill.

I highly recommend giving npkill a try. It's been a real game-changer for me in terms of keeping my workspace clean and organized.
Blog Website
Tags: webdev, react, node, typescript
Published: 2023-03-20 06:17:17

##### Day 5
Hello beautiful people!
Currently I am building a blog website. This is the 'public page' of the website where one can view all the blogs posted by the users.

#### Page - Public
![Desktop](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pzuwn68f836vdg3jpmdx.png)

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

![Moblile](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yw1e2p3wc1khuz5m9yuf.png)

![Mobile](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wlspc7tzvlvva227dafc.png)
The green globe which you see below/beside the date inside the blog shows the visibility of the blog. I have decided for now there would be 2 types:-
* Public
* Closed

The Public visibility will be, you guessed it, public.
Closed visibility implies that the blogs will only be visible to the followers only.

Here are some features(sidebar) which I am going to add into this project:-
**Features**  
1. Filter public/closed posts
2. Add follow/unfollow users
3. Report blog

GitHub: https://github.com/parthK57/blogit
What is API Testing ? || 30 Days of API Testing || Day 1 ( API Testing Explained)
Tags: webdev, beginners, programming, tutorial
Published: 2023-03-20 05:55:11

We are going to learn about the What is API Testing and Why do we required API Testing.

{% embed https://youtu.be/yj_BG3WbBDA %}

In this series of 30 Days of API Testing - Introduction, We are going to start a 30 api testing challenge with Day 1.

Learn more - http://scrolltest.com/api-testing-tut...

In this 30 Days of API Testing,
You are going to learn the about the concepts of API, API testing, web services and HTTP Methods basics which are helpful in API testing interview questions. 

You will learn about everything API Testing Using Postman, SOAPUI, PAW and many more API Testing Tools in these 30 Days.

These challenges are a great way to learn on your own, as a team effort or join in with the wonderful Ministry of Testing community online.

Below is a list of 30 challenges and a bonus challenge, one for each day of the month. Download the PDF below. Save it somewhere. Print it out. Stick it on your wall. Let’s do this!

Source. : https://www.ministryoftesting.com/doj...

#API #APITesting #Postman  #APITestingTutorials.

Join Facebook Group :  http://bit.ly/learntesting2019
Website:   https://scrolltest.com
Website:   https://thetestingacademy.com
Twitter: https://twitter.com/itstechmode

Download PPT : https://bit.ly/2PhosOh

API stands for Application Programming Interface.
API is a defined set of rules, which contains clearly defined methods of communication. API helps different software components to interact with each other.

API testing involves testing the collection of APIs and checking if they meet expectations for functionality, reliability, performance, and security and returns the correct response.
API testing is used to determine whether the output is well-structured and useful to another application or not, checks the response on basis of input (request) parameter, and checks how much time the API is taking to retrieve and authorize the data too. 🚀 Tools and services I recommend:
Some of the courses that I recommend to become better Automation Tester 🙌🙌

✅Selenium Training and Certification -
https://scrolltest.com/go/edureka

✅Learn Jenkins for QA -
https://bit.ly/learnjenkins-p1

✅Programming Java -
https://bit.ly/learnjava2020-p1

✅Test Automation - 
https://bit.ly/learnautomation2020

✅API Testing - 
https://www.learnapitesting.com

✅Cypress Tutorial with LIVE Projects -
http://cypresstutorial.com
Thin Controllers Fat Models
Published: 2023-03-20 05:41:39

`"Thin Controllers Fat Models"` is an approach to organizing code in [Laravel](https://laravel.com/), a popular PHP framework. The basic idea behind this approach is to keep the logic of your application in your models, while keeping your controllers simple and focused on handling HTTP requests and responses.

In this approach, models are responsible for handling database queries, processing data, and implementing business logic. Controllers, on the other hand, are responsible for handling requests from the client, and returning responses. They should be kept as simple as possible, and should delegate most of their work to the models.

The benefits of this approach are numerous. By keeping the logic of your application in your models, you can easily test and reuse code, and make your application more modular. Your controllers become simpler and easier to maintain, and your code becomes more organized and easier to understand.

To implement this approach in Laravel, you can create a separate class for each model, and use it to encapsulate all the logic related to that model. You can also use Laravel's built-in Eloquent ORM to create relationships between models, and to perform database queries.

Overall, the `"Thin Controllers Fat Models"` approach is a great way to write cleaner, more maintainable code in Laravel. By separating concerns and keeping your controllers and models focused on their respective responsibilities, you can create a more scalable and robust application.

What I do like, though, from `Taylor's` opinion, is to have custom methods in Models. For a long time, there was a debate in community, that Eloquent Models need to have only Eloquent stuff - settings like $table or $fillables, methods for Relationships, Accessors/Mutators, and nothing more.
But if the creator of the framework himself says that you can put whatever you want there, as long as it doesn't include all the logic, I agree it's more readable than calling Service/Job directly from Controller.

What do you think? Agree with Taylor? How "thin" are your Controllers and Models?
Netex, VMware Kaynağı Ekleme ve Kullanımı
Tags: liman, netex, vmware
Published: 2023-03-20 05:34:59

# 1. VMware Kaynağı Ekleme

- Discovery → Servers sekmesine girilir ve **+** butonuna tıklanarak VMware eklemesi yapılır:

**Name:** Server'a verilmek istenen ad girilir.
**IP Address:** VMware'in bulunduğu server IP'si girilir.
**Port:** VMware eklendiği için port olarak **443** girilir.
**Type:** Virtualization seçilir.
**Node Name:** Boş bırakılabilir.
**Token:** VMware API Key bilgisi girilir.
**Secret:** Boş bırakılabilir.



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

- Submit butonuna tıklanır ve VMware eklenmiş olur.



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

# 2. VMware Kaynağı Kullanımı

- Daha sonra server'ın sağındaki kalem butonunun yanında bulunan ActiveSync butonuna tıklanır ve VMware'de IP ve MAC adresine sahip olan makineler **Machines** sekmesine düşer.


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


- Bu özellikle beraber VMware'de olan makinelerin envanterini çıkarılabilir.
Netex, Sertifika'nın Güncellenmesi
Tags: netex, agizleme
Published: 2023-03-20 05:21:13

- Netex Server'ın IP adresinin değişmesi, sertifika süresinin dolması gibi durumlarda sertifikanın güncellenmesi gerekmektedir.

 

- Sertifikanın güncellenmesi gerekmektedir ve bu adımlar izlenir:

:bangbang: Eğer Server'ın IP adresinde bir değişim var ise ilk 3 adım yapılır, yoksa bu adımlar atlanır.

**1)** Netex Server'ın kurulu olduğu makinenin terminali açılır ve **/opt/netex/keys** dizinine gidilir:

```bash
# cd /opt/netex/keys
```
**2)** Şu komut ile dizinde bulunan sertifikalar listelenir:

```bash
# ls
```

**3)** Ardından şu komutlar sırasıyla çalıştırılarak netex.pem ve netex.key sertifikaları silinir:

```bash
# rm netex.pem
```

```bash
# rm netex.key
```

**4)** Netex Sensör'ün kurulu olduğu makinenin terminali açılır ve **/opt/netex-sensor/certs** dizinine gidilir:

```bash
# cd /opt/netex-sensor/certs
```

**5)** Şu komut ile dizinde bulunan sertifika listelenir:

```bash
# ls
```

**6)** Ardından şu komut çalıştırılarak netex.pem sertifikası silinir:

```bash
# rm netex.pem
```

**7)** Son olarak sertifikanın güncellenmesi için şu komut çalıştırılır:

```bash
# sensor update cert
```

**8)** Böylece sertifika güncellenmiş olur ve sertifika problemi çözülür.
RPM tabanlı Makinalarda SNMPv3 Kurulumu ve Konfigürasyonu
Tags: linux, beginners, tutorial, opensource
Published: 2023-03-20 05:08:24

#**1. RPM Tabanlı Dağıtımlarda Kurulum**

_Not: Aşağıdaki komutlar **root** kullanıcısı ile çalıştırılmıştır, normal bir kullanıcı ile işlem yapacaksanız komutların başına **sudo** ekleyiniz._

##1.1
İlk önce SNMP paketini bilgisayarımıza aşağıdaki komutla kuruyoruz.

``` bash 
yum install net-snmp
```

##1.2
SNMP servisini durduruyoruz.

``` bash
systemctl stop snmpd.service
```

##1.3
Kullanıcıyı aşağıdaki komutta ilgili yerleri değiştirerek oluşturuyoruz.

``` bash
net-snmp-create-v3-user -ro -A [Doğrulama Parolası] -a [MD5|SHA] -X [Parola] -x [DES|AES] [Kullanıcı Adı]
```

Örnek:
``` bash
net-snmp-create-v3-user -ro -A authpassword -a MD5 -X password -x AES deren
```

#**2. Test**
##2.1
SNMPv3 kullanıcısı oluşturduk, şimdi snmpwalk komutu ile kontrol edelim, bunun için ilk önce aşağıdaki komutu çalıştırarak gerekli paketi indirelim.

``` bash
yum install net-snmp-utils
```

##2.2
snmpwalk komutu ile test edelim

``` bash
snmpwalk -u [Kullanıcı Adı] -A [Doğrulama Parolası] -a [MD5|SHA] -X [Parola] -x [DES|AES] -l authPriv 127.0.0.1 -v3
```

Örnek:

``` bash
snmpwalk -u deren -A authpassword -a MD5 -X password -x AES -l authPriv 127.0.0.1 -v3
```
Animation -9 : Pure CSS Wizard loader
Tags: css, webdev, animation, design
Published: 2023-03-20 05:04:33

Are you looking for animations to enhance your website? We've got you covered with our wide selection of creative and engaging #animations. Say goodbye to endless searching and hello to seamless integration on your website!

#### We're excited to introduce our latest YouTube series, which features diverse creative and inspiring website animations.

---

In our short videos, you'll find a variety of #animations that can be easily implemented on your website to enhance user experience.


---

### Pure CSS Wizard loader 

---

{% youtube EY_Be78ykbs %}

 ---
### [Source code](https://democoding.netlify.app/loaders/pure-css-wizard-loader)


---
## For more information

1. Check my GitHub profile
[https://github.com/amitSharma7741](https://github.com/amitSharma7741)

2. Check out my Fiver profile if you need any freelancing work
[https://www.fiverr.com/amit_sharma77](https://www.fiverr.com/amit_sharma77)

3. Check out my Instagram
[https://www.instagram.com/fromgoodthings/](https://www.instagram.com/fromgoodthings/)

4. Linktree
[https://linktr.ee/jonSnow77](https://linktr.ee/jonSnow77)

5. Check my project

- EVSTART: Electric Vehicle is the Future
[https://evstart.netlify.app/](https://evstart.netlify.app/)
-  News Website in react
 [https://newsmon.netlify.app/](https://newsmon.netlify.app/)
-  Hindi jokes API
 [https://hindi-jokes-api.onrender.com/](https://hindi-jokes-api.onrender.com/)
- Sudoku Game And API
[https://sudoku-game-and-api.netlify.app/](https://sudoku-game-and-api.netlify.app/)

---
---