lxdlam 最近的时间轴更新
lxdlam's repos on GitHub
Go · 4 人关注
monkey-plus
The Monkey programming language implementation by Ramen.
CSS · 2 人关注
hitwh-2018-newbie
HIT@WH 2018 Newbie Contest Materials
HTML · 2 人关注
lxdlam.github.io
C++ · 1 人关注
CP-Answers
My own competitive programming answers
1 人关注
kilo-tutorial
build your own text editor
HTML · 0 人关注
attractors
prototypin' shtuff
C++ · 0 人关注
banshao
WIP
Python · 0 人关注
BigBedBot
hmmm
C · 0 人关注
BuildLisp
A Lisp implemention based on http://buildyourownlisp.com/contents
0 人关注
cf-tool
:bar_chart: Codeforces Tool (Submit, Parse, Test, Watch, Pull, etc.). Provide executable files (Win, macOS, Linux, about 6 MB).
JavaScript · 0 人关注
cheerio
Fast, flexible, and lean implementation of core jQuery designed specifically for the server.
0 人关注
chinese-independent-blogs
中文独立博客列表
JavaScript · 0 人关注
crowds
The Wisdom and/or Madness of the Crowds
0 人关注
dot-files
My own dot configs
0 人关注
dotfiles
0 人关注
elixir-lang.github.com
Website for Elixir
C++ · 0 人关注
GAC
Implement algorithms in "GrokkingAlgorithms" using C++ \ 《算法图解》C++实现
0 人关注
GitLearnInPractice
qwe
0 人关注
go
The Go programming language
0 人关注
goenums
Type Safe Enum generator for Go
0 人关注
gol-rust
A Conway's Game of Life implementation in vanilla Rust
JavaScript · 0 人关注
hackergame2021-writeups
中国科学技术大学第八届信息安全大赛的官方与非官方题解
0 人关注
hackergame2022-writeups
中国科学技术大学第九届信息安全大赛的官方与非官方题解
CSS · 0 人关注
hugo-theme-even
🚀 A super concise theme for Hugo https://blog.olowolo.com/example-site/
C · 0 人关注
Judger
Online judge sandbox based on seccomp | 需要Java JNI和php C extension集成,欢迎contribute
Python · 0 人关注
JudgeServer
Vue · 0 人关注
lightblog
Python · 0 人关注
LPTHW
the answers and exercises of Learn Python the HARD WAY, based on the THIRD EDITION of chinese.
0 人关注
lxdlam
Self-introduction
lxdlam

lxdlam

Stay hungry, stay foolish
V2EX 第 91515 号会员,加入于 2015-01-13 12:44:59 +08:00
今日活跃度排名 3587
根据 lxdlam 的设置,主题列表被隐藏
二手交易 相关的信息,包括已关闭的交易,不会被隐藏
lxdlam 最近回复了
20 小时 43 分钟前
回复了 lsk569937453 创建的主题 程序员 目前来看 CAP 理论中的 CP 和 AP 最容易造的轮子是?
@lxdlam 有一定差距 -> 有一定不同
20 小时 43 分钟前
回复了 lsk569937453 创建的主题 程序员 目前来看 CAP 理论中的 CP 和 AP 最容易造的轮子是?
Zookeeper 不是 Paxos ,而是自己发明的协议 ZAB ,跟 Paxos 有一定差距;实现了 Paxos 的系统有很多,比如 Google 的 Chubby 和 Scylla DB 。

同样,根据 DDIA 的说法,现代 CAP 其实逐渐式微,因为现代系统设计里面这三个每一个话题都会有很多需要考虑的问题,不再只是单纯的 3 选 2 了。
1 天前
回复了 onlyApple 创建的主题 程序员 Al 可以推理 AES 算法??
@ShinichiYao #28 如果 Key space 足够小且 IV 的 space 也足够小的情况下,知道一定的 plaintext 才是可以攻击出密钥的,这个叫做 Known-plaintext Attack 。

在已知范围内,如果不满足上面的结论,AES (所有模式)都免疫 KPA ,这是因为 KPA 的一种最直接的攻击就是遍历 key 跟 iv space ,尝试每一种可能的 combination ,如果都在 2^16 这个级别,现在的好一点的家用电脑可能不需要一晚上时间。而在现代实践中,AES 一般使用 128bit 及以上的 key ,这种情况下即使 IV space 较小,攻击难度也非常大。跟知道多少 (plaintext, encrypted) 无关。

Reference: https://crypto.stackexchange.com/questions/100521/for-aes-gcm-does-knowing-plaintext-and-ciphertext-allow-attacker-to-learn-the-k
零知识证明。
@kuanat OCaml 有两种数据对象,一种是传统的函数式对象 Record ,这个是 nomimal 的,类型 tag 区分不同类型,而 object 和 module system 是 structural 的,实际上我例子中提到的函数可以这么写:

```ocaml
let print (bar : < foo : string; .. >) = print_endline bar#foo;;
```

注意到这个独特的签名,其实要求 `bar` 需要具有一个特定的 foo 即可,对其他的都不要求。
@lxdlam oops ,应该是 #10 ,看错楼了
@lxdlam 补充一点,Go 的基于 Signature 的 interface matching ,实际上 OCaml 早实现出来了,即使是 First class module ,也是 2011 年引入的,早于 Go 。

```ocaml
module type Foo = sig val foo : string end;;

class a = object method foo = "A" end;;
class b = object method foo = "B" end;;

let print bar = print_endline bar#foo;;

print (new a);; (* "A" *)
print (new b);; (* "B" *)
```
不同意 #14 的说法,实际上 #14 所需要的只是 Composable 的 interface ,而并不是所谓的 duck typing 。

引用原文:

> - Don't implement Interfaces preemptively.

在这里提到的 case 实际上是因为,Java 由于无法对任意 External Type 实现 Internal interface ,所以如果原始的行为 Contract 没有被声明为 Interface ,我们既不能实现我们自己的替代品(有 interface 的情况下,实现一个 Adapter 不就可以了?),也无法使用我们的 interface 去将其替代;而这个限制在 Rust 中已经被放宽到不允许使用 External struct 去实现 External trait ( https://doc.rust-lang.org/book/ch10-02-traits.html#implementing-a-trait-on-a-type )。

而 Go 这种 Duck typing ,实际上比起 Java 的显式声明,是另一种推卸责任。举个例子,假定我存在两个 interface:

```go
type Visitor interface {
Saw() bool // If we have seen this node
}

type Sawyer interface {
Saw() bool // Can sawyer saw?
}
```

当我实现 `func (???) Saw() bool` 的时候,我究竟在实现谁?这大大加剧了误用几率,反而在工程上是一个 bad practice 。(这种 case 一定存在,参考 Hyrum's Law - https://www.hyrumslaw.com/ ,一个行为只要被足够多的人观察,无论是否跟你的设计和想法保持一致,一定会有人在依赖这个行为)。

如何回避上述行为?一种方案是实现一个空的 method ,限定其在特定 namespace 下面,比如:

```go
type Visitor interface {
Saw() bool

IsVisitorImpl()
}
// ...
```

但这跟 Java 的 `implements XXX` 相比,无非是把这个 Tag 下推到 `interface` 内部了,本质是完全一样的。

而如果实现细粒度的 `interface`,#40 提出了一个很好的例子,我们甚至可以:

```java
public interface Putter {
String put(Item item);
}

public interface Getter {
Item get(String key);
}

public class Storage {
private Putter putter;
private Getter getter;
}
```

虽然有点累赘,一样实现了类似的细粒度接口组合,并未有任何功能上的差异。
看 op 应该是 Oracle

猜测 union 查询命中了联合索引,所以不需要对 `datetime` 排序,只需要决定起始位置就可以直接 fetch 数据;而 IN list 先对命中三个条件的数据进行 merge ,然后 sort 后再筛选,无论是合并、排序操作还是需要扫描的行数( 8989K > 2123K+180K )都远比前一个查询计划大。

一种可行的优化可以尝试 over partition 拆成三个子表排序再重新 where 一下,不确定优化效果,需要再 explain 一下看看,参考 https://use-the-index-luke.com/sql/partial-results/window-functions
6 天前
回复了 um1ng 创建的主题 机械键盘 24 年了大家在用什么键盘
家里 Apex Pro TKL Wireless
公司 宁芝 Micro84
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2350 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 26ms · UTC 01:41 · PVG 09:41 · LAX 18:41 · JFK 21:41
Developed with CodeLauncher
♥ Do have faith in what you're doing.