2022W35

Lex Fridman Podcast #309: John Carmack https://youtu.be/I845O57ZSy4 Focused, hard work is the real key to success. Keep your eyes on the goal and just keep taking the next step towards completing it. If you aren’t sure which way to do something, do it both ways and see which works better. You can’t learn everything, but you have to convince yourself that you can learn anything. [And learn deeply]. Be prepared for opportunities to present themselves. ...

September 3, 2022

2022W29

Programming notes

July 19, 2022

2022W23

Cell division: Asynthetic fission https://doi.org/10.1038/s41586-022-04641-0 https://youtu.be/fi3pGplAxy0 A recent paper in Nature reported on a novel form of cell division called asynthetic fission. The skin cells of zebrafish are able to split twice; in other words, one skin cell can split into three new cells plus itself. Remarkably, asynthetic fission doesn’t replicate DNA. It simply splits whatever DNA is available into the two halves. The DNA is damaged during the process, but only seemed to occur during times of rapid growth. Once growth slowed down, the damaged cells were removed. ...

June 7, 2022

2022W22

Golang: Using linker flags I am using -ldflags to set a version variable at build time. I couldn’t find the right package name to use, but this answer helped: https://stackoverflow.com/questions/47509272/how-to-set-package-variable-using-ldflags-x-in-golang-build I used this command to find the right name: go tool nm <your binary> | grep <your variable>

May 31, 2022

2022W20

Unix file permissions There are three “user levels” who can receive permissions: user, group, and other. There are three types of permissions: read (4), write (2), and execute (1).

May 18, 2022

2022W14

Caml Trading https://youtu.be/FnBPECrSC7o Talk given at Carnegie-Mellon University by Yaron Minsky in 2011 (but apparently posted on YouTube in 2016). Originally, Jane Street started out using industry-standard tools like Visual Basic, Java, and C++. But, after awhile, they decided to use OCaml. This talk explains some of the reasons why. Most projects that use functional languages are usually linked to academics, but OCaml’s use at Jane Street is entirely industrial. Incidentally, because of this connection, the pool of OCaml programmers tends to have an academic background which can be good for recruiting purposes. ...

April 6, 2022

2022W13

OCaml

April 1, 2022

2022W08

LeetCode 78. Subsets Given an integer array nums of unique elements, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution in any order. Both solutions below take O(n*2^n) time. Using enumerate binary numbers: class Solution: def subsets(self, nums: List[int]) -> List[List[int]]: """Create power set by counting in binary""" n = len(nums) hi = 1 << n subsets = [] for i in range(hi): new_subset = [] k = 0 while i > 0: if i & 1: new_subset.append(nums[k]) i >>= 1 k += 1 subsets.append(new_subset) return subsets Backtracking: ...

February 22, 2022

2022W06

778. Swim in Rising Water You are given an n x n integer matrix grid where each value grid[i][j] represents the elevation at that point (i, j). The rain starts to fall. At time t, the depth of the water everywhere is t. You can swim from a square to another 4-directionally adjacent square if and only if the elevation of both squares individually are at most t. You can swim infinite distances in zero time. Of course, you must stay within the boundaries of the grid during your swim. ...

February 9, 2022

2021W40

Problem Log Algorithm Design Manual Cheat Sheet Interview Cake Course

October 4, 2021