Skip to content

Instantly share code, notes, and snippets.

View ismdeep's full-sized avatar

L. Jiang ismdeep

View GitHub Profile
@ismdeep
ismdeep / is_ip.py
Created October 24, 2020 07:40
判断IP地址
def is_number(num_str):
if len(num_str) <= 0:
return False
for _item_ in list(num_str):
if _item_ not in '0123456789':
return False
return True
def is_ip(s):
@ismdeep
ismdeep / main.py
Created October 11, 2020 13:04
Python 画动态图
from tkinter import *
from random import randint
width_size = 1920
height_size = 1080
colors = ['red', 'green', 'black', 'yellow', 'blue', 'gray', 'pink', 'purple']
distance = 300
sleep_time = 100
step_count = 1000
@ismdeep
ismdeep / main.py
Created October 11, 2020 02:16
Python 画图例子
from tkinter import *
from random import randint
width_size = 800
height_size = 600
canvas = Canvas(width=width_size, height=height_size)
canvas.pack(expand=YES, fill=BOTH)
colors = ['red', 'green', 'black', 'yellow', 'blue', 'gray', 'pink', 'purple']
@ismdeep
ismdeep / selective-sort.c
Last active September 24, 2020 08:38
一个选择排序的演化过程。
从最简单的C语言基础开始,一步一步编写一个选择排序(从小到大)的程序。
#!/usr/bin/env python3
import os
import sys
from prettytable import PrettyTable
from colorama import Fore, Back, Style
def show_help_msg():
print('''Usage: proxy [on [pac]|off|status]''')
package main
import "sync"
type receiver struct {
sync.WaitGroup
data chan int
}
func newReceiver() *receiver {
/*
* Building Huffman Tree
* Author: ismdeep
* */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct Node {
int id;
// ==UserScript==
// @name hdu helper
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author ismdeep
// @require https://code.jquery.com/jquery-2.1.4.min.js
// @match http://acm.hdu.edu.cn/showproblem.php?pid=*
// @grant none
// ==/UserScript==