son pham logo

Son's NoteBook

  • About
  • Categories
  • CountDown

Racket for Beginners

May 9, 2023

Racket, why racket? I don’t know the main reason, but it is interesting and importantly my professor requires it for our Psychology course. I have never learned Racket before but I have a bit of experience in Erlang. In Erlang we cannot assign a value to a variable like Racket because = operator is a pattern matching that is similar to car and cdr. The game is totally changed in Racket. Now we can just define whatever value we want.

Read more

[English] Connectives

May 4, 2023

After many hours of googling, mermaid is finally run on Github Page, thanks to Jojozhuang.

Read more

Note for International Students in Waterloo Region

May 3, 2023

Congrats to all of you that already here in Waterloo Region. Today I will summarize the process of becoming an international student in Canada. And I hope you will have a great experience here!

Read more

R Notebook - dplyr

October 25, 2021

Dplyr

Read more

Explaining TCP flows

August 27, 2021

A few days ago, I wrote a note detailing how to set up a simple TCP client and server using netcat. Today, I have taken things a step further by capturing packets in Wireshark and providing a step-by-step explanation of how the TCP flow works. In the table below, you can find a general overview of this process.

Read more

Quick Note - Decibel dB vs dBm

August 24, 2021

Many of us have heard about decibel unit in our daily lives, as it can be used to describe the loudness of our speakers, the strength of our antennas, or the signal strength from a transceiver. But what exactly are decibels (dB) and dBm? In this discussion, let’s explore these concepts and expand our understanding.

Explanation

Deci-bel is ten time of a Bel (10 x Bel)
Bel is named after an inventor Alexander Graham Bell, in Bell Lab.
It is an unit of a ratio on base 10 logarithm scale
Bel is defined as \(X = \log\frac{P2}{P1}\)

  • P1: Reference Power
  • P2: Measured Power

Now we have \(Decibel = 10 Bel = 10\log\frac{P2}{P1}\)

So what is the difference between dB and dBm?

dBm stands for decibel in miliwat. That means, our Reference Power will be 1 mW

\[Y = 10 \log\frac{P2}{P1} = 10 \log\frac{P2}{1 mW}\]

We can find Y by raise them to the power of 10

\[10^{\frac{Y}{10}} = 10^{\log\frac{P2}{1 mW}} => P2 = 10^{\frac{Y}{10}} 1 mW\]

So in communication, we usually use dBm because we know the reference power which is 1 mW.

Read more

TCP/UDP Flow Analysis with Wireshark and Windows Subsystem for Linux

August 20, 2021

During many of my interviews, I have been asked whether I understood TCP and UDP, and how they differed from each other. While I knew that TCP had an error-checking procedure that made the protocol more reliable but slower than UDP, my understanding was limited. Although I had learned about the detailed structure of these protocols in school, I didn’t have a chance to get hands-on experience with them. However, I later discovered an easy way to explore TCP and UDP packets using Windows Subsystem for Linux (WSL) and WireShark. As a result, I would like to share what I have learned today.

Read more

Basic JavaScript Part 1

August 3, 2021

In this tutorial, I will introduce a few steps to access and edit elements in JavaScript. Mastering and understanding these steps can help you make a simple form, handling submission, and change the outlook of your website.

Read more
Prev Next

Go back to homepage Son's Notebook