AisLing Site

write something

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

$ hexo new "My New Post"

More info: Writing

Run server

$ hexo server

More info: Server

Generate static files

$ hexo generate

More info: Generating

Deploy to remote sites

$ hexo deploy

More info: Deployment

问题现象

打开 OpenClaw 控制面板 (http://127.0.0.1:18789/) 后无法连接,可能的表现:

  • 页面一直加载中

  • 显示连接错误

  • 看不到配对页面

根本原因

OpenClaw Gateway 使用设备配对机制来确保安全性。首次访问控制面板时,设备需要与 Gateway 完成配对握手。如果配对未完成或被阻塞,连接会被拒绝,日志中会出现:

reason: "not-paired"
code: 1008 reason: pairing required
`

⚠️ macOS 升级后的常见问题

重要: macOS 系统升级后,此问题很可能再次出现。原因包括:

  • 系统重置了网络权限 - macOS 升级后可能重置应用的网络访问权限

  • 设备标识符变化 - 系统升级可能导致设备指纹/标识符改变

  • 配对信息丢失 - Gateway 的配对状态可能因系统更新被清除

  • 服务重启 - 升级过程中 Gateway 服务被中断,需要重新配对

建议: 每次 macOS 升级后,如果控制面板无法连接,优先检查配对状态:

openclaw devices list
`

排查步骤

1. 检查 Gateway 运行状态

openclaw gateway status
`

正常输出示例:

`Runtime: running (pid 95807, state active)
RPC probe: ok
Listening: 127.0.0.1:18789
`

如果 Gateway 未运行,先启动它:

openclaw gateway start
`

2. 查看日志确认错误

tail -100 /tmp/openclaw/openclaw-$(date +%Y-%m-%d).log | grep -i "pairing"
`

如果看到 pairing-requirednot-paired 错误,说明是配对问题。

3. 检查待配对设备列表

openclaw devices list
`

输出示例:

`Pending (1)
┌──────────────────────────────────────┬──────────────┬──────────┬────────────┐
│ Request │ Device │ Role │ Age │
├──────────────────────────────────────┼──────────────┼──────────┼────────────┤
│ 8e238d19-c27a-4d90-bdce-d180ba6bf878 │ Mac mini │ operator │ just now │
└──────────────────────────────────────┴──────────────┴──────────┴────────────┘
`

4. 批准配对请求

方法一:批准最近的请求(推荐)

openclaw devices approve --latest
`

方法二:批准指定请求 ID

openclaw devices approve <requestId>
`

成功输出:

`Approved 51991519449ac3ad9cc62bf5b7c5cfd35e5a1905c2540bd46376db6ac9873f52 (8e238d19-c27a-4d90-bdce-d180ba6bf878)
`

5. 刷新控制面板

配对批准后,刷新浏览器页面 (http://127.0.0.1:18789/),应该可以正常连接了。

常用命令速查

命令
说明

openclaw devices list
查看待配对和已配对设备

openclaw devices approve --latest
批准最近的配对请求

openclaw devices approve <id>
批准指定请求

openclaw devices remove <deviceId>
移除已配对设备

openclaw devices clear
清空所有配对设备

openclaw gateway status
检查 Gateway 状态

openclaw logs
实时查看 Gateway 日志

其他可能的问题

如果 devices list 显示为空

可能是浏览器没有发起配对请求,尝试:

  • 清除浏览器缓存和 Cookie

  • 使用无痕/隐私模式访问控制面板

  • 重启 Gateway:openclaw gateway restart

如果配对后仍然连不上

  • 检查是否有防火墙阻止本地连接

  • 确认 Gateway 绑定地址:openclaw gateway status 应显示 bind=loopback

  • 查看完整日志:openclaw logs

多设备场景

如果你有多个设备需要配对,每个设备都会生成独立的配对请求。使用 openclaw devices list 查看所有待处理请求,然后逐个批准或使用 --latest 批准最新的。

安全提示

  • 只批准你认识的设备

  • 定期使用 openclaw devices list 审查已配对设备

  • 可疑设备可用 openclaw devices remove <deviceId> 移除

  • 如需全部重置:openclaw devices clear

最后更新: 2026-03-09

适用版本: OpenClaw 2026.3.8+

参考资料

https://www.programmercarl.com/

选用语言c++

编程素养

代码规范

参考google c++编程规范

变量命名使用小驼峰

库函数使用

-

如果题目关键的部分直接用库函数就可以解决,建议不要使用库函数。

-

如果库函数仅仅是 解题过程中的一小部分,并且你已经很清楚这个库函数的内部实现原理的话,那么直接用库函数。

本地编译

参考如下示例 采用添加日志输出的方式

#include <iostream>
#include <vector>
using namespace std;

class Solution {
public:
int minCostClimbingStairs(vector<int>& cost) {
vector<int> dp(cost.size());
dp[0] = cost[0];
dp[1] = cost[1];
for (int i = 2; i < cost.size(); i++) {
dp[i] = min(dp[i - 1], dp[i - 2]) + cost[i];
}
return min(dp[cost.size() - 1], dp[cost.size() - 2]);
}
};

int main() {
int a[] = {1, 100, 1, 1, 1, 100, 1, 1, 100, 1};
vector<int> cost(a, a + sizeof(a) / sizeof(int));
Solution solution;
cout << solution.minCostClimbingStairs(cost) << endl;
}
`

核心代码模式&ACM模式

由于自己刷题多是牛客 所以目前选择ACM

核心代码模式

如下示例只需要填入相关算法即可

class Solution {
public:
int getDays(vector<int>& work, vector<int>& gym) {
// 处理逻辑
}
};
`

ACM模式

ACM模式下除了要写核心算法 还要处理输入输出逻辑

#include<iostream>
#include<vector>
using namespace std;

int getDays(vector<int>& work, vector<int>& gym);

int main() {
int n;
while (cin >> n) {
vector<int> gym(n);
vector<int> work(n);
for (int i = 0; i < n; i++) cin >> work[i];
for (int i = 0; i < n; i++) cin >> gym[i];
int result = 0;

// 处理逻辑
result = getDays(work,gym);
cout << result << endl;
}
return 0;
}

int getDays(vector<int>& work, vector<int>& gym) {
// 处理逻辑
}
`

ACM模式下如何自己构造二叉树输入用例

二叉树可以有两种存储方式,

  • 一种是 链式存储

  • 就是大家熟悉的二叉树,用指针指向左右孩子。

  • 一种是顺序存储。

  • 就是用一个数组来存二叉树

  • 数组如何转化成二叉树:如果父节点的数组下标是i,那么它的左孩子下标就是i * 2 + 1,右孩子下标就是 i * 2 + 2

测试模式如下

#include <iostream>
#include <vector>
#include <queue>
using namespace std;

struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};

// 根据数组构造二叉树
TreeNode* construct_binary_tree(const vector<int>& vec) {
vector<TreeNode*> vecTree (vec.size(), NULL);
TreeNode* root = NULL;
// 把输入数值数组,先转化为二叉树节点数组
for (int i = 0; i < vec.size(); i++) {
TreeNode* node = NULL;
if (vec[i] != -1) node = new TreeNode(vec[i]);
vecTree[i] = node;
if (i == 0) root = node;
}
// 遍历一遍,根据规则左右孩子赋值就可以了
// 注意这里 结束规则是 i * 2 + 1 < vec.size(),避免空指针
// 为什么结束规则不能是i * 2 + 2 < arr.length呢?
// 如果i * 2 + 2 < arr.length 是结束条件
// 那么i * 2 + 1这个符合条件的节点就被忽略掉了
// 例如[2,7,9,-1,1,9,6,-1,-1,10] 这样的一个二叉树,最后的10就会被忽略掉
// 遍历一遍,根据规则左右孩子赋值就可以了
for (int i = 0; i * 2 + 1 < vec.size(); i++) {
if (vecTree[i] != NULL) {
vecTree[i]->left = vecTree[i * 2 + 1];
if(i * 2 + 2 < vec.size())
vecTree[i]->right = vecTree[i * 2 + 2];
}
}
return root;
}

// 层序打印打印二叉树
void print_binary_tree(TreeNode* root) {
queue<TreeNode*> que;
if (root != NULL) que.push(root);
vector<vector<int>> result;
while (!que.empty()) {
int size = que.size();
vector<int> vec;
for (int i = 0; i < size; i++) {
TreeNode* node = que.front();
que.pop();
if (node != NULL) {
vec.push_back(node->val);
que.push(node->left);
que.push(node->right);
}
// 这里的处理逻辑是为了把null节点打印出来,用-1 表示null
else vec.push_back(-1);
}
result.push_back(vec);
}
for (int i = 0; i < result.size(); i++) {
for (int j = 0; j < result[i].size(); j++) {
cout << result[i][j] << " ";
}
cout << endl;
}
}

int main() {
// 注意本代码没有考虑输入异常数据的情况
// 用 -1 来表示null
vector<int> vec = {4,1,6,0,2,5,7,-1,-1,-1,3,-1,-1,-1,8};
TreeNode* root = construct_binary_tree(vec);
print_binary_tree(root);
}
`

下载地址:https://ipa.playcover.workers.dev/

ipa源模版

[
{
"bundleID": "com.miHoYo.GenshinImpact",
"name": "Genshin Impact",
"version": "2.8.0",
"itunesLookup": "http://itunes.apple.com/lookup?bundleId=com.miHoYo.GenshinImpact",
"link": "https://ipa.playcover.workers.dev/0:/Genshin%20Impact/US/Genshin%20Impact_2.8.0.ipa"
},
{
"bundleID": "com.blizzard.diablo.immortal",
"name": "Diablo Immortal",
"version": "1.5.2",
"itunesLookup": "http://itunes.apple.com/lookup?bundleId=com.blizzard.diablo.immortal",
"link": "https://ipa.playcover.workers.dev/1:/IPAs/Diablo%20Immortal/Diablo%20Immortal_1.5.2.ipa"
},
{
"bundleID": "com.netflix.Netflix",
"name": "Netflix",
"version": "14.53.0",
"itunesLookup": "http://itunes.apple.com/lookup?bundleId=com.netflix.Netflix",
"link": "https://ipa.playcover.workers.dev/1:/IPAs/Netflix/Netflix_14.53.0.ipa"
},
{
"bundleID": "com.google.ios.youtube",
"name": "YouTube",
"version": "17.38.9",
"itunesLookup": "http://itunes.apple.com/lookup?bundleId=com.google.ios.youtube",
"link": "https://ipa.playcover.workers.dev/1:/IPAs/YouTube/YouTube_17.38.9.ipa"
},
{
"bundleID": "com.nintendo.znma",
"name": "Nintendo Switch Parental Controls",
"version": "1.17.0",
"itunesLookup": "http://itunes.apple.com/lookup?bundleId=com.nintendo.znma",
"link": "https://ipa.playcover.workers.dev/0:/Nintendo%20Switch%20Parental%20Controls/Nintendo%20Switch%20Parental%20Controls_1.17.0.ipa"
}
]
`

然后将此json文件托管到github

OSS Insight

We are a powerful insight tool that can help you analyze in depth any single GitHub repository/developers, compare any two repositories using the same metrics, and provide comprehensive, valuable, and trending open source insights.

https://github.com/pingcap/ossinsight

  • Feature 1: Visible & Unique Developer Analytics

  • Feature 2: Visual & Comprehensive Repository Analytics

  • Feature 3: Ranked & Dynamic Collections

api测试工具

在线版 Hoppscotch

在线api测试工具 ui相当好看

Hoppscotch is light-weight, web based API development suite. It was built from the ground up with ease of use and accessibility in mind providing all the functionality needed for API developers with minimalist, unobtrusive UI. It is free-to-use and as an added perk completely Open Source!

Features

❤️ Lightweight: Crafted with minimalistic UI design.

⚡️ Fast: Send requests and get/copy responses in real-time.

客户端版 Insomnia

Insomnia is an open-source, cross-platform API client for GraphQL, REST, WebSockets and gRPC.

Terminal

Warp

Warp is a blazingly-fast modern Rust based GPU-accelerated terminal built to make you and your team more productive.

Tabby

Tabby (formerly Terminus) is a highly configurable terminal emulator, SSH and serial client for Windows, macOS and Linux

Integrated SSH and Telnet client and connection manager

Integrated serial terminal

Theming and color schemes

Fully configurable shortcuts and multi-chord shortcuts

Split panes

Remembers your tabs

PowerShell (and PS Core), WSL, Git-Bash, Cygwin, MSYS2, Cmder and CMD support

Direct file transfer from/to SSH sessions via Zmodem

Full Unicode support including double-width characters

Doesn’t choke on fast-flowing outputs

Proper shell experience on Windows including tab completion (via Clink)

Integrated encrypted container for SSH secrets and configuration

SSH, SFTP and Telnet client available as a web app (also self-hosted).

Learn Tools

Qwerty Learner

https://github.com/Kaiyiwing/qwerty-learner

为键盘工作者设计的单词记忆与英语肌肉记忆锻炼软件 / Words learning and English muscle memory training software designed for keyboard workers

电鸭社区

电鸭是国内最早的远程工作社区。我们倡导“只工作,不上班”的生活方式,努力推动多样化工作方式在国内的渐进式发展。

收集提高开发技能的一些书籍文档及博客

Design Patterns

Design Patterns implemented in Swift 5.0

must learn

图说设计模式

本书使用图形和代码结合的方式来解析设计模式;

每个模式都有相应的对象结构图,同时为了展示对象间的交互细节, 我会用到时序图来介绍其如何运行;(在状态模式中, 还会用到状态图,这种图的使用对于理解状态的转换非常直观)

为了让大家能读懂UML图,在最前面会有一篇文章来介绍UML图形符号(看到UML类图和时序图);

在系统的学习设计模式之后,我们需要达到3个层次:

  • 能在白纸上画出所有的模式结构和时序图;

  • 能用代码实现;如果模式的代码都没有实现过,是用不出来的;即所谓,看得懂,不会用;

  • 灵活应用到工作中的项目中;

algorithm

algorithm-pattern-swift

算法模板,最科学的刷题方式,最快速的刷题路径,一个月从入门到 offer,你值得拥有

算法模板顾名思义就是刷题的套路模板,掌握了刷题模板之后,刷题也变得好玩起来了~

目标:完成自己的一套

代码随想录

本站是一套完整的刷题计划,旨在帮助大家少走弯路,循序渐进学算法。

fucking-algorithm

本仓库总共 60 多篇原创文章,都是基于 LeetCode 的题目,涵盖了所有题型和技巧,而且一定要做到举一反三,通俗易懂,绝不是简单的代码堆砌,后面有目录。

LABULADONG 的算法网站

LABULADONG 的算法网站

参考意义比较大 刷leetcode技巧可以参考

leetcode题解

本项目包含 LeetCode、《剑指 Offer(第 2 版)》、《剑指 Offer(专项突击版)》、《程序员面试金典(第 6 版)》等题目的相关题解。所有题解均由多种编程语言实现,包括但不限于:Java、Python、C++、Go、TypeScript、Rust,日常更新

没有思路了可以参考下其它语言的

华为 OJ 题解分享

主要使用JavaScript处理牛客上华为OJ题型

没有思路了可以参考下其它语言的

小浩算法

小浩算法是一套针对小白的完整的算法训练流程!

目前共包括以下几个步骤:

  • PART_1_算法基础

  • PART_2_力扣图解

  • PART_3_大厂面试

  • PART_4_CS知识汇总

Interview

iOS-InterviewQuestion-collection

iOS 开发者在面试过程中,常见的一些面试题,建议尽量弄懂了原理,并且多实践。

must learn

Tools

LearnGitBranching

LearnGitBranching is a git repository visualizer, sandbox, and a series of educational tutorials and challenges. Its primary purpose is to help developers understand git through the power of visualization (something that’s absent when working on the command line). This is achieved through a game with different levels to get acquainted with the different git commands.

game

cpp-game-engine-book

从零编写游戏引擎教程 Writing a game engine tutorial from scratch

本书以实际项目开发Timeline,完整介绍一个游戏引擎的所有模块,从最基础的OpenGL环境搭建,到骨骼动画、多线程渲染、阴影实现等等,最后实现一个完整的游戏引擎。

少见的关于游戏的书籍

Game-Programmer-Study-Notes

我的游戏程序员生涯的读书笔记合辑。你可以把它看作一个加强版的Blog。涉及图形学、实时渲染、编程实践、GPU编程、设计模式、软件工程等内容。Keep Reading , Keep Writing , Keep Coding.

少见的关于游戏开发的笔记

音视频

FFmpeg原理

本书《FFmpeg原理》主要讲解 FFmpeg 原理性的知识,前面几章主要讲解一些音视频开发的基础知识,例如原始数据 YUV 跟 RGB,封装格式 FLV 跟 MP4 ,压缩编码的基本概念,还有封装格式分析

Deep Learn

动手学深度学习(Dive into Deep Learning,D2L.ai)

本开源项目代表了我们的一种尝试:我们将教给读者概念、背景知识和代码;我们将在同一个地方阐述剖析问题所需的批判性思维、解决问题所需的数学知识,以及实现解决方案所需的工程技能。

我们的目标是创建一个为实现以下目标的统一资源:

所有人均可在网上免费获取;

提供足够的技术深度,从而帮助读者实际成为深度学习应用科学家:既理解数学原理,又能够实现并不断改进方法;

包含可运行的代码,为读者展示如何在实际中解决问题。这样不仅直接将数学公式对应成实际代码,而且可以修改代码、观察结果并及时获取经验;

允许我们和整个社区不断快速迭代内容,从而紧跟仍在高速发展的深度学习领域;

由包含有关技术细节问答的论坛作为补充,使大家可以相互答疑并交换经验。

深度学习推荐书籍

technical skill

Every Programmer Should Know

A collection of (mostly) technical things every software developer should know about

少见的关于游戏开发的笔记

收集优秀的macOS&iOS开发库

opensource libs

Harbeth

Harbeth 是 Apple 的 Metal 框架上的一小部分实用程序和扩展,专用于使您的 Swift GPU 代码更加简洁,让您更快地构建管道原型。图形处理和滤镜制作。

Support macOS & iOS

代码规范 推荐学习

opensource product

Pencil

The Pencil Project’s unique mission is to build a free and opensource tool for making diagrams and GUI prototyping that everyone can use.

Support macOS & Windows & Linux

Pencil uses Atom Electron as the runtime

Boost Note

Boost Note next local spaces is lightspeed workspace for developers

Support Web app & Desktop app & iOS app & Android app

base electron

Mailspring

A beautiful, fast and fully open source mail client for Mac, Windows and Linux.

Mailspring’s UI is open source (GPLv3) and written in TypeScript with Electron and React

engine based on mailcore2

DevToysMac

This is the mac app version of DevToys for Windows

Support Mac

base swift & Objective-C

界面比较好看 推荐

DevDataTool

编码转换、摘要(hash)、加解密(MD5、SHA1、SHA256、SHA3、SM3、HMAC、DES、3DES、AES、SM4)

Support Mac

base Objective-C

存放技术相关的书签

Idea

独立开发变现周刊

分享独立开发、产品变现相关内容,每周五发布

Reference

Quick Reference

为开发人员分享快速参考备忘清单【速查表】 (主要是方便自己),在看到 Reference 快速参考备忘单,感觉非常简单,造轮子使命感突然来了,造个中文版本的,为了方便自己的技术栈查阅,立马撸起来 :)。如果您发现此处的备忘单不合适,您可以通过提交 PR 来修复它或提供更好的备忘清单,只针对【中文】用户。以下是开源天使提供的一些备忘清单和快速参考 :)。

关注 Bash Swift SwiftUI Python Markdown MySQL Git Home Brew Github Actions

developer-roadmap

Interactive roadmaps, guides and other educational content to help developers grow in their careers.

roadmap

android roadmap

没有iOS…

输入输出

主要学习使用C++怎么输入输出

需要引入头文件

#include <iostream>
`

该文件定义了 cin、cout、cerr 和 clog 对象,分别对应于标准输入流、标准输出流、非缓冲标准错误流和缓冲标准错误流。

输入cin

预定义的对象 cin 是 iostream 类的一个实例。cin 对象附属到标准输入设备,通常是键盘。cin 是与流提取运算符 >> 结合使用的

C++ 编译器根据要输入值的数据类型,选择合适的流提取运算符来提取值,并把它存储在给定的变量中。

流提取运算符 >> 在一个语句中可以多次使用,如果要求输入多个数据

cin >> name >> age;
`

输出cout

预定义的对象 cout 是 iostream 类的一个实例。cout 对象”连接”到标准输出设备,通常是显示屏。cout 是与流插入运算符 << 结合使用的,

C++ 编译器根据要输出变量的数据类型,选择合适的流插入运算符来显示值。<< 运算符被重载来输出内置类型(整型、浮点型、double 型、字符串和指针)的数据项。

流插入运算符 << 在一个语句中可以多次使用,如上面实例中所示,endl 用于在行末添加一个换行符。

 cout &lt;&lt; "名称是: " &lt;&lt; name &lt;&lt; " " &lt;&lt;"年龄: " &lt;&lt; age &lt;&lt; "\n" &lt;&lt; endl;
`

例子1:基本用法

#include &lt;iostream&gt;
using namespace std;
int main(){
char name[50];
int age;
cout &lt;&lt; "请输入您的名称与年龄 \n";
cin &gt;&gt; name &gt;&gt; age;
cout &lt;&lt; "名称是: " &lt;&lt; name &lt;&lt; " " &lt;&lt;"年龄: " &lt;&lt; age &lt;&lt; "\n" &lt;&lt; endl;
}
`

Output

请输入您的名称与年龄 
aisling
99
名称是: aisling 年龄: 99
`
0%