Skip to content

Instantly share code, notes, and snippets.

View chaseliu's full-sized avatar
😃
work..work..

Chase Liu chaseliu

😃
work..work..
  • Nanjing
View GitHub Profile
@chaseliu
chaseliu / Path Finding Algorithms.cpp
Created September 4, 2019 06:13 — forked from OmarElgabry/Path Finding Algorithms.cpp
Implementation of BFS, DFS(Recursive & Iterative), Dijkstra, Greedy, & Astart Algorithms. These algorithms are used to search the tree and finding the shortest paths from starting node to goal node in the tree.
#include <cstdlib>
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <iterator>
#include <algorithm>
#include <math.h>
#include <sstream>
#include <cmath>
@chaseliu
chaseliu / org_report.py
Created September 3, 2019 08:22
演示如何使用python-docx创建团体报告
"""
演示如何使用python-docx创建团体报告
"""
import functools
import itertools
import operator
from docx import Document
from docx.table import Table
@chaseliu
chaseliu / parallel_requests_in_asyncio.py
Created June 6, 2018 01:42
Demonstrate how to execute parallel http get requests with requests in asyncio
"""Demonstrate how to execute parallel http get requests with requests in asyncio"""
import asyncio
import concurrent.futures
import requests
num_requests = 20
# Example 1: synchronous requests
def example_1():
@chaseliu
chaseliu / comparision.py
Last active June 6, 2018 01:24 — forked from dmahugh/comparision.py
comparison of asynchronous HTTP requests (aiohttp/asyncio) and traditional sequential requests (with Requests library)
"""Comparison of fetching web pages sequentially vs. asynchronously
Requirements: Python 3.5+, Requests, aiohttp, cchardet
For a walkthrough see this blog post:
http://mahugh.com/2017/05/23/http-requests-asyncio-aiohttp-vs-requests/
"""
import asyncio
from timeit import default_timer