Broken Terminal? MAC OSX

Broken? : Yeah sometimes, you might haphazardly configured/changed your environment and that somehow broke you’r terminal

Effects : Commands like ls, cd , bash don’t work


1. Open Terminal

2. Type  PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin and press enter

3. Type export PATH   and press enter

Build Your Qt Project on Windows and Mac OSX

Why i needed to build my app on another platform?

I’ve used Qt just for its cross platform-ness indeed its “code less and do more ” paradigm is apt  so there were hinderances in using MinGW compiler to build my project targeted to windows platform, below is the listed procedure and screenshots

Its a 2 Stage Process, Installing Libraries and building your project

Working on Microsoft Windows 7 and Mac OSX Snow Leopard

*Note: Phew Dont Worry its very simple, ive just added some information, so it looks little long



  1. mingw-get-inst
  2. Qt libraries 4.8.2 for Windows (or Higher Version)
  3. Your .proj file (Associated .ui, .cpp, .h etc)

STAGE 1: Setting up the environment

Step1:Download and install mingw-get-inst

Get if from here
You would need this as in Qt libraries installation it will ask you for the g++ component

Do select

  • C Compiler
  • C++ Compiler
  • MingW Developer Toolkit

Step2:Download and Install Qt libraries 4.8.2 for Windows

  1. Goto :
  2. Scroll down to Qt Library
  3. and choose your version

*Choose with minGW*

ex:Qt libraries 4.8.2 for Windows (minGW 4.4, 318 MB)

You Can get the above file from here

and finish the installation in case if it asks you for g++ component , point to the MinGW/bin folder you just installed in step1

Step4:Setting Up Environment Variables

In User variables create

Variable                 Value

QMAKESPEC          win32-g++

QTDIR                      C:\Qt\4.8.2

*The above value is the  location where you installed your version of Qt
















Next: Set the Path Variable

add this

*They are locations where you installed MinGW and Qt respectively







STAGE 2: Make and Build Project

Step1:Goto Start > All Programs > Qt by Nokia v4.8.2 (MinGW OpenSource)>Qt 4.8.2 Command Prompt
Now you can put your folder containing .proj file (Associated .ui, .cpp, .h etc) in one folder and placethem in C:\Qt\4.8.2
In the Screenshot the folder where my project files reside are in Galaxyand Galaxy.proj is the project file
Now go to the Galaxy Directory as cd Galaxy

Step2: Make

qmake -o Makefile

Step3: Build

mingw32-make -f Makefile.Debug












Now Within Galaxy Folder you have Debug and Release where your executable .exe file resides

Now Enjoy Making Projects on Mac OSX and Easily Deploy on Windows too

Here are the screenshots for my prototype apllication in windows and OSX

*Censored as it is a Coveted Project 😀 *

Deployed on  Mac OSX (Project Written and Built Initially):
















Deployed To Windows:


Solution for Pointer Content Bug in Netbeans 7.1

Using Netbeans 7.1

I had a pointer variable declared as

int **nodes

As program continued ,i allocated size on the fly and at a point i needed to watch the contents of this pointer (as an array of values)

The watch pane of Netbeans does not reflect the values


Create a watch with  *nodes@22

where you want to watch  all the values in nodes[22][]

Attached Screenshot for reference

in the picture 1st three rows reflect the bug

and post that row is the solution ! Happy Debugging!!!!

Note: For n00bs , you can add a Watch in Variables too !!! 😀


netbeans bug.jpg

‘Nan’ Can Cripple You and your Code

NaN- Not a number is one such night mare that can cripple your entire Code , your hours (Or even Minutes 😉 ) of punching the keyboard , that almost teases your patience of debugging the program

Only oneTIP for this : How certain you are about your code and how perfect is your code analysis and Data flow is ,

Just Check for Division By Zero Evaluation!

In any Division Arithmeticity Do check this , keep it as a habit and it should just flow when you are busy in such Divisional Logics in your code

The dirty way is to add a very small (negligible) padding to your denominator , Sure you woudnt do that if your coding for a Nuke Reactor or NASA JPL Mars Program 😉

An Uncanny Blog Visitor Turns out to be a 13 year old School Friend! – Incredible Stories:

This is a story how i met my childhood friend , not through Facebook, Twitter, Orkut or Linkedin or any social network but as a visitor to my blog who commented on my post. He is Manu ( Who inturn found me through

It was just an usual comment on a post and i replied back , the next day there was another post from my end and he commented back, as we were friends in Indiblogger , and as a fellow blogger approached him so that i can add him up on facebook, quickly we added each other, the surprising thing was we had no common friends (that was expected) but least i could imaging that our coversation would turn into a shocking Experience.

I started saying I am pursuing my undergraduation from a reputed college and words exchanged and talked about interests and at a point i asked him , from which school he was from , he said St.Patricks , i said even i hail from the same school , i thought that, it might be at another location(but it was less probable as i knew the only branch was ours), but what he said brought a shocking bolt in our head, even he was from the very same school , we were awe struck , i then took out the Class group photo and pointed who i was and he readily pointed himself out and he could identify few others , we were speech less as to how a comment from a random visitor turned out to be a School friend From MY class , who eventually hand to leave due to a personal reason , None of us were even touch with him , later shared the pictures, tagged each other and we guys found out Our very own classmate ! We spoke of this unusual bump into each other for few days, oh yeah and lot of our tastes did match !!

Its something which neither of us can forget ! its a Destiny to meet your long lost friend, who else and how could such an Uncanny Event Take place !


Indiblogger For providing such an oppurtunity to share my experience

M&M fro Organizing

Manu – For being such a great fellow blogger and a great friend !


Rahul Reddy

A.k.a Godhc!

GREP – Ending With Space

The below Snippet Uses Awk and Pipes it to GREP and finds all matches that end with a space


awk ‘{FILELOC=”TFIDF.txt”} {print $0}’FILELOC | grep ‘^$1[[:space:]]’ D/Step2/3D_Final > a


so to match for a space u need to use  [[:space:]]

The snippet finds matches that start with $1 variable and proceeds with a space or a tab

You can use in any scenario , Phew took a long time to find this!! Enjoy Scripties!!