This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Kotlin, Java, C++ | |
1. App components (entry points of app): | |
- Activity | |
- Service | |
- Broadcast receiver | |
- Content Provider | |
2. Activity (UI) | |
- Represents a single screen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>Timeline | Basic demo</title> | |
<style type="text/css"> | |
body, html { | |
font-family: sans-serif; | |
} | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |