teleren/devto huggingface dataset:
Data Types(9)
Tags: beginners, discuss, opengauss
Published: 2023-03-02 09:35:48

**Pseudo-Types**

openGauss type system contains a number of special-purpose entries that are collectively called pseudo-types. A pseudo-type cannot be used as a column data type, but it can be used to declare a function's argument or result type.

Each of the available pseudo-types is useful in situations where a function's behavior does not correspond to simply taking or returning a value of a specific SQL data type. Table 16 lists all pseudo-types.

Table 16 Pseudo-types

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

Functions coded in C (whether built in or dynamically loaded) can be declared to accept or return any of these pseudo-types. It is up to the user to ensure that the function will behave safely when a pseudo-type is used as an argument type.

Functions coded in procedural languages can use pseudo-types only as allowed by their implementation languages. At present, the procedural languages all forbid use of a pseudo-type as argument type, and allow only void and record as a result type. Some also support polymorphic functions using the anyelement, anyarray, anynonarray, anyenum, and anyrange types.

The internal pseudo-type is used to declare functions that are meant only to be called internally by the database system, and not by direct invocation in an SQL query. If a function has at least one internal-type argument then it cannot be called from SQL. You are advised not to create any function that is declared to return internal unless it has at least one internal argument.

Example:

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

**Data Types Supported by Column-store Tables**

Table 17 lists the data types supported by column-store tables.

Table 17 Data types supported by column-store tables

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

**XML Types**

openGauss supports the XML types. The following is an example:

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y5rpx6ndynowelxjz7yz.png)
Data Types(8)
Tags: beginners, discuss, opengauss
Published: 2023-03-02 09:31:02

**Indexes**

GiST and SP-GiST indexes can be created for table columns of the range type. For example, to create a GiST index, run the following command:

**CREATE INDEX reservation_idx ON reservation USING GIST (during); **

A GiST or SP-GiST index can accelerate queries involving the following range operators: =, &&, <@, @>, «, >>, -|-, &<, and &>.

In addition, the B-tree and hash index can be created on table columns of the range type. For these index types, basically the only useful range operation is equivalence. Using the corresponding < and > operators, there is a B-tree sort oder for range value definitions, but that order is fairly arbitrary and is often less useful in the reality. The B-tree and hash support for range types is primarily designed to allow sorting and hashing within a query, rather than creating an index.

**OID Types**

OIDs are used internally by openGauss as primary keys for various system catalogs. OIDs are not added to user-created tables by the system. The OID type represents an object identifier.

The OID type is currently implemented as an unsigned four-byte integer. So, using a user-created table's OID column as a primary key is discouraged.

Table 15 OID types

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

The OID type is used for a column in the database system catalog.

Example:

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

The alias type of the OID is REGCLASS which allows simplified search for OID values.

Example:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mo2xxsqf0tof0avaf5h9.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xtlqcg90b3o3yh07ccdu.png)
Time, quality, cost triangle when the client can't choose.
Published: 2023-03-02 09:26:33

The time/quality/cost triangle is well know as a good way to decide where flexibility is in a project.

In short, the client decides on **one** of these if is the most important to the business and the other 2 are given more flexibility as specifications and timelines wander.

Sometime clients refuse to pick one, and say for example: they need time and cost, but will allow for lower quality. this is not enough room for manoeuvre on a project as complex as a web application.

Therefore:
Only quality is flexible: 
The app produced is agreed to be rebuilt properly after a pre-determined time limit (1 or 2 years probably). 

This time limit could be discussed at the time, but deciding this up front allows the client to manage costs, rather than devs coming back after 1 year and telling them that they need a rebuild - because the app has become unmaintainable (and this was predictable a year ago!)

Be wary of people thinking/pretending this is the same as Agile! It is absolutely not.

Only Time is flexible:
The app to be produced does not have a fixed deadline, and the client expects longer response times, and does not decide on a launch date until after the app is completed.

When both quality and time are constrained the company ned the flexibility of allowing devs to move to other projects and deprioritise the one with the flexible time-scale. Having any kind of launch date planned before the app is completed and signed off is a fools errand as it will almost always be missed (and this was predictable at the start of the project!)

Only Cost is flexible:
The price is not determined before time and the client pays whatever costs are generated whilst trying to rush a high quality app out of the door, even if estimates are inaccurate.
Cost estimates for features cannot be enforced, as more developers will need to be drafted in to finish the app in time. Cost-flexible clients would receive the developer hours from projects whose time is flexible to allow cost saving for the time-flexible projects and time-saving on the cost flexible projects. Csots on these projects can spiral and its imperative that the client is planning for this. Its not fair to wait until the crunch of a project and say that you have run out of budget. The client needs time to gather budget (and this was predictable at the start of the project!)
I have a problem with JS
Published: 2023-03-02 09:21:20

i want to hide a word when i scroll down , but this is no working .

can you help me ?

----------------------------------------------------------

if(scrollY >= 67){
    novel.style.fontSize = 67 + 'px';
    novel.style.position = 'fixed';
       if(scrollX >= 448 ){
        novel.style.display = 'none';
          }else{
            novel.style.display = 'block';
          }
            if(scrollY >= 127 ){
              document.querySelector('.main').style.background = 'linear-gradient(rgb(0, 0, 0), rgb(255, 255, 255))rgb(129, 24, 173)';
            }else{
              document.querySelector('.main').style.background = 'linear-gradient(rgb(0, 0, 0), rgb(255, 255, 255))rgb(129, 24, 173)';
Types of Queen Mattresses
Tags: queen
Published: 2023-03-02 09:13:03

Here are some of the best types of queen mattresses available in the market. 

Innerspring:

This is a traditional type of mattress that consists of steel coils as the support system.
The coils provide a bouncy feel and the level of firmness can vary based on the number and type of coils used.
An innerspring mattress may also have a comfort layer on top, made of materials such as foam or fiberfill.
Pros: Affordable, widely available, and good for those who like a bouncy feel.
Cons: Limited conformance, may not provide enough support for those with back pain.

Memory foam:

Memory foam is a type of polyurethane foam that moulds to the shape of your body.
This material is often used in the comfort layer of the mattress, providing pressure relief and support.
Pros: Good for those with pain, especially in pressure points like hips and shoulders. Reduces motion transfer.
Cons: May retain heat, slow to respond to changes in position.

Hybrid:

A hybrid queen size mattress combines the support of an innerspring with the comfort of memory foam or other foam materials.
This type of mattress aims to provide the best of both worlds, combining the bounce of innerspring coils with the pressure relief of foam.
Pros: Offers a balanced feel with both support and comfort.
Cons: May be more expensive than innerspring or foam-only options.

Latex:
Latex is a natural or synthetic foam that provides a supportive and bouncy feel.
Latex can be used as the support layer in a mattress or as a comfort layer.
Pros: latex queen-size mattresses are durable, bouncy, hypoallergenic.
Cons: May be expensive, and may have a distinctive smell.

Adjustable air:

Adjustable air mattresses have air-filled chambers that can be adjusted to personal comfort.
Some models allow you to control the firmness of the mattress by inflating or deflating the air chambers.
Pros: Can be adjusted to personal preference, good for those with changing needs (e.g. during pregnancy).
Cons: May be noisy, and may lose air pressure over time.

Waterbed:

A waterbed is a type of mattress that's filled with water, providing a floating sensation.
Some models have a solid foam perimeter for added stability, while others are fully filled with water.
Pros: Good for those with pain, especially in pressure points.
Cons: May be heavy and difficult to move, and may develop leaks over time.

It is important to keep in mind that different types of mattresses will suit different people and preferences. When choosing the right queen mattress, consider factors such as firmness preference, sleeping position, and any health conditions that may affect comfort. 

If you’re looking for right queen size mattresses on sale, look no further than [paylateralligator.com.au](https://paylateralligator.com.au/). They have a pretty good selection of queen mattresses available online in Australia.
Write Smart Contract In Solidity
Tags: solidity, javascript, webdev, programming
Published: 2023-03-02 09:06:54

In this article, we will walk you through the steps required to **[write smart contract](https://mrexamples.com/solidity/write-smart-contract/)** and deploy it on the Ethereum blockchain.

We will cover the basics of the development environment, and the tools needed to write, compile, and deploy your first smart contract.

Smart contracts are self-executing computer programs that automatically enforce the terms of an agreement when certain predefined conditions are met.

The first step in writing a smart contract in Solidity is defining the contract.

You can do this by creating a new file with a .sol extension and then defining the contract

Remix IDE is used to compile and run **[Solidity](https://mrexamples.com/solidity/what-is-solidity/)** code.

Step 1: Enter the given code in the Remix IDE Code Section.

**[Read Full Here](https://mrexamples.com/solidity/write-smart-contract/)**
Comprehensive Guide To Solidity Syntax
Tags: solidity, javascript, webdev, programming
Published: 2023-03-02 08:59:36

In this article, we are examining Solidity syntax, including data types and its functions, whether you are a beginner or an experienced developer looking to brush up on your Solidity skills, read on to learn about the building blocks of **[Solidity syntax](https://mrexamples.com/solidity/solidity-syntax/)**.

As with any programming language, **[Solidity](https://mrexamples.com/solidity/what-is-solidity/)** has its own syntax and set of rules that must be followed to write correct and effective code. If you are new to Solidity, learning the language’s basic syntax is an essential first step.

A **[Solidity](https://mrexamples.com/solidity/what-is-solidity/)** source file can contain a great number of contract definitions, import directives, and pragma directives all at the same time.

Let’s start by taking a look at a simple Solidity source file.

**[Learn More Here](https://mrexamples.com/solidity/solidity-syntax/)**
Data Types(3)
Published: 2023-03-02 08:45:38

**Network Address Types**

openGauss offers data types to store IPv4, IPv6, and MAC addresses.

It is better to use these types instead of plain text types to store network addresses, because these types offer input error check as well as specialized operators and functions.

Table 11 Network address types


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

When sorting inet or cidr data types, IPv4 addresses will always sort before IPv6 addresses, including IPv4 addresses encapsulated in or mapped to IPv6 addresses, such as ::10.2.3.4 or ::ffff:10.4.3.2.

·cidr

The cidr type (Classless Inter-Domain Routing) holds an IPv4 or IPv6 network address. The format for specifying networks is address/y where address is the network represented as an IPv4 or IPv6 address, and y is the number of bits in the netmask. If y is omitted, it is calculated using assumptions from the older classful network numbering system, except it will be at least large enough to include all of the bytes written in the input.

Table 12 cidr type input examples


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

·inet

The inet type holds an IPv4 or IPv6 host address, and optionally its subnet, all in one field. The subnet is represented by the number of network address bits present in the host address (the “netmask”). If the netmask is 32 and the address is an IPv4 address, then the value does not indicate a subnet but a single host. In IPv6, because the address length is 128 bits, 128 bits specify a unique host address.

The input format for this type is address/y where address is an IPv4 or IPv6 address and y is the number of bits in the netmask. If the /y portion is omitted, the netmask is 32 for an IPv4 address and 128 for an IPv6 address, and the value represents just a single host. On display, the /y portion is suppressed if the netmask specifies a single host.

The essential difference between the inet and cidr data types is that inet accepts values with nonzero bits to the right of the netmask, whereas cidr does not.

·macaddr

The macaddr type stores MAC addresses, known for example from Ethernet card hardware addresses (although MAC addresses are used for other purposes as well). Input is accepted in the following formats:


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

These examples specify the same address. Upper and lower cases are accepted for the digits a through f. Output is always in the first of the forms shown.
Linux Series: Bash Programming & Operating Systems (Part-2)
Published: 2023-05-10 06:25:58

---
title: Linux Series: Bash Programming & Operating Systems (Part-2)
published: true
date: 2023-03-02 08:38:44 UTC
tags: 
canonical_url: https://blog.muhammadnoorani.com/linux-series-bash-programming-operating-systems-part-2
---

# Overview

- Welcome to part 2 of our Linux Fundamentals series! In this section, we will be exploring Ubuntu, one of the most popular Linux distributions.

- Throughout this part, we will be diving into the command line interface, a powerful tool that allows you to interact with the system using text commands.

- We'll be covering some of the most useful and commonly used commands in Linux, helping you to build your knowledge and confidence.

# Starting the Terminal

1. What Is A Terminal?

2. What Is A Shell?

3. Bash Programming

4. Shell Format

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677698525707/60edc5fa-ded6-4f88-b836-1f83fef7ac07.png)

# Structure and Tree Hierarchy of Directory [📁](https://emojipedia.org/file-folder/)

- Let's understand this with images,

- Now, visually you are familiar with the Structure and Tree Hierarchy of Directory.

# Exploring Commands [💻](https://emojipedia.org/laptop/)

- First, let's print "Hello World" into the console using Bash.

- `Relative Path and Absolute Path`- Relative path specifies the location of a file or directory relative to the current working directory, whereas an absolute path specifies the exact location of a file or directory from the root directory.

- Let's start exploring.

- example: `whatis ls`

# Flags 🏴

- In Bash, flags are also referred to as options or switches. They are additional parameters that can be passed to a command to modify its behavior.

Let's see some Flags::

1. `.` : This flag represents the current directory.

2. `..` : This flag represents the parent directory of the current directory. It is often used to move up one level in the directory hierarchy. For example, `cd ..` would move the user up one level in the directory hierarchy.

3. `~` : This flag represents the user's home directory. It is often used to refer to the home directory of the current user.

4. `-` : This flag represents the previous directory. It is often used to quickly switch between two directories.

5. `/` : This flag represents the root directory of the file system. It is often used to refer to the top-level directory in the file system hierarchy.

# **You can find me on these platforms** [**🤝**](https://emojipedia.org/handshake/) **:**

> **_After reading this blog, give your reviews and feedbacks for more improvements._**

- [**Twitter**](https://twitter.com/MuhammadN_twts)

- [**Linkedi**](https://www.linkedin.com/in/muhammadnoorani)n

- [**GitHub**](https://github.com/MuhammadNoorani)

- [**Blog**](https://blog.muhammadnoorani.com/)
Linux How To Set All Dir to 775 and All Files to 664
Published: 2023-03-02 08:29:52

Here is the quick command to do this:

```sh
$ sudo find /path/to/dir -type d -print0 | sudo xargs -0 chmod 775
$ sudo find /path/to/dir -type f -print0 | sudo xargs -0 chmod 664
```

Credit:
https://tecadmin.net/set-all-directories-to-755-and-all-files-to-644/
What Is Solidity?
Tags: solidity, javascript, webdev, programming
Published: 2023-03-02 08:29:49

The Solidity programming language is a contract-oriented, high-level language used for building smart contracts and decentralized applications (dApps) that execute on blockchain platforms.

It was introduced by Ethereum, the world’s second-largest cryptocurrency by market capitalization, and has since become the most widely used programming language for **[smart contract](https://mrexamples.com/solidity/write-smart-contract/)** development.

**[Solidity](https://mrexamples.com/solidity/what-is-solidity/)** is a statically-typed language, which means that data types are explicitly defined and checked at compile time.

In addition to being heavily influenced by C++, **[Python](https://mrexamples.com/python/)**, and **[JavaScript](https://mrexamples.com/html/html-javascript/)**, Solidity intends to target Ethereum Virtual Machines (EVMs). It is similar to C++ in its syntax and is designed to be easy to learn for developers who are familiar with object-oriented programming concepts.
Data Types(1)
Tags: beginners, discuss, opengauss, database
Published: 2023-03-02 08:29:34

Numeric Types

Table 1 lists all available types.

Table 1 Integer types

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

Table 2 Arbitrary precision types

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

Table 3 Serial integers

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

Table 4 Floating point types

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

**Boolean Types**

Table 5 Boolean types

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

**Character Types**

Table 6 lists the character data types supported by openGauss.

Table 6 Character types

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


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

In openGauss, there are two other fixed-length character types, as shown in Table 7. The name type exists only for the storage of identifiers in the internal system catalogs and is not intended for general users. Its length is currently defined as 64 bytes (63 usable characters plus a terminator). The type “char” only uses one byte of storage. It is internally used in the system catalogs as a simplistic enumeration type.

Table 7 Special character types

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9yj826d5er8rqy0b81k0.png)
Syntax
Tags: beginners, discuss, opengauss
Published: 2023-03-02 08:21:50

By default, after you log in to the installed database, you can run the \help statement to view syntax of all openGauss statements.

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

You can run the **\h **name command to view detailed syntax information. For example:

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

**SQL Statements**

An SQL statement usually contains keywords, identifiers (columns), constants, and special characters. For example, a simple SQL statement is as follows:

**SELECT id, name FROM t1;**


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

For details about the SQL syntax, see Appendix: SQL Syntax.