Skip to content

Instantly share code, notes, and snippets.

View kosmosr's full-sized avatar
:octocat:
Coding

小宇宙 kosmosr

:octocat:
Coding
View GitHub Profile
package top.mollysu;
import java.io.*;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
@kosmosr
kosmosr / MaxPQ.java
Created March 19, 2019 03:41
最大堆的优先队列
package top.mollysu.type;
import java.util.Arrays;
/**
* @author zmh
* @date 2019-02-27 13:58
* 优先队列
* 删除最大元素,插入元素
*/
@kosmosr
kosmosr / user.py
Created July 18, 2018 16:17
marshmallow demo
# encoding: utf-8
"""
@author: kosmosr
@contact: zmhwft@gmail.com
@time: 2018/7/17 23:53
"""
from marshmallow import Schema, fields, pre_dump
@kosmosr
kosmosr / str_speed_test.py
Created June 30, 2018 03:27
python 多种字符串连接性能测试
#!/usr/bin/env python
# encoding: utf-8
"""
@author: zmh
@time: 2018/6/30 10:29
"""
import threading
import time
@kosmosr
kosmosr / manage.py
Created May 17, 2018 00:59
flask 数据库迁移框架
#!/usr/bin/env python
# encoding: utf-8
"""
@author: zmh
@time: 2018/5/17 8:46
数据库迁移脚本
"""
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
@kosmosr
kosmosr / near.py
Created April 26, 2018 06:28
距离排序
import math
from sqlalchemy import asc, func
from model.device.station import Station
def station_nearby_list(distance, longitude, latitude, page=None, limit=None):
minlat, maxlat, minlng, maxlng = __get_area(latitude, longitude, distance)
# 按距离最近排序