- 準備履歷,可參考 https://codingman.cc/resume.pdf
- 刷題 https://leetcode.com/
- 準備面試投影片與自我介紹約 2 ~ 3 分鐘
This file contains hidden or 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
| def obj2base64(obj): | |
| # convert object to base64 string using json | |
| return base64.b64encode(json.dumps(obj).encode('utf-8')).decode('utf-8') | |
| def base642obj(s): | |
| # convert base64 string to object using json | |
| return json.loads(base64.b64decode(s).decode('utf-8')) |
This file contains hidden or 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
| re.sub(r'[^\w\s]', '', c) |
This file contains hidden or 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
| from linebot import LineBotApi | |
| line_uuid = 'qq' | |
| line_bot_api = LineBotApi('qq_token') | |
| line_bot_api.push_message( | |
| line_uuid, | |
| TextSendMessage(text='晚安,早點睡')) |
This file contains hidden or 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
| class Solution: | |
| def threeSum(self, nums: List[int]) -> List[List[int]]: | |
| if (length := len(nums)) < 3: | |
| return [] | |
| result_map = {} | |
| result = [] | |
| targets = [] | |
| for i in range(length): |
This file contains hidden or 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
| def permutations(data, start_index, end_index): | |
| if start_index == end_index: | |
| print(data) | |
| return | |
| for i in range(start_index, end_index): | |
| data[i], data[start_index] = data[start_index], data[i] | |
| permutations(data, start_index + 1, end_index) | |
| data[i], data[start_index] = data[start_index], data[i] |
This file contains hidden or 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
| # set your java installer here, must with tar.gz | |
| java_installer=https://cdn.azul.com/zulu/bin/zulu16.30.15-ca-jre16.0.1-linux_x64.tar.gz | |
| installer_name_full="$(basename -- $java_installer)" | |
| installer_name="${installer_name_full%.*}" | |
| installer_name="${installer_name%.*}" | |
| sudo apt-get update && sudo apt-get -y upgrade | |
| sudo apt-get -y install git |
This file contains hidden or 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
| # ____________ | |
| # | | | |
| # | | | |
| # | | | |
| # | | | |
| # | | | |
| # | | | |
| # | | | |
| # _____________________| |_____________________ | |
| # | | |
This file contains hidden or 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 subprocess | |
| import locale | |
| def run_cmd(cmd, use_cmd=False): | |
| if use_cmd: | |
| # windows | |
| cmd = ['cmd', '/c'] + cmd | |
| # Linux | |
| cmd = ['/bin/sh', '-c'] + cmd | |
| result = subprocess.run(cmd, stdout=subprocess.PIPE) |
This file contains hidden or 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 os | |
| if __name__ == '__main__': | |
| def walk_dir(current_path, recursive=True): | |
| result = [] | |
| for (parent_path, folder_names, file_names) in os.walk(current_path): | |
| # I don't like -> \ <- | |
| parent_path = parent_path.replace('\\', '/') | |
| if not recursive: |