Andrew.Log
-
原來 Arrow Func 可以這樣用
Mar 20, 2025
-
1 min read
剛進公司時,被指派了寫上團購系統前台後台的登入系統,是這樣的,後台管理員還有不同的角色,每個角色所擁有的權限也不一樣。所以可以希望透過
Middleware來做權限的控管。 -
DDD 中的 Pub/Sub 模式應用
Feb 24, 2025
-
2 min read
以往在
MVC架構下的設計,並沒有分領域的概念,所以時常修改或新增需求時,我們都要從API開始 Trace..,依序地找到Controller -> Service ...等等,這樣的設計方式,耦合比較高之外,也不易擴充。 -
[Leetcode]424. Longest Repeating Character Replacement
Jan 7, 2025
-
2 min read
You are given a string s and an integer k. You can choose any character of the string and change it to any other uppercase English character. You can perform this operation at most k times.
Return the length of the longest substring containing the same letter you can get after performing the above operations.
-
3. Longest Substring Without Repeating Characters
Dec 30, 2024
-
2 min read
Given a string s, find the length of the longest substring without repeating characters.
-
[Leetcode]128. Longest Consecutive Sequence
Dec 16, 2024
-
1 min read
Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence.
You must write an algorithm that runs in O(n) time.
-
[Leetcode] 198. House Robber
Dec 12, 2024
-
2 min read
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security systems connected and it will automatically contact the police if two adjacent houses were broken into on the same night.
Given an integer array nums representing the amount of money of each house, return the maximum amount of money you can rob tonight without alerting the police.
-
[Leetcode] 377. Combination Sum IV
Dec 11, 2024
-
1 min read
Given an array of distinct integers nums and a target integer target, return the number of possible combinations that add up to target.
The test cases are generated so that the answer can fit in a 32-bit integer.
-
[Leetcode] 139. Word Break
Dec 11, 2024
-
2 min read
Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words.
Note that the same word in the dictionary may be reused multiple times in the segmentation.
-
Node Sequelize Update 與 Set 的差異
Oct 22, 2024
-
1 min read
主要遇到的問題
原專案是使用
Rails開發,但因總總原因,決定改用Node.js開發,但在轉換時,遇到了一些問題,其中就有 Sequelize 的 Update 與 Set 的差異。使用
Rails所提供的 ORM 有跟很方便的方法,就是可以把 column 設定為json或是text,在寫入與讀取時,ORM 會自動幫你處理,可以很方便的讀寫 json 裡的資料。但在Node.js使用 Sequelize 時,就沒有這麼方便了。