TLDR ★★★★ Very easy to read. Direct link to the paper. Interesting takeaways Novel approach to conflict resolution: Unlike most data systems that push conflict resolution to the write phase, Dynamo allows writes and shifts conflict resolutions to reads. This unique strategy ensures that writes are never rejected. Quality: An impressively high bar by focusing … Continue reading Paper Review: Dynamo: Amazon’s Highly Available Key-value Store
Category: Computer Science
Check Endianness with JavaScript
How to check for endianness using JavaScript
Guaranteeing software behaviour
My foremost goal while building software is to build stable self-healing systems with deterministic behaviour. I want to ensure my code continues to work even when unexpected events occur. In the event of unknown unknowns, the expectation is a graceful degradation in the worst case.
The Exclusive OR (XOR) Explained
I recently ran into a code puzzle; the question asked for the finding the unique element in a list of integers given that every integer appears twice except the single special element.
Why you should not use isNaN in JavaScript
Nan literally means Not a Number. Yes, it means that value is not a number and occurs when you try to coerce a non-mathematical value (e.g. string) into a number.
Why computer science matters for software developers
I used to think computer science never mattered because I rarely used algorithms and never saw the value of algorithm-based interviews (I still don't ;) ). The few folks I asked also concurred so I felt I was right.
What every programmer should know about types I
the mathematical concept of sets in number theory. The set of integers can be seen as a type - only values such as 1, 2, 3 are integers; decimals (e.g. 1.1) or irrational numbers (e.g. π) aren't members of the integer set.
Why JavaScript has two zeros: -0 and +0
Do you know there are two valid zero representations in JavaScript?
A simple explanation of 1s complement arithmetic
A simple explanation of 1s complement arithmetic - a basis for how computers run.
Understanding Bit masks
Bit masks enable the simultaneous storage and retrieval of multiple values using one variable. This is done by using flags with special properties (numbers that are the powers of 2). It becomes trivial to symbolize membership by checking if the bit at a position is 1 or 0.
Understanding and using Streams in JavaScript
Let's take a scenario from Mathematics, how would you model the infinite set of natural numbers? A list? An Array? Or a Stream? Even with infinite storage and time, lists and arrays do not work well enough for this scenario. Why? Assuming the largest possible integer an array can hold is x, then you've obviously missed out onx + 1. Lists, although not constrained by initialization, need to have every value defined before insertion.
Why JavaScript ‘seems’ to get addition wrong
This post was actually motivated by Gary Bernhardt's very popular WAT talk. It aims to provide a deeper understanding of how JavaScript evaluates expressions and operations on primitives and object types.
How to implement the Y-combinator in JavaScript
This post provides a very simple step-by-step implementation of the Y-combinator in JavaScript. You should be able to implement the Y-combinator in your language of choice after reading this post; as you'll see - it's that easy.
SICP Section 3.3 – 3.5 : Found a bug in memq
1. Is memq broken? memq is an in-built list search function; it finds the first occurrence of a key in a list and returns a new list starting from that key. Now that you know what memq does, lets look at some weird behaviour Building on that foundation leads to the following conundrum memq tests whether the key exists in the … Continue reading SICP Section 3.3 – 3.5 : Found a bug in memq
SICP Review: Sections 3.1 & 3.2
The deeper I go into the book, the more I appreciate the effort, style, and work the authors put into it. Each section builds on earlier sections, and it is amazing how it forces you to see software development from a new angle. Enjoy... 1. Perception and Design Our perceptions of the real world influence … Continue reading SICP Review: Sections 3.1 & 3.2
SICP Section 2.5
So, four months after I started and more than 90 solved exercises, I can say Alhamdulillaah, chapter 2 is done! Section 2.5 was among the most challenging; the exercises revolved around building large, easily extensible software systems. And here are the thoughts again :) 1. Coercion The section revealed the importance of coercion in software development by creating … Continue reading SICP Section 2.5
SICP Sections 2.3 & 2.4: Thoughts and Ideas
1. Top-Down Design Most of the problems in the SICP book are solved in a top-down way with lower level details deferred until needed. The focus on high-level details makes for expressive, flexible code since implementation is based on well-defined interfaces and not implementations. Consequently, swapping and improving interfaces is a cinch - the dependency on high-level interfaces shields … Continue reading SICP Sections 2.3 & 2.4: Thoughts and Ideas
SICP Section 2.1 : Thoughts
Alhamdulillah, I wrapped up this section a few days ago. Thirteen of the solutions are here (if you are curious enough); the other three need proofs, and I wasn't in the mood for too much interval arithmetic. So, what did I learn? 1. More Scheme This chapter introduced the concepts of cons, car, and cdr for … Continue reading SICP Section 2.1 : Thoughts
SICP Section 1.3 : Thoughts and Concepts
This section exposed me to the full power and beauty of functional programming. The expressiveness of using functions as values is awesome. For example, a sum of cubes function can use a sum function, which itself relies on a reduce function. Think of higher-order differentiation in mathematics, and you do get the idea. An interesting concept involves using lambda … Continue reading SICP Section 1.3 : Thoughts and Concepts
5 things I have gained from SICP: Section 1.2
What I learnt from Chapter 1.2 of the SICP book. A needed pause to reflect on knowledge gained before diving into 1.3.
Understanding Partial Application and Currying
In pure functional languages, functions are not 'invoked', rather a set of arguments is 'applied' to them. Now, if all the arguments are not passed in, then the function is being 'partially' applied. Partial application converts variadic functions (i.e. functions with multiple parameters) into functions of lesser arity by pre-specifying certain argument values.
Understanding Tail Recursion
The biggest advantage of using tail calls is that they allow you to do extensive operations without exceeding the call stack. This makes it possible to do a lot of work in constant space without running into out of memory exceptions; this happens because the frame for the currently executing function is re-used by the newly-executed function call.
Programming Language Type Systems II
Strong/weak typing describes the ease of mixing variables of different types in expressions. Strong typing does not imply static typing just as weak typing does not mean dynamic typing. To put it simply, if a programming language tries to interpret an expression containing variables of varying types at runtime (e.g. adding an int to a … Continue reading Programming Language Type Systems II
Programming Language Type Systems I
Static, dynamic, strongly-typed and/or weakly-typed; the terms we routinely use to describe typing in programming languages. However, these terms (especially the last two) have more to them than is generally assumed.
MOOC Review : Machine Learning
My review of the MOOC on Machine Learning