解决: Vue 3 遇到 process is not defined

解决: Vue 3 遇到 process is not defined
主要智能合约语言:Solidity
合约编程语言是智能合约开发者最基本的部分,你至少应该掌握一种才能编写智能合约。合约语言通常不是传统的编程语言(如C/C++,Python等), 为了保证合约代码在任何一个区块链节点上都能够得到一个确定的执行结果, 必须要求合约不能访问外部世界(如进行HTTP连接或操作文件),早期的区块链开发者们设计出了专为编写合约的编程语言,如Solidity、Vyper, 后来又诞生了一些新的合约语言如Move或Rust(但包含一些使用限制)。好消息是这些语言都大量借鉴了传统编程语言的语法,如Solidity借鉴JavaScript、Vyper借鉴Python,这使得成为一名合约开发者的学习曲线平坦了一些。
目前90%的智能合约都是Solidity写的。Solidity算是最早也是最流行的面向对象的高级静态语言,最初2014年是为以太坊EVM量身设计的, 后来又出现了很多兼容以太坊EVM的区块链平台(如Ethereum、Avalanche、Moonbeam、Polygon、BSC),所以现在Solidity也可以运行在其他那些兼容EVM的区块链上。 在目前排名前十的 Defi项目 中,有九个使用Solidity作为他们的主要编程语言。
Solidity发展至今已经快十年,生态内已经有大量优秀的开发工具可供使用,包括第三方库以及IDE等(后面介绍)。另外,在EVM上运行的比Solidity更原生的语言是汇编语言Yul,进阶Solidity时你会了解到Solidity与Yul通过内联交互以提高性能的应用。
需要注意的是,Solidity在语法设计上存在一些缺陷,当然,这些年不断的被改进,在易用性和安全性上已经得到了极大的提升。
对于Solidity的学习,这里强烈推荐本仓库主页中列出的书籍 智能合约技术与开发 ,且在本仓库中也存放有笔者对该书的代码笔记 。
SpringCloud下的微服务生态介绍
阿波罗配置中心的几个核心概念
application (应用)
environment (环境)
cluster (集群)
namespace (命名空间)
Apollo核心概念之“Namespace”
Namespace是配置项的集合,类似于一个配置文件的概念。
Apollo在创建项目的时候,都会默认创建一个“application”的Namespace。顾名思义,“application”是给应用自身使用的,熟悉Spring Boot的同学都知道,Spring Boot项目都有一个默认配置文件application.yml。在这里application.yml就等同于“application”的Namespace。对于90%的应用来说,“application”的Namespace已经满足日常配置使用场景了。
Config config = ConfigService.getAppConfig();
Config config = ConfigService.getConfig(namespaceName);
配置文件有多种格式,例如:properties、xml、yml、yaml、json等。同样Namespace也具有这些格式。在Portal UI中可以看到“application”的Namespace上有一个“properties”标签,表明“application”是properties格式的。
注1:非properties格式的namespace,在客户端使用时需要调用
ConfigService.getConfigFile(String namespace, ConfigFileFormat configFileFormat)
来获取,如果使用Http接口直接调用时,对应的namespace参数需要传入namespace的名字加上后缀名,如datasources.json。
注2:apollo-client 1.3.0版本开始对yaml/yml做了更好的支持,使用起来和properties格式一致:
Config config = ConfigService.getConfig("application.yml");
,Spring的注入方式也和properties一致。
Namespace的获取权限分为两种:
这里的获取权限是相对于Apollo客户端来说的。
private权限的Namespace,只能被所属的应用获取到。一个应用尝试获取其它应用private的Namespace,Apollo会报“404”异常。
public权限的Namespace,能被任何应用获取。
Go语言:注释例子
// main is a user's login Service.
package main
import "fmt"
// @Title main.go
// @Description main.go contains the user login function and logout function
// @Create XdpCs 2023-03-13 11:14
// @Update XdpCs 2023-04-03 11:20
// User defines user login info
type User struct {
UserName string // user's name
Password string // user's password
}
// IUser defines user function
type IUser interface {
Login() // user login into the system
Logout() // user logout the system
}
var _ IUser = (*User)(nil)
// Login
// @Description User login into the system and print success or print failed
// @Create XdpCs 2023-04-03 13:12:23
// @Modified XdpCs 2023-04-03 13:18:00
// @Modify description Fix comment
func (user *User) Login() {
if user.UserName == "XdpCs" && user.Password == "11141118" {
fmt.Println("登录成功")
return
}
fmt.Println("登录失败")
}
// Logout
// @Description User logout the system and print success
// @Create XdpCs 2023/3/13 11:14
func (user *User) Logout() {
fmt.Println("注销成功")
}
// Register
// @Description User login into the system and print success or print failed
// @Create XdpCs 2023-04-03 13:20:40
// @Param userName string user's name
// @Param password string user's password
// @Return *User object contains userName and password
func Register(userName string, password string) *User {
return &User{
UserName: userName,
Password: password,
}
}
func main() {
user := Register("XdpCs", "11141118")
user.Login()
user.Logout()
}
K8s选择器:关于nodeSelectorTerms、matchExpressions
1. If you specify both nodeSelector and nodeAffinity, both must be satisfied for the pod to be scheduled onto a candidate node.
2. If you specify multiple nodeSelectorTerms (i.e. multiple matchExpression blocks) associated with nodeAffinity types, then the pod can be scheduled onto a node if one of the nodeSelectorTerms can be satisfied.
3. If you specify multiple matchExpressions associated with nodeSelectorTerms, then the pod can be scheduled onto a node only if all matchExpressions is satisfied.
ElasticSearch自定义字典配置
IKAnalyzer.cfg.xml
can be located at {conf}/analysis-ik/config/IKAnalyzer.cfg.xml
or {plugins}/elasticsearch-analysis-ik-*/config/IKAnalyzer.cfg.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>IK Analyzer 扩展配置</comment>
<!--用户可以在这里配置自己的扩展字典 -->
<entry key="ext_dict">custom/mydict.dic;custom/single_word_low_freq.dic</entry>
<!--用户可以在这里配置自己的扩展停止词字典-->
<entry key="ext_stopwords">custom/ext_stopword.dic</entry>
<!--用户可以在这里配置远程扩展字典 -->
<entry key="remote_ext_dict">location</entry>
<!--用户可以在这里配置远程扩展停止词字典-->
<entry key="remote_ext_stopwords">http://xxx.com/xxx.dic</entry>
</properties>
QQ邮箱问题:邮箱配置后发送邮件日志输出:Send email failed: 535 Error: authentication failed, system busy #1271