Weekly Digest #57

Weekly Dev Blog
3 min readJan 10, 2022

--

Articles

How WhatsApp scaled to 1 billion users with only 50 engineers

Engineer culture

  1. Keep Things Small (Having a fewer number of servers means fewer things breaking down, which makes it easier for the team to handle.)
  2. Keep Things Simple (Just Enough Engineering, avoid over-investing in systems and components, focus on building just enough for scalability, security and reliability.)
  3. Have a Single Minded Focus on the Mission (dedicated to delivering a core communications app with a great UI. avoid extra bells and whistles and don’t implement features that aren’t exclusively focused on core communications.)

Why you can have millions of Goroutines but only thousands of Java Threads

  1. The JVM delegates threading to operating system threads. Go implements its own scheduler that allows many Goroutines to run on the same OS thread.
  2. The JVM defaults to a 1 MB stack per thread. Go’s stacks are dynamically sized and a new goroutine will have a stack of about 4 KB.

Learning with not Enough Data Part 1: Semi-Supervised Learning

I blew $720 on 100 notebooks from Alibaba and started a Paper Website business

The author make use of NLP API to build a website that accepts image and turn them into blog post.

Tutorials

Various ways to include comments on your static site

A Visual Guide to useEffect — Cleanups

Making HTTP requests with sockets in Python

HTTP is an application protocol. It basically means that HTTP itself can’t be used to transport information to/from a remote end point. Instead it relies on an underlying protocol which in HTTP’s case is TCP.

Sockets on the other hand are an API that most operating systems provide to be able to talk with the network. The socket API supports different protocols from the transport layer and down.

import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect(("www.example.com", 80))
sock.send(b"GET / HTTP/1.1\r\nHost:www.example.com\r\n\r\n") response = sock.recv(4096)
sock.close()
print(response.decode())

to fix the blocking socket we can:

  1. disable the persistent HTTP connection
  2. 2) set a timeout on the socket
  3. 3) read the HTTP response headers to determine when to quit

Tools

codepng — Turn your code into awesome pictures

Microdiff is a tiny (currently <1kb), fast, zero dependency object and array comparison library. It is significantly faster than most other deep comparison libraries, and has full TypeScript support.

AppFlowy The Open Source Notion Alternative

it-depends It-Depends is a tool to automatically build a dependency graph and Software Bill of Materials (SBOM) for packages and arbitrary source code repositories.

Off-topic

Building a Theban Lattice Stool

Redundancy is Life, Except When it’s Death

When airplane have more engine, it doesn’t make it more safe

--

--

No responses yet