• Increase font size
  • Default font size
  • Decrease font size
Greetings from Waqqas!


E-mail Print PDF

Welcome to my page!

This content management website is an attempt to organize all the work I've done over the past few years. I'll try to update this website with a lot of useful information so keep coming back to get the updates.

Also, if you have questions / suggestions then please leave a comment on the particular article.



Z Spread

E-mail Print PDF

There are many available definitions of Z (zero volatility) spread e.g.:

Quote [Investopedia]:

"The constant spread that will make the price of a security equal to the present value of its cash flows when added to the yield at each point on the spot rate Treasury curve where a cash flow is received . In other words, each cash flow is discounted at the appropriate Treasury spot rate plus the Z-spread."

Quote [Wikipedia]: 

"The Z-spread, ZSPRD, Zero-volatility spread or Yield curve spread on a simple mortgage-backed security (MBS) is the flat spread over the treasury yield curve required in discounting a pre-determined coupon schedule to arrive at its present market price."

The purpose of this article is give a visual (graphical) representation of a z-spread. I will go over the procedure of building a graph in excel. This should help your understanding of the z-spread. Towards the end of this article you should see a graph that is similar to:


Remove elements from std::vector and std::list

E-mail Print PDF

Often times you would want to filter out some data from your collection of a vector or a list. The following code snippet shows a quick and fool proof way of doing that:


Simulations Infrastructure

E-mail Print PDF

In this article I want to give out a basic reusable infrastructure for quickly starting off with simulations and reporting the results.

I will give a step-by-step setup of simulations testbed using 4 different technologies:

  1. Excel Spreadsheets
  2. Excel VBA macro
  3. Python
  4. Matlab

I believe that the best way to learn something is to bring in an application (or example) in as soon as possible. So the layout of this article will be that I will describe a fictitious 'situation' and then I will go ahead and provide a step-by-step guide as how to model the 'situation' in computer tech (e.g. matlab, python,...).

The complete source code is available in Appendix A


Bind and find (C++ std bind2nd and find_if example)

E-mail Print PDF

STL provides us with very useful algorithms and utilities. You start enjoying the usefulness of programming when you reap the benefits of these utils. In this article I will try to show you the usefulness of the std::bind2nd function. The basic idea behind bind2nd (or bind1st) is that it will take a binary function along with one of the parameters and bind it in a function object. This function object will be then a unary function. If all this sounds confusing then don't worry too much about it. You should read these first few lines again after you go through the example and hopefully then this will all make sense.

I have a created an example to illustrate how you can use std::find_if and std::bind2nd to search through a STL collection. I've tries to keep the example simple. Please let me know if you have trouble understanding the code. In this example we will create a collection of Person and we will search through this collection.

Example Description:

  • «
  •  Start 
  •  Prev 
  •  1 
  •  2 
  •  3 
  •  Next 
  •  End 
  • »

Page 1 of 3