The fallen leaves tell a story

Joining the Wolf Pack

The fallen leaves tell a story. Of how a tarnished became Elden Lord.

Learn about my interview experience and regrets

Digits Gone Wild: Sieves

Blazingly fast ways to find all primes within a range.

Sieve of Erastosthenes

Sieve of Erastosthenes is an algorithm for finding all the prime numbers in a segment [1,n] using O(n log log n) operations. Just your basic sieve, can probably find an explanation elsewhere.

Sieving till root

Optimisation of Sieve of Erastosthenes, by optimising it until the root of max N.

int n;
vector<bool> is_prime(n+1, true);
is_prime[0] = is_prime[1] = false;
for (int i = 2; i * i <= n; i++) {
    if (is_prime[i]) {
        for (int j = i * i; j <= n; j += i)
            is_prime[j] = false;
    }
}

Can be further optimised by i incrementing by 2 and making sure that only odd numbers are considered.

Learn more about Sieves in the Number Theory column

Utopia: What it was meant to be

Utopia was to be a collaborative editor which would combine google docs with an local IDE. It should have had LSP support, Integrated VCS better than git, Low latency Websocket communications, Project Management and Admin support. It would have revolutionised pair programming where people could actually program together.

Truly an Utopia.

Read more on Utopia and what it was meant to be

Remenants of the past: SQL vs NoSQL

Should have included in the previous issue but couldn’t :(

Relational databases are also called a relational database management system (RDBMS) or SQL database. The most popular ones are MySQL, Oracle database, PostgresSQL, etc. Relational databases represent and store data in tables and rows. You can perform join operations using SQL across different database tables.

Non-Relational databases are also called NoSQL databases. Popular ones are CouchDB, Neo4j, Cassandra, MongoDB, Redis, etc. These databases are grouped into five categories:

  • Key-Value stores
  • Graph stores
  • Column stores
  • Document stores
  • Vector stores

The Problem

The standard definition of NoSQL and SQL leaves much to be desired. The concept of relations and data which has no relations is not modeled accurately.

Learn about the different SQL and NoSQL Databases