2021W39

Problem Log Full Stack Introduction PEP 484: Type Hints in Python Beginning in Python 3.5, type hints are allowed in function signatures. This PEP aims to define a common syntax for type hints. The module, typing, defines base types and has some basic tooling for dealing with types. But static analysis is done by third-party software, like mypy. Definition syntax def greeting(name: str) -> str: return f'Hi {name}' __init__ should have a return type of None __annotations__ attribute contains the type hint information Available type hints: None, Any, Union, Tuple, Callable, all ABCs and stand-ins for concrete classes exported from typing (e.g. Sequence and Dict), type variables, and type aliases The type hint None evaluates to type(None) Example of type alias, concrete classes, and generics: ...

September 28, 2021

2021W38

Algorithm Design Manual Problem Log

September 22, 2021

2021W37

Algorithm Design Manual

September 17, 2021

2021W32

Problem log

August 13, 2021

2021W30

Personal Essays JavaScript Using the comma operator to update two indices at once. From Stack Overflow function pushToHash(key, value) { for (var t = 0, x = 0; t < value.length; t++, x += 2) { MQHash[key[t]] = value.slice(0, lineLength[x]); } } The soul of a new machine: rethinking the computer Talk by Bryan Cantrill IBM 709 (1961) First computer capable of time sharing Vacuum tube PDP 11 (1971) Rise of server-side computing Running tasks remotely Heavy workload Need to minimize down time Sun (1999) eBay eCommerce beginnings HP DL380 (2009) x86 a personal computer used as a server Google (2009) Attempted to run custom, purpose-built computer rather than personal computers Getting rid of components they didn’t need like cd drives, VGA ports Facebook Tioga pass (2020) compute sled connects into a bus bar, so no power supply inside the compute sled minimize power conversion But outside Google and Facebook, everyone still uses PC servers Today’s problems There are reasons to not have cloud computing, but to own your own servers mostly for economic reasons the people making the hardware are not the same as the people making the software this means that the hardware people are confined to certain components because customers are running Windows Personal example saw increasing number of DIMM failure, or memory failures normally in ECC memory, you will see more and more correctable failures before seeing an uncorrectable error however, the firmware was causing memory to be corrupted much faster but can’t change the firmware Solution Use existing microprocessors. They are already reliable. Create real root-of-trust with open firmware. Customers should be able to inspect the firmware for their computers Increased security using purposed-built BMC (baseboard management controller) that only does very limited operations Need firmware that only boots the operating system Redesigning the physical cases to incorporate hardware (like network switches) and software as well as make dense form factors that are power efficient You get better designs when the hardware and software are co-designed: hypervisor, control plane, storage, API endpoints You shouldn’t want proprietary infrastructure software: it should be open source and attested. Most of the solution is building very low-level software (root-of-trust, service processor, boot software) A lot of the hardware is already out there Is this solution achievable? Many have accepted that the current state is good enough We know how to solve all the problems, but the key is creating an integrated approach Hyperscalers (Google, Facebook) do not support many OSes, only a few. By doing that, you can tight up your solution Hardware trends Industry recognizes the need for collaboration on hardware root-of-trust Spectre and Meltdown vulnerabilities: using processor speculation to access memory you’re not supposed to. Microsoft Cerberus, Google openTitan Google Chromebook solves most of these problems, but for the PC Open EDA makes FPGA design and implementation easier Yosys, Chisel, SpinalHDL, Bluespec (a VHDL) RISC-V instruction set Open firmware is happening Thanks to hyperscalers, Spectre, and Meltdown Facebook’s Open Compute Project Software trends Infrastructure software is open source Databases, consensus software (like Zookeeper) Programming languages for systems programming Garbage collected languages aren’t allowed because you need to be deterministic Rust, a safer C C doesn’t incorporate other libraries very well Writing safe C is hard Questions Rust is excellent for embedded applications Learn Rust the dangerous way

July 26, 2021

2021W28

Real Productivity: How to build habits that last SkillShare class by Thomas Frank Perfect is the enemy of good Work at your own pace. Many people will try to do too much all at once or try to compare their progress to others. Don’t do that. The key is consistency. Do a little bit today; do a little bit tomorrow. Make things that are good enough. Bias towards action. Set a deadline and publish, even it is not perfect to you. By doing this, you will learn more from producing five good enough projects than from one perfect project (that you may or may not finish). ...

July 15, 2021

2021W27

Creative writing: tips and prompts for journaling SkillShare course by Ashley Keenan Journaling has no rules. You can write about your aspirations, ideas for projects, to-do lists, etc. The only commonality is that journaling is for you; you are the only writer and reader. Journaling can also be where you record your past, express yourself, reflect and meditate. Have fun! Capture everything; try not to filter before writing something. Cross things out instead of erasing them. ...

July 5, 2021

2021W26

Installing Zig Used brew install zig. Got this error: Error: Could not symlink lib/sigc++-2.0/include/sigc++config.h Target /usr/local/lib/sigc++-2.0/include/sigc++config.h is a symlink belonging to libsigc++@2. You can unlink it: brew unlink libsigc++@2 To force the link and overwrite all conflicting files: brew link --overwrite libsigc++@2 To list all files that would be deleted: brew link --overwrite --dry-run libsigc++@2 Not sure if it’s relevant yet. The zig build run seems to be working though. ...

June 27, 2021

2021W24

Fitness mistakes by patients By Doctor Mike https://youtu.be/zQDelcHOhpM Weight loss isn’t just exercise Think holistically: Recovery, sleep, exercise, nutrition 70%-80% of weight loss comes from nutrition alone. Spot reduction is a myth A study with tennis players showed that, even though the dominant hand may have more muscle mass, both arms had the same amount of body fat. In general, you can’t control where fat will be reduced. All you can do is exercise to build up muscles in different areas. ...

June 14, 2021

2021W23

An open letter about regret to Millennials from a Millennial therapist By Tess Brigham https://www.cnbc.com/2021/06/02/millennial-therapists-open-letter-to-30-somethings-full-of-regrets-in-life.html Thinking about mistakes You can’t backtrack if you’re unhappy about your choices, but you can pivot to get closer to where you want to be. Remember, your “mistakes” are teaching moments that taught you about yourself and what you want to be. Reflect often on what you’ve done and make sure to note where things have gone well. ...

June 8, 2021