joe %!s(int64=2) %!d(string=hai) anos
pai
achega
c393744c68

+ 3 - 0
README.md

@@ -21,6 +21,9 @@
 ## languages/python
 
 
+## languages/lua
+
+
 ## languages/v
 
 - [vlang documentation 中文版](https://git.wenlabs.org/joe/blog/src/master/content/languages/v/docs_cn.md)

+ 94 - 0
content/blockchain/solidity-in-short.md

@@ -4,3 +4,97 @@ date: 2022-04-07T11:10:45+07:00
 draft: true
 ---
 
+## `solc` 命令行
+
+- `--asm` `--optimize --asm`
+- `--via-ir`
+
+## 虛擬機(EVM)
+
+- uint: 256bit
+- address: 160bit
+- 成员访问不需要 this
+- 关键字 `public` 使变量可以从其他合约中访问
+- `event` 允许客户端对您声明的特定合约变化做出反应
+- 构造函数代码只有在合约创建时运行
+- `error` 变量允许您提供关于操作失败原因的信息, 它们会返回给函数的调用者,与 `revert` 一起使用。
+- `map` 自动初始化,不能获得所有键/值列表
+- 交易总是由发送人(创建者)签名
+- 如果您想安排您的合约的未来调用(timer),您可以使用智能合约自动化工具或oracle服务
+- 在合约创建的过程中,它的代码还是空的。 所以直到构造函数执行结束,您都不应该在其中调用合约自己函数。
+- 每笔交易都会被收取一定数量的 gas, 这些 gas 必须由交易的发起人(tx.origin)支付
+- 每个区块都有最大 gas 量
+- gas price 是交易发起人设定的值, 他必须提前向 EVM 执行器支付 gas_price * gas。 如果执行后还剩下一些 gas,则退还给交易发起人。如果发生撤销更改的异常,已经使用的 gas 不会退还
+- 以太坊虚拟机有三个存储数据的区域:存储器,内存和堆栈
+- 内存 读的宽度限制在256位, 而写的宽度可以是8位或256位
+- 合约可以通过消息调用的方式来调用其它合约或者发送以太币到非合约账户
+- 调用被 限制 在1024的深度;在一个消息调用中,只有63/64的gas可以被转发
+- 委托调用(delegatecall), 除了目标地址的代码是在调用合约的上下文(即地址)中执行, msg.sender 和 msg.value 的值不会更改之外,其他与消息调用相同
+- 合约甚至可以通过一个特殊的指令来创建其他合约
+- 从区块链上删除代码的唯一方法是当该地址的合约执行 selfdestruct 操作, 存储在该地址的剩余以太币被发送到一个指定的目标,然后存储和代码被从状态中删除.如果有人向被删除的合约发送以太币,以太币就会永远丢失
+- 尽管一个合约的代码中没有显式地调用 selfdestruct , 它仍然有可能通过 delegatecall 或 callcode 执行自毁操作。
+- 有一小群合约地址是特殊的。 1 和(包括) 8 之间的地址范围包含 “预编译合约“
+
+## 语言
+-  一个 pragma 指令始终是源文件的本地指令
+- 单位
+	- 1 wei = 1
+	- 1 gwei = 1e9
+	- 1 ether = 1e18
+- 函数修饰器
+	- virtual: 可重载
+	- 
+
+### 生僻关键字
+- modifier
+- error
+- unchecked { ... } 切换到“不检查模式
+- fixed/ufixed: 有/无符号的定长浮点型
+- address 
+	- address 20byte 
+	- address payable: 与 address 相同,但有额外的方法 transfer 和 send
+	- 允许从 address payable 到 address 的隐式转换, 而从 address 到 address payable 的转换必须通过 payable(<address>) 来明确
+	- 只有在合约可以接收以太的情况下才允许这种转换,也就是说, 合约要么有一个 receive 函数,要么有一个 payable 类型的 fallback 的函数
+	- delegatecall:只使用给定地址的代码, 所有其他方面(存储,余额,...)都取自当前的合约
+	- staticcall:基本上与 call 相同, 但如果被调用的函数以任何方式修改了状态,则会恢复。
+	- 所有的合约都可以转换为 address 类型,所以可以用 address(this).balance 查询当前合约的余额。
+
+## 全局变量
+
+- msg
+	- data
+	- sender
+	- sig
+	- value
+- tx
+	- origin
+	- gasprice
+- block
+	- basefee
+	- chainid
+	- coinbase
+	- difficulty
+	- gaslimit
+	- number
+	- timestamp
+- blockhash(unit blockNumber) returns (bytes32)
+- gasleft() returns (uint256)
+
+## 合约
+- 当一个合约被创建时,它的 构造函数(constructor) (一个用 constructor 关键字声明的函数)被执行一次。构造函数执行完毕后,合约的最终代码被存储在区块链上。部署的代码不包括构造函数代码或只从构造函数调用的内部函数。
+- 状态变量可见性
+	- public
+	- internal
+	- private: 派生合约中是不可见
+- 函数可见性
+	- external: 一个外部函数 f 不能从内部调用 (即 f() 不起作用,但 this.f() 可以)。
+	- public: 
+	- internal:
+	- private: 
+- constant, immutable 状态变量:对于 constant 变量,其值必须在编译时固定, 而对于 immutable 变量,仍然可以在构造时分配。
+- 状态可变性
+	- view: 函数承诺不修改状态
+	- pure: 函数承诺不读取或修改状态
+- 特殊函数
+	- 最多一个 `receive() external payable{}` 函数
+	- 最多一个 `fallback() external [payable]` 或 `fallback(bytes calldata input) external [payable] returns (bytes memory output)`

+ 1 - 1
content/history/events/yiyangzhihan.md

@@ -16,7 +16,7 @@ draft: false
 
 君曰:“子为寡人谋,且奈何?”
 
-对曰:“君谓景翠曰:‘公爵为执圭,官为柱国,战而胜,则无加焉矣;不胜,则死,不如背秦援宜阳,公进兵。秦恐公之乘其弊也,必以宝事公;公慕公之为己乘秦也,亦必尽其宝。’”
+对曰:“君谓景翠曰:‘公爵为执圭,官为柱国,战而胜,则无加焉矣;不胜,则死,不如背秦援宜阳,公进兵。秦恐公之乘其弊也,必以宝事公;公慕公之为己乘秦也,亦必尽其宝。’”
 
 秦拔宜阳,景翠果进兵。秦惧,遽效煮枣;韩氏果亦效重宝。景翠得城于秦,受宝于韩,而德东周。
 

+ 203 - 0
content/languages/lua/api.md

@@ -0,0 +1,203 @@
+---
+title: "Api"
+date: 2023-11-04T14:29:51+07:00
+draft: true
+---
+
+## 类型
+
+```c
+lua_Number
+lua_Integer
+
+luaL_Buffer
+
+```
+## 函数
+```c
+lua_State* luaL_newstate();
+
+void luaL_openlibs(lua_State*L);
+int luaL_loadbuffer(lua_State*L, const char* buf, int len, const char* name);
+int luaL_newmetatable (lua_State *L, const char *tname);
+int luaL_optint (lua_State *L, int narg, int d);
+lua_Integer luaL_optinteger (lua_State *L,
+                             int narg,
+                             lua_Integer d);
+long luaL_optlong (lua_State *L, int narg, long d);
+const char *luaL_optlstring (lua_State *L,
+                             int narg,
+                             const char *d,
+                             size_t *l);
+const char *luaL_optstring (lua_State *L,
+                            int narg,
+                            const char *d);
+
+lua_Number luaL_optnumber (lua_State *L, int narg, lua_Number d);
+
+// 
+void luaL_checkstack (lua_State *L, int sz, const char *msg);
+const char *luaL_checkstring (lua_State *L, int narg);
+const char *luaL_checklstring (lua_State *L, int narg, size_t *l);
+lua_Number luaL_checknumber (lua_State *L, int narg);
+int luaL_checkoption (lua_State *L,
+                      int narg,
+                      const char *def,
+                      const char *const lst[]);
+void *luaL_checkudata (lua_State *L, int narg, const char *tname);
+// 检查函数参数 narg 是否是类型 t
+void luaL_checktype(lua_State*L, int narg, int t);
+
+int lua_load(lua_State*L, lua_Reader reader, void*data, const char* chunkname);
+void lua_call(lua_State*L, int nargs, int nresults);
+int lua_pcall(lua_State*L, int nargs, int nresults, int errfunc);
+
+int lua_status (lua_State *L);
+int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar);
+void lua_close(lua_State*L);
+
+/* push 系列
+	栈中索引是以 1 开始。第一个压入栈中元素为 1. -1 表示栈顶
+*/
+void lua_pushnil(lua_State*L);
+void lua_pushboolean(lua_State*L, int bool);
+void lua_pushnumber(lua_State*L, lua_Number n);
+void lua_pushinteger(lua_State*L, lua_Integer n);
+void lua_pushlstring(lua_State*L, const char*s, size_t len);
+void lua_pushstring(lua_State*L, const char*s);
+void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n);
+int lua_checkstack(lua_State*L, int sz);
+
+/*返回值
+LUA_TNONE
+LUA_TNIL
+LUA_TNUMBER
+LUA_TBOOLEAN
+LUA_TSTRING
+LUA_TTABLE
+LUA_TFUNCTION
+LUA_USERDATA
+LUA_TTHREAD
+LUA_TLIGHTUSERDATA
+*/
+int lua_type(lua_State*L, int index);
+// 转换 type 为字符串
+const char* lua_typename(lua_State*L, int type)
+
+/* lua_is***
+	兼容类型返回 1, 否则返回 0。(lua_isboolean例外)
+*/
+int lua_isnumber(lua_State*L, int idx);
+int lua_isboolean(lua_State*L, int idx);
+int lua_isfunction(lua_State*L, int idx);
+int lua_istable(lua_State*L, int idx);
+int lua_isstring(lua_State*L, int idx);
+int lua_isnil(lua_State*L, int idx);
+int lua_iscfunction(lua_State*L, int idx);
+
+/** lua_to***
+*/
+int lua_toboolean(lua_State*L, int idx);
+lua_Number lua_tonumber(lua_State*L, int idx);
+lua_Integer lua_tointeger(lua_State*L, int idx);
+const char* lua_tolstring(lua_State*L, int idx, size_t* len);
+const char* lua_tostring(lua_State*L, int idx);
+lua_CFunction lua_tocfunction (lua_State *L, int index);
+const void *lua_topointer (lua_State *L, int index);
+lua_State *lua_tothread (lua_State *L, int index);
+void *lua_touserdata (lua_State *L, int index);
+size_t lua_objlen(lua_State*L, int idx);
+
+/** stack
+ */
+int lua_gettop(lua_State*L);
+void lua_settop(lua_State*L, int idx);
+// 指定索引入栈
+void lua_pushvalue(lua_State*L, int idx);
+void lua_remove(lua_State*L, int idx);
+// 栈顶元素插入
+void lua_insert(lua_State*L, int idx);
+// 弹出栈顶,并设置到索引
+void lua_replace(lua_State*L, int idx);
+void lua_pop(lua_State*L, int num);
+
+lua_CFunction lua_atpanic(lua_State*L, lua_CFunction panicf);
+
+int lua_error(lua_State*L);
+/**
+ what:
+ LUA_GCSTOP
+ LUA_GCCRESTART
+ LUA_GCCOLLECT
+ LUA_GCCOUNT
+ LUA_GCCOUNTB
+ LUA_GCSTOP
+ LUA_GCSETPAAUSE
+ LUA_GCSETSTEPMUL
+ */
+int lua_gc(lua_State*L, int what, int data);
+
+void lua_getfenv (lua_State *L, int index);
+int lua_setfenv (lua_State *L, int index);
+void lua_getglobal (lua_State *L, const char *name);
+void lua_setglobal (lua_State *L, const char *name);
+
+// table
+void lua_getfield (lua_State *L, int index, const char *k);
+void lua_setfield (lua_State *L, int index, const char *k);
+int lua_getmetatable (lua_State *L, int index);
+int lua_setmetatable (lua_State *L, int index);
+void lua_gettable (lua_State *L, int index);
+void lua_settable (lua_State *L, int index);
+
+
+int lua_rawequal (lua_State *L, int index1, int index2);
+// 
+void lua_rawget (lua_State *L, int index);
+
+void lua_rawgeti (lua_State *L, int index, int n);
+
+void lua_rawset (lua_State *L, int index);
+
+void lua_rawseti (lua_State *L, int index, int n);
+
+
+
+void luaL_buffinit (lua_State *L, luaL_Buffer *B);
+void luaL_addchar (luaL_Buffer *B, char c);
+void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l);
+void luaL_addsize (luaL_Buffer *B, size_t n);
+void luaL_addstring (luaL_Buffer *B, const char *s);
+void luaL_addvalue (luaL_Buffer *B);
+void luaL_pushresult (luaL_Buffer *B);
+```
+## C 中保存状态
+
+- 全局变量(注册表)
+- 函数环境(环境)
+- upvalue(closure)
+
+## 元表和元方法
+
+### 算术类
+- __add
+- __sub
+- __mul
+- __div
+- __unm (相反数)
+- __mod
+- __pow
+- __concat
+
+### 关系类
+- __eq
+- __lt
+- __le
+
+### 库定义
+- __tostring
+- __metatable
+
+### table 访问
+- __index 	访问不存在的 key
+- __newindex 对不存在的 key 赋值

+ 15 - 0
content/middleware/makefile.md

@@ -0,0 +1,15 @@
+---
+title: "Makefile 速记"
+date: 2023-11-01T09:36:27+07:00
+draft: true
+---
+
+##
+
+- $@ 表示规则中的目标文件集
+- $% 仅当目标是库文件时,表示规则中的目标成员名
+- @< 依赖目标中的第一个目标名字
+- $? 所有比目标新的依赖目标的集合
+- $^ 所有的依赖目标的集合,以空格分隔,并自动去重
+- $+ 同 $^,不去重
+- $* 

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 133 - 0
content/posts/vinu_validator.md


+ 9 - 0
content/res/docs_or_books.md

@@ -54,3 +54,12 @@ draft: false
 > using C
 - [ANSI Common Lisp 中文](https://acl.readthedocs.io/en/latest/index.html)
 > 简繁
+
+- [Rust 秘典(死灵书)](https://nomicon.purewhite.io/)
+- [Asynchronous Programming in Rust](https://rust-lang.github.io/async-book/)
+- [The Cargo Book](https://doc.rust-lang.org/cargo/index.html)
+- [Rust 语言备忘清单](https://cheats.rs.kingfree.moe/)
+- [Rust Language Cheat Sheet](https://cheats.rs/)
+- [rust-learning git repo](https://github.com/ctjhoa/rust-learning)
+- [The Rust Programming Language](https://doc.rust-lang.org/book/title-page.html)
+- [Rust 程序设计语言](https://rustwiki.org/zh-CN/book/title-page.html)

+ 2 - 0
content/res/github_projects.md

@@ -135,6 +135,8 @@ draft: false
 - [notify]https://github.com/nikoksr/notify
 > A dead simple Go library for sending notifications to various messaging services.
 - [nginx-ui](https://github.com/0xJacky/nginx-ui)
+- [muraena](https://github.com/muraenateam/muraena)
+> Muraena is an almost-transparent reverse proxy aimed at automating phishing and post-phishing activities.
 
 ### Python
 

+ 13 - 7
content/res/languages.md

@@ -6,18 +6,24 @@ draft: false
 
 ## prolog
 
-- [swi-prolog](https://www.swi-prolog.org/)
+- [anko](https://github.com/mattn/anko)
+> Scriptable interpreter written in golang
+- [assemblyscript](https://www.assemblyscript.org)
+- [bog](https://github.com/Vexu/bog)
+- [goja](https://github.com/dop251/goja)
+> ECMAScript/JavaScript engine in pure Go
 - [gprolog](http://www.gprolog.org/)
 - [mistql](https://www.mistql.com/)
-- [ruby](https://www.ruby-lang.org/en/)
+- [mojo](https://www.modular.com/mojo)
 - [mruby](https://mruby.org/)
-- [rubyonrails](https://rubyonrails.org/)
-- [assemblyscript](https://www.assemblyscript.org)
-- [pike](https://pike.lysator.liu.se/)
 - [nelua](https://github.com/edubart/nelua-lang)
+- [pike](https://pike.lysator.liu.se/)
+- [ruby](https://www.ruby-lang.org/en/)
+- [rubyonrails](https://rubyonrails.org/)
+- [swi-prolog](https://www.swi-prolog.org/)
+- [tengo](https://github.com/d5/tengo)
+> A fast script language for Go
 - [zig](https://github.com/ziglang/zig)
 > 更好的C
-- [bog](https://github.com/Vexu/bog)
 > zig 实现的一个强类型脚本语言
-- [mojo](https://www.modular.com/mojo)
 > For all AI developers

+ 2 - 1
content/res/tools.md

@@ -24,4 +24,5 @@ draft: false
 - [nps](https://github.com/ehang-io/nps)
 > 一款轻量级、高性能、功能强大的内网穿透代理服务器。支持tcp、udp、socks5、http等几乎所有流量转发,可用来访问内网网站、本地支付接口调试、ssh访问、远程桌面,内网dns解析、内网socks5代理等等……,并带有功能强大的web管理端。
 - [gost](https://github.com/ginuerzh/gost)
-> GO Simple Tunnel - a simple tunnel written in golang
+> GO Simple Tunnel - a simple tunnel written in golang
+- [contabo VPS 矿机](https://contabo.com/en/)

+ 27 - 0
content/specs/blockchain_game.md

@@ -0,0 +1,27 @@
+---
+title: "Blockchain_game"
+date: 2023-11-17T16:43:19+07:00
+draft: true
+---
+
+## Design
+
+Contract + HTTP server
+
+- Contract 提供链上数据
+- HTTP 提供前端资源和 WS 接口
+
+### 基本架构
+
+- Contract-1: ERC-20 coin, 用于游戏中代币
+- Contract-2: NFT, 游戏中使用
+- Contract-3: 游戏逻辑上链(optional)
+- HTTP: 提供前端资源下载
+- WS: 游戏中推送
+
+### Pushment
+
+### Randomize Seed
+
+### Cross Chain
+

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio