Author image

Regular Expression tutorial


Regular expressions are sequences of characters and symbols to be searched for (CTRL + F) within a longer piece of text.

Here I summarize my personal notes on regexps, awk, sed, grep and C++ regexps, Java regexps, Python regexps, Bash (linux shell) regexps, Javascript (regexps), PHP (regexps) etc.

For example to create a pattern that matches only the numbers out of this character sequence: 917-555-1234 and 646.867-5309 stop it!

use \d{3}[-.]\d{3}[-.]\d{4}

in PCRE regexp dialect.

But what are all these cryptic runes and sequences? Let's find out. Read on!

Meta Characters

  • \g : global matching, matches found in entire text
  • \G : matches the end of previously...

Author image

Windows Leak Checker


Memory Leak checking facility for Windows.

Simply integrate the files to your own program and test if you have any memory leaks.

You don't have to reference this code in your own code files. It will do everything on its own, so long as you add the files to your program and compile them.

Note that it works only in debug mode.

This is essentially a barebones alternative to the free and open source "Visual Leak Detector".

I used Windows and Microsoft Visual Studio to build the project.

Github

Github repository link.

Author image

Minimal XAudio v2.8 Windows library


A high performance minimal XAudio 2.8 based library developed from scratch. It is almost as low level as one can get in Windows; such is the nature of XAudio2. It is flexible and extensible.

XAudio2 delegates sounds to the WASAPI backend. You don't need multiple threads for each playing sound; these are managed internally by WASAPI which mixes & matches them internally as it best sees fit.

I used:

  • Windows x86_64, Microsoft Visual Studio
  • XAudio v2.8
  • X3DAudio

If you're on Windows 10 you can use XAudio v2.9 dll without much, if any, change.

If you'd prefer a more graphical approach, I have a QT audio player project.

Usage

SoundManager is a singleton audio instance.

There is a maximum number of sound channels, which I have hardcoded to 64. But make...

Author image

Set-Bit Sort in MIPS Assembly & C/C++

In this project we will dig deep into the MIPS64 architecture innards to make sense of CPU pipelining. We'll be using the free & open source emulator EduMIPS64 which is written in Java. The emulator supports a subset (indeed the majority) of the MIPS64 architecture's instruction set repertoire. We will attempt to optimize and thus minimize the execution time of the program.

To test drive it, we will put together a program which processes an unsorted table of 120 signed integer numbers xi and performs the following computation:

  • counts the number of ones in the binary representation of each number and sorts them in increasing order of their number of one-bits. In case there are numbers with equal set-bits sort them in increasing order of their arithmetic value.

We won't be using console input for the numbers, they will reside in a file.

The following table sums up our...

Author image

Butterworth, Sallen-Key & Chebyshev Filter Analysis, Design and Synthesis


I separate the implementation in several parts as outlined below.

Part A.
A1. Design a normalized low-pass filter with Butterworth response, cutoff rate equal to 18dB/octave and maximum allowed gain deviation in the pass region equal to amax = 1.5 dB.
A2. Implement the normalized filter by connecting in cascade multiple sections. All capacitors must be identical. For the implementation of the second section, use a Sallen-Key filter with identical resistors and identical capacitors (Design II).
A3. Depict the logarithmic gain curve as calculated from the transfer function of the design along with the transfer function of the circuit.
A4. Denormalize the circuit such that the cutoff frequency become f
c = 1.6 kHz and the resisters be at their normal values with dimensions. Sketch the logarithmic gain curve of the denormalized circuit given frequency f (logarithmic axis)....

Author image

Fix Windows Boot issues - Your PC needs to be repaired | The drive where Windows is installed is locked


I have wrestled a few times with this unsurprisingly common BSOD, both with my own computer and on friends'. A quick online search led me to believe that many are suffering from it, so I thought about making this post to help somebody out. I know it can be alarming to see such an error for the first time, as it's a BSOD error basically totally preventing you from using your computer. But go through this article and with a little patience, we can, and we will, fix it together. (Honest!)

Author image

In the beginning...

... there was nothing ... there was darkness.

13,800,000,000 years later, in 490 BC, Greek forces lead by Miltiades, outnumbered, managed to overpower the opposing Persian military, but had to quickly march for Athens to defend their fair city from the oncoming threat. Miltiades sent a runner on ahead to Athens with news of victory, Pheidipidis. Upon reaching Athens, having exerted all his strength Pheidipidis said "Νενικήκαμεν!" ("Rejoice! We have victory!") and dropped dead of exhaustion. Theirs was a struggle of a desperate forced march. Theirs was was a story of courage.

Some 2,500 years later a young man had a dream which he sort of accomplished up against the odds. He made this website to share his memoirs. This too, is a story of courage. Subscribe to the newsletter to see it unfold and enjoy your stay.

1 2 3 4 5