Normally when you buy something, purchasing in bulk gives you a bigger discount.
However, take a look at the following item price list from a mobile game I recently played.

Based on the image, here’s the per-item price breakdown:

Keys Package Price Per-Item Price
25 $0.99 $0.040
75 $3.99 $0.053
140 $6.99 $0.050
285 $12.99 $0.045
600 $24.99 $0.041
1500 $49.99 $0.033

As you can see, all packages follow the “Buy more, save more” rule — except for the first one!
If you do the math, there are only two reasonable choices:

  • The 25-key package if you don’t want to spend much money.
  • The 1500-key package for the best overall value.

Who would buy the other packages?

I use WSL 2 to run LLM AI models on my laptop, which is very convenient when you need to keep Windows as your main OS.
However, when you want to access a network service running on a WSL system from the LAN, you have to do some configuration.

Since the WSL OS network runs under NAT, you need to set up a port proxy on the host Windows OS.

Use the following command to get the WSL system IP address:

wsl hostname -I

Then, run the following command to apply the port proxy (assuming the WSL system IP is 172.22.38.136).

netsh interface portproxy add v4tov4 listenport=18863 listenaddress=0.0.0.0 connectport=18863 connectaddress=172.22.38.136

Don’t forget to set both firewall rules on Windows and WSL.

Today’s LeetCode daily challenge requires finding a dominant item that appears more than half the time in an array.
I used a hash map to count each item and track the most frequent one during this process.
This results in O(N*log N) time complexity and O(N) space complexity.
After I applied my solution, I found that most other solutions were much faster than mine.
They all used a simple algorithm to find the dominant item - Boyer-Moore Majority Vote Algorithm:

def majority_element(nums):
candidate, count = None, 0

for num in nums:
if count == 0:
candidate = num
count += 1 if num == candidate else -1

return candidate

nums = [3, 3, 4, 2, 3, 3, 3, 1]
print(majority_element(nums)) # Output: 3

If you know that there is a dominant item appears more than half the time in an array, this algorithm will find it in O(N) time and O(1) space.

Amazing!

I often hear about people using AI to pass technical interviews.
Here’s a real case.

This person had a LinkedIn profile, a photo, and a resume - everything looked perfect.
During the interview, he answered all the questions flawlessly, which made the interviewer suspect he was using AI.
To verify, the interviewer asked him to turn off the video background filter and raise his right hand.

He could do neither.

I did wood working for years in China, building backyard decks, pergolas, etc.
I wouldn’t say I’m a carpenter, it’s more of a hobby, but I consider myself a seasoned worker.
After I moved to Canada, I bought some Ryobi tools and built a flower rack.
While building it, I found the drill bit kept camming out of the screw head, which was very annoying.

I checked the bit and saw a mark “PZ 1” on it, which had to mean something.
After searching online, I figured it out!
There are two types of cross-shaped bits: PH and PZ.

  • PH means Phillips Head, which has 4 flanks and is commonly used.
  • PZ means Pozidriv Head, which is similar to Philips but has 4 additional small flanks, making it better suited for high-torque situations.

The number after PZ or PH indicates the head size.

To ensure a proper fit, screws also have the same mark on their heads.
If the bit and the screw don’t match, they will cam out.

Last weekend, I learned a new skill: cleaning the carpet with a RugDoctor carpet cleaner.
The system is quite easy to use, but you need to keep pressing the middle button to keep it working.
After hours of work, my thumb was sore.

However, call me if you need someone to clean your carpet!

A senator visited a village for a campaign.
He asked the local people what they needed.
The mayor answered: “We have two problems here. First, we don’t have a doctor.”
The senator picked up his mobile phone and made a call.
After he hung up, he told the mayor: “A doctor will come tomorrow.”
The mayor kept saying: “Second, there is no phone signal here.”

My Wife has an infinite loop:

  • The fridge is empty - we need to buy food.
  • The fridge is full - we need to eat all the food.

And it never ends.

Recently, when my daughter and I went grocery shopping, we started playing a game.
Before checkout, we each guess the total price of the items in our cart, type it into our phones, and reveal our numbers at same time.
Whoever’s guess is more accurate wins.
This has been a great way for my daughter to develop a sense of everyday expenses.
And she’s been doing really well at it!

Differences between Canadian banks and Chinese banks:

  • Personal cheques:
    You can deposit or withdraw a cheque at a Canadian bank, but personal cheques are not used in Chinese banks.

  • Joint accounts:
    In Canada, you can link your account with a family member’s for convenient money transfers. This option is not available in Chinese banks.

  • Phone transfers:
    In Canada, you can request a bank transfer over the phone if they verify your identity. I consider this a risky option, and it is not allowed in China.

  • Bank apps:
    Canadian banking apps crash all the time!