Learnings From Today
Today I did my finances (made a spreadsheet for my holdings and cash flow) so that I would not run out of money this summer, since I will be working at an AeroAstro-style company (and as I'm sure you've heard, they all pay dog shit... I guess that's what you get for going for the "wow rockets" job I guess). In the process I learned some nifty
- Use ROW() and COLUMN() functions in Excel to get the row and column of a cell. Note that these will be 1-indexxed integers.
- Use ADDRES(row, col) with the row and column (integers) you want. Returns something you can get the value for using INDIRECT(addr). So if I want the value of the cell to my right I can do INDIRECT(ADDRESS(ROW(), COLUMN() + 1))
- You can do conditional formatting with custom formulas. A nice one is to use indirects as above to make one column depend on the type fo another column. You can use IF or SWITCH to do this (if you have, say, an enumeration you want to handle). I've been using strings for enumerations. Not sure if there is a better way. You can turn it into a dropdown using the data validation section in the data dropdown on the top left of the google sheets window.
- There is apparently a so-called Google App Script API you can use to automatically do shit with your google sheets and other G-suite tools. I'm probably gonna start using this as I start to upgrade my personal finance, task management, note-taking, and CRM systems. It seems super useful.
I do want to start reflecting on life, but I honestly do not have a burning depressing tale to tell. I will say one thing though (and talking to my mom has actually helped me remember): the job rat race is a cancer to your academic progression (and general intellectual improvement). It is true that the interviews (technical) can help you practice skills, but the raw logistics of scheduling like 30 interviews over the span of 1-2 months (as I did for 2-3 years in a row) is very taxing and gains you very little. I do not recommend it. Instead, it's worth to take the chance on few companies and practice a lot, a lot, a lot. It will make you better. I felt compelled to get a good job early on and this led me to make irrational decisions. When shame is involved and there is nothing you can do immediately, it's hard to make the right long-term decision and defer a potential (but false... it's a red herring) "fix" of sorts. Applying to more jobs seems like that fix but it's not: it just taxes you. To anyone going into college, I'd say the most important thing is focus. If you have something you love, great! Otherwise, maybe try to do things in sequence with an exploration plan. Get good at things and don't just do them in parallel because you'll be overwhelmed and not learn as well, not improve as much, etc. Exploration is good, but exploitation is something that I've underrated. Don't make this mistake.
Today I also learned some things about bash while trying to get GDB to work on my mac, which involved some codesigning and other nonsense. It still didn't work because of (probably) a bug related to a wait4 call in the darwin source code (which I'm going to try to modify next), but whatever, here is what I learned:
- At some point (I think it was after snow leopard, which was when I was in middle school around 2011) OSX introduced taskgate (try looking at it with man). Taskgate is a daemon that appears to decide when a process can call another. This is important because if any process can call any other based purely on the user that's running it, someone can probably hack you just by tricking you into running their script in some nasty ways. I'm not expert, but this basically means that if you are trying to run an executable like GDB you need to get it codesigned (i.e. you add a certificate metadata into the executable which is then read by the daemon with a key... I think... to validate that it is indeed allowed to call whatever it's calling) before you can just run it.
- In my quest to get it codesigned I stopped to read the bash script that does it. I don't really know bash so I learned a few things. For example, the trap command allows you to run code on a signal. This is cool because it allows you to do cleanup on exit or maybe if part of your program crashes. I also learned about the difference between kill, pkill, and killall. They seem to just be wrappers around the kill syscall's C api. However, pkill allows you to do it by name. I'm not sure how they implement it, but it might be cool to check.
- I also learned that there is a global $TMPDIR directory available to all (apparently) for temporary file storage-kinda nifty. It seems to not change after use... or maybe it only changes during use?
- I also learned that if you use ampersand next to a file descriptor (like 1 or 2 for stdout and stderr) you can get a copy of it. This is meaningful for when multiple procs want to pipe into stdout.
- I also learned a little bit about the security command. I thought it was an OSX command only but apparently it's from BSD. I didn't read any docs, but from the usage it seems like you manipulate its state by changing its stdin and stdout file descriptors with a pipe command. Kinda cool.
- .tmpl files are template files.
- BSD stands for Berkeley Software Distribution and is a discontinued OS (research Unix)
- Use the $@ variable to get the command line arguments.
- Use syntax on in vim to get syntax highlighting.
- Fat binaries are binaries that can run on multiple different ISAs.
- Github copilot auto-generated this: "I also learned that the "set -o pipefail" command is a bashism. It's a way to make the shell exit if any of the commands in a pipe fail." Wow!
When I get a chance I'll upgrade this site to have code-like code embeddings so that you can read it more nicely.