Thinking you can learn coding/data science by watching someone else do it in a tutorial Is like thinking you will get abs by watching someone else work out.
Design patterns in 1 tweet Facade: abstract complex operations behind a simple interface Ex: when you buy something at Amazon, you see an interface that hides all the complexity behind it: warehouses, deliveries, payments, suppliers, etc.
CAP theorem Out of these 3: - Consistency: reads the most recent writes - Availability: all request receive response - Partition tolerance: ~ network failures YOu can only pick 2. Network failures are guaranteed, so it boils down to: Consistency or availability?
Som important root subdirectories in a tweet - /bin: stores executables (cp, ls) - /dev: device files - /etc: stores core system configuration - /home: your personal directory - /lib: libraries - /opt: 3rd-party programs - /proc: has info about running processes
"Measuring programming progress by lines of code is like measuring aircraft building progress by weight." - Bill Gates
Python list traversing tip Instead of this: for i in range(len(l)): x = l[i] Use this for i, x in enumerate(l): ... TO keep track of indices and values inside a loop.
"Besides a mathematical inclination, an exceptionally good mastery of one's native tongue is the most vital asset of a competent programmer." - Edsger W. Dijkstra
Whether you're working on: - Frontend - Backend - UX - Operations - Customer service Always focus on the user experience
DFS vs BFS - Both find a path between 2 nodes (graph, tree, maze, ...) - BFS finds shortest path - Tree is wide -> BFS needs too much memory - DFS can result in stack overflow (recursion) - BFS limited by RAM, not stack - Sol far form root->DFS - Sol near root ->BFS
A heap: - Finding its max/min is a O(1) operation - Can be built in *linear time* - Adding elements is O(logn)
Design patterns in 1 tweet Command: Encapsulate a command request as an object (with state information if necessary) Ex: Ordering food at a restaurant The command has all the information the chef needs to start preparing the meal Commonly used for undo/redo operations
Atomic operations refer to operations composed of multiple steps where either all the steps are performed or none are performed. This is a mechanics to deal with multiple processes/threads accessing the same resource where the order of operations may change the end result.
"The number of programmers doubles every 5 years. That means, at any time, half the world's programmers have less than 5 yrs experience" - Robert C. Martin
Use zip to iterate multiple lists in parallel. for name, age in zip(names, ages):. print(name, age) In Python 2, you should use izip instead (to use less memory) Use zip_longest if the lengths might differ.
"I simply have no clue how to do that." Step by step. "There is only one way to eat an elephant: a bite at a time"
You're not finished when "it works" You're finished when it's "right" Otherwise, you're setting up yourself for failure in the (near) future
In 1970, PASCAL was developed by Nicolaus Worth Compared to prior languages Pascal was easy to learn and was favored when teaching programming. It was designed to encourage good programming style and structure program HelloWorld; begin WriteLn('Hello, world!'); end.
- Horizontal scaling: add more machines to your pool of resources -> scaling out - Vertical scaling: add more power (CPU, RAM) to an existing machine -> scaling up
As a software developer, writing working code is only part of your job You have to write working code that you AND *other people* can : - Maintain - Understand - Use - Extend Otherwise, as soon as requirements change, it'll become useless.