Friday, 24 June 2016

Some great Programming Hacks in C/C++.

We do use so many things to optimise our programs, from good algorithms to good data structures made specifically for that purpose. But, often we tend to write more lines of code which can be saved by using some special features offered in C++. These are known as preprocessor directives.

Till date, most of the people have been using just the #define directive to declare a variable. Most people dont know that they can even define functions in the preprocessor directives.


  1. #define REV(a,n) reverse(begin(a),begin(a)+n)


There are so many other templates that people use to make their
programming even faster

One more example of such an hack is the typedef keyword. This thing
particularly is more useful in competitive programming, where you can
save your time by making some typedef statements in the beginning of
program itself. Here's a sample code for the purpose:

While all these things are only a few techniques to reduce your time, here are some links where you can continue to read:


Also I have a github repository where I post some important links actively:


Throw in some comments, if you find this post good.

Saturday, 4 June 2016

Want to limit your time on facebook? here's a solution

Fb-Script

So, its about yesterday, when I put my hands on the selenium web driver for the node-js.

I was amazed with the capabilities, and to start with I created a script in javascript that allows you to login to facebook and browse there for a fixed amount of time which is set by the user.

Its all open source and the source code is available on Github and the steps for using is given in the Readme file included in the source code.

Here's the link for Github:

Click here: Fb-script


On the way next, I plan to make this more interactive by taking the code to python and then implementing some more features.

Throw some comments for hugs and bugs.

Enjoy!