teleren/devto huggingface dataset:
Ambari Configuration Challenges on 1U Rack Servers
Published: 2023-08-04 05:37:40

Hi Everyone

Our organization is in the process of setting up a Hadoop cluster using 1U rack servers. We have chosen Ambari as the management tool for its ease of use and rich features. However, we are encountering several configuration challenges on these servers, hindering our successful deployment.

Symptoms:

Resource Constraints: 1U rack servers typically have limited resources, and we are struggling to configure Ambari to efficiently utilize the available CPU, memory, and storage. This has led to performance bottlenecks and reduced cluster efficiency.

Heat Dissipation: The compact design of [1U rack](https://www.lenovo.com/au/en/c/servers-storage/servers/racks/
) servers makes heat dissipation a critical concern. Running Ambari and Hadoop services on these servers generates substantial heat, potentially leading to thermal throttling and system instability.

Networking and Cabling: Managing network connections and cabling in a confined rack space can be cumbersome. We face challenges in organizing the network infrastructure efficiently, affecting the overall reliability and accessibility of the cluster.

Scalability Concerns: As we plan to expand the cluster in the future, we are uncertain about the scalability of the 1U rack servers and whether they can accommodate the increasing demands of additional nodes
How to Filter and Sort Data in the Vue Pivot Table Component
Tags: webdev, vue
Published: 2023-08-04 05:27:35

Learn how easily you can filter and sort data in the Syncfusion Vue Pivot Table component. This video demonstrates how to filter data in a Pivot Table and the types of filtering like label and value. It also shows how to sort data and the different types like alphanumeric and value sorting. 

The Vue Pivot Table is a powerful control for organizing and summarizing business data and displaying the result in a cross-table format. Its major functions are data binding, drilling up and down, Excel-like filtering and sorting, editing, Excel and PDF exporting, several built-in aggregations, field lists, and calculated fields. A large volume of data can be loaded without any performance degradation by using row and column virtualization. 

Bind data seamlessly with various local and remote data sources such as JSON, OData, WCF, and RESTful web services with the help of a data manager. Users can perform actions on raw data at runtime, including create, read, update, and delete. Through an interactive user interface, the control provides several edit modes, including inline, dialog, batch, and column. 

You can easily integrate your Pivot Table with independently rendered pivot data. It has support for more than 20 chart types. Pivot Table has a highly responsive layout and an optimized design for desktops, touchscreens, and smart phones. It works well on all mobile phones that use iOS, Android, or Windows OS. 

**Product overview**: https://www.syncfusion.com/vue-components/vue-pivot-table

**Explore our tutorial videos**: https://www.syncfusion.com/tutorial-videos

**Example Project**: https://github.com/SyncfusionExamples/how-to-filter-and-sort-data-in-the-vue-pivottable-component

{% youtube TIXRaEdmAks %}
Basic Knowledge of Database
Published: 2023-08-04 05:16:23

1. What is a database?

A database is a warehouse for storing data. This warehouse is organized and stored according to certain data results. We can manage the data in the database through a variety of methods provided by the database.

 

2. Types of databases
There are three popular database models in the early days, namely Hierarchical Database, Network Database and Relational Database. In today’s Internet, the most commonly used database models are mainly two types, namely Relational Databases and Non-Relational Databases.

 

3. Introduction to Relational Database
Network Databases and Hierarchical Databases lack data independence and abstraction levels. When users carry out storage, they need to declare the storage structure and relative path of the data. Relational Database can solve this problem more effectively.

Like Excel workbooks, Relational Databases also use two-dimensional tables composed of columns and rows to manage data, which is easy to understand. In addition, it uses SQL to perform actual operations on the data.

 

4. Introduction to Non-Relational Database
With the rise of Internet technology, traditional relational databases have exposed many difficulties when dealing with large amounts of data. Therefore, a database product-NOSQL Database, which aims at large-scale data volume scenarios and aims at excellent performance and convenient application.

Non-Relational Databases are mainly based on the “non-relational entity model” database, also known as NoSQL database. The original intent of NOSQL is “Not only SQL”. Therefore, the emergence of NoSQL is not to completely deny relational databases, just as a A reasonable supplement to traditional relational databases.

Non-Relational Databases can also be subdivided into four small items:

1) Key-Value storage database;
2) Column-oriedted database;
3) Document-Oriented database;
4) Graph database.
Free Fire Tips & Tricks
Tags: gamedev, free, firebase, gatsby
Published: 2023-08-04 04:29:26




1. Choose Landing Locations Wisely:
Select your landing spot based on your playstyle. If you're aiming for intense action, drop in popular areas. If you prefer a quieter start, opt for less crowded places.

2. Loot Efficiently:
Prioritize grabbing essential items like weapons, armor, and medical supplies when looting. Optimize your inventory for a good balance of offense and defense. [Free Fire Hack App
](https://freefirehackapp.com/)
3. Master Weapon Selection:
Learn the characteristics of different weapon types. Generally, it's a good idea to have a mix of long-range and close-range weapons to cover various combat scenarios.

4. Improve Your Aim:
Practice your aiming skills to increase your accuracy. You can do this in training mode or by engaging in battles regularly.

5. Stay Aware of the Zone:
Pay attention to the shrinking playzone. Always be on the move and plan your movements to stay within the safe area.

6. Use Cover and Movement:
In fights, use natural cover to your advantage. Keep moving and make yourself a challenging target to hit.

7. Play Smart:
Survival is key in Free Fire. Engage in battles you're confident you can win, and know when to disengage if the odds are against you.

8. Customize Controls:
Adjust the control settings to suit your preferences. This can greatly impact your gameplay by making actions more intuitive and fluid.

9. Communicate with Your Squad:
If you're playing with a team, communication is vital. Use voice chat or the in-game messaging system to coordinate your strategies effectively.

10. Use Characters Wisely:
Each character in Free Fire has unique abilities. Choose characters that complement your playstyle and the team's overall strategy.

11. Manage Resources:
Manage your ammunition, healing items, and throwables wisely. Wasting resources can leave you vulnerable in critical situations.

12. Stay Calm Under Pressure:
Maintain your composure during intense moments. Panicking can lead to poor decisions and gameplay mistakes.

13. Learn from Your Mistakes:
After each match, take a moment to reflect on what went well and what didn't. Learning from your mistakes is crucial for improvement.

14. Practice, Practice, Practice:
Improvement takes time. Keep playing, learning, and adapting to different situations to refine your skills.

15. Watch and Learn:
Watch gameplay videos or streams of skilled players. You can pick up valuable strategies, tips, and tricks by observing their tactics.
phamquocdung
Published: 2023-08-04 04:13:29

Tôi - Phạm Quốc Dũng - CEO của một số sòng bạc và nhà cái nổi tiếng tại Campuchia, đã có nhiều cơ hội tiếp xúc với nhiều sòng bạc và nhà cái uy tín. Qua những trải nghiệm của mình tại đó, tôi đã phát hiện đam mê riêng đối với trò chơi bắn cá trong casino. Vì vậy, tôi đã tạo ra trang web banca.bid nhằm chia sẻ kinh nghiệm cá nhân về trò chơi bắn cá đổi thưởng trực tuyến với cộng đồng anh em đam mê. Trang web này được tạo ra với mục đích đánh giá các nhà cái, cổng game uy tín và chia sẻ cách chơi bắn cá tại từng cổng game, giúp cộng đồng có thể tìm thấy những sân chơi tốt và đáng tin cậy nhất. Đồng thời, qua đây tôi cũng muốn chia sẻ kiến thức và kinh nghiệm cá nhân với cộng đồng đam mê săn cá trực tuyến, giúp mọi người có thể tận hưởng trò chơi một cách tốt nhất và an toàn nhất.
Website: https://banca.bid/
Phone        0984422211
Hastag        #PhạmQuốcDũng BancaBid 
Địa chỉ        ngách 30 Ng. 460 Đ. Khương Đình, Hạ Đình, Thanh Xuân, Hà Nội, Việt Nam
https://phamquocdung.mystrikingly.com/
https://phamquocdungg.blogspot.com/2023/08/pham-quoc-dung.html
http://qucdngphm.website3.me/
https://www.anobii.com/fr/0175cc719953cc3ce5/profile/activity
https://www.vingle.net/posts/6588915
https://git.sickrage.ca/QucDng
https://dribbble.com/phamquocdung/about
https://flipboard.com/@phamquocdun2023/phamquocdung-4e1e1ugoy
https://research.openhumans.org/member/phamquocdung/
https://visual.ly/users/bancabidphamquocdung/portfolio
https://ko-fi.com/phamquocdung
https://wakelet.com/@QuocDungPham7903
https://folkd.com/user/phamquocdung
https://glose.com/u/QuocDungPham

https://www.pinterest.com/bancabidphamquocdung/
https://en.gravatar.com/phamquocdung1
https://www.blogger.com/profile/14584251920598142327
https://www.deviantart.com/phamquocdung
https://issuu.com/phamquocdung
https://www.kickstarter.com/profile/1300002625/about
https://www.openstreetmap.org/user/phamquocdung
https://phamquocdung.webflow.io/
https://knowyourmeme.com/users/phamquocdung
https://about.me/phmqucdng/
https://www.reverbnation.com/artist/phamquocdung
https://hub.docker.com/u/phamquocdung
https://profile.ameba.jp/ameba/phamquocdung
https://fliphtml5.com/homepage/fkfqa
https://peatix.com/user/18489701/view
https://www.walkscore.com/people/456663709835/walk-score-user
Game bài Net88 - Cổng game bài đổi thưởng uy tín số 1 VN
Published: 2023-08-04 04:11:38

https://gamebainet88.com Game bài Net88 cổng game bài đổi thưởng uy tín và hấp dẫn✔️ Chơi tiến lên✔️ phỏm✔️ xóc đĩa✔️ bầu cua và nhiều game khác✔️ Net88 tặng ngay 200k✔️✔️✔️
0934262723
79 Âu Cơ, Phường 14, Quận 11, Thành phố Hồ Chí Minh
https://www.mojomarketplace.com/user/gamebainet88-za6kzWriMc
https://www.pearltrees.com/gamebainet88
https://www.plurk.com/gamebainet88
https://www.provenexpert.com/gamebainet88/
郭文贵的谎言 小蚂蚁的毒品
Published: 2023-08-04 03:49:06

近年来，郭文贵的无耻不断的刷新着大众对骗子的认知，挺郭者中理智尚存的纷纷清醒，而残余蚂蚁帮扭曲的三观让吃瓜群众叹为观止。他们对漏洞百出的谎言深信不疑，对显而易见的真相置若罔闻，沉浸在郭文贵的谎言中无法清醒。郭文贵的谎言是大众的笑料，却是他自己和小蚂蚁们赖以生存、为之疯狂的毒品。如果郭文贵的喜马拉雅是疯人院，那么恭喜郭文贵和蚂蚁帮已提前到达终点。
谎言毒品——权贵
上层权贵是郭文贵一直求而不得的身份，是爆料革命不可或缺的部分，也是诱惑小蚂蚁的重要毒品。每当谎言被戳得惨不忍睹时，他就会幻想出一些神秘事件和人士抬高身价。以前的我盟、老领导、特情局、神秘会议、全球反CCP联盟组织、大军火商、前元首、美国政坛未来的高层。而小蚂蚁们也尤为喜欢这一套，为郭文贵的“独立顾问”沾沾自喜。至于故事中的商人干预政治、总统跨党派选参谋、未来领袖关键时刻不操心中期选举却管他国闲事这些与常理相悖的情节，小蚂蚁们一概忽略。郭文贵这些只为效果不顾常理的权贵故事，确实能让贪慕虚荣的无脑蚂蚁们失去理智，但这也是绝路上自欺欺人的海市蜃楼。
谎言毒品——阴谋
郭文贵眼见权贵故事被砸得粉碎，就立马换药，蹭热点爆假料，曾经为重庆公交车坠江事故塑造阴谋的面纱。这起事故的起因有黑匣子的监控视频为证，整个事件过程的回溯详细完整，强大的网友也扒出了女乘客和司机的身份，这确实是一出悲剧，但显而易见的与阴谋绝对无关。可郭文贵偏要借题发挥，杜撰出阴谋的味道，而性喜阴谋的小蚂蚁们果然无中生有的恶意揣测出了各种疑问。这是对证据确凿、事实脉络清晰的事件百般质疑，他们已经完全丧失了对真相的追求，只要有阴谋，真相完全不重要。郭文贵为了阴谋而阴谋，确实能让性喜阴谋的小蚂蚁们兴奋异常，却让大众更加看清了这出名为民主实为闹剧的所谓爆料革命的真面目。
谎言毒品——金钱
财产被冻，债台高筑，而股票又连连失利，郭文贵的财产和爆料革命一样风雨飘摇，但为了残存的蚂蚁帮，郭文贵只能硬着头皮炫耀财富。“越南制造”的战袍送不起，以次充好的领带被打脸嘲笑，不得已郭文贵编出个专业摄影师摆阔，还不忘奉上几张照片作为证明。满眼闪着金光的小蚂蚁只看得见郭文贵的虚假炫富，却看不见他对全球经济趋势的一无所知，他的巨额财富来源于罪恶终结于法律，在国外偷生的逃犯除了做梦，现实中绝不会再次侥幸成为挥斥方遒的金融大鳄。郭文贵的炫富，只能吸引无脑的小蚂蚁趋之若鹜，却无法掩盖他捉襟见肘的财务危机。
郭文贵的爆料是为了政庇，无料可爆就只能靠谎言维持，政庇遥不可及，谎言却成了郭文贵苟且度日、笼络蚁群的精神毒品，但谎言成不了现实，惩罚终将会来临，郭文贵必将自食恶果。
ModelOps pipelines for NO-CODE production
Tags: webdev, javascript, beginners, programming
Published: 2023-08-04 03:30:00

## [ModelOps Pipelines](https://www.aiforme.wiki/ai/tools/ai%20surge%20cloud) for No-Code Production with AI Surge Cloud

**Introduction:**
[AI Surge Cloud](https://www.aiforme.wiki/ai/tools/ai%20surge%20cloud) presents an innovative low-code data fabric solution to overcome data productivity challenges. 

By rapidly adopting artificial intelligence (AI) through the Tool, Service, & Application model, businesses can drive growth, efficiency, and optimization. With multi-persona capabilities, the platform enables effortless data preparation and exploratory data analysis in minutes, making it an ideal choice for organizations looking to build data applications without code.

**Revolutionizing the Data World:**

Cloud Infrastructure:
[AI Surge Cloud](https://www.aiforme.wiki/ai/tools/ai%20surge%20cloud)'s Infrastructure as Code (IaC) and auto-scaling mechanism ensure optimized resource usage, saving costs, and providing the exact resources required for data architecture.

Data Processing:
The low-code data infrastructure-as-a-platform enables businesses to focus on their core needs and ecosystem, streamlining productivity and data-driven decision-making.

Data Observability:
Data Observability ensures that the right data is available for actionable insights, enhancing data quality and reliability.

Marketing Capabilities:
Utilize multi-view capabilities to analyze individual Customer360 and visually link relationships, unlocking powerful marketing insights.

**Your First Project, Delivered in 4 Weeks:**
A[I Surge Cloud](https://www.aiforme.wiki/ai/tools/ai%20surge%20cloud) guarantees a swift solution from raw data to decision-making, delivering your first data project within a dedicated 4-week period.

Data Scientists Love AI Surge Cloud:
Data scientists praise AI Surge Cloud for its efficiency, reducing model building time from days to hours, making it easy to use, and saving valuable time.

Secure Self-Hosted Deployment:
AI Surge Cloud ensures data security with self-hosted deployment, making data science accessible and empowering businesses to make agile data-driven decisions.

Deploy as You Need:
Scale your machine learning applications on a low-code data fabric in private, public, hybrid, or multi-cloud environments, offering flexibility and adaptability.

Conclusion:

[AI Surge Cloud](https://www.aiforme.wiki/ai/tools/ai%20surge%20cloud)'s low-code data fabric revolutionizes data productivity, empowering businesses to leverage AI without coding. With a focus on simplicity, efficiency, and data observability, the platform accelerates insights while reducing costs. 

Data-driven decisions become seamless, and businesses can confidently scale their machine learning applications across various cloud environments. Join the global community of satisfied users and witness the power of AI Surge Cloud in maximizing your data's value.
Cypress入门
Published: 2023-08-04 03:28:19


![XBcHdy](https://cdn.jsdelivr.net/gh/manonicu/pics@master/uPic/XBcHdy.jpg)

Cypress 包含测试网站所必须的所有组件，可以快速编写测试用例。

## 下载源码

```bash
git clone github.com/ahfarmer/emoji-search
#安装依赖
cd emoji-search && npm install
#启动项目
npm run start
#访问http://localhost:3000
```

![65rXws](https://cdn.jsdelivr.net/gh/manonicu/pics@master/uPic/65rXws.jpg)

## 安装 Cypress

```bash
#安装
npm install cypress —save-dev

#启动
npx cypress open
#或者
./node_modules/.bin/cypress open
#或者
$(npm bin)/cypress open
```

以上命令将会在项目根目录创建`cypress`文件夹，如下： ![09GuGd](https://cdn.jsdelivr.net/gh/manonicu/pics@master/uPic/09GuGd.jpg)

## 创建测试用例

默认情况下，所有测试都存储在`cypress/integration`文件夹中，该文件夹在第一次`Cypress`启动时自动创建。在此示例中，我们将编写一个测试，该测试将：

检查输入单词`lollipop`后是否在页面上仅显示一个结果

检查标题类的标签是否包含正确的文本

首先在`cypress/integration`目录中创建一个`sample_spec.js`文件：

该文件应包含以下代码：

```js
describe('Sample test', () => {
  it('Search lollipop emoji', () => {
    cy.visit('http://localhost:3000/') // launch project website
    cy.get('input').type('lollipop') // enter 'lollipop' in search
    cy.get('.component-emoji-result-row').should('have.length', 1) // check if only 1 result is returned
    cy.contains('Lollipop').should('have.class', 'title') // check if returned element contains 'title' class
  })
})
```

你将会看到这样的窗口：

![ZabqgO](https://cdn.jsdelivr.net/gh/manonicu/pics@master/uPic/ZabqgO.jpg)

单击`sample_spec.js`后，将打开一个带有搜索引擎实例的窗口，您可以在其中实时预览执行的测试。结果应如下所示（请记住，带有示例性网站的项目应该正在运行）：

![3NotH3](https://cdn.jsdelivr.net/gh/manonicu/pics@master/uPic/3NotH3.jpg)
Swift - 内存安全
Published: 2023-08-04 03:27:42


内存安全是编程语言中的一个重要概念，它指的是在程序执行过程中，确保所有内存访问都是合法的、有效的，不会导致内存泄漏、访问未初始化的内存或非法访问其他应用程序的内存等问题。Swift 是一种内存安全的语言，它通过一系列的机制来确保内存访问的安全性。

Swift 中的内存安全机制主要包括以下几个方面：

- ARC（Automatic Reference Counting，自动引用计数）：ARC 是一种自动内存管理机制，它通过对对象引用计数的跟踪来管理内存。当一个对象没有任何引用时，ARC 会自动释放这个对象所占用的内存。
- 可选类型：Swift 中的可选类型可以表示一个值存在或者不存在的状态，它可以避免空指针异常等问题。在 Swift 中，如果一个可选类型没有明确赋值，那么它的值默认为 nil。
- 访问控制：Swift 提供了访问控制机制，可以限制对某些代码的访问权限，从而防止未经授权的访问。
- 内存访问检查：Swift 对数组、字典、字符串等常用类型的访问进行了检查，避免了越界访问等问题。
- copy-on-write 语义：Swift 中的某些类型，比如数组和字典，采用了 copy-on-write 语义。当这些类型的值被复制时，实际上并不会立即进行复制，而是共享同一块内存空间。只有在其中一个值被修改时，才会进行实际的复制操作，从而避免了不必要的内存开销。

通过以上这些机制，Swift 可以保证程序在运行过程中不会出现内存泄漏、空指针异常等问题，从而提高了程序的可靠性和稳定性。
Docker - 基本的网络操作
Published: 2023-08-04 03:27:41


实际上，大多数项目都将有一个或多个容器，这些容器需要相互通信。在这种情况下，Docker 提供了一些选项，以便容器可以相互通信。

假如现在有一个简单的应用程序，它由两个容器组成：一个 web 容器和一个数据库容器。web 容器需要与数据库容器通信，以便它可以从数据库中检索数据。

## 解决方案

- 使用暴露的端口访问数据库容器
- 使用 ip 和默认端口访问数据库容器

第一种方法设计从数据库容器中暴露端口，web 容器通过该端口连接，假设数据库容器的端口为 3306，那么 web 容器就可以通过 `http://localhost:3306` 访问数据库容器。

第二种方法使用 container inspect 命令来获取数据库容器的 IP 地址，然后使用该 IP 地址和默认端口访问数据库容器，假设数据库容器的 id 为 postgres，通过以下命令获得 IP 地址：

```bash
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' postgres
# 172.17.0.2
```

现在可以通过http://172.17.0.2:5432访问数据库容器。

两种方法都有缺点，因为它们都依赖于容器的 IP 地址，如果容器的 IP 地址发生变化，那么就需要更新 web 容器的配置。

正确的方式是放在一个网络中，这样就可以通过容器名称访问数据库容器，而不是通过 IP 地址。
Go - 包管理
Published: 2023-08-04 03:23:41


在 Go 语言中，Packages 是一种组织代码的方式。一个 package 是一组相关的 Go 文件，它们共享同一个包名。每个 Go 源文件都属于一个 package，而且在文件的开头都要声明所属的 package。

一个 package 可以包含多个 Go 文件，但是它们必须都属于同一个目录。Go 语言提倡每个 package 只做一件事情，并且把它做好。这样可以提高代码的可读性、可维护性和可复用性。

一个 package 可以被其他 package 导入并使用。在一个 package 中，可以使用 import 语句来导入其他 package。导入的 package 可以是标准库中的 package，也可以是其他第三方库或者自己编写的 package。

下面是一个简单的示例，展示了如何定义和使用 package。

我们新建一个文件夹，命名为 mymath，然后在该文件夹下新建两个 Go 文件，分别为：

math.go：定义了一个名为 Sum 的函数

```go
package mymath

func Sum(x, y int) int {
    return x + y
}
```

main.go：使用了 Sum 函数

```go
package main

import (
    "fmt"
    "mymath"
)

func main() {
    x := 3
    y := 4
    sum := mymath.Sum(x, y)
    fmt.Printf("%d + %d = %d\n", x, y, sum)
}
```

在 main.go 中，我们通过 import 语句导入了 mymath package，并调用了其中的 Sum 函数。

在命令行中进入 mymath 目录，然后使用 go run 命令运行 main.go 文件。可以看到程序输出了 3 + 4 = 7，证明了我们成功使用了 mymath package 中的函数。

## Package 特性

- 可以使用不同的可见性（Visibility）规则来限制对 package 中函数和变量的访问。Go 语言中，以大写字母开头的函数和变量是公共的，其他的是私有的，只能在同一个 package 中使用。
- 可以使用 init 函数来进行 package 的初始化操作。每个 package 中可以定义一个或多个 init 函数，这些函数在程序启动时自动被调用。
- Go 语言标准库中提供了大量的 package，例如 net 包用于网络编程、http 包用于 HTTP 服务器和客户端、os 包用于操作系统相关的功能等等。
- 有些 package 可以通过命令行工具 go get 进行安装。例如，如果要使用一个名为 github.com/user/repo 的第三方库，可以使用以下命令进行安装：

```bash
go get github.com/user/repo
```

这将自动下载、编译并安装该库。

Packages 是 Go 语言中组织代码的一种方式，可以提高代码的可读性、可维护性和可复用性。除了基本的使用方法，还有很多特性和用法需要掌握，可以通过阅读官方文档和相关书籍来深入了解。
Postgresql - Select
Published: 2023-08-04 03:23:40


[示例数据库](https://cdn.jsdelivr.net/gh/manonicu/pics@master/uPic/dvdrental.zip)

使用数据库时，最常见的就是使用`SELECT`语句来查询数据。

`SELECT`语句是 Postgresql 最复杂的一种查询语句，它可以查询数据库中的所有数据，也可以查询指定的数据。

- `DISTINCT`查询不同行的数据
- `ORDER BY`排序查询结果
- `WHERE`条件过滤查询结果
- `LIMIT`或`FETCH`限制查询结果的数量
- `GROUP BY`分组查询结果
- `HAVING`条件过滤分组查询结果
- `INNER JOIN`内连接查询结果
- `LEFT JOIN`左连接查询结果
- `FULL OUTER JOIN`全连接查询结果
- `CROSS JOIN`交叉连接查询结果
- `UNION`查询结果的并集
- `INTERSECT`查询结果的交集
- `EXCEPT`查询结果的差集

## SELECT 语法

`SELECT [select_list] FROM [table_name]`

- select_list:指定一个或多个查询字段，也可以使用`*`来查询所有字段
- table_name:指定查询的表名

## SELECT 语句的示例

#### 查询所有客户的名字

```sql
SELECT first_name FROM customer;
```

![OZfMMd](https://cdn.jsdelivr.net/gh/manonicu/pics@master/uPic/OZfMMd.jpg)

> `;`表示语句结束

#### 查询多个字段

```sql
SELECT first_name, last_name, email FROM customer;
```

![6Snfin](https://cdn.jsdelivr.net/gh/manonicu/pics@master/uPic/6Snfin.jpg)

#### 查询所有数据

```sql
SELECT * FROM customer;
```

> 尽量避免使用`*`，因为它会查询所有字段，会影响性能。

#### 表达式查询

使用`||`连接姓名查询

```sql
SELECT first_name || ' ' || last_name, email FROM customer;
```

![UbI7CW](https://cdn.jsdelivr.net/gh/manonicu/pics@master/uPic/UbI7CW.jpg)

```sql
SELECT 5*3;
```

![eCZOtM](https://cdn.jsdelivr.net/gh/manonicu/pics@master/uPic/eCZOtM.jpg)
Node.js - Events
Published: 2023-08-04 03:22:23


在 Node.js 应用程序中，事件和回调概念用于提供并发性。由于 Node.js 应用程序是单线程的，Node js 的每个 API 都是异步的。

因此，它使用异步函数来保持并发性。节点使用观察者模式。节点线程保持事件循环，在任何任务完成后，它会触发相应的事件，向事件侦听器函数发出执行信号。

## Node.js 中的事件

```js
var fs = require('fs')
var rs = fs.createReadStream('./demofile.txt')
rs.on('open', function () {
  console.log('The file is open')
})
```

## 事件模型

Node.js 有一个内置的模块，名为“ Events”，在这个模块中，可以创建、监听、销毁等事件。

使用 require ()方法引入`events`模块。此外，所有事件属性和方法都是 `EventEmitter` 对象的实例。

```js
var events = require('events')
var eventEmitter = new events.EventEmitter()
```

## 事件对象

可以使用 `EventEmitter` 对象将事件处理程序分配给自己的事件。

在下面的示例中，我们创建了一个函数，该函数将在`scream`事件被触发时执行。

```js
var events = require('events')
var eventEmitter = new events.EventEmitter()

//Create an event handler:
var myEventHandler = function () {
  console.log('I hear a scream!')
}

//Assign the event handler to an event:
eventEmitter.on('scream', myEventHandler)

//Fire the 'scream' event:
eventEmitter.emit('scream')
```
Next.js - Imperative Routing
Published: 2023-08-04 03:20:56


到目前为止，使用 `Link` 组件从一个页面导航到另一个页面。使用 `Router` 组件也可以实现相同的功能。

更新`index.js`

```jsx
import Router from 'next/router'
import Head from 'next/head'

function HomePage(props) {
  return (
    <>
      <Head>
        <title>Welcome to Next.js!</title>
      </Head>
      <div>Welcome to Next.js!</div>
      <span onClick={() => Router.push('/posts/one')}>First Post</span>
      <br />
      <div>Next stars: {props.stars}</div>
      <img src="/logo.png" alt="Logo" />
    </>
  )
}

export async function getServerSideProps(context) {
  const res = await fetch('https://api.github.com/repos/vercel/next.js')
  const json = await res.json()
  return {
    props: {stars: json.stargazers_count}
  }
}

export default HomePage
```

启动服务

```bash
npm run dev
```

验证结果

![iZhXRv](https://cdn.jsdelivr.net/gh/manonicu/pics@master/uPic/iZhXRv.png)
Linux命令export
Published: 2023-08-04 03:20:56


**export**用于设置或显示环境变量。

## 使用方法

```bash
export TEST="test"
# TEST代表变量名，test代表变量值

export -n TEST
#-n参数代表一出TEST变量
```

## 参数：

- -f 　代表[变量名称]中为函数名称。
- -n 　删除指定的变量。变量实际上并未删除，只是不会输出到后续指令的执行环境中。
- -p 　列出所有的 shell 赋予程序的环境变量。
Next.js - Environment Variables
Published: 2023-08-04 03:20:26


`Next.js` 内置了对环境变量的支持，让你可以执行以下操作：

- 使用 `.env.local` 加载环境变量
- 通过给环境变量添加 `NEXT_PUBLIC_` `前缀将环境变量暴露给浏览器

## 创建环境变量

```bash
DB_HOST=localhost
DB_USR=root
DB_PWD=123456
```

## 创建 env.js

```jsx
import Head from 'next/head'
import Container from '../../components/container'

export default function FirstPost(props) {
  return (
    <>
      <Container>
        <Head>
          <title>Environment Variables</title>
        </Head>
        <h1>Database Credentials</h1>
        <p>Host: {props.host}</p>
        <p>Username: {props.username}</p>
        <p>Password: {props.password}</p>
      </Container>
    </>
  )
}

export async function getStaticProps() {
  // Connect to Database using DB properties
  return {
    props: {
      host: process.env.DB_HOST,
      username: process.env.DB_USER,
      password: process.env.DB_PASS
    }
  }
}
```

`Next.js`会在`.env*`中自动扩展变量，即可以定义变量

```bash
HOSTNAME=localhost
PORT=3000
HOST=http://$HOSTNAME:$PORT
```
什么是docker images 和 docker registry
Published: 2023-08-04 03:19:53


## 什么是镜像

docker 镜像是一个只读的模板，用来创建 docker 容器。镜像可以用来创建多个容器，镜像是用来创建容器的，容器是镜像的运行实例。

过去不同的容器引擎有不同的镜像格式，docker 采用了统一的镜像格式，这样就可以在不同的容器引擎之间共享镜像。

容器只是镜像的运行实例，容器的生命周期结束后，容器内的数据也会消失，而镜像是不会消失的，镜像可以被多个容器共享。

```bash
# 列出本机的所有 image 文件。
$ docker image ls

# 删除 image 文件
$ docker image rm [imageName]
```

关于镜像的操作

1. 停止镜像

```bash
docker stop <ID or name>
```

2. 移除镜像

```bash
docker rm <ID or name>
```

3. 拉取最新镜像

```bash
docker pull <image name>
```

4. 启动镜像

```bash
docker run <image name> ...options
```

## 什么是 docker registry

docker registry 是一个存储和分发 docker 镜像的服务，docker registry 有两种类型：

- 公共 registry：docker hub
- 私有 registry：自己搭建的 registry

![lGvNhi](https://cdn.jsdelivr.net/gh/manonicu/pics@master/uPic/lGvNhi.jpg)