阅读视图

发现新文章,点击刷新页面。
☑️ ☆

为网站启用 IPv6 支持

本文描述如何以 NAT64 的方式,为网站启用 IPv6 支持。这篇文章与之前的 IPv6 文章不同:之前讲的是:“假如我是一个 IPv4-only 的用户,我怎样才能访问一个 IPv6-only 的互联网服务”,而这篇文章讲的是:“假如我的站点是 IPv4-only 的,我该如何向 IPv6-only 的用户提供服务“。
☑️ ☆

Sketching and implementing a binary protocol:Concepts and Concerns

本文介绍了如何使用二进制协议作为应用程序之间的通信协议,并介绍了如何在应用层实现 framing 代码,使得上层代码接收消息、发送请求和处理请求更加方便。同时,还介绍了 Apple 的 Network Framework 提供的便于使用的 API,让开发者能够更好更快地完成 framing 和 sending / recving 的逻辑分离的工作。
☑️ ⭐

多核并行计算

该文介绍了多核并行计算的实现方法,以及管线并行和数据并行的效果对比。实现管线并行的关键是使用 barrier 同步机制来实现 workers 和流水线传送带之间的同步。在一个更加复杂的系统中,可能需要显式地移动(复制)数据本身。通过测试,可以看到管线并行和数据并行都比串行计算快,但如果计算的步骤分得足够细,则管线并行的加速效果会更好一些。
☑️ ☆

LeetCode 256 Paint House

This article discusses the dynamic programming (DP) algorithm design technique and uses LeetCode 256 Paint House as an example to demonstrate its application. The problem is to paint n houses with three colors such that no two adjacent houses have the same color. A cost matrix is given, and the goal is to find the minimum cost of painting all the houses. The DP solution has a time complexity of O(n) and a space complexity of O(1) for three colors, and O(nm) and O(m) for m colors. The article provides a detailed explanation of the DP algorithm and includes the code implementation in C++.
☑️ ☆

基于链表生成所有 N 元 permutations

本文介绍了如何使用链表生成 N 元 permutations,同时提供了 C++ 代码实现。文章还讨论了有重复元素的情形,并给出了相应的代码实现。最后,文章简要介绍了链表型数据结构的其它应用。
☑️ ⭐

基于 golang channel 实现的比较

该文章介绍了如何使用 golang channel 实现比较,通过实现 Walkable 接口和 IsEqual 函数,可以比较任何实现了 Walkable 接口的类型,包括自定义结构体、tree、slice、文件等。只要一个类型是可 Walk 的,并且 Walk 过程中访问过的值能够代表它本身,则可以用上述方式进行比较。
❌