teleren/devto huggingface dataset:
JavaScript —— String
Tags: javascript
Published: 2023-02-23 08:50:08

## 静态方法

- `String.fromCharCode()`: `UTF-16` 编码创建字符串
- `String.fromCodePoint()`: `Unicode` 编码创建字符串
- `String.raw()`: 模版字符串创建字符串

---

## 实例属性

- `length`: 字符串长度

---

## 实例方法

### 访问字符

- `at()`: 索引字符, 支持负数索引
- `charAt()`: 索引字符, 不支持负数索引
- `charCodeAt()`: 索引字符对应的 `UTF-16` 编码
- `codePointAt()`: 索引字符对应的 `Unicode` 编码

### 转换字符串

- `toUpperCase()`: 转成全部大写
- `toLowerCase()`: 转成全部小写
- `toLocaleUpperCase()`: 根据环境转成全部大写
- `toLocaleLowerCase()`: 根据环境转成全部小写

### 判断字符串

- `startsWith()`: 是否以子串开头
- `endsWith()`: 是否以子串结尾
- `includes()`: 是否包含子串
- `localeCompare()`: 判断两个字符串的字典顺序

### 搜索字符串

- `indexOf()`: 从左到右, 子串第一次匹配得到的索引
- `lastIndexOf()`: 从右到左, 子串第一次匹配得到的索引
- `search()`: 正则搜索子串得到的索引

### 匹配替换字符串

- `match()`: 匹配正则的结果
- `matchAll()`: 匹配所有正则的结果
- `replace()`: 替换第一个匹配的子串
- `replaceAll()` 替换所有匹配的子串

### 填充字符串

- `padStart()`: 左侧填充指定字符达到指定长度
- `padEnd()`: 右侧填充指定字符达到指定长度
- `repeat()`: 重复指定次数字符串
- `concat()` 合并字符串

### 字符串操作

- `slice()`: 切片字符串, 支持负数参数
- `substring()`: 切片字符串,不支持负数参数
- `split()`: 分隔成数组

### 清除空格

- `trim()`: 清除两端空格
- `trimStart()`: 清除开头空格
- `trimEnd()`: 清除末尾空格

### 序列化

- `normalize()`: 以 `Unicode` 形式序列化字符串
How to get API using Fetch?
Tags: javascript, beginners
Published: 2023-02-23 08:12:18

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n0mczpd4bxq3tilz15e5.jpg)
If you are learning how to import a data to your websites, you can't avoid using "Fetch" method. Today, I would like to share how Fetch imports data in Javascript.
**index**
1. What is Fetch?
2. Words which you need to know before read
3. How does Fetch work
4. Check the code(How to fetch API)   


**1. What is Fetch?**
In JavaScript, `the fetch()` method is used to make asynchronous requests to the server and load the information that is returned by the server onto the web pages. The request can be of any type of API that returns the data in JSON or XML. The `fetch()` method requires one parameter, the URL to request, and returns a promise.


**2. Words which you need to know before read**

> -**Asynchronous processing**
A process or function that executes a task "in the background" without the user having to wait for the task to finish. The `promise` and `async / await` are objects returned by an asynchronous function.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1nezpe5bn5csx6jv4cuw.png)

> -**API(Application Programming)**
Interface can be thought of as a contract of service between two applications. This contract defines how the two communicate with each other using requests and responses.

> -**JSON(JavaScript Object Notation)**
More commonly known by the acronym JSON, is an open data interchange format that is both human and machine-readable. 

> -**Dictionary**
A dictionary is a general-purpose data structure for storing a group of objects. A dictionary has a set of keys and each key has a single associated value.
```
// Dictionary
const array1 = {'Bob:1', 'Tom:2', 'Sum:3'}
```


**3. How does Fetch work**
Here is a Fetch syntax. 
```
fetch('http://example.com/movies.json')
  .then((response) => response.json())
  .then((data) => console.log(data));
```
First of all, write URL link of API inside of `fetch()`. `fetch()` returns a promise, whch means you can use `then()` or `async / await` for returning data. In this case, I used `then()` method. 

**4. Check the code(How to fetch API)**
Let's see how to fetch API. 
```
fetch('http://example.com/movies.json')
 .then(response => {
    return response.json()
})
 .then(data => {
    console.log(data)
})
 .catch(error => {
    console.log(error)
})
```
First, URL is compiled as JSON data by `return response.json()`. JSON data returns data as Dictionary. So when you check inside of JSON file, data is compiled like this style.
```
//JSON
{
  "id": 1,
   "name":"example"
}
```
Second, if Internet doesn't work when you execute, `catch` method works insted of `then()`. And then console displays "error" message. Thus  `catch` method works for error.
```
 .catch(error => {
    console.log(error)
})
```
Finally, if fetch works sucessfully, `then()` method works. `return response.json()` is changed "data" by `then()` method. Thus if we check console, it shows JSON data on console log, which means it successed to fetch.
```
 .then(data => {
    console.log(data)
})
```
tired of managing your IT in-house... #Outsourcing?
Tags: webdev, career, opensource, news
Published: 2023-02-23 08:37:36

Are you tired of managing IT in-house? Let our experienced team of IT professionals take care of all your technology needs. We offer top-notch IT outsourcing services at affordable rates.

With our services, you'll get:

Expert IT support for your business Improved efficiency and productivity Access to cutting-edge technology Reduced IT costs Don't let IT headaches slow down your business. Contact us today to learn more about our outsourcing services and start optimizing your IT infrastructure.

Click the button below to visit our website and request a quote:

"Get a Quote Now": https://atlasiko.com/services/it-outsourcing-services/

Thank you for considering our services. We look forward to helping your business succeed.
Zooming PDF iframe on Iphone
Tags: html, webdev
Published: 2023-02-23 08:31:06

Have you ever embedded a PDF file using iframe in your website?

## Yes??


Great! Did you manage to get the PDF file shows up?

#### Desktop

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

#### Android


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


## Duh, anyone can do that

Okay, then did you test it on Iphone devices?

> Why it's works fine on Android?

> Oh my, you should come here and take a look

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


Can't scroll or zoom out, this is broken

Why??????

## Solution

Okay there is no time to panic, we need to fix this before the boss see it.

But how???

We'll using the Google Docs Viewer it's merely a URL which allows you to preview a document while passing the link of a file to it.

```
<iframe src="https://docs.google.com/viewer?url=[FILE_URL]&embedded=true"></iframe>

```

And boom everything works again

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/absti2keieombq0jws1w.gif)
Show DEV: Windstatic - Free elements and layout with Tailwind CSS and Alpine.js
Tags: showdev, tailwindcss, alpine
Published: 2023-02-23 08:26:05

**
## Introducing Windstatic
**
https://windstatic.com/

A free collection of aesthetically designed elements & layouts made with Tailwind CSS and Alpine.js - 

- Hero 
- Features 
- Grids 
- Footers 
- Cta 
- Testimonials 
- Logo clouds 
- Gallery 
- Pricing 
- Faq 
- Team 
- Blog 
- Newsletter 
- Error 
- Navbars 
- Flyout menu 
- Sidebar menus 
- Breadcrumbs 
- Tabs 
- Pagination 
- Vertical navigation 
- Steps 
- Command palettte 
- Sign in
- Registrations 

A sneak peak:

{% twitter 1628665974801981441 %}

some images
![1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ceq1eglds29tbchiiea.png)
![1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eg6njk8htsbf693n144y.png)
![2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xkbuat132qj23z1uv531.png)
![3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2z2p8yjri7qus3r2t0ij.png)
![4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u4062mjdnlyvmfugkexm.png)

Any questions feel free to ask me here or on twitter.com/mike_andreuzza
why you should consider using Node.js over other technologies.
Tags: node, webdev, javascript, beginners
Published: 2023-02-23 08:21:52

Node.js has been gaining popularity as a server-side technology in recent years, and for good reason. It is fast, efficient, and versatile, making it a great choice for building web applications and services. In this article, we will discuss why you should consider using Node.js over other technologies.

1.JavaScript Everywhere
One of the biggest advantages of Node.js is that it is built on JavaScript, which is the most widely used programming language in the world. As a result, if you know JavaScript, you can easily switch between front-end and back-end development without learning a new language. This makes Node.js a popular choice for full-stack developers and allows them to create seamless web applications.

Asynchronous and Non-Blocking
Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. This means that it can handle a large number of concurrent connections without blocking any of them. As a result, Node.js is ideal for building real-time web applications such as chat applications and online games.

2.Huge and Active Community
Node.js has a huge and active community of developers who continuously contribute to its development. This community has developed a vast number of libraries and packages that make it easy to add functionality to your application. This means that you can leverage the work of others to build your application quickly and efficiently.

3.Scalability
Node.js is designed to be scalable, which means that it can handle a large amount of traffic and requests without slowing down. This makes it an ideal choice for building web applications that need to handle a lot of traffic and requests.

4.Cross-Platform Compatibility
Node.js is compatible with a wide range of operating systems, including Windows, Linux, and macOS. This means that you can easily develop and deploy your application on any platform without worrying about compatibility issues.

5.Microservices Architecture
Node.js is a great choice for building microservices, which are small, independent services that work together to form a larger application. With Node.js, you can easily build and deploy microservices that can be scaled independently, allowing you to create complex applications that are easy to maintain and update.

In conclusion, Node.js is an excellent choice for building web applications and services. Its flexibility, scalability, and cross-platform compatibility make it an ideal choice for developers who want to create fast and efficient web applications. Its huge and active community also ensures that there are always new libraries and packages being developed that can help you build your application quickly and efficiently.
Branching Out: Trees 101
Tags: computerscience, beginners, programming
Published: 2023-02-23 08:00:49

### What all you will learn ?
- Trees: Definition
- Types of Trees
- Applications of Trees
- Getting Started with Tree Programming

## Getting Started

If you're interested in Computer Science, you've probably heard of trees. Trees are an important data structure that represents hierarchical relationship between data. They have a ton of applications, including in computer science, mathematics and biology.

## What is a Tree?

A tree is a data structure that consists of nodes connected by edges. Each node represents some kind of data, and each edge represents a relationship between that data. The topmost node in a tree is called the root node, and each node in the tree can have zero or more child nodes.

## Types of Trees

There are many different types of trees, each with their own unique properties. Here are some of the most common types of trees:

- Binary trees: Binary trees are trees where each node has at most two child nodes. They are commonly used in computer science to represent data structures such as binary search trees and heaps.
- AVL trees: AVL trees are a type of binary search tree that is self-balancing. They are commonly used in computer science to optimize the performance of search and insertion operations.
- Red-black trees: Red-black trees are a type of self-balancing binary search tree. They are commonly used in computer science to implement data structures such as sets and maps.

## Applications of Trees

Trees have a wide variety of applications in computer science. Here are a few common ones:

- Storing hierarchical data, such as file systems and XML documents
- Implementing search algorithms, such as binary search
- Optimizing the performance of database operations, such as searching and sorting

## Getting started with Programming

If you're interested in learning more about trees, there are a few things you can do to get started. First, read up on the different types of trees and their properties. Next, try implementing a few different types of trees yourself. Finally, explore the different applications of trees to get a better understanding of how they can be used in real-world scenarios.

## Conclusion

Trees are an important data structure in computer science with a wide range of applications. Whether you're a computer scientist, mathematician, or biologist, understanding trees is an important part of your toolkit. So, start exploring the world of trees today and see what you can discover!
Which Tools and Resources Do You Suggest for Folks Who Are New to Programming?
Tags: discuss, beginners, codenewbie
Published: 2023-02-23 08:00:00


Starting out as a new programmer can be overwhelming, but there are plenty of tools and resources available to help you along the way! Some of our favorites include:

- Codecademy for interactive coding courses
- Stack Overflow for troubleshooting and community support
- GitHub for version control and collaboration
- Udemy for in-depth video tutorials
- FreeCodeCamp for project-based learning

What tools and resources have you found helpful as a beginner programmer? Share your favorites with us!
vectorization engine （openGauss）
Published: 2023-02-23 07:52:29

availability
This feature has been introduced since openGauss version 1.0.0.

Feature introduction
openGauss provides a vectorization engine, usually used in OLAP data warehouse systems. The main reason is that analytical systems are usually data-intensive, and basically use sequential methods to access most of the data in the table, then perform calculations, and finally output the calculation results to users.

value of customer
Through batch calculation, the query performance of complex classes is greatly improved.

Characteristic description
Traditional database query execution adopts the pipeline execution mode of one array (tuple) at a time, so most of the processing time of the CPU is not used to process data, but to traverse the query operation tree. In this case, the effective utilization of the CPU is not high, and it will also lead to low instruction cache performance and frequent jumps. To make matters worse, this method of execution cannot take advantage of new optimization features of modern hardware to speed up query execution. In the execution engine, another solution is to change the mode of one array at a time (tuple) to one column at a time. This is also a basis for our vectorized execution engine.

The vectorization engine is bound to the column storage technology, because the data of each column is stored together in the column storage, and it can be considered that these data are stored in the form of an array. Based on this feature, when the column of data needs to perform a certain operation, a cycle can be used to efficiently complete the calculation of each value of this data block.

The advantages of the vectorized execution engine are:

It can reduce the scheduling between nodes and improve the utilization rate of CPU.
Because the same type of data is placed together, it is easier to take advantage of new optimization features of the hardware and compiler.

dependencies
Depends on column storage.
Closures In JavaScript
Tags: javascript, webdev, beginners, programming
Published: 2023-02-23 07:51:20

##### Hey I am glad you are here! Today in this Blog We will be learning about Closures in JavaScript.

## Basic Definition of Closure

*A function along with its lexical scope bundled together is called a closure* 

So what do we mean by lexical scope 🤔 lexical 
scope means the place where the variable or functions is created 

Chatting is okay lets chat with code 😁
```js
function x() {
    var a=10 // local variable 
    function y() {
      console.log(a)
    }
    return y;
}
x() // 10
```

In the above code we have a function **x** within that we have another function **y**. 
Function **x** creates local variable and function **y** prints it to console. 

Function y doesn't have any local variable of its own but it 
has the access to local variable of its parent function 
**x** because of the Closure concept in JavaScript.

 

```js
function x() {
    
    function y() {
      console.log(a)
    }
    var a=10 // local variable 
    a++;
    return y;
}
x() // 11 
```


Numerous Output questions can be formed on the basis of Closures concept. 

To understand Closures properly we need to understand *Execution Context* first.

Functions run inside a Execution Context 


What is execution context ? Its an abstract concept used by ECMAScript to track runtime evaluation of code. 


## Back to Closures 
Every function creates an execution context. Execution Context comprises of comprises of variables 
in the function they were created and reference to the parent's environment. Since execution context got 
reference to its parent environment. All the variables of parent functions gets available to the inner function.


That's it for this blog!!

I hope you learnt something from my Blog!

Thank you!! 😁
Support LLVM （openGauss）
Published: 2023-02-23 07:51:09

availability
This feature has been introduced since openGauss version 1.0.0.

Feature introduction
The LLVM (Low Level Virtual Machine) technology of openGauss provides the ability to query dynamic compilation and execution.

value of customer
By dynamically compiling and executing queries, the re-query performance is greatly improved.

Characteristic description
With the help of library functions provided by LLVM, openGauss advances the process of determining the actual execution path of the query at the executor stage to the execution initialization stage according to the query execution plan tree, thereby avoiding the function call and logical conditional branch judgment accompanying the original query execution And a large amount of data reading and other issues, in order to achieve the purpose of improving query performance.

dependencies
Rely on LLVM open source components, the current version of the open source components is 10.0.0.
JavaScript —— Number
Tags: javascript
Published: 2023-02-23 07:50:39

## 静态属性

- `Number.MAX_VALUE`: 最大值
- `Number.MIN_VALUE`: 最小值
- `Number.MAX_SAFE_INTEGER`: 最大安全整数
- `Number.MIN_SAFE_INTEGER`: 最小安全整数
- `Number.POSITIVE_INFINITY`: 正无穷
- `Number.NEGATIVE_INFINITY`: 负无穷
- `Number.EPSILON`: 最小间隔
- `Number.NaN`: 非数字

---

## 静态方法

- `Number.parseFloat()`: 字符串转化成浮点数
- `Number.parseInt()`: 字符串转化成整数
- `Number.isInteger()`: 是否整数
- `Number.isSafeInteger()`: 是否安全整数
- `Number.isFinite()`: 是否有穷数
- `Number.isNaN()`: 是否非数字

---

## 实例方法

- `toFixed()`: 保留几位小数表示
- `toPrecision()`: 保留有效位数表示
- `toExponential()`: 指数表示
CBO optimizer （openGauss）
Published: 2023-02-23 07:49:32

CBO optimizer
availability
This feature has been introduced since openGauss version 1.0.0.

Feature introduction
The openGauss optimizer is a cost-based optimization (Cost-Based Optimization, referred to as CBO).

value of customer
The openGauss CBO optimizer can select the most efficient execution plan based on the cost among many plans to meet the customer's business requirements to the greatest extent.

Characteristic description
Under the CBO optimizer model, the database calculates the cost of each execution step based on the table's tuple number, field width, NULL record ratio, DISTINCT value, MCV value, HB value and other table feature values, as well as a certain cost calculation model. The number of output tuples and execution cost (cost) of different execution methods, and then select the execution method with the smallest overall execution cost and the smallest first tuple return cost for execution.
Basic functions and features (openGauss)
Published: 2023-02-23 07:45:20

1、Background Information
openGauss is a stand-alone database with the basic functions of a relational database and enhanced functions of enterprise features.

2、basic skills
1）Standard SQL support
Support standard SQL92/SQL99/SQL2003/SQL2011 specifications, support GBK, GB18030, UTF-8, SQL ASCII and Latin-1 character sets, support SQL standard functions and analysis functions, and support stored procedures.

2）Database storage management functions
Table space is supported, and different tables can be planned to different storage locations.

3）Provide active and standby dual machines
Transactions support ACID features, single node failure recovery, dual-machine data synchronization, dual-machine failover, etc.

4）API
Support standard JDBC 4.0 features and ODBC 3.5 features.

5）management tool
Provides installation and deployment tools, instance startup and shutdown tools, and backup and recovery tools.

6）safety management
Support SSL secure network connection, user rights management, password management, security audit and other functions to ensure the security of the database at the management layer, application layer, system layer and network layer.
JavaScript —— Foundations
Tags: javascript
Published: 2023-02-23 07:34:25

## 声明

- `let`: 声明块级作用域变量
- `const`: 声明块级作用域常量
- `var`: 声明函数级作用变量（不推荐使用）

> 都存在变量提升，但 `let` 和 `const` 不会被赋予初始值, 在声明前使用将抛出引用错误(`ReferenceError`).

---

## 数据类型

- `boolean`
- `null`
- `undefined`
- `number`
- `bigint`
- `string`
- `symbol`
- `object`

> 1. 基本数据类型判断使用 `typeof` : `boolean`, `undefined`, `number`, `string`, `object`, `function`.
> 2. 引用类型判断使用 `instanceof`.
> 3. 属性判断使用 `in`.

---

## 流程控制

- `if...else if...else`
- `switch...case...default`
- `throw`
- `try...catch...finally`

---

## 循环与迭代

- `for`
- `do...while`
- `while`
- `continue`
- `break`
- `for...in`: 遍历 `key`, 数组慎用
- `for...of`: 遍历 `value`, 对象不可用
- `for await...of`: 遍历异步迭代

## 模块

> 导出原则: 导出不可变数据, 例如 const, function, class.

- 导出: `export const name = 'itroger'`
- 默认导出 `export default function func() {}`
- 导出重命名: `export { func as func1 }`
- 导入: `import { name } from '...'`
- 导入默认的导出: `import func from '...'`
- 导入重命名: `import { func as func1 } from '...'`

## 新运算符

> nullish 表示值为 null 或 undefined.

- `?.`: 可选链运算符, 在引用为 nullish 时短路返回
- `??`: 空值合并表运算符, 左侧为 nullish 时返回右侧
- `??=`: 逻辑空赋值, 左侧为 nullish 时赋值
- `...`: 展开运算符, 直接获取元素
LLVM
Tags: opengauss
Published: 2023-02-23 07:26:50

Availability
This feature is available since openGauss 1.0.0.

Introduction
openGauss provides the Low Level Virtual Machine (LLVM) technology to query dynamic compilation execution.

Benefits
The requery performance is greatly improved by dynamically building and executing queries.

Description
Based on the query execution plan tree, with the library functions provided by the LLVM, openGauss moves the process of determining the actual execution path from the executor phase to the execution initialization phase. In this way, problems such as function calling, logic condition branch determination, and a large amount of data reading that are related to the original query execution are avoided, to improve the query performance.

Enhancements
None

Constraints
None

Dependencies
It depends on the LLVM open-source component. Currently, the open-source version 10.0.0 is used.