Skip to content

Instantly share code, notes, and snippets.

View liuzhengyang's full-sized avatar
🎉
bytejava

刘正阳 | bytejava.cn liuzhengyang

🎉
bytejava
View GitHub Profile
@liuzhengyang
liuzhengyang / cursor-agent-system-prompt.txt
Created May 15, 2025 07:11 — 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.
function FindProxyForURL(url, host)
{
return "SOCKS 192.168.0.101:1080";
}
/*
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
@liuzhengyang
liuzhengyang / UDPTest.java
Created March 30, 2017 13:00
udp echo client with raw datagram api
package com.github.lzy.web.net;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetSocketAddress;
import java.net.SocketException;
/**
* Description:
package com.github.lzy.web.net.udp;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.net.SocketException;
import java.nio.ByteBuffer;
import java.nio.channels.DatagramChannel;
@liuzhengyang
liuzhengyang / UDPServer.java
Created March 30, 2017 13:00
UDP java server echo example
public class UDPServer {
public void start() {
try {
DatagramChannel datagramChannel = DatagramChannel.open();
datagramChannel.bind(new InetSocketAddress(8089));
while(true) {
ByteBuffer byteBuffer = ByteBuffer.allocate(1024);
SocketAddress receive = datagramChannel.receive(byteBuffer);
byteBuffer.flip();
System.out.println("Receive " + byteBuffer.toString());
@liuzhengyang
liuzhengyang / DirectMemorySize.java
Created March 21, 2017 13:54
An Serviceability-Agent based tool to see stats of NIO direct memory for JDK8
import java.lang.reflect.*;
import java.lang.reflect.Method;
import java.util.*;
import sun.jvm.hotspot.memory.*;
import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.tools.*;
import sun.jvm.hotspot.utilities.*;
@liuzhengyang
liuzhengyang / MyCountDown.java
Created May 18, 2016 01:27
count down latch using aqs
private final class Sync extends AbstractQueuedSynchronizer {
private int count;
public Sync(int count) {
this.count = count;
}
@Override
protected int tryAcquireShared(int arg) {
return (getState() == 0 ? 1 : -1);
@liuzhengyang
liuzhengyang / BuildClass.java
Created April 18, 2016 09:01
字节码ASM使用
package com.lzy.research;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
@liuzhengyang
liuzhengyang / Main.java
Created April 8, 2016 02:00
EJ25, prefer list to array
Object[] objects = new String[]{"s"};
objects[0] = 2;
System.out.println("h");