I used to have a Valve Index VR headset and a lot of VR games on Steam, including MS Flight Simulator, Beat Saber, and Half-Life: Alyx…
It was pretty good, but it required a wired connection to the PC, making it less agile.
Before moving to Canada, I left it with a friend.

Last week, I bought a Meta Quest 3S in Canada for \$399, an affordable all-in-one VR headset.
I tried using Steam Link for remote PC gaming, and it lagged, even when my PC was connected via an Ethernet cable.
After searching online, I found that everyone recommended Virtual Desktop as the best option.

I purchased Virtual Desktop for \$27, and it was absolutely worth the price.
The video is smooth and clear, with no delay, I cannot even tell that it’s being streamed from my PC.

Now, I can play Beat Saber wirelessly every day!

I just learned that Thanksgiving dates are different between Canada and the US.
It originated from Indigenous harvest festival.
Since Canada is farther north, the harvest season is earlier.
Therefore, Thanksgiving is celebrated on the second Monday of October in Canada,
and on the fourth Thursday of November in the US.

World’s harvest festival list:

Country Holiday Name Date or Timeframe
Canada Thanksgiving Second Monday of October
United States Thanksgiving Fourth Thursday of November
China Mid-Autumn Festival (similar) 15th day of the 8th lunar month
South Korea Chuseok 15th day of the 8th lunar month
Vietnam Tết Trung Thu (Mid-Autumn) 15th day of the 8th lunar month
Japan Labor Thanksgiving Day November 23
India Pongal / Makar Sankranti January 14-15
Malaysia Kaamatan May 30-31
Philippines Harvest Festival Varies by region
Grenada Thanksgiving October 25
Liberia Thanksgiving First Thursday of November
Brazil Dia de Ação de Graças Fourth Thursday of November (optional)
Netherlands Thanksgiving Service First Wednesday in November (optional)

Yesterday, I heard the news that the northern lights would be visible in Toronto at night.
At 9 PM, I drove north with my family and parked in a wild park.
There were already many people there.

Then, we saw the northern lights for the first time!

It was amazingly beautiful.
Before moving to Canada, we never thought we could see the northern lights in Toronto.
Lucky us!

But does this signal extreme global climate change?

Before I came to Canada, I didn’t know you could lease a car.
It’s a great option for those who want to drive new cars with lower monthly payments.

For example:
A Toyota RAV4 costs \$36,000.
You could lease it for 6 years at \$110 per week, that’s even cheaper than car insurance!
After 6 years, you can either buy it for \$16,000 or return it and lease a new car.

Why had I never heard of this in China?
I think the reason is that Chinese love new things, few people like used cars, so their resale prices are much lower than Canada.
The low lease-end value makes the lease payments much higher, making leasing an unattractive option.

Today, while sorting a vector using a comparison function in C++, I encountered a crash.
The error message was a segment fault, providing no clear indication of the exact issue in the code.
After some investigation, I finally pinpointed it, the issue was with the comparison function:

bool comp(int a, int b){
return a <= b;
}

Using a <= b is incorrect, because it results in ambiguous comparisons.
After change it to a < b, the problem was solved.

Comparison Function Rules:

Rule Description Example/Explanation
Asymmetry If comp(a, b) is true, then comp(b, a) must be false. If a < b is true, then b < a should be false.
Transitivity If comp(a, b) and comp(b, c) are true, then comp(a, c) must be true. If a < b and b < c, then a < c must hold.
Irreflexivity comp(a, a) must always return false. An element is never less than itself.
Return Type The comparison function should return a boolean value. bool comp(const T& a, const T& b);
Consistency The function should provide consistent results for the same inputs. Results should not change when called multiple times with the same values.
No Modification The comparison function should not modify its arguments. It should take const references to avoid modification.
Strict Weak Order The function must impose a strict weak ordering on the elements. It should behave like a < operator or similar comparison.
No Equality Comparison Equal elements should not return true for either direction. If a == b, both comp(a, b) and comp(b, a) should be false.

This morning, I found a note on the ground outside my front door.
It said:

Dear tenants,
This is the homeowner of ...
We would like to discuss an important matter regarding the house with you.
Can you please give me a call?
My phone number is .......

The phone number on the note was exactly my landlord’s number.
So, I called my landlord, but he said he had no idea who wrote it and told me to ignore it.

What kind of scam is this?
No one would use the real landlord’s phone number if they were trying to scam someone.
Who can give me an answer?

Today I got a phone call from 855-xxx-xxxx, it was a man claiming to be from VISA Group Service Center:

Me: Hello, what’s the issue?
Him: We found two abnormal charges on your VISA card today and need check with you.Please tell me your name.

Me: So you don’t know my name?
Him: We know your name, but we need to make sure it’s you and not someone else holding this phone.

Me: Ok, which bank issued my credit card?
Him: We are from the VISA Group, we handle all banks’ VISA cards, including RBC,CIBC and TD.

Me: What’s the last 4 digits of my card?
Him: I cannot keep doing this service, Goodbye.

About 10 years ago, I worked at Gameloft as a game server developer.
We used C++ to develop an online MMO-RPG game, where thousands of players connected simultaneously.

One day after a game update, our QA team reported a bug: players experienced significant lag when performing actions.
The game client team investigated and informed me that the lag originated from the server.

I added some logs and eventually found the problematic code.
It’s a call to get the size of a list, which looked something like this:

std::list<int> items;
... // do someting with items
int count = items.size();

Can you see the problem?

The size() function’s time complexity was O(N), not O(1)! until C++11
So why didn’t I catch this issue in tests before it went live?

  • First, it’s only noticeable when the list contains a large number of items.
  • Second, We tested under Windows, compiling the code with MSVC. The default STL library in MSVC implemented size() as an O(1) function.However our production server ran on linux and was compiled with GCC.

Yes MSVC was ahead of its time in this regard.