12·04
MONDAY

Numberphile - Josephus Problem Explanation

Josephus problem can be solved using the power of 2. Given that there are total of 2^n people standing in a circle, the start position is 1 and skip is 1, then person at position 1 would always be the winner.

in other words: if we write n such that n = 2^a + l where l is smaller than 2a, and 2^a is the biggest power of n; then the winner will be (2l + 1).

Theorem n = 2^a + l, where l < 2a W(n) = 2l + 1

Example:

  n = 100
  n = 64 + 36  (64 is the biggest power of n, and 36 is the reminder)
  w(n) = 2 * 36 + 1 = 73

  so the answer will be 73
11·04
SUNDAY

writing a technical design documentation

A design doc is simply a description of how a problem should be solved. Design Doc is also known as Technical Spec.

what to include in a design doc

how to write it


10·04
SATURDAY

interesting articles


spent time on redesigning this site. I hope to post more here. [note to self: add RSS feed]

05·04
MONDAY

[YT]Why Do So Many Programmers Lose Hope?

25·02
THURSDAY

Starting up at 22 — Reflections - Rahul Mathur

21·02
SUNDAY

nice tool for visualizing SQL tables: https://drawsql.app

09·02
TUESDAY

learnt how to make list-items reveal on scroll. demo

resources: suelan.github.io


linking error messages to filename: simply log error message in this format: file:///<PATH>/<FILENAME>:<LINE?>:<COLUMN?> - source

27·01
WEDNESDAY
24·01
SUNDAY

really interesting article on how to ship ES2015+ code to browser: read here

takeaways:

browser with exec ES5 version if there's no module support available. note that having availablity of module means browser have support for async/await, promise and bunch of other ES2015+ goodies


23·01
SATURDAY
22·01
FRIDAY

YAYAYYAYYA!!! FIRST DAY AT WORK! From now on, I will be working for Algorisys Technologies



  function factorial(num, a = 1) {
    if (num === 1) return a;
    return factorial(num - 1, num * a);
  }

  factorial(10);
20·01
WEDNESDAY

nothing much for the day. gotta resume solving problems on leetcode.

18·01
MONDAY

mongoose in serverless

when defining a Model, first check if the model already exists with mongoose.models.ModelName. otherwise an overwrite error will be thrown

15·01
FRIDAY
13·01
WEDNESDAY

in an interview, it hurts when people judge my skills based on an assignment and happily ignore whatever project I built at past.

12·01
TUESDAY
11·01
MONDAY
10·01
SUNDAY
09·01
SATURDAY
07·01
THURSDAY
06·01
WEDNESDAY

Nothing Much today. Just some React coding.

05·01
TUESDAY

learnt about readline.emitKeypressEvents. this listens for keypress on terminal. it also accepts an interface which can be used to terminate an event listener.

const iface = readline.createInterface({ input: process.stdin });

readline.emitKeypressEvents(process.stdin, iface);
process.stdin.setRawMode(true);

process.stdin.on("keypress", (key, e) => {
  if (e.ctrl && e.name === "c") {
    process.exit(0);
  }

  if (key && !e.ctrl) {
    resolve(key.toLowerCase());
    process.stdin.setRawMode(false);
    iface.close();
  }
});

Something awesome happened. I revived my throw-away and (kind-of) incative twitter account, all thanks to Tanay Pratap and his discord server. (quite sure he hated me for not reading the channel chat history before posting)


No DSA for today :(

04·01
MONDAY

No Algorithms Problems today


Open-Source Contributions:


Made a new LinkedIn Post - Detect whether a Request is XMLHttpRequest or not

03·01
SUNDAY

How to Communicate Better - Clément Mihailescu


No DSA problems today. Went through the problems I solved in last week.


PR and Code Review:

02·01
SATURDAY

DSA problems solved:

Started a new Project: A Project Management Webapp

01·01
FRIDAY

Project Idea: What if we mix a Kanban board and an Email client? would not it be awesome as people would be able to manage emails in slightly better way?

What I learnt/Read

31·12
THURSDAY

NOTES ON SYSTEM AVAILABLITY - Backend Engineering Concept

availablity of a system = uptime / total time

redundency: having multiple identical replica of a system up and running to make the said system highly available

total downtime of the system can be calculated by multiplying the probability of downtime of all identical replica. example:

sys1's downtime probability is 0.2, sys2's downtime probability is 0.15 and sys3's downtime probability is 1.0. so the combained downtime probability would be 0.2 x 0.15 x 1.0, which is 0.03(i.e. 3%).

load balancing is the technique to reduce downtime of a system. a load-balancer is simply a reverse proxy server which sits in-front of a group of servers and distributes incoming request to servers which are up and running.

Importance of a Proxy Server

02·12
WEDNESDAY

Some beautiful fonts:

13·11
FRIDAY

Computer Science Basics to Learn

Languages to Learn(any one of the following)

Projects to Build

10·11
TUESDAY

Math Resources:

06·11
FRIDAY

Changed this LogBook workflow a bit. Now, the dairy content is managed by VimWiki. And pushed regularly using a Cronjob.

I am planning to publish my vimwiki as a live site. I can still do it out-of-the-box, but I don't want to bother with VimWiki templates. Guess I will write a small script for converting markdown to HTML.

Some useful VimWiki shortcuts:

05·11
THURSDAY

Some Vim Commands:

Data Structure and Algorithms Resources

04·11
WEDNESDAY

YouTube channels to learn basic Computer Science stuffs: