Aug 13, 2021

List Slicing In Python

Lists are one of the most versatile structures in Python. They allow us to keep lists elements which can be of different types and access them by index with constant time complexity. One of the best features of lists in Python is the slicing mechanism.

Python

Aug 06, 2021

Python Priority Queue

Priority queues are useful to keep track of smallest elements in Python. A typical example would be to keep track of the smallest elements of a collection, for example first, second, third elements, we can simply keep popping out of the priority queue to get them. Python comes with a built in pirority queue via the library heapq. In today’s post, we will look at the main functionalities of heapq with examples.

Python

Jul 30, 2021

Python Dictionary

Python dictionary is a structure that can be used to store key/value data with constant time for access. Dictionary structures in Python are very versatile which makes them popular and we can see them being used in many projects. They allow us to store keys and values of different types, provide us ways to iterate over the keys or values and have different ways to delete values. In today’s post, we will explore all the functionalities of dictionaries in Python.

Python

Jul 16, 2021

Pointers To Functions In C

Last week we covered the basics of C pointers with their definitions and how to use them in variables and functions. In today’s post we will look at pointers to function and more specificities around pointers like NULL pointer or void return.

C Language

Jul 09, 2021

Pointers In C

Pointers are variables containing addresses of other variables. In C, pointers are used in many scenarios where they improve the code readability or where they are just necessary. In this post, we’ll explore what C pointers represent, how they can be used in functions, and explore the relationship between pointers and arrays.

C Language

Jul 02, 2021

Visual Studio Code Shortcuts

I have been using Visual Studio Code for many years, starting from frontend development with Angular and React, then moving to work on Python and lately working on C# projects. Visual Studio Code has always been at the top of my favorite editor to use as it is very lightweight, responsive and fast. It’s quick to open files, quick to load projects, it has a clean and minimal interface and has a strong community. Over the years of using it, I realised that there are a couple of shortcuts that I keep using in repetition and that I found missing when using other IDE. In today’s post I’ll go through those keyboard shortcuts.

VSCode

Jun 25, 2021

Two's Complement

Last week we looked at bitwise operators in Python. We briefly went through all of them without looking into how signed intergers were represented. In this post we will be looking at Two’s complement, Python’s way of storing signed integers, and finally answer the question of why ~9 = -10.

Python

Jun 18, 2021

Bitwise Operators In Python

When working with cryptographic algorithm and hashes, it’s quite common to operate at the bit and byte level. For those situations, Python provides functionalities to convert int to byte and vice versa and bitwise operators to operate on bits. In today’s post we will look at the different bitwise operators available with examples.

Python

Jun 11, 2021

How Time Based Otp Work

One-time passwords (OTP) are a great way to provide a second factor of authentication to an application. They are commonly distributed through channels like SMS, voice call, email, or physical token generator - common with banks. Although very useful, each of those distribution channels have limitations on both side; for the user and for the application developer. For example, for the user, SMS or voice call needs network connectivity which isn’t always available, and from the application developer, we need to rely on third party SMS gateway or voice call gateway which don’t support all countries, making 2FA unavailable for some. HMAC-based OTP (HMAC) and later on Time-based OTP (TOTP) were algorithms invented to address those problems providing a way for a prover to generate a valid OTP without the need of the verifier to send it to the prover. In today’s post we will see an example of TOTP implementation and look at how it is constructed.

Python

Jun 04, 2021

Chrome Shortcuts

As software developers the second application we spend the most time on after our text editor is our web browser. I have been using Chrome browser for years and only recently realised how often I was clicking around with the mouse to change tabs, pin tabs, or simply searching for options. Since then, I learnt few shortcuts that I now use daily, some shortcuts built-in and others brought by extensions. In this post I’ll go through the shortcuts.

Chrome

May 28, 2021

Jekyll Category Page

After five years of writing with over 250 posts, I realised that it would be nice to have a page with all post categories that I’ve discussed so far. In today’s post we’ll look at how we can leverage site.categories from Jekyll to construct a category page.

Jekyll

May 21, 2021

The Different Usages Of Asterisks In Python

In Python, we often see asterisks being used for other operation than the infix operations like multiplication. In today’s post we will look at the other scenario were we encounter the asterisk and understand the meaning of it in those different contexts.

Python

May 14, 2021

Testing Rxjs Observable With Marble Testing

In Angular, we often use RxJS observables. Since observables are dependent on time, it makes them to hard to test. To make our life easier, RxJS provides a TestScheudler which offers a function run providing helper functions accepting Marbles, a special syntax used to define a timeline of events. In today’s post, we will learn about the Marble syntax and see how we can use it to test the behaviour of our observable composition.

Angular NGRX

May 07, 2021

Component Reuse Angular

Angular Router reuses components when it sees fit. The act of reusing a component saves time as the framework doesn’t need to destroy and create back a new object, instead it emits new values onto the observable params and data of the route. In today’s post we dig into the details of when does the reusability of components take place and understand how it impacts route.data.

Angular