Pingshian Yu
I'm
關於我
Software Engineer
Over 3 years experience in Python development.
Over 2 years experience in Django web framework development.
- Name: Pingshian Yu
- Birth: 1992/1
- Specialize: Python, Django, JS, Vue
- City: Taipei, Taiwan
技能
-
Backend
- Django, Flask
- FastAPI, Django-restframework
-
Frontend
- HTML, CSS, JS, JQuery, Bootstrap
- Vue.js
- Docker
- Git Flow
- Nginx
- Ubuntu
- AWS
- Linode
- airlines, hotels, rail APIs
- cwa weather opendata
- linebot
- notion
- Draw.io
- Figma
- Postman
- Pycharm, Vim, VS Code
- Data Process: Pandas, Numpy, Openpyxl
- Web Crawler: Selenium, BeautifulSoup
簡歷
- Actively pursued learning opportunities in DevOps, Design Patterns, and System Design, fostering continuous skill development.
- Engaged in daily code refactoring and proactive log management, providing support to team members when necessary.
- Leveraged async web crawlers to streamline the synchronization of products from partner websites, enhancing efficiency.
- Dedicated to maintaining accurate test cases for the development of web applications, ensuring code reliability.
- Collaborated effectively with cross-functional departments to design and develop essential systems.
學歷
2011 - 2017
Bachelor of Social Work, National Taiwan University (NTU)
工作經歷
Software Engineer
Richmond Tours • September 2021 - Present
- Designed and developed the company's official website using Django and FastAPI Python web frameworks.
- Established API connections, employing both synchronous and asynchronous methods to optimize data retrieval and processing.
- Managed log collections, proactively resolved issues, fixed bugs, and enhanced features to ensure the website's seamless operation.
- Committed to writing comprehensive technical documents, documenting system architecture, codebase, and other critical aspects of the project for reference and future development.
(temp worker) Software Testing Engineer
MediaTek • February 2021 - June 2021
- Proficiently developed testing software and specialized tools to enhance quality assurance processes.
- Conducted thorough analysis of test cases, producing comprehensive test reports for evaluation and decision-making.
- Demonstrated proficiency in writing technical documents, ensuring clear and concise documentation of project details and specifications.
MIS
The Mustard Seed Mission • December 2019 - February 2021
- Utilized SQL to extract data from multiple departments' databases.
- Employed Python's pandas library to develop efficient report generation scripts.
- Gathered and documented requirements from various departments and communicated them to partner companies, actively monitoring the progress of development.
- Facilitated the integration of new systems, provided support for user issues, and optimized daily operational procedures.
Articles
LeetCode Weekly Contest 369 第 2 題 2918. Minimum Equal Sum of Two Arrays After Replacing Zeros
# 題目敘述:
給兩個含有正整數的陣列 nums1, nums2,要求把所有 0 用正整數取代,如果取代後兩個陣列總和無法相等,就回傳 -1;如果可以,就回傳最小的總和。
# 想法:
回傳 -1 的條件是其中一個陣列的和 + 0 的數量大於另一個陣列的和,且另一個陣列沒有 0。原因是題目要求把 0 用正整數取代,所以至少要把 0 都用 1 取代,則第一個陣列的和會變成 total1 + zeros,如果這個和比另一個陣列的和大,那兩者就沒有機會相等了。
由題目的 sample 1 可以知道,結果是由 total 比較大的陣列決定的 (nums2 = [6,5,0]) ,所以可以把題目簡化成 找兩個陣列中 total + zeros 大的。
# 上code:
class Solution:
def minSum(self, nums1: List[int], nums2: List[int]) -> int:
total1, total2 = sum(nums1), sum(nums2)
zero_1, zero_2 = nums1.count(0), nums2.count(0)
if ((total1 + zero_1 > total2 and zero_2 == 0)
or (total2 + zero_2 > total1 and zero_1 == 0)
):
return -1
return max(total2+zero_2, total1+zero_1)
LeetCode Weekly Contest 368 第1, 2 題 Minimum Sum of Mountain Triplets
給一個正整數陣列求最小 (i, j, k) 的和,(i, j, k) 須滿足以下兩個條件:
1. i < j < k
2. nums[i] < nums[j] and nums[k] < nums[j]
第一題的編號是 2908,直接依照題目給的條件寫三層迴圈就能通過了。時間複雜度 O(n³)。
第二題 nums.length 10⁵ 這樣寫會TLE,要用 Prefix Min 的做法,時間複雜度 O(n)。
因為 i < j < k,就是整個數列依序取三個數出來,假設有一個解是 (l, pivot, r),分別在 2, 5, 8 的位置:
如果 (l, pivot, r) 要是最小,l 一定要是 pivot 之前所有數中最小的,r 也是一樣,會是 pivot 之後的所有數中最小的那個。然後再從 i = 0 開始找有最小值的 pivot 就可以了。
min_l 是 pivot 左邊的最小值陣列,min_r 是 pivot 右邊的最小值陣列,min_l[i] 代表到第 i 個為止最左邊的值,min_r[i] 代表從右邊數回來第 i 個為止最小的值。找法是 nums[0] 和 nums[len(nums)-1] 分別是 min_l 和 min_r 的最小值,接著每個 nums[i] 都跟 min_l[i-1] 和 min_r[i+1] 比哪個比較小,比較小的那個就是 min_l 或 min_r [i] 的值。
做完這兩個陣列之後再遍歷一次 nums 找符合題目要的 mountain triplets 最小值就行了。
aiohttp + FastAPI + BeautifulSoup 測試
Photo by Hitesh Choudhary on Unsplash
background: 平常網路上搜尋到的爬蟲(加上自己常常寫的)都是在 local 直接跑,本來如果使用 requests + BeautifulSoup 放上去 FastAPI 也能跑的很正常,但就是……慢、慢、還是慢……
有找到一些資料,像是 FastAPI-aiohttp-example,但看了很久還是不太懂,而且還有使用 aioresponses 來 mock/fake web requests in python aiohttp package ,以及 collections.abc 的 Coroutine 抽象class,完全看不懂啊啊啊啊啊啊啊… 所以不才小弟我想寫個簡單例子方便理解😂 順便做做實驗XD
Notion API with FastAPI (Releasing Daily Leetcode Problem Page’s Public Link)
Recently, I joined a Discord server that encourages its members to solve a LeetCode problem every day, though participation isn’t mandatory. While I don’t manage to solve one every single day, I make it a point to do so on weekdays. However, I encountered some difficulty when it came to copying and pasting the public URLs of Notion pages from a database into the Discord server. I thought it was a trivial task. To simplify this process, I decided to create a Notion API connection with a Linebot that can automatically provide me with the Notion page public link.
Contact
Location:
Taipei, Taiwan
Line: