Skip to content

Instantly share code, notes, and snippets.

@tinylamb
tinylamb / cursor-agent-system-prompt.txt
Created April 2, 2025 13:53 — forked from sshh12/cursor-agent-system-prompt.txt
Cursor Agent System Prompt (March 2025)
You are a powerful agentic AI coding assistant, powered by Claude 3.5 Sonnet. You operate exclusively in Cursor, the world's best IDE.
You are pair programming with a USER to solve their coding task.
The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.
Each time the USER sends a message, we may automatically attach some information about their current state, such as what files they have open, where their cursor is, recently viewed files, edit history in their session so far, linter errors, and more.
This information may or may not be relevant to the coding task, it is up for you to decide.
Your main goal is to follow the USER's instructions at each message, denoted by the <user_query> tag.
<communication>
1. Be conversational but professional.
@tinylamb
tinylamb / .vimrc
Last active August 29, 2015 14:02
vimrc for macvim
""General {{{
set nocompatible
set encoding=utf-8
""set langmenu=zh_CN.UTF-8
""language message zh_CN.UTF-8
set ignorecase
set incsearch
"filetype test
@tinylamb
tinylamb / code.py
Last active August 29, 2015 14:01
Introduction to Computer Science and Programming[Mit]
#汉诺塔
#Towers(3,0,1,2)
def Towers(size,fromStack,toStack,spareStack):
if size == 1:
print 'Move disk from ',fromStack, 'to ',toStack
else:
Towers(size-1,fromStack,spareStack,toStack) #将n-1个盘子从起点移到空闲
Towers(1,fromStack,toStack,spareStack) #将最大的盘子从起点移到终点
Towers(size-1,spareStack,toStack,fromStack) #将n-1个盘子从空闲移到终点
@tinylamb
tinylamb / findmink.c
Created April 22, 2014 01:12
寻找数组中最小的k个数。基于快排。keywords:快排,两种findp实现
/*
* =========================================================
* Filename: findmink.c
* Description: 基于快排的两种寻找pivot元素位置的方法
* 来实现寻找数列中最小的k个数字
*
* =========================================================
*/
#include <stdio.h>
#include <time.h>
@tinylamb
tinylamb / mink.c
Created April 19, 2014 12:36
寻找数组中最小的k个数。keywords:堆,自上而下,自下而上
/*
* =========================================================
* Filename: mink.c
* Description: 输入n个整数,找出其中最小的K个数
*
* =========================================================
*/
#include <stdio.h>
#include <stdlib.h>
#define PARENT(i) (i - 1) / 2
@tinylamb
tinylamb / adjlist.c
Last active August 29, 2015 13:59
图的邻接表实现及操作.多文件链接,makefile
/*
* =========================================================
* Filename: adjlist.c
* Description: 图的邻接表表示及各种操作
*
* =========================================================
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
@tinylamb
tinylamb / rank.py
Created April 9, 2014 14:10
天猫推荐算法
# coding:utf-8
__author__ = 'tinylamb'
import os
import math
FILEPATH = os.getcwd()
PERIOD = 5
NOW = 122 / PERIOD + 1 # 122
MID = NOW / 2
GAP = 0.5
@tinylamb
tinylamb / heap.c
Last active August 29, 2015 13:57
小根堆.keywords: 宏 , 堆的自下而上/自上而下的调整
/*
* =========================================================
* Filename: heap.c
* Description: 模仿heapq.py创建堆
*
* =========================================================
*/
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
@tinylamb
tinylamb / EditDistance.c
Created March 17, 2014 08:49
编辑距离计算。keywors:动态规划,动态二维数组分配
/*
* =========================================================
* Filename: EditDistance.c
* Description: 动态规划求编辑距离
*
* =========================================================
*/
#include <stdio.h>
#include <stdlib.h>
int Length(char *s);
@tinylamb
tinylamb / BST.c
Created March 16, 2014 13:29
二叉搜索树. keywords:return in recursive
/*
* =========================================================
* Filename: BST.c
* Description: 二叉搜索树
*
* =========================================================
*/
#include <stdio.h>
#include <stdlib.h>
//数据集定义