一杯咖啡的账

这篇笔记的第一行写于丽江的三联书店:此刻我是丽江最富有的人。 那时候我在读《黑金:咖啡秘史》。一个觉得自己很富有的下午,一本讲这杯东西怎么把成本推给别人的书。 ...

2026-10-18 · 4 min

边界不止在墙上

去耶路撒冷的人,第一眼看到的边界通常是墙。高高的混凝土墙,检查站,轻轨从墙边穿过去。但这本书把镜头放低了:橄榄山上的一条巷子,一家咖啡馆,几户人家;然后再把镜头抬起来,越过城门,落到墙下。 ...

2026-10-18 · 13 min

如何从零开始构建简单的MCP

简介 这是一篇介绍如何从零开始构建 MCP server 的简单说明。本说明由三部分组成:UV 介绍、代码开发和部署。 UV 简介 UV是一个基于 rust 的 Python 软件包和项目管理器。除了 UV 非常快之外,UV 与其他管理器没有什么区别。此外,MCP 使用 UVX(运行 python 包的 UV 工具)来运行服务器。因此,在本说明中,我们将使用 UV 来管理我们的项目。 ...

2025-04-27 · 4 min

how to build a simple mcp tool server from scratch

Pre-assumption This guide assumes that readers are familiar with Linux or MacOS command line interface (CLI) and what is a MCP server. Brief introduction This guide shows how to build a MCP server from scratch. This note is composed by three parts: UV introduction, Code development, and deployment. UV introduction UV is a rust based Python package and project manager. There are no differences between UV and other managers except UV is very fast. Also, MCP uses UVX, a UV tool for running python package, to run the server. So in this note, we’ll use UV to manage our project. ...

2025-04-18 · 3 min

黑客与画家

hacking is a kind of art 也许是读了上一本《禅与摩托车维修艺术》之后对这些书产生了 PTSD,起初并没有对这本书有多上心。但是在读完了之后,我发现我的 PTSD 被治好了。2333333 这本书可以看作是Paul Graham的一本随笔集,因此这本书中的各个章节没有严格的顺序。所以你可以自由地读你想读的每一个篇章。在这里,我想要跟大家聊一下这些东西: ...

2024-08-17 · 2 min

禅与摩托车维修艺术

这是一场亲子之间的公路旅行,也是一个对自己的探索。更是一个如何“维修摩托车”的手册吗? 这是一本双线发展的书。在公路旅行的过程中,作者不断与儿子发生着互动,也在跟读者们阐述着什么是 “良质”。虽然跟儿子的故事线是一个重要的篇章,但是我想要记录一下在读这本书的时候我对“良质”的粗浅理解以及看法。 ...

2024-07-04 · 4 min

A story of debugging

Introduction We’ve been experiencing an application crash on the QNX platform, which initially seemed like a common occurrence since core dumps happens. However, this issue is different. After the crash, we’re unable to enter engineering mode, making it impossible to use SSH to retrieve the core file. Furthermore, the crash occurs near the application start, leaving no time to enter engineering mode when the system boots up. This page serves to document how I’ve dealt with this issue, which is perhaps my proudest achievement so far at the new company. ...

2024-07-04 · 2 min

complicated geo coordinate systems

Transforming through coordination systems can be confused for some developers like me. But we have to know those commonly used systems and know the bridge between these words. As an autonomous system developer, the commonly used coordination systems are: WGS84, local Cartesian, and ego. Although it is not that important to know the projection theory behind these coordinates, it is good to know how to transform between the coordinations. Conversion from WGS84 to Cartesian We first need to choose a reference point in WGS84 as the cartesian’s origin. Convert the WGS84 coordinates of the reference point to Earth-Centered, Earth-Fixed (ECEF) Cartesian coordinates. Convert the WGS84 coordinates of the point you want to transform to ECEF Cartesian coordinates. Translate and rotate the ECEF coordinates of the target point to the local ENU coordinate system centered at the reference point. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 import math import numpy as np # WGS84 ellipsoid constants a = 6378137.0 # Semi-major axis in meters f = 1 / 298.257223563 # Flattening e2 = 2 * f - f * f # First eccentricity squared def wgs84_to_ecef(lat, lon, alt): lat_rad = math.radians(lat) lon_rad = math.radians(lon) N = a / math.sqrt(1 - e2 * math.sin(lat_rad) ** 2) X = (N + alt) * math.cos(lat_rad) * math.cos(lon_rad) Y = (N + alt) * math.cos(lat_rad) * math.sin(lon_rad) Z = (N * (1 - e2) + alt) * math.sin(lat_rad) return X, Y, Z def ecef_to_enu(x, y, z, lat0, lon0, h0): lat0_rad = math.radians(lat0) lon0_rad = math.radians(lon0) X0, Y0, Z0 = wgs84_to_ecef(lat0, lon0, h0) dx = x - X0 dy = y - Y0 dz = z - Z0 sin_lat0 = math.sin(lat0_rad) cos_lat0 = math.cos(lat0_rad) sin_lon0 = math.sin(lon0_rad) cos_lon0 = math.cos(lon0_rad) t = np.array([ [-sin_lon0, cos_lon0, 0], [-sin_lat0 * cos_lon0, -sin_lat0 * sin_lon0, cos_lat0], [cos_lat0 * cos_lon0, cos_lat0 * sin_lon0, sin_lat0] ]) enu = np.dot(t, np.array([dx, dy, dz])) return enu[0], enu[1], enu[2] # Reference point (example: latitude, longitude, altitude) ref_lat = 41.8902 ref_lon = 12.4924 ref_alt = 0 # Target point to be transformed (example: another point near the reference) target_lat = 41.8912 target_lon = 12.4934 target_alt = 0 # Convert target point to ECEF target_x, target_y, target_z = wgs84_to_ecef(target_lat, target_lon, target_alt) # Convert to ENU coordinates relative to the reference point enu_x, enu_y, enu_z = ecef_to_enu(target_x, target_y, target_z, ref_lat, ref_lon, ref_alt) print(f"ENU coordinates: E={enu_x}, N={enu_y}, U={enu_z}") Convert local cartesian to ego position In our system, the difference between the local cartesian to the ego coordinate system is only the rotation. ...

2024-07-04 · 2 min

Myth of Override

Introduction: Recently, while acquainting myself with the new company, I encountered a piece of unusual code. It seems quite straightforward. We start by declaring a base class with a private virtual function, which is then called by a public member function. Next, we derive a class from the base class and override the virtual function. This pattern is known as the Template Pattern. It defines the skeleton of an algorithm but allows subclasses to override specific steps without altering its structure. The code appears sound until we scrutinize the derived class. ...

2024-07-04 · 1 min

The first touch on cutlass

Introduction This is the very first touch for me to learn how to use cutlass and how it works. Until this moment, there is a little textbook teach us how to use cutlass and how to develop with it. So most of the paper I read are from Zhihu and official. As the first touch on cutlass, I would not dig deep into how to manipulate the cutlass. Why cutlass? I try to avoid cliche. It just because the cutlass is the only high performance open-source computing library we can use on Nvidia’s chips. You need to master it if interested in HPC( high performance computing) or model deployment. ...

2024-07-04 · 3 min