https://www.gravatar.com/avatar/ff0292ca9329b69a1325f916c783db36?s=240&d=mp
Do not let today be the enemy of your tomorrow

Timestamp conversion in MacOS

Idea This weekend I work on a project that use Strava activity data and Forest data to generate heat map. The data source used to render the JavaScript component is in JSON format, and the date entry is in timestamp. To update new data entry, I can either use the python to process the whole pipeline or just edit the JSON file needed in React. For convenience, I choose to amend the JSON file, that’s why I need to “Timestamp conversion” here.

DNS Notes

DNS There’re two ways to identify a host — by a hostname and by a IP address. People prefer the more mnemonic hostname identifier, while routers prefer fixed-length, hierarchically structured IP addresses. What is DNS DNS, domain name system is the networking system that allows us to resolve human-friendly names to unique id addresses. DNS is a globally distributed, stateless, scalable, reliable database. a distributed database implemented in a hierarchy of DNS servers an application-layer protocol that allows the host to query the distributed database DNS protocol runs over UDP protocol and uses port 53 Important DNS Terminology Resolver: A DNS client that sends DNS messages to obtain information about the requested domain name space Recursion: The action taken when a DNS server is asked to query on behalf of a DNS resolver Authoritative Server: A DNS server that responds to query messages with information stored in RRs for a domain name stored on the server A non-authoritative server constructs a cache file based on previous queries for domains.

Email Delivery Issues

Email in the Internet Email has been around since the beginning of the Internet. As with ordinary postal mail, email is an asynchronous communication medium. Internet mail system has three major components: user agents (outlook..) mail servers SMTP, Simple Mail Transfer Protocol SMTP (sending protocol) SMTP is at the heart of email, is much older than HTTP. It is a legacy technology that possess certain archaic characteristics. e.g., it restricts the body of all mail messages to simple 7-bit ASCII, which was made sense in the early 1980s.

Bit Manipulation Notes

This note is primarily based on Explore Card on leetcode. And the objective is to grasp the basics of bit in computer science and tackle the related leetcode problems with confidence. Concepts introduction Base Base is a carry counting system with fixed digital symbols and rules. We use decimal numeral system (base-10) as standard in everyday life. In computer science, the binary system is mostly used. Octal (base-8) and hexadecimal (base-16) are also commonly used.

Memory Palace Introduction

Overview Motivation As a student in the field of Software Engineering, my academic and personal interests span a wide array of topics. From delving into complex technical subjects to exploring diverse fields such as history, psychology, and personal development, the necessity to form cognitive connections in each area and across areas is paramount. This breadth of interests requires me to internalize and retain a vast amount of detailed knowledge. ‘Memory Palacer’ stems from this personal need — a tool crafted not just for academic rigor but also for the joy of learning and exploring various domains.

Campus Forum Project Introduction

Overview Demo Currently, only the first phase of the demo is available, showcasing the initial prototype developed during the hackathon. GitHub repo: link Live Demo for the first phase, the prototype for Hackathon: Demo link Background This project originated from the Builder’s Dojo Hackathon held on the Silicon Valley Campus in March 2023. During the event, I led the development of a prototype campus forum using Django, which was recognized with a top prize at the hackathon.

AWS Instance set up for blog and portfolio

TL;DR Create an EC 2 (or other instance from any cloud service provider) With ssh login setup (security rules, private key, non-root user) Domain name Install dependencies (Nginx…For SSL/TLS, I use certbot) Nginx configuration Blog setup I use HUGO Content (.md files) Make sure your blog service could generate static files Serve the content via Nginx Use GitHub repo to manage blog project Use GitHub Actions to automatically deploy static files on the instance Launch EC2 AWS or GCP Create a new Instance On your local machine (which is used to ssh login to the instance) Generate pem as private key file Make the key private by chmod 400 "key_name.

Prefix Sum Technique Notes

Idea Start from 0 Start from 1 Prefix sum is to create an array prefix where prefix[i] is the sum of all elements up to the index i (inclusive). nums = [5, 2, 1, 6, 3, 8]; pref = [5, 7, 8, 14, 17, 25]; # delay pref = [0, 5, 7, 8, 14, 17, 25]; Sometimes, we use a delay-prefix array which start from index 1. This is convenient when calculating distance or length.

Binary Search Guide

Recently, the LeetCode daily problems frequently focus on topics of binary search. so I update this note, include and share them. Note: The following content is a collection of tutorials from leetcode. I’m not the original author; I have simply organized the material for easier access and study. When to use Binary Search? Every time you need to search for an index or element in a collection. If the collection is unordered, we can always sort it first before applying Binary Search.