teleren/devto huggingface dataset:
Difference between CSS display inline, block & inline-block
Tags: webdev, beginners, tutorial, css
Published: 2023-08-21 17:57:55

## 
Difference between **CSS display _inline, block & inline-block_**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/92dmf8jajlu0om78nzlg.jpeg)

The display property defines how an HTML element should be displayed on the webpage. There are several values for the display property, including _block, inline, and inline-block._These values determine the layout behavior of the element they are applied to.

` display:block; `
` display:inline;`
`display:inline-block;`

Here's an example of how these display values might be used in HTML and CSS:

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

## **`display:block;`**

The element will start on a new line and occupy the full width available. Block elements will occupy the entire width of its parent element. And you can set width and height values.This means that block elements stack vertically, one below the other. Common block elements include 

- div
- h1 to h6
- p
- li
- section


```javascript
.block-element {
  display: block;
}
```

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

## **`display:inline;`**

The element doesn't start on a new line and only occupy just the width it requires. You can't set the width or heightThey flow within the content, allowing other inline elements to be placed beside them. Common inline elements include 

- span 
- a
- strong
- em

```javascript
.block-element {
  display: inline;
}

```

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

## **`display:inline-block;`**

It's formatted just like the inline element, where it doesn't start on a new line. BUT, you can set width and height values. It combine aspects of both block and inline elements. They maintain their inline characteristics, allowing other elements to be placed beside them, while also allowing you to set their width, height, margins, and padding. This is often used for creating layout components that need to be positioned horizontally but require control over their dimensions.
```javascript
.block-element {
  display: inline-block;
}

```
not-null constraint in Postgresql
Tags: postgres, apacheage
Published: 2023-08-21 17:50:45

A `not-null constraint` makes sure that a column must have some values and a value is not left as null. Drop the previously created tools table and create the tools table again using this constraint using the following example:

```
warehouse_db=# CREATE TABLE tools
  (
  tool_id INTEGER NOT NULL,
  tool_name TEXT,
  tool_class NUMERIC
  );
```

The preceding query will create a table with a not-null constraint on the tool_id column. We can apply the not-null constraint on as many columns as we can. Consider the following example:

```
warehouse_db=# CREATE TABLE tools
  (
  tool_id INTEGER NOT NULL,
  tool_name TEXT NOT NULL,
  tool_class NUMERIC
  );
```

The preceding query will create the tools table with not-null constraints on tool_id and tool_name.

In the next article, we'll discuss `Exclusion constraints` in postgresql.
What are the top 10 vulnerabilities for web application?
Tags: websecurit, applicaitonsecurity, appsec, owasp
Published: 2023-08-21 17:43:35

Web application security is crucial to protect sensitive data and maintain the integrity of online services. Here are the top 10 application security issues that developers and security professionals need to address:

1. **Injection Attacks:** This includes SQL injection and command injection, where attackers insert malicious code into input fields to manipulate databases or execute unauthorized commands.

2. **Cross-Site Scripting (XSS):** Attackers inject malicious scripts into web pages that are then executed by other users, allowing them to steal sensitive information or perform actions on behalf of the victim.

3. **Cross-Site Request Forgery (CSRF):** This occurs when attackers trick users into performing actions on a website without their consent. Users are manipulated into making requests that can lead to unintended actions.

4. **Broken Authentication:** Weak authentication mechanisms can lead to unauthorized access to user accounts. This includes issues like weak passwords, improper session handling, and lack of multi-factor authentication.

5. **Sensitive Data Exposure:** If sensitive data is not properly protected, it can be stolen or accessed by attackers. This includes inadequate encryption, poor credential management, and unsecured storage.

6. **Security Misconfigurations:** Incorrectly configured security settings, server settings, or application frameworks can expose vulnerabilities that attackers can exploit.

7. **Insecure Deserialization:** Attackers can exploit vulnerabilities in the process of deserializing data, leading to remote code execution and other malicious actions.

8. **Broken Access Control:** Insufficient authorization checks can allow unauthorized users to access restricted resources or perform actions they shouldn't be able to.

9. **Security Components with Known Vulnerabilities:** If your application relies on outdated or insecure third-party libraries, frameworks, or components, attackers can exploit known vulnerabilities.

10. **Insufficient Logging and Monitoring:** Without proper logging and monitoring, it becomes difficult to detect and respond to security incidents in a timely manner.

It's important to note that this list isn't exhaustive, and new security issues can arise over time. Addressing these issues requires a combination of secure coding practices, regular security assessments, and staying up-to-date with the latest security threats and solutions.
Artis Jav Paling Cantik Saat Ini
Published: 2023-08-21 17:32:10

Menonton jav adalah salah satu cara mempelajari bagaimana cara menyayagi dan membahagiakan wanita. Bagi kebanyakan pria kini menonton Jav adalah salah satu hobi yang selalu di lakukan. Cek saja di HP nya pasti ada salah satu koleksi video jav yang di simpan dan gak mau di hapus.

Salah satu yang membuat orang suka dengan Jav adalah kecantikan para artis yang memerankannya. Di jepang sana gak hanya artis terkenal saja yang bisa terjun jadi pemain jav melainkan wanita biasa yang punya keistimewaan pun bisa ikut terjun dan menjadi bintang disana.

Kini semakin berkembangnya zaman, sudah banyak bibit bibit muda bintang JAv yang bermunculan. Di usia yang masih muda ribuan judul film jav sudah mereka bintangi. Nah timbul dong pertanyaan siapa sih untuk saat ini artis jav Paling cantik yang sedang naik daun dan di cari cari penggemar?

Kepopuleran artis jav bisa di lihat dari antusiasnya fans yang menunggu dan membeli video asli artis jav tersebut. Dan dari banyaknya artis jav yang sudah membintangi ribuan judul film berikut adalah beberapa deretan artis jav paling cantik masih muda dan punya basis fans yang sangat luar biasa banyaknya.

1. Eimi Fukada

2. Mina Kitano

3. Yua Mikami

4. Tsubasa Amami

4. Kana Momonogi

5. Nana Yagi

Dll

Nah bagi Anda yang penasaran dan belum koleksi daftar video video jav artis diatas bisa langsung berkunjung ke salah satu situs penyedia video jav gratis dengan kualitas HD di [bokeplendir](https://bokeplendir.online). Silahkan disana Anda bisa nonton gratis atau mendownload videonya guna dijadikan koleksi yang bisa di tonton lagi kapan pun Anda mau.
Functional Testing and Non Functional Testing Difference with Examples
Published: 2023-08-21 17:40:50

Functional testing and non-functional testing  both are two wide classification of software testing and they are used to ensure the quality of the applications.
**Function Testing** checks the application's processes against a set of requirements or specifications.Testing of all functions by providing appropriate input to check whether the actual output matches the expected output or not.
Functional Testing types are
• Unit testing
• Smoke testing
• User Acceptance
• Integration Testing
• Regression testing
• Localization
• Globalization
• Interoperability

Examples : Checking if a login form works correctly, verifying that a calculation is performed correctly.

**Non Functional Testing**  checks various aspects of the application like performance, load, stress, scalability, security, compatibility etc. The main focus of this test is to improve the user experience in terms of how quickly the system responds to the request.
Non Function Testing types are
• Performance Testing
• Volume Testing
• Scalability
• Usability Testing
• Load Testing
• Stress Testing
• Compliance Testing
• Portability Testing
• Disaster Recover Testing
Examples : Checking the software's response time under heavy load, testing the software's user interface for usability, checking the software for security vulnerabilities
Projects + AIs: The Winning Formula?
Tags: programming, productivity, ai, discuss
Published: 2023-08-21 17:34:33

Introduction
In today's rapidly evolving technological landscape, the collaboration between human expertise and artificial intelligence (AI) has become a game-changer, transforming industries and empowering innovation. One such realm that has witnessed this profound impact is the world of programming and software development. With the emergence of advanced AI tools like Blackbox, programmers are now exploring the potential synergy between projects and AI. But is this partnership truly the winning formula? Let's delve into the fusion of Projects and AIs to explore the possibilities.

Table of Contents
Enhancing Creativity and Efficiency
The Role of AI in Projects

The Role of AI in Projects 
As AI technology continues to advance, it is increasingly integrated into various aspects of project development. From automating repetitive tasks to providing data-driven insights, AI brings a new dimension of efficiency and precision.

Enhancing Creativity and Efficiency
AI-powered tools, such as Blackbox, assist programmers by generating code snippets, suggesting optimizations, and identifying potential errors. This augmentation not only speeds up the coding process but also liberates programmers to focus on more innovative aspects of their projects.

Leveraging Blackbox AI Integration
In the realm of coding, the integration of advanced tools like Blackbox AI opens new frontiers. By seamlessly merging human creativity with the computational prowess of AI, Blackbox empowers developers to craft intricate code solutions with unprecedented efficiency and accuracy.

Igniting Curiosity with AI Collaboration
Embark on a journey of exploration as you delve into the synergy between human intellect and AI capabilities in code review. Unleash the potential of collaboration with an AI partner like Blackbox, and witness how this dynamic interplay can spark new dimensions of creativity and innovation.
"Server refused our key" error when I try to connect to my AWS EC2 instance using SSH?
Tags: aws, ec2, troubleshooting
Published: 2023-08-21 17:31:08

If you're having trouble connecting to your AWS EC2 instance via Putty software and receiving the error message "Server refuse key", there is a solution.


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

- First, make sure you have the latest version of Putty (0.78) installed. 

- Then, create a keypair file with a .pem extension. 

- Use Puttygen to load this .pem file and save the private key. Be sure not to generate a new private key. 

- Finally, load this private key into Putty under the SSH -> Auth -> Credentials -> Private key file for authentication category. 

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

- Now, AWS has made this process easy to generate the private keys. you can download the .ppk (private key) directly from the AWS portal while creating the key pair.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o7mulxtgfn50i9qbgvn9.png)
Following these steps should resolve the issue.
Short and Long Queries in PQSL
Tags: apacheage, postgres
Published: 2023-08-21 17:30:47

Let us identify whether a query is a `short query` or a `long query`. You will learn how to identify short queries.

What is a short query? First, it has nothing to do with the length of the SQL query.

*`A query is short when the number of rows needed to compute its output is small, no matter how large the involved tables are. Short queries may read every row from small tables but read only a small percentage of rows from large tables.`*

Example:
Let's consider a scenario where you have two tables: a small table named `small_table` and a large table named `large_table.` The goal is to identify whether a query is a `short query` based on the criteria you provided.

```
CREATE TABLE small_table (
    id SERIAL PRIMARY KEY,
    name VARCHAR(50)
);

CREATE TABLE large_table (
    id SERIAL PRIMARY KEY,
    data VARCHAR(100)
);
```

Here's an example of a query that reads from both tables and follows the criteria for a `short query`:

```
-- Short query example
SELECT *
FROM small_table
UNION ALL
SELECT *
FROM large_table
WHERE id <= 100;
```

In this example, the query is considered "short" because even though it involves both tables, it reads every row from the small_table and only a small percentage of rows (those with id values less than or equal to 100) from the large_table.


```
SELECT *
FROM large_table
WHERE data LIKE '%something%';
```

In this case, the query involves only the large_table, but it reads potentially a large number of rows based on the LIKE condition, so it would not meet the criteria for a "short query."
Understanding React State and Event Handling
Published: 2023-08-21 17:28:09

React State:
In React, state is a critical concept that allows components to manage and store dynamic data. It represents the current condition of a component, and any change in state triggers a re-render of the component. State is particularly useful for handling user interactions and any data that may change during the components life cycle. To manage state in a React component, you can utilize the useState hook. This hook provides a way to initialize and update state withinimport React, { useState } from 'react';

Event Handling:
React applications become truly interactive by responding to user actions, suck as clicks, input, and other events. Event handling in React is similar to standard HTML event handling but with a more streamlined and declaritive approach. You attach event handlers to JSX elements using curly braces to pass in a function to execute when the event occurs

The Connection: State and Event Handling:
State and event handling in React work in tandem to create dynamic and interactive components. By updating the state in response to events, you can control how your components behave and render. Whether its a simple button toggle, a form submission, or a more complex interactive element, managing state and event handling are essential skills. Reacts state managment and event handling form the foundation of modern web development. By mastering these concepts, you can build powerful user interfaces that respond intuitively to user interactions.
Modify Status Bar in Flutter Apps in 2023
Published: 2023-08-21 17:08:07

If u want to have your Status bar look like this
Add this in your Scaffold

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

```
appBar: AppBar(
          systemOverlayStyle: SystemUiOverlayStyle(
            systemStatusBarContrastEnforced: false,
            statusBarColor:
                Colors.transparent ,
            statusBarIconBrightness: Brightness.dark,
            statusBarBrightness: Brightness.light,
          ),
          elevation: 0,
          toolbarHeight: 0,
        ),
```
You can modify this as per your needs

You will notice that you have to swipe the status Bar once to see your changes.

To prevent this Add this Code in your First screen initState

```
  SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
        overlays: SystemUiOverlay.values);

```
Unique Indexes and Constraints in Postgresql
Tags: postgres, apacheage
Published: 2023-08-21 17:06:20

# What is an Index in `PSQL`?
>> An index is unique if for each indexed value there is exactly one matching row in the table.

There are several different ways to create a unique index. First, PostgreSQL automatically creates a unique index to support any primary key or unique constraint on a table.

What is the difference between a primary key and a unique constraint? A common misconception among SQL developers is that a primary key has to be an incrementing numeric value and that each table “has” to have a primary key. Although it often helps to have a numeric incremental primary key (called a surrogate key), a primary key does not have to be numeric, and moreover, it does not have to be a `single-attribute constraint`.

It is possible to define a primary key as a combination of several attributes; it just has to satisfy two conditions: the combination must be `UNIQUE` and `NOT NULL` for all of the participating attributes. 
In contrast, unique constraints in PostgreSQL allow for `NULL values`.

A `table` can have a single primary key (though a primary key is not required) and multiple unique constraints. Any non-null unique constraint can be chosen to be
a primary key for a table; thus, there is no programmatic way to determine the best candidate for a table’s primary key
rpcbenchmark.com - New SaaS to benchmark RPC Nodes
Tags: rpc, ethereum, web3, blockchain
Published: 2023-08-21 17:03:57

Have you ever needed to compare different RPC nodes for your dApp in Ethereum or Solana? This might be of your interest 👇

### What is rpcbenchmark.com

I just published my latest project: [rpcbenchmark.com](rpcbenchmark.com) this is a tool to benchmark RPC Nodes from different blockchains like Solana, Ethereum, Near, etc. It has a free plan which is unlimited benchmarks but maximum with 2 RPCs. You can also buy credits at a relatively low price and each benchmark with over 2 nodes is going to cost 1 credit.

### How is the benchmark done?

We have different lambda functions deployed in different regions across the globe. These lambdas make 50 concurrent requests to the RPC nodes we wish to compare. We compute the average time of each request and then we return this number as the latency, expressed in ms. As you can see it is very simple.

Here I benchmarked [Helius vs HelloMoon Solana Free Tier RPC](https://rpcbenchmark.com/benchmarks/ecfa42fa-b2c8-44b4-bd5a-40fae6cd3560).

Additionally I am giving away 11 coupons for 5 FREE credits (5€) in [rpcbenchmark.com/buy](https://rpcbenchmark.com/buy)

RPCB2

RPCB3

RPCB4

RPCB5

RPCB6

RPCB7

RPCB8

RPCB9

RPCB10

RPCB11

RPCB12

### Tech Stack

The tech stack I used is:

- NextJS
- Postgre
- Kafka
- Stripe
- DigitalOcean
- TRPC
- Kysely
¿Qué son las interfaces? Ejemplos de Java y Golang
Tags: go, java, beginners, programming
Published: 2023-08-21 17:01:05

En programación, una interfaz es un conjunto de métodos (funciones) que una clase debe implementar. Proporcionan un contrato o una especificación para las clases que las implementan, garantizando que ciertos métodos estén disponibles y se comporten de cierta manera. Las interfaces son una herramienta poderosa para lograr la abstracción y la modularidad en el código, permitiéndote definir comportamientos comunes que varias clases diferentes pueden compartir.

Aquí te comento algunos puntos clave para entender cómo funcionan las interfaces y cómo usarlas de manera efectiva:

* Declaración de interfaces: En muchos lenguajes de programación, como Java o C#, declarar una interfaz es similar a declarar una clase, pero en lugar de proporcionar implementaciones concretas para los métodos, solo defines las firmas de los métodos (nombre, parámetros y tipos de retorno).

- Implementación de interfaces: Una vez que has definido una interfaz, las clases pueden implementarla. Para hacerlo, la clase debe proporcionar implementaciones concretas para todos los métodos definidos en la interfaz. Esto asegura que cualquier instancia de la clase implementadora también cumpla con el contrato de la interfaz.

- Herencia múltiple de interfaces: A diferencia de las clases, muchas lenguajes permiten la implementación de múltiples interfaces en una misma clase. Esto es útil cuando deseas compartir comportamientos comunes de diferentes fuentes sin tener que forzar una única jerarquía de clases.

- Polimorfismo: Las interfaces permiten lograr el polimorfismo, lo que significa que puedes tratar diferentes objetos de clases que implementan la misma interfaz de manera uniforme. Esto simplifica el código y permite intercambiar fácilmente implementaciones en tiempo de ejecución.

- Flexibilidad y extensibilidad: Las interfaces son excelentes para diseñar componentes modulares y extensibles. Si más adelante necesitas agregar una nueva implementación que cumpla con ciertos requisitos, solo necesitas implementar la interfaz, en lugar de cambiar el código en múltiples lugares.

- Código más limpio: Las interfaces fomentan la separación de preocupaciones y el principio de "programar para interfaces, no para implementaciones", lo que lleva a un código más limpio y mantenible.

Espero que este post te haya gustado y si prefieres una explicación de interfaces en formato audiovisual, aquí te dejo un vídeo de mi canal de YouTube:

{% embed https://www.youtube.com/watch?v=s68gLZzUZnc %}
Demystifying BDD: A Game-Changer for Software Testing 🎮
Tags: java, programming, discuss, tutorial
Published: 2023-08-21 16:53:29

In the world of programming, sometimes we get lost in tech talk, leaving our buddies who aren't tech wizards scratching their heads. So, let's unpack a cool concept called Behavior Driven Development (BDD) in plain English. Think of it like explaining your favorite game to a friend!

**<u>What's BDD All About? 🤔</u>**
Imagine you're teaching your friend how to play a video game. Before diving into the action, you lay down the game rules:

   _What's the objective?
    What should happen at different stages?
    What's the winning move?_

BDD is a bit like this. Instead of coding blindly (not literally, of course!), you define precisely how a piece of code should behave.

**Breaking It Down: The Game Analogy 🎮**

    **Given** - Picture it as the starting point of your game. Your character is loaded, and you're ready to roll.

    **When** - This is when the game is in full swing. You're making moves, battling foes, and collecting points.

    **Then** - The end goal of the game. You've reached the final level, maybe defeated the boss, and celebrated your victory.

Now, translate this to coding, especially with tools like Mockito:

Given - We set up the initial game conditions.
When - A specific action or event happens in the game.
Then - We expect a particular outcome, just like reaching a winning stage.

**_A Real-Life Example: The Food Delivery App 🍔_**

Imagine you're building a food delivery app. A key feature is applying discounts during a food festival.

    Given - The app displays regular prices of items.
    When - The food festival starts.
    Then - Items on the app should show their festival discounts.

Using Mockito's BDD features, it's like saying:


`given(menuService.getAllItems()).willReturn(allItems);
`
In simple words, you're telling the app that if someone wants to see all the items, it should show the list of items we've set up.
Summing It Up 🎮

For folks who know programming but are new to Mockito and fancy testing tools, I hope this made BDD crystal clear. It's all about setting the rules for your code, much like explaining the rules of a game. This ensures smooth sailing without any unexpected glitches!