Hey!This hasn’t been updated in a while. Has Marc learned anything after January of 2021?
That’s a good question. I’m writing this in mid-May of 2021. The past few months I’ve been kept busy between my co-op at Vicarious Surgical, and doing research work on developing atom rearrangement algorithms for large Rydberg atom arrays. Both of those have just concluded, and here I am on my two-day summer vacation before I start as an intern at Facebook.
This learning log began as a way for me to give my days some structure over quarantine, in August of 2020. When my classes began in fall, this log helped me feel accountable to make my schoolwork interesting and exciting – if I’m attending classes almost every day, I’m surely going to be able to find something interesting about them to write a few bullet points about. Some days I wrote more than others, and some days I forgot to write an entry and then had to think really hard the next day to catch up.
When my co-op started, I began to struggle to keep up with these logs. I questioned if I was actually learning anything on co-op, and began to be worried about what having a career would look like. At work I was certainly doing new things and getting better at existing skills, but I struggled to quantify that.
I am looking back on these past few months and at the same time I am looking out my window at the big tree outside. From my second floor window it stands swaying with green buds on fresh branches. The shoots have not made the tree much taller than it was last year, but the quality of the tree has changed – the leaves are denser, the canopy wider, the once green twigs now strong branches bearing sprouting leaflets.
Measuring your tree every day with a ruler is, in some strange way, fun. But leaves rustle, branches sway, twigs bend, and boughs fall from wind and rain. The tree will feel static until one day in May when you will look at the tree with fresh eyes, and be surprised at just how much has changed.
I try to learn or discover something new every day. Here are some of the things that I get excited about! Dates in YYYY-MM-DD.
Update December 14, 2020: Switching to a weekly format, instead of daily updates.
Week of 2021-01-25
JavaScript has a way to check for null fields inline
When serving a React single-page app that uses React-Router with nginx, you’ll need to change the location block in the configuration file to this. This tells nginx to forward other requests to the index.html file as well.
location/{try_files$uri/index.html;}
Cantor’s diagonalization argument; there are more reals than whole numbers
Week of 2021-01-18
Finished reading Anna Karenina (finally!); Libby says I read it for 15 hours and 38 minutes total which definitely shouldn’t have taken me 7 months.
Learned TypeScript last week. Turns out it’s called TypeScript because the syntax requires so much typing.
Printing a line to console with \r (carriage return) puts the cursor at the beginning of the line, meaning that the next line you print will overwrite the previous line.
Worked a ton with React, Tailwind CSS, and Firebase
Learned a lot about the robot and systems at work
These past weeks I’ve learned that it’s pretty hard to learn things when one has work. I’m definitely learning a lot through work, but I’m not sure how to write down those things I learn. I’m hoping this is because it’s generally hard to write down learnings, rather than that I’m not really learning anything. It’s easy to write down buzzwords, syllabi topics, and short snippets of code, but the types of things I’m learning at work is how to do things. That’s probably the whole point of co-op, whereas learning things is what you get through classes and academia. I like learning things.
React’s useEffect() hook is akin to Verilog’s always@() statement, where assignments get updated whenever a register in the dependency list changes value. This is cool.
You can make your own directional wifi antenna with a can of beans and a coaxial connector. Turns out wifi is more than just magic.
Week of 2021-01-11
We know about snake_case, but the official name for its cousin is SCREAMING_SNAKE_CASE 😱
Re-familiarized myself with working with Pandas and seaborn
Got comfortable with working with Postgresql and jsonb documents
To get that fancy conda env tab in Jupyter notebook, conda install nb_conda in your base env or whichever environment you start Jupyter notebook from should do the trick.
I (re)learned React. I also learned TypeScript and am very much enjoying typed callback functions. I also finally took a course on CSS instead of Googling “how to center a div” for the millionth time. I’ve been enjoying Tailwind UI’s components as well as ANT Design’s charts and graphs.
The complex analogue of an orthogonal matrix, $A^T=A^{-1}$ and $A^TA=I$, is the unitary matrix, where $A^\dagger=A^{-1}$, so that $A^\dagger A=I$.
The complex analogue of a symmetric matrix, $A^T=A$, is the Hermitian matrix, where $A^\dagger=A$.
9 and 11 have this intriguing property:
$\frac{n}{11}=0.\overline{x}$ where $x=9n$. For example, $\frac{7}{11}=0.\overline{63}=0.6363636363\dots$ and $9\cdot7=63$.
$\frac{n}{9} = 0.\overline{x}$ where $x=11n$. For example, $\frac{7}{9}=0.\overline{77}=0.7777777777\dots$ and $11\cdot7=77$.
With edX’s switch to hosting video files on their own server, the old edx-dl tool no longer works. Fortunately, someone has made a fork of the repo that does work.
ffmpeg -i video.mp4 -i audio.m4a -acodec copy -vcodec copy output.mp4 to merge separate audio and video tracks
Quantum Flytrap for super cool quantum mechanics demonstrations
List comprehensions in Haskell are brilliant. Fizzbuzz:
The DFT’s Fourier matrix is constructed where the $(i,j)$’th element of $F_n$ is $w^{ij}$, when $i,j=0\dots n-1$. $n$ is the size of the square matrix, and $w$ is a root of unity. A root of unity is a complex number that, when raised to some power $n$, yeilds $1$. We could write $w=e^{2\pi i/n}$, since then $w^n=(e^{2\pi i / n})^n=e^{2\pi i}=1$ by Euler’s identity. Often, when this matrix is used, the factors are normalized by $\frac{1}{\sqrt{n}}$, so you could write the $(i,j)$’th element of $F_n$ is $\frac{w^{ij}}{\sqrt n}$.
If your basis states are $\vert\leftrightarrow\rangle$ and $\vert\updownarrow\rangle$, then $\vert\nearrow\rangle=\frac{1}{\sqrt{2}}(\vert\leftrightarrow\rangle+\vert\updownarrow\rangle)$, and you can even define circular polarization with $\vert\circlearrowright\rangle=\frac{1}{\sqrt{2}}(\vert\leftrightarrow\rangle-i\vert\updownarrow\rangle)$.
When we are dealing with qubits, the reason we can express a qubits’ 2-dimensional complex vector space as a 3-dimensional real vector space is because we also know that a qubit’s vector within this 2D complex vector space is normalized. We know for sure that the length is one, so we can represent all this data with just 3 real dimensions instead of 4.
Complexity class #P (Sharp P) is the class of problems dealing with counting the number of solutions to a problem in complexity class NP. #P is outside of both P and NP. Then you can count the number of counting problems, and so on and so forth. “This is how you get a career as a theoretical computer scientist” – Isaac Chuang
Website response times aren’t Gaussian, but can be better approximated by a Log-normal or Erlang distribution.
To remap keys on Linux, edit /usr/share/X11/xkb/symbols/pc. Remove the xkb cache with sudo rm -rf /var/lib/xkb/*, then reboot.
To show statistics from curl, can use this function in /.zshrc:
function perf {
curl -o /dev/null -s-w"%{time_connect} s connect + %{time_starttransfer} s transfer = %{time_total} s total\n""$1"}
Week of 2020-12-14
I’ve just finished my final exams, and I’m going to be switching to a weekly format for my log of learnings. I’m hoping this will be more sustainable particularly over the holidays, as well as allow me to put down not just tidbits of learnings but also the progress towards substantial goals that I’m working towards.
Wrote a blog post about the proofs for two unique properties of Hermitian operators. Why are the eigenvalues always real? Why are the eigenvectors always orthogonal? Find out now.
To make Home and End keys work on an external keyboard on mac, create file ~/Library/KeyBindings/DefaultKeyBinding.dict and in it put
{
/* Remap Home / End keys */
/* Home Button*/
"\UF729" = "moveToBeginningOfLine:";
/* End Button */
"\UF72B" = "moveToEndOfLine:";
/* Shift + Home Button */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:";
/* Shift + End Button */
"$\UF72B" = "moveToEndOfLineAndModifySelection:";
/* Ctrl + Home Button */
"^\UF729" = "moveToBeginningOfDocument:";
/* Ctrl + End Button */
"^\UF72B" = "moveToEndOfDocument:";
/* Shift + Ctrl + Home Button */
"$^\UF729" = "moveToBeginningOfDocumentAndModifySelection:";
/* Shift + Ctrl + End Button*/
"$^\UF72B" = "moveToEndOfDocumentAndModifySelection:";
}
If you run 120VAC through a pickle, you get pure sodium light from the Na+ and Cl- ions produced from pickling.
“Once you open the box, however, it will either be dead or alive – the superposition will have collapsed to a single state. This is a bit of an unrealistic experiment, but it does illustrate one key point: Schrödinger did not like cats. This also illustrates the point that QM assumes no knowledge of anything that is not experimentally observable, because observation has the potential to change the outcome of later experiments.” - MIT OCW
$\sum_{i=0}^{n}\frac{1}{i}=\int_{0}^{n}{\frac{1}{x}dx}\approx ln(x)$. Finding the sum, for sufficiently large $n$, is akin to finding the area under the curve. Didn’t learn this but I definitely forgot it previously.
Adding 1 to all the edge weights in a graph does not preserve the minimum weight path. You could have a situation with two paths from a source to a sink, one with 10 edges and one with only one edge. The path with 10 edges, while it may be less weight than the path with only one edge, will increase by weight 20, whereas the path with only one edge will increase by only 1.
I need to devote some time every week (maybe on Saturday mornings) to do all the tiny but important things that I need to do but never get around to, like checking my credit card statement, doing work for that one class, making sure my backups are working, etc.
2020-12-09
Strange Chinese domains like .xn--czru2d are actually supposed to be displayed as Chinese characters, due to Internationalized Domain Names (IDN). The domain xn--45q11c is supposed to be displayed as .八卦, meaning “gossip”.
This super approachable lecture notes on the Fast Fourier Transform, by Jeff Erickson who has a great book on algorithms in general.
Incrementing and decrementing a binary counter using Gray Codes is always constant time, because Gray codes hold the invariant that adjacent binary numbers differ only in 1 bit. Gray codes are also cyclic, in that to roll over from 15 to 0 also requires only one bit flip. Gray codes can even provide a solution to the Towers of Hanoi puzzle. Here’s a recent paper on using Gray codes to reduce noise in quantum computing! It covers how to create operators that work on qubits with Gray encoding, and shows how it can be much more qubit efficient than the Jordan-Wigner encoding.
Where to sit in a car and which windows to open in a car with a potentially virulent COVID-19 patient, according to a new study from Brown. In the most common seating arrangement in ridesharing services where the passenger sits in the rear right seat and the driver in the front left, opening the windows opposite the occupants generates a diagonal flow of air through the car that separates the passenger’s air from the driver’s air. According to the fluid modeling of this study, usually air flows into the car from the rear windows, and exits the car from the front windows when all windows are open. The best is to open all four windows. “Driving around with the windows up and the air conditioning or heat on is definitely the worst scenario.”
2020-12-04
If you have a qudit, or a $d$-valued version of a qubit, the pure states are $\vert0\rangle,~\vert\frac{1}{d-1}\rangle,~\vert\frac{2}{d-1}\rangle,\ldots\vert\frac{d-2}{d-1}\rangle$. In a 2-state qubit, the pure states are of course just $\vert0\rangle$ and $\vert1\rangle$. A pure state of $\vert\frac{k}{d-1}\rangle=\begin{bmatrix}0 \\ \vdots \\ 1\\ \vdots\\ 0\end{bmatrix}$
The Fredkin gate in quantum computing (CSWAP) takes 3 inputs and swaps two of them based on the input of the third. The matrix form conserves $0$’s and $1$’s, which by the billiard-ball model indicates that the gate conserves energy/information.
hedonometer.org of Twitter sentiment over time. Every Christmas since 2015 has been sadder than the year before. The variance in the trend is increasing: maybe due to media that is made to incite outrage, fear, and anger, there are more spikes and dips in recent years than ever before. May 30, 2020 was the saddest day in the history of Twitter.
If you have a set of points in a vertical line, spaced $d$ apart, and another point $\ell$ away from the very first point, and you draw lines connecting that top point to each point on the line, the angle formed by $\theta=\arctan(\frac{d}{\ell})$. With infinitely many points, $\lim_{d\to\infty}{\arctan{(\frac{d}{\ell})}}=\frac{\pi}{2}=90^\circ$. As you add points, $\frac{\partial}{\partial \ell}\arctan{(\frac{d}{\ell})} = \frac{\ell}{d^2+\ell^2}$, meaning that the angle changes proportional to $\frac{1}{d^2}$ when $\ell$ is a constant. This is both cool and neat.
<-length l->
| |
*----------* +
\ Θ |
\ |
\ | distance d
\ |
\ |
* +
more points down here, d distance away
and so on...
2020-12-02
You’ve heard of salting passwords, but what about peppering passwords?
Edge-disjoint paths are paths on a graph between the same source and sink that don’t share any edges in common. You can find edge-disjoint paths using a reduction to integer max flow on a graph, in $O(mn)$ time.
2020-11-30
If MacOS refuses to open an app from an unidentified developer (claiming that the code is damaged), run xattr -cr /path/to/application.app to clear the permissions and allow it to run.
2020-11-29
rm -r to delete a directory is not implemented in in the file system: the rm command literally just recurses through every single item (and nested items) in the folder and deletes them first individually. The rmdir file system call only allows deleting empty directories.
Most operating systems don’t allow hard links to directories, where two directory entries point to the same, another directory inode. This can get complicated mainly in avoiding cycles.
2020-11-28
If you need to implement a priority queue that has a fixed number of values for the primary ordering (like if you are storing scheduling appointments by the minute, you only have $24\times60=1440$ minutes), you can use a lookup-based approach where in a $1440\times1440$ array that stores the number of requests that start at the row index and end at the column index. In another $1\times1440$ array, store the number of requests that end that minute. Then you can traverse your fixed length 1D array, and find the first ending time to traverse for in your 2D array. This is asymptotically constant time, since $1440$ is a constant. This can be pretty slow though in practice.
Added the outline on the left hand side. I used jekyll-toc
List<String>[]liz=newArrayList<String>[10];// ILLEGALObject[]objs=liz;// is fine, since List<String> is subclass of ObjectList<Integer>ints=newArrayList<Integer>;ints.add(42);objs[0]=ints;Stringohno=liz[0].get(0);// oh no! liz now contains integers!
2020-11-26
char arrays are not automatically null terminated in C, but string literals are.
Simple Fuse API calls to implement a bare bones file system 🎉
2020-11-25
Always put extra parenthesis in your C functions in macros to to avoid order of operations errors, particularly around any parameters. Example:
#define CEIL(x) ((x) == (double) (int) (x) ? (int) (x) : (int) (x) + 1) // is ok
#define CEIL(x) (x == (double) (int) x ? (int) x : (int) x + 1) // not ok
Rule of Silence: When a program has nothing surprising to say, it should say nothing.
This is probably why diff returns nothing if files are the same.
Most of the things I actually learn, don’t end up on this page. This has become (or always was?) a subset of little tidbits, facts, links that I stumble across. I don’t really attribute much meaning to any individual bullet point on this page, whereas I do find lots of value in big learnings like designing a memory allocator or understanding how the quantum fourier transform works. Most things worth learning aren’t things you pick up in a day, but things you work at over long periods of time. Mastery comes from incremental improvement, and while I’m far from that in anything, incremental learning is difficult to quantify beyond cute little discoveries/tricks/hacks. How do I measure how good I am at improvising a jazz solo over the Bb blues?
On balance, a lot of these entries are minute things that I do want to remember or come back to, like yesterday’s learning about vim clipboard settings. Perhaps, like many other things in life, these minute learnings may have little meaning by themselves, but when taken together and considered as a whole, they become something special.
It’s almost the 3 month anniversary of me starting to do this. When I look back at a random day, I’m surprised how the things I’ve recorded can jog my memory and help me recall the happiness, sorrow, and meaning that I’ve been so incredibly fortunate to have experienced in my short existence. I’m glad that I do this.
2020-11-21
set clipboard=unnamed in vim makes vim use the system clipboard instead of its own; so you can copy and paste with y and p and have it work with the system.
On linux you can view the CPU temperature in cat /sys/class/thermal/thermal_zone0/temp: divide by 1000 to get degrees Celsius.
Some substances, like bitumen, appear to be solids but are actually liquids. The Pitch Drop Experiment has the record for the longest continually running laboratory experiment, and consists of a cone of pitch that is dripping at a rate of once per decade since 1930. Watch the live stream here – the tenth drip is expected in 8 years (as of writing).
As of a recent lawsuit, the USPS is required to publish statistics. This Google Drive folder contains spreadsheets with mail processing rates and other statistics, grouped by region and time period. It’s important to note that the percentages are mail processing rates, not delivery rates – mail not processed on time could still get delivered on time. Some more information about this data here.
Farm workers talk to their dairy cows use a lower lexical difficulty of english than mothers talking to their 3¼-year-old children. Science is becoming more and more difficult to understand, and we’ve understood this since this article in Nature from 1992.
Lempel-Ziv-Welch compression algorithm, and the Huffman coding algorithm
Computer dies during a git operation. Git is upset. See this question.
error: object file .git/objects/31/65329bb680e30595f242b7c4d8406ca63eeab0 is empty
fatal: loose object 3165329bb680e30595f242b7c4d8406ca63eeab0 (stored in .git/objects/31/65329bb680e30595f242b7c4d8406ca63eeab0) is corrupt
From the .git directory, run find . -type f -empty -delete -print and then git pull
/bin/time -v gives extra info like memory usage, stack sizes, sockets used, etc. Somehow this is different than time even though which time shows it to be the same 🤔
How to write a super fast, multithreaded memory allocator using buckets and multiple arenas. Blog post coming soon.
2020-11-15
“Communism will never work out. There are too many red flags.”
#define NDEBUG to disable asserts in C. Made my own memory allocator almost 40% faster because I had all kinds of asserts sprinkled in there.
Sometimes you’ll need to use sudo apt-get dist-upgrade to get linux-headers and other common tools.
2020-11-14
“Infinite boiling softens the stone”
How to construct the bebop scale
For major scales, add the #5
For minor scales, add the major 3rd
For dominant 7 scales, add the major 7th
2020-11-13
This page about the train-launched RT-23 Molodets ICBM. In order to fit in a train cart, this rocket featured an inflatable nose cone. Disguised as refrigerator carts, the trains carrying these ICBMS featured a number of innovations to deflect power wires, eject the rocket without launching, and support the immense weight across multiple carts.
If you try to mmap a fractional size of a page, it returns the next largest size possible with whole numbers of pages.
How do you write an online algorithm to detect a beat drop in music playing in real time?
Always assert bounds for array access in C!
2020-11-11
Static arrays in C must have a size defined not as a variable, like as #define size 5. Apparently constants are variables.
Are trees aliens?
Initializing a pthread_mutex_t using the macro initializer is fine for static initializations, but if you are doing it afterwards like in a constructor you’ll want to use pthread_mutex_init(&mut, NULL)or else you’ll get an error __pthread_tpp_change_priority: Assertion 'new_prio == -1 || (new_prio >= __sched_fifo_min_prio && new_prio <= __sched_fifo_max_prio)' failed
Online algorithms are able to provide useful results even with partial data, and results are updated efficiently as more data is available.
Imagine a doubly ordered, doubly linked list that has two orderings: ordering a, which prev_a and next_a define, and ordering b, which is kept track of with prev_b and next_b. You could use this in keeping track of a free list in a memory allocator, where one ordering is allocations by memory address and the other is by size. This would enable constant time freeing with blocks ordered by memory address, while still letting you use a first-fit allocation strategy on allocating the smallest previously free block on new allocation calls. What is the name for this type of data structure?
Initialize a pthread_mutex_t with static pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER;
2020-11-08
The size of a struct in C isn’t the sum of the sizes of each of its fields; padding is automatically added to align the struct fields.
2020-11-07
always@(...) in Verilog describes events that should happen under certain conditions. Two common use cases are to have a sensitivity list inside the parenthesis, or to trigger on every clock cycle. Good reference is here.
always@(A, B, C) indicates that the assignments inside the block change whenever any of the parameters in the sensitivity list changes – any time A, B, or C changes.
always@(posedge clock) updates assignments inside the block at the positive (rising) edge of every clock cycle.
Amortized time analysis
2020-11-06
It’s pretty difficult to divide a line into sevenths without practicing. Is there something fundamental about 7 that makes dividing into 7 pieces difficult? Are there aliens for whom it is easy to divide things into 7 pieces, just like humans find it easy to divide things in halves?
Pointer arithmetic in C works differently on void* and struct* or any other pointer type: when you do +1 on a void pointer, that increments the pointer’s address in memory by 1 byte, whereas if you do +1 on an int*, char*, or struct* that increments the pointer by one whole unit, whether that’s an integer, character, or struct.
2020-11-04
“We are all in the gutter, but some of us are looking at the stars” — Oscar Wilde
After committing a super large file in Git, and now you have regrets because it won’t fit in Github and you can’t push it, and now you just want to forget everything you’ve ever had to do with it: (you may have to put the -f flag after --index-filter)
D-type flip flops implemented using registers in Verilog
Akku to monitor bluetooth headphone battery level from mac
Spinlocks are useful when you only expect to wait a very short amount of time, because they prevent your thread from being rescheduled. But they are wasteful if you hold them any longer because they’re literally just busy waiting. Also ticket locks and seqlocks are pretty cool.
Up until 2019, in Texas it was illegal to buy an Erlenmeyer flask without a permit, in an attempt to prevent illicit drug sales.
Minimum spanning trees and some interesting properties of graph cuts
Multi-bit wires in verilog
The story of Hiroo Onada, Japanese soldier tasked with defending to the death an island in the Phillippines against US invasion during WWII. After all his comrades were killed, Onada spent 29 years hiding in the mountains and occasionally murdering civilians and burning crops – nobody ever told him that the war was over, and his last orders were to never surrender or take his own life. There’s a semi-happy ending to this story too.
2020-10-29
How to write a barrier in C using mutexes and condition variables
If you can’t think of anything to say, it probably means you aren’t listening closely enough. I’ve found that if I really think about what the other person is saying, there’s always a question I can ask or something related that I can share that moves the conversation forward. When one gets caught up with thinking “what should I say next” it’s easy to fall into the habit of just waiting for one’s turn to speak, rather than engaging in true conversation.
Non-demolition quantum measurement is in contrast to the usual projective measurement of a system that leaves it in the measured eigenstate. How can this be done, and what is the state that the system takes on after measurement?
You shouldn’t use malloc when creating objects in C++, since new takes care of that for you. But malloc might still be useful when paired with realloc, like for building a dynamically allocated vector, since you can’t do that with new.
Is general intelligence equivalent to lossless compression? This is a hot take I’ve heard floating around.
The Efficient Market Hypothesis hypothesizes that stock prices always reflect all knowable data about a company, with the conclusion that there are no such things as undervalued or overvalued stocks. If you believe in this you probably believe it’s impossible to beat the market by picking stocks.
Negative edge weights on graphs could be useful in modeling the free energy of chemical reactions or cost/profit of driving a taxi. Negative edge weights open up the possibility of having negative cycles, where following a cycle ends up with a sum negative weight – this doesn’t really make sense, and the Bellman-Ford algorithm detects these.
2020-10-21
systemctl disable influxdb to prevent a service from starting automatically on boot, effective next stop event (reboot).
Controversy over the Mpemba effect, where hot water freezes faster than cold water (sometimes????)
Sleep Sort: sort a list by literally doing nothing
Build nice command line UIs with Go using bubbletea
2020-10-20
Djikstra’s algorithm
Basics of Verilog
ctrl-z to suspend a process, and bg and fg to manage processes. Here is how Unix implements them with a job table.
Data lakes in organizations easily suffer from data quality issues when the applications dumping data are not responsible for the quality of their data, the team managing and using the data lake is unable to resolve data quality issues originating upstream.
2020-10-17
Algorithms for finding strongly connected components of graphs in linear time
Applying breadth-first search to bipartite coloring
bat is a cat clone that does syntax highlighting and looks nice
Topological sort of a graph in linear time, using discovery and finish times of depth-first search
2020-10-15
On Unix, pipes run processes concurrently: when you run echo hi | tail, the shell uses forking to run both echo hi and tail at the same time, and the stdout file descriptor of the echo is the same as the file descriptor for the stdin of tail. The two ends of the pipe are in different processes, and link the stdout of the left hand process to the stdin of the right hand process. This example behaves the same as if I did tail <(echo hi), but this would first run echo hi and then pass that output to tail.
This is also the reason why when you do ps -ef | grep cron, the grep command you are running shows up. It would not show up in the output of ps if grep were running after ps completed. But because we are using piping, the grep process is started at the same time, and doing its work on the stdout of ps, which of course will include grep.
Put set follow-fork-mode child and set detach-on-fork off in the gdb window in order to debug forked processes inside the CLion debugger
Note: this doesn’t really work very well but I don’t have the time to figure out why. When a child process exits basically the whole program exits 😟
The inventor of the theremin, Leo Theremin, also happened to invent a bugging device concealed within a gift given by the Soviet Union to the US Ambassador’s house in Moscow.
News embargoes mean that science reporters can only report in the ways that publishers like the FDA allow. Embargoed news has been around since the 1920s, when it meant that science journals would offer reporters early access to papers and contact information of authors, under the condition that the reporters can only publish their story after the embargo time period expires. This would enable reporters extra time to research their story, without the fear that their story would get published by someone else first.
The close-hold embargo forbids reporters from contacting outside sources for commentary about news. This essentially prevents all independent reporting, allowing the journal or organization to dictate what the news says. The FDA has a history of doing this.
2020-10-11
Cookies are passé. Browser fingerprinting is à la mode. Check if your browser is leaking your fingerprint at Panopticlick, a project by the EFF.
Boop to easily do text things! Lots of useful and fun shortcuts. Hard to describe but pretty awesome.
QuickJS is a JavaScript runtime that starts much faster than the v8 engine used in Node.js. Could be useful for serverlessor CLI apps that need to start and stop very quickly. Elsa is a QuickJS wrapper written in Go.
Windcatchers are an ancient and effective way to ventilate and cool a large space, and are still great techniques to use today. Yakhchāls are related and also pretty cool.
Put commands in /etc/rc.local to have them run every time the system boots! Using the @reboot descriptor in your crontab doesn’t always work, depending on the system-specific implementation of cron (it didn’t on the Intel DE1-SoC board’s distribution of Linux).
Use cron to schedule recurring tasks, use anacron to schedule recurring tasks on machines that aren’t powered on all the time. Any tasks that were missed while the computer was off, will be run when it turns on again with anacron.
Rectangle for a super clean way to manage window tiling on MacOS
Paper about the effects of ventilation on indoor spread of COVID-19. Many common ventilation approaches actually increase the risk of COVID-19 exposure indoors.
2020-09-30
Survey of Waterloo software engineering majors on all sorts of topics, ranging from salary to personal habits. (over 100 pages long!)
:set keywordprg=cppman in vim gives you access to C++ function documentation when you press K over a function name
Shigeo Sekito, a Japanese electone player whose song “ザ・ワード II” was sampled in Travis Scott and Quavo’s song “How U Feel”. Sekito’s enigmatic and diverse body of works seem to be heavily influenced by jazz, blues, bop, funk, and even a bit of electronica emerging at the time. You can hear his style progress and develop, especially in his 1985 album アーティスティック・エレクトーン. I absolutely love his sound, and especially the title song – and the album just gets better.
2020-09-29
Algorithms for finding the majority element of a list in linear time
Darwinism suggests that human altruism may have evolved in a way such that groups of early humans who demonstrated more altruism, were more likely to survive in violent conflicts against other groups with less altruistic traits. This study suggests that violence among early humans played a significant role in shaping the social dynamics of groups during the hunter-gatherer time period.
After you add an ssh key to Github, you need to use the ssh url to clone the repo in order to use your ssh credentials.
2020-09-21
How to use partially observable markov decision processes (POMDP) to efficiently search for items on a desk using a robotic manipulator, when some items obscure others. While solving for full solutions for a POMPD requires an \(O(n^2)\) solution, using Monte-Carlo sampling can cut this time down dramatically, enabling this paper to be able to plan movements of the robotic manipulator in real time.
In that paper, they use a POMDP by defining:
Set of world states (the objects on the table)
Set of actions (moving an object, moving the robot camera location/angle)
Set of observations (using R-CNN model to recognize bounding boxes for objects on the table)
State transition function, defining the probability distribution of new states after taking some action (moving an item) under the current state
Observation function, defining the probability distribution of possible observations (arrangements of obscured objects) given the resulting state and an action. Follows from the state transition function.
Reward function, giving a valued-reward for taking certain actions like finding the correct item.
How to get Outlook to not delete event invitations after you accept them (it’s in settings, under Settings => Calendar => Events and invitations => Delete invitations and responses…)
2020-09-16
Using the stack and safe registers in assembly
The Line: a short story by Amor Towles, the author of one of my recent favorite books, A Gentleman in Moscow.
2020-09-15
How to use GDB for debugging assembly programs
You will segfault if you call printf on a format string with the wrong specifiers :(
2020-09-14
The difference between function calls and labels in assembly
SSH port forwarding from Virtualbox to host
2020-09-13
Stoicism and Seneca (added to my reading list)
The independent set problem and some applications to things like interval scheduling and bipartite matching
What my would-be-roomates’ dorm in Boston looks like (it’s nice!)
2020-09-12
How to play codenames
Silq is a cool and hip high level quantum programming language which has the unique feature of automatic uncomputation
NORMALIZE PROGRAMMING WITH EXPLICIT PRECONDITIONS AND POSTCONDITIONS!!!
One can think of quantum state teleportation as \(g(f(\vert\phi\rangle)) = \vert\phi\rangle\), and its inverse of teleporting classical bits, as \(f(g(x, y)) = (x,y)\) when \(f:qbit \rightarrow bit\; \otimes\; bit\), \(g:bit\;\otimes\;bit \rightarrow qbit\). \(f\) is located at the sender, while \(g\) is located at the receiver (in state teleportation). Beautiful.
2020-09-10
Checkpointing and restart versus Kubernetes’s approach to drain a node
Mainframes still exist (!) and are still used today when huge amounts of memory needs to be accessed by huge amounts of processors, and for high throughput applications
“The computer is the tool, computation is the principle.” (I kinda already knew this but this is a nice way of saying it)
“There are at least two kinds of games. One could be called finite, the other, infinite. A finite game is played for the purpose of winning, an infinite game for the purpose of continuing the play.” (Finite and Infinite Games, Ballantine, 1986, p. 1.)
2020-09-09
Who the AI research faculty are at Northeastern, what are the labs, and what they work on
Living in a red haze all day from the wildfire smoke really messes with how you perceive time. I felt exactly like I feel at hackathons, since the luminosity of my room did not change from morning to evening.
2020-09-08
Lambdacalculusforquantumcomputers is insane and I need to learn more. Somehow I’ve managed to not hear about this before. It seems like an area orthogonal to the gate model and that is going to be super important once the hardware of quantum computing is ironed out.
SecDB is a thing. More, I cannot really say
2020-09-07
Dewey Square by Charlie Parker, on saxophone
2020-09-06
Surprising effect when you use both L2 Regularization and Batch Norm together
2020-09-05
This startup building an AI friend/therapist/romantic partner, and a great podcast about it
2020-09-03
How to set up a custom message to greet people on your SSH server
2020-09-02
“Your assumptions are your windows on the world. Scrub them off every once in a while, or the light won’t come in.” - Isaac Asimov