关于我
欢迎来到我的空间! 关于我 🌱 毕业于复旦大学 ⭐ 现就职于华为,软件开发工程师 兴趣 👨🏽💻 项目: NLP, Large Language Model, Golang Project, Python Project, Vue Project 编程语言 : Golang, Python 开源项目经验 👯As a manager : 优酷x天池 「酷文」小说创作大模型挑战赛: DeepThinking Team Leader, Third Prize. As a member : PhenoBERT : PhenoBERT: A combined deep learning method for automated recognition of human phenotype ontology IEEE Journal of Biomedical and Health Informatics(IF=5.77) : Reviewer 比赛 优酷x天池 「酷文」小说创作大模型挑战赛: DeepThinking Team...
【Goalng】数组可以作为map的key!
在Go语言中,数组可以作为map的key,这是Go语言的一个特性。 数组作为map key的特性1. 数组是值类型,不是指针12345a := [3]int{1, 2, 3}b := a // 这里是值拷贝,不是引用b[0] = 9fmt.Println(a) // [1 2 3] - 原数组不变fmt.Println(b) // [9 2 3] 2. 数组是可比较的(comparable)Go语言中,数组支持 == 和 != 操作符: 123456a := [3]int{1, 2, 3}b := [3]int{1, 2, 3}c := [3]int{1, 2, 4}fmt.Println(a == b) // truefmt.Println(a == c) // false 3. 因此数组可以作为map key1234// 这是合法的cnt := map[[3]int]int{}key := [3]int{1, 2, 3}cnt[key] =...
【Git】Git代理配置
配置 Git 插件使用代理,有几种方法可以实现: 方法一:通过 Git 全局配置代理(推荐)在终端中执行以下命令: 12345678910# 设置 Git 全局代理git config --global http.proxy http://127.0.0.1:7897git config --global https.proxy http://127.0.0.1:7897# 如果需要设置不使用代理的地址(如内网地址)git config --global http.proxy http://127.0.0.1:7897git config --global https.proxy http://127.0.0.1:7897# 查看配置是否生效git config --global --list | grep proxy 方法二:为特定仓库配置代理如果只想为 Obsidian 仓库设置代理,进入仓库目录后执行: 123cd /path/to/your/obsidian/vaultgit config http.proxy http://127.0.0.1:7897git...
【Golang】滑动窗口总结
双指针与滑动窗口算法总结一、核心思想双指针 (Two Pointers) 思想:使用两个指针在序列中按特定规则移动,避免暴力枚举 特点:通常时间复杂度从 O(n²) 优化到 O(n) 滑动窗口 (Sliding Window) 思想:维护一个动态的窗口,通过移动左右边界来寻找最优解 特点:窗口大小可能固定或可变 二、通用模板1. 滑动窗口通用模板1234567891011121314151617181920212223func slidingWindow(nums []int, k int) int { left := 0 count := 0 // 或使用map记录窗口内元素 result := 0 for right := 0; right < len(nums); right++ { // 右指针扩张,更新窗口状态 count = updateCount(count, nums[right], +1) // 收缩窗口条件 for...
Dijkstra算法实现带权重最短路径
以下是使用 Dijkstra 算法解决带权重最短路径问题的 Golang 实现(以 LeetCode 743 “网络延迟时间” 为例)。该算法通过优先队列(最小堆)高效地寻找单源最短路径: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899import ( "container/heap" "math")// 优先队列元素结构type Item struct { node int // 节点编号 distance int // 从起点到该节点的距离 index int // 在堆中的索引}// 优先队列(最小堆)type PriorityQueue []*Itemfunc (pq...
【项目】GoToDo 四象限法待办谷歌插件
GOTODO 四象限法 TODO 管理 Chrome 插件Eisenhower Matrix TODO Chrome Extension 项目简介 | IntroductionGOTODO 是一个基于四象限法(重要紧急矩阵/Eisenhower Matrix)的 TODO 管理 Chrome 插件,帮助你高效管理任务,聚焦真正重要的事情。支持任务添加、优先级分类、象限视图、日视图、任务排序等功能。 GOTODO is a Chrome extension for managing your tasks using the Eisenhower Matrix (Important/Urgent Quadrant). It helps you focus on what really matters. Features include task add/edit, priority classification, quadrant view, day view, and task sorting. 主要功能 | Features 添加...
【工具】7小时代码编写机器claude code 安装
安装Node macOS 用户1234sudo xcode-select --install # 安装 Xcode 命令行工具/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" # 安装 Homebrewbrew install nodenode --version 18版本以上即可 安装 Claude Code1npm install -g @anthropic-ai/claude-code 验证是否成功 1claude --version 大功告成 启动!12claude
英文输入时再也不打出中文标点啦
以微软拼音为例, 需要打开 中文输入时使用英文标点
【算法】链表
206. 反转链表 https://leetcode.cn/problems/reverse-linked-list/solution/you-xie-cuo-liao-yi-ge-shi-pin-jiang-tou-o5zy/ 92. 反转链表 II https://leetcode.cn/problems/reverse-linked-list-ii/solution/you-xie-cuo-liao-yi-ge-shi-pin-jiang-tou-teqq/ 25. K 个一组翻转链表 https://leetcode.cn/problems/reverse-nodes-in-k-group/solution/you-xie-cuo-liao-yi-ge-shi-pin-jiang-tou-plfs/
【算法】二分法
转化方式: >=x 使用sort.SearchInts(nums, x) >x 使用 sort.SearchInts(nums, x+1) <x 使用sort.SearchInts(nums, x) -1 <= 使用sort.SearchInts(nums, x +1) -1 704 二分查找704. 二分查找 - 力扣(LeetCode) 123456789101112131415func search(nums []int, target int) int { left, right := 0, len(nums)-1 for left <= right { mid := left + (right - left)/ 2 if nums[mid] > target { right = mid - 1 } else if nums[mid] < target { left = mid...
