# C# Tuple Element Names and Method Signatures

Methods in C# have special checks if tuples appear in their signatures. Sometimes you can see confusing compile errors due to these checks, for example, in interface implementation. Unfortunately there is no such a “formal document” that defines these behaviors. So I note them down here, which may serve as a side note until the specification follows up (or not :D).

# C# 元组元素名称和方法签名相关

C# 中带元组的方法，在涉及继承、接口实现等等情况时遵循特殊的规则。可惜这部分并没有一篇文档记载，于是我就先记下来，以后如果这个规则正式成文了（或没成文），本文都可以起到参考作用。

# 小谈 .NET 和 Java 的并发容器 API 设计

• 为什么 ConcurrentHashMap<K, V> 不支持 null 值？因为这样就无法区分给定的键不存在还是对应值就是 null
• 为什么 ConcurrentHashMap<K, V> 不支持 null 键？可能只是 Lea 自己的喜好——因为从逻辑上来说，允许也没有什么问题（虽然有潜在的语义错误）。

# C++ 模板类的非待决名查找

#define DECLARE_CLASS(this_class, base_class) \
typedef base_class MyBase; \
typedef this_class MyClass


#define DECLARE_ROOT_CLASS(class_name) \
typedef class_name MyClass

#define DECLARE_CLASS(class_name) \
typedef MyClass MyBase; \
typedef class_name MyClass


class Base {
DECLARE_ROOT_CLASS(Base);
};

class Derived : public Base {
DECLARE_CLASS(Derived);
};


# 几种斐波那契数列项算法的复杂度分析

GRIS 的文章，没鸽。真的。星月妹妹什么时候骗过你了？而且我还准备开新坑讲一下 BEATLESS

“回字有四样写法，你知道么？”

GRIS 的文章呢？

# NW.js 的上下文问题

NW.js 有一个或两个上下文，使用时要多加小心。

# The "New" Encryption of HCA Audio

Recently CRI Middleware updated their latest ACB archives’ format, and they seemed to have updated encryption of HCA files as well. As a result, the old toolsets can do nothing on the updated files. After about 20 hours of research I finally found what they changed on the decryption. Might be the first in the world, again. This is what’s called “highlight moment” in reverse engineering. XD

The final answer is somewhat simple: transform the decryption key, and use the transformed key to initialize the decryption table. The formula is key' = key * ((uint64_t)(k2 << 16) | (uint16_t)(~k2 + 2)) where key is the input key and k2 is a secondary key stored in the higher 16 bits of “field alignment” field, in each ACB/AWB file.

My result is based on various people’s works. Without thoses pieces, the whole puzzle cannot be completed. So a big thank you for everyone involved.

Be noted again: the contents in this article must not be used for commercial purposes.

# HCA 的“新式”加密

English version can be found here.