各个架构CPU intrinsic指令:x86 arm riscv powerpc

CPU intrinsic指令是一种在高级语言中提供对特定CPU指令集访问的方法。它们通常由编译器提供,允许开发者在不直接写汇编代码的情况下利用特定的CPU指令,如SIMD(单指令多数据)操作。不同的CPU架构有不同的intrinsic集合,以下是一些常见架构的intrinsic指令概述

使用 sqlparse 库解析 SQL 查询语句

以下是一个简单的 SQL 解析器的 Python 代码示例,这个代码使用了 Python 的 SQL 解析库 sqlparse,它实现了一个完整的 SQL 解析器。它接受一个 SQL 查询语句作为输入,并返回一个字典,包含了查询类型和查询目标。具体来说,它使用 sqlparse.parse 函数解析 SQL 查询语句,并根据查询类型调用相应的解析函数来获取查询目标。目前,它支持解析 SELECT、INSERT、UPDATE 和 DELETE 四种类型的查询语句。对于 SELECT 查询语句,它将返回一个包含字段列表、表名和条件的字典;对于 INSERT 查询语句,它将返回一个包含表名、字段列表和值列表的字典;对于 UPDATE 查询语句,它将返回一个包含表名、字段列表、值列表和条件的字典;对于 DELETE 查询语句,它将返回一个包含表名和条件的字典。请注意,这个解析器可能无法处理所有的 SQL 查询语句,因此您可能需要根据实际情况进行修改和扩展。

网络中的DMZ

在计算机安全中,DMZ 或非军事区(有时称为外围网络或屏蔽子网)是一个物理或逻辑子网,它包含组织的面向外部的服务并将其暴露给不受信任的、通常更大的网络,例如 Internet。 DMZ 的目的是为组织的局域网 (LAN) 添加额外的安全层:外部网络节点只能访问 DMZ 中公开的内容,而组织网络的其余部分则受到防火墙保护。 DMZ 用作位于 Internet 和专用网络之间的小型隔离网络。

WALDEN 瓦尔登湖英文版 梭罗

When I wrote the following pages, or rather the bulk of them, I lived alone, in the woods, a mile from any neighbor, in a house which I had built myself, on the shore of Walden Pond, in Concord, Massachusetts, and earned my living by the labor of my hands only. I lived there two years and two months. At present I am a sojourner in civilized life again.

I should not obtrude my affairs so much on the notice of my readers if very particular inquiries had not been made by my townsmen concerning my mode of life, which some would call impertinent, though they do not appear to me at all impertinent, but, considering the circumstances, very natural and pertinent. Some have asked what I got to eat; if I did not feel lonesome; if I was not afraid; and the like. Others have been curious to learn what portion of my income I devoted to charitable purposes; and some, who have large families, how many poor children I maintained. I will therefore ask those of my readers who feel no particular interest in me to pardon me if I undertake to answer some of these questions in this book. In most books, the I, or first person, is omitted; in this it will be retained; that, in respect to egotism, is the main difference. We commonly do not remember that it is, after all, always the first person that is speaking. I should not talk so much about myself if there were anybody else whom I knew as well. Unfortunately, I am confined to this theme by the narrowness of my experience. Moreover, I, on my side, require of every writer, first or last, a simple and sincere account of his own life, and not merely what he has heard of other men’s lives; some such account as he would send to his kindred from a distant land; for if he has lived sincerely, it must have been in a distant land to me. Perhaps these pages are more particularly addressed to poor students. As for the rest of my readers, they will accept such portions as apply to them. I trust that none will stretch the seams in putting on the coat, for it may do good service to him whom it fits.

golang通过json-iterator提供的扩展点,实现json编解码过程可定制

json-iterator/go是一个golang编解码库,主要用于比特序列与map/struct的互转,在使用过程中,我们可能需要对编解码过程进行处理,比如客户端发过来的请求体中某个字段为加密或编码过的,业务代码不想感知这种行为,如何在反序列化的过程中优雅地处理掉这种问题,json-iterator提供了Extension的机制,来满足一些复杂的编解码场景。
通过extendsion机制可实现下列能力:
* 定制化的codec
* 操作struct属性