Sep 24

C++ memory error checking with Valgrind

Memory errors come in different forms and they are not the easiest to find. They do not usually showup in compile time and creep up during runtime. Even static analysis tools have a hard time finding memory errors. Most memory errors can be of two types: 1)     Memory leaks 2)     Out of bounds array access …

Continue reading »

Jul 26

Embedding a matplotlib plot on a PyQt GUI

Screenshot-Qt Designer-2

Matplotlib (http://matplotlib.sourceforge.net/) provides a great range of plotting tools and functionality. It is a nice alternative for Matlab. Making a plot with matplotlib in Python is not that difficult. But often you need to be able to embed a plot into a GUI with other components like push buttons and text fields and so on. This …

Continue reading »

Mar 11

C++ Object File, Symbol Table and Name Mangling

Test_case2.0 symbol table

In my previous post I looked at how a C++ compiler and linker act on source codes. This post I want to take one small step further and look in to an C++ object file. An object file in C++ is generated by the compiler. As was mentioned in the previous post, an object file …

Continue reading »

Mar 04

C++: Compilers and Linkers Job on Functions and Function Templates.

It’s important to know the role of the compiler and the linker. This helps not only in understanding errors but also in implementing many programming strategies. Unfortunately the roles of compilers and linkers are not uniform across compiler vendors but they are close. Here we will look at what a compiler and a linker do in …

Continue reading »

Dec 14

JAXB: An alternative serialization for Java

Java Architecture for XML Binding (JAXB) is method to convert your class objects in to XML files. I came across this concept while looking for a way to share the architecture of exchanges and queues in an AMQP system. Although Java object serialization would’ve worked I wanted a much more ‘standard’ way to share this …

Continue reading »

Oct 02

Theory behind Doppler frequency shift

Doppler

Doppler frequency shift plays a major part in wireless communications, radar and many other systems. Sometimes Doppler shift is useful, like in radar detection systems, but sometimes it’s harmful, like in mobile wireless communications systems. Calculating the Doppler shift is very trivial. , where v is the relative speed between transmitter and receiver, and the …

Continue reading »

Sep 17

Introduction to Virtual functions, Virtual Tables and Virtual Pointers in C++

VirtualFunctions1-2

If coming from Java to C++, it could be slightly confusing how function inheritance works in C++. C++ uses the notion of “virtual” functions. In C++, unless a function is declared as virtual, polymorphism will not work. Lets see how this works with a simple Base class and a Derived class. #include <iostream> #include <string> …

Continue reading »

Sep 25

Android Activity lifecycle demo code – with Intents and multiple Activity switching

Lifecycle2

It can be a little confusing to understand where Android Activities are started and which methods are invoked and what happens when Intents are sent and returned, restarted, etc. So in this code I overrode all the Activity lifecycle methods and put a Toast so I can see which methods are invoked at what time. …

Continue reading »

Jan 28

How the Cyclic Prefix (CP) works in OFDM – Part II – The Theory.

This is a follow up to the Cyclic Prefix (CP) I did here. There I gave a graphical explanation and here I will discuss how it happens theoretically. I recently came across the derivation in a text [1]. So here goes. Considering an N-point FFT system, a block of data points , is to be …

Continue reading »

Sep 23

Android Activity Life Cycle Demo

I’m just starting with Android, and if you are a beginner like me, you probably want to understand two of main concepts of Android: Activities and Intents. You probably start off with a “Hello, World.”, so in Android that is an Activity. Anything you can see on the screen is handled by an Activity. And …

Continue reading »

Older posts «