- What is encapsulation
- Link layer
- Link layer basics (pick something like Ethernet to get a quick overview of what the link layer entails)
- What is a MAC address
- IP - this is a vast topic but there are several important concepts to understand here
- IP addresses and subnet masks
- How are IP addresses different from MAC addresses and why are they required
- How do you discover a MAC address of a device on the same network if you only have its IP address (hint: see ARP)
- What are routers and how IP routing works
- Route tables
(defun search-and-replace-all (old new string) | |
(loop | |
with start = 0 | |
for pos = (search old string :start2 start) | |
while pos | |
do (setf string (concatenate 'string | |
(subseq string 0 pos) | |
new | |
(subseq string (+ pos (length old)))) | |
start (+ pos (length new)))) |
Assumes you've gone through the [topics to study][topics] for TCP/IP networking.
You can use [GNS3][] to emulate TCP/IP networks inside a single host.
- Assume you've got two machines with working ethernet ports and an ethernet [crossover cable][]. You connect the two. Your objective is to send a message from one machine to the other. How will you do that? What networking protocols are required to achieve this and why?
- Assume you've got more than two machines, an ethernet hub and straight through ethernet cables for each machine. You connect all of these machines to the hub. Your objective is to send a message from one machine to any of the other machines. How will you do that? What networking protocols are required to achieve this and why?
- If you replace the hub in the previous question with a switch, what advantages do you get?
- You have three machines, an ethernet hub/switch and required cables. As does your neighbour. You want to connect your network with your neighbour
Read about reading and writing files in Python.
- Why is it recommended to use the
with
keyword when opening file objects? Why is it important to close a file even if an exception is raised? - The documentation states that, "Using with is also much shorter than writing equivalent try-finally blocks". What is the
finally
block and, if thewith
keyword did not exist, could you have used it to properly close a file after it was opened? - The documentation warns: > Calling f.write() without using the with keyword or calling f.close() might result in the arguments of f.write() not being completely written to the disk, even if the program exits successfully.
You will find a lot of material online for why long lived feature branches are harmful. Intead of deferring to one of those articles, I wanted to highlight why I believe they are harmful, and why they are an unsustainable practice for most software projects.
In projects where long lived feature branches are the norm, the code in the feature branch is effectively silo'ed from development happening in other branches. This has two effects:
- you cannot test how code in the long lived branch plays with other code under development
- painful merge conflicts become a recurring event when the long lived branch gets merged into the mainline
To handle these issues, it is generally recommended to merge the mainline into your long lived feature branch on a regular basis. However, the catch is, if all feature development happens on long lived branches, there won't usually be anything new in the mainline apart from small fixes. Since all features sit in their own long lived branch, you cannot see how your branch will
// pg-format-sql.js | |
// | |
// Format SQL statements in Postgres logs | |
// i.e. If a log line contains a SQL statement, it will be transformed from this: | |
// | |
// 2021-09-14 08:02:37.255 IST [20200] LOG: statement: SELECT MAX("my_notification"."id") AS "latest_id", COUNT(*) AS "count" FROM "my_notification" WHERE ("my_notification"."is_unread" AND "my_notification"."organization_id" = 1 AND "my_notification"."recipient_id" = 2) | |
// | |
// to this: | |
// | |
// 2021-09-14 08:02:37.255 IST [20200] LOG: statement: |
// This simple example shows that name shadowing in Kotlin depends on type specificity | |
// | |
// Foo().baz(1) after evaluating this class returns 43 | |
class Foo() { | |
fun bar(x: Int): Int = x + 42 | |
fun baz(bar: Int): Int = bar(bar) | |
} |
# shows time in milliseconds | |
# source: https://superuser.com/a/1613753/95678 | |
ffmpeg -i input.mp4 -vf drawtext="fontsize=60:fontcolor=yellow:text='%{e\:t*1000}':x=(w-text_w):y=(h-text_h)" output.mp4 |