Skip to content

Instantly share code, notes, and snippets.

View shao-wang-me's full-sized avatar
🔋
0.99^100 = 0.37

Shao shao-wang-me

🔋
0.99^100 = 0.37
View GitHub Profile
builder.OpenFile("https://github.com/shao-wang-me/delete-me-later/raw/main/tracked_changes.docx");
var oDocument = Api.GetDocument();
oDocument.AcceptAllRevisionChanges();
oDocument.SetTrackRevisions(false);
builder.SaveFile("docx", "AcceptAllRevisionChanges.docx");
builder.CloseFile();
# 508. Most Frequent Subtree Sum
# https://leetcode.com/problems/most-frequent-subtree-sum/
# Easy
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
@shao-wang-me
shao-wang-me / vis-timeline-basic-usage.html
Created January 23, 2020 01:19
vis-timeline 基础例子
<!doctype html>
<html>
<head>
<title>Timeline | Basic demo</title>
<style type="text/css">
body, html {
font-family: sans-serif;
}
</style>
@shao-wang-me
shao-wang-me / elastic_australian_people.py
Last active August 22, 2019 06:03
A script to generate fake Australian demographic data, and index into Elasticsearch.
"""A script to generate fake Australian demographic data, and index into Elasticsearch.
Python requirements:
* elasticsearch
* faker
Elasticsearch requirements:
* phonetic plugin
* name_synonyms.txt in elasticsearch-<version>/config/
Author: Shao Wang
@shao-wang-me
shao-wang-me / android_dev_notes.txt
Created September 21, 2018 06:37
Android Dev Notes
Kotlin, Java, C++
1. App components (entry points of app):
- Activity
- Service
- Broadcast receiver
- Content Provider
2. Activity (UI)
- Represents a single screen
import numpy as np
import json
import pickle
a = np.random.random(1000000)
# a = np.zeros(1000000)
print(a)
a.dump('np_dump')
with open('pickle_dump', 'wb') as f:
@shao-wang-me
shao-wang-me / count_lines.py
Last active October 3, 2019 00:37
Print number of lines of all files in a directory (default is the currect directory) and its subdirectories.
"""Print number of lines of all files in a directory (default is the currect directory) and its subdirectories.
"""
import os
import sys
def count_file_lines(filepath):
"""Count lines in a file
"""
lines = 0