Skip to content

Instantly share code, notes, and snippets.

刘钦 liuqinh2s

Block or report user

Report or block liuqinh2s

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 获取一个随机端口
def findFreePort():
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('localhost', 0))
# 用getsockname来获取我们实际绑定的端口号
addr, port = s.getsockname()
# 释放端口
View 最小二叉堆(Priority Queue)
import java.util.ArrayList;
import java.util.Arrays;
public class Solution {
public void insert(ArrayList<Integer> heap, int val){
update(heap, heap.size()-1);
View API过滤器
import java.util.ArrayList;
import java.util.Iterator;
public class Solution {
public static void main(String[] args) {
Solution solution = new Solution();
View java二叉树
import java.util.ArrayList;
public class Solution {
public boolean HasSubtree(TreeNode root1,TreeNode root2) {
boolean result = false;
if(root1!=null && root2!=null){
result = doesTree1HaveTree2(root1, root2);
result = HasSubtree(root1.left, root2);
View java单链表
public class Solution {
public ListNode Merge(ListNode list1,ListNode list2) {
return list2;
return list1;
ListNode node = new ListNode(0);
View 四路partition
public class Solution {
public void partition(int[] array) {
if (array == null || array.length <= 1) {
int index1 = 0;
int index2 = 0;
int index3 = 0;
for (int i = 0; i < array.length; i++) {
View 单链表
using namespace std;
struct ListNode{
int value;
ListNode* pNext;
View json解析器(java版)
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class JsonParser {
private String json;
private int index = 0;
private Map<Character, Boolean> numChars = new HashMap<>();
View 自动输入电话支付宝按键精灵脚本
* 全局变量
* 1. LOG 相关变量和函数
* 2. 延时函数,控制点击速度,寻找最佳的速度,避免被支付宝限制
* 3. 结束函数,自定义结束时候要执行的动作
* 2. 路径和文件相关变量和函数
View 股票挑选
# coding=utf-8
import requests
import time
import os
import json
import queue
import threading
import tushare as ts
You can’t perform that action at this time.