Structs are very useful datatype in swift when it come to storing data models required by our apps. Having mutable data models often leads to unwanted app states, due to inconsistent model values present across app, introduced as a side effect of mutation. This makes our code unsafe and our apps prone to a lot of bugs. Thus, we generally prefer to have our data models immutable to ensure safety from above scenarios, but you cannot always escape mutability, as our apps are open to various user interactions which often cause data model changes. So if we can’t escape it…

A week ago, on one fine weekend, chattering with my friends, sprang out the lines

For men may come and men may go. But I go on forever.

What followed was a momentary silence, which prompted me to take the spotlight 😅, to explain the context of the lines. The lines transported me back to my English lessons in the school and made me recall an interesting poetic instrument called Personification.

The lines are from the famous “The Brook” penned by the British poet Alfred Lord Tennyson. The poem is a ballad which explains the journey of the brook or…

Human beings are complex creatures behaviourally. Though there are certain lines defined by anthropologists through decades of research and study, which distinguish human beings from other animal species and give us a journey of our behavioral evolutions, within our species we have many other fine lines of behavioral distinction, which in ways can be attributed to the explanation of an individual’s personality.

Even if we don’t go into the psychological distinctions and depths of these fine lines, we can observe these in our everyday life, at very grass root levels. Assume these two simple affirmatives by an individual: “I can…

Stories have been an integral part of human evolution. Stories have served as a medium to pass down knowledge and ideas across generations over time. The entire lifetime of a person is filled with tremendous such stories, which influence the intellectual and behavioral aspects of a person. Be it the early days of storytelling around fireplace gatherings or the modern-day binge-watch of digital content on Netflix etc, humans no doubt have been inveterate producers and consumers of stories.

From stories to narratives

The idea of a story starts with two main elements: Character and Plot. A plot is a sequence of events occurring in…

IDOR stands for Insecure Direct Object Reference is a security vulnerability in which a user is able to access and make changes to data of any other user present in the system. It has been placed fourth on the list of OWASP Top 10 Web application security risks since 2013. This attack is likely to occur when the internal implementation object, without any validation mechanism which allows attackers to manipulate these references to access unauthorized data.

This attack also reveals the storage patterns/identifiers for the data in the backend and database systems to the attacker, which can be further exploited…

Functional programming is a programming paradigm which models the computations as the evaluation of mathematical functions. It is a declarative style of programming where the major focus is on “what to solve” rather than “how to solve”, as in the case of imperative style. It uses expressions in place of statements, where the expression is evaluated to produce a value rather than being executed to assign a value.

In functional code, the output value of a function depends only on the arguments that are passed to the function, so calling a function f twice with the same value for an…

A transaction is a single logical unit of work which accesses and possibly modifies the contents of a database. Transactions access data using read and write operations. To maintain consistency across the database, before and after transactions, ACID properties need to be followed. ACID stands for Atomicity, Consistency, Isolation and Durability.


Atomicity states that a transaction must be treated as an atomic unit, that is, either all of its operations are executed or none. There must be no state in a database where a transaction is left partially completed. It involves the following two operations.

  • Abort: If a transaction aborts…

Infinity is one of those concepts that we think we understand, but most (all?) of us can’t actually wrap our minds around. German mathematician David Hilbert created a thought experiment called the Grand Hotel paradox to demonstrate the absurd complexity of infinity.

It is demonstrated that a fully occupied hotel with infinitely many rooms may still accommodate additional guests, even infinitely many of them, and this process may be repeated infinitely often. The key in this thought experiment is the notion of countably infinite.

A set is countably infinite if its elements can be put in one-to-one correspondence with the…

The Model View Presenter (M.V.P.) is a design paradigm, which is architecturally the derivation of MVC pattern, is generally used for building user interfaces. MVP in popular design pattern adopted in android programming where the presenter becomes the middleman containing UI business logic for the View. MVP advocates separating business and persistence logic out of the Activity and Fragment

The model-view-presenter software pattern originated in the early 1990s at Taligent, a joint venture of Apple, IBM, and Hewlett-Packard. It was further popularized by Dolphin Smalltalk in1998, then in 2006, Microsoft adopted MVP for user interface programming in the .NET framework.

A genetic algorithm is a search heuristic that is inspired by Charles Darwin’s theory of natural evolution. This algorithm reflects the process of natural selection where the fittest individuals are selected for reproduction in order to produce offspring of the next generation.

In the words of Charles Darwin:

It is not the strongest of the species that survives, nor the most intelligent , but the one most responsive to change.

Interestingly, the entire concept of genetic algorithms revolves around this single quote.

Genetic algorithms are commonly used to generate high-quality solutions to optimization and search problems by relying on bio-inspired…

Anshul vyas

Product Engineer @ GO-JEK Tech | History and Literature Enthusiast |IIITIAN | Nerd | Music Lover |

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store