chirag1992m

fast I/O in C/C++

There many ways to do input/output in C/C++. Some are slow, some are fast and some can be very fast. Here I’ll be discussing some of these methods.Many a times during competetive programming you come across the warning “Careful – large input/output“. Now what exactly does this means? This basically means that you have to…

Read more...

Ubuntu (12.04) upstart (at boot) services

Creating your own ubuntu upstart service: Create a shell script. (Name it whatever you want. Here I am assuming it to be “autorun.sh”) Copy the shell script to /etc/init.d/ Make the script executable. Update the upstart table of ubuntu by creating symbolic links. Done. To boot an already existing script: Update the upstart table of…

Read more...

Download Facebook Album

Here, I am going to tell you a simple method to download an entire facebook album with just one click.It is an automated process using a small JavaScript code. All you have to do is: Go to: https://github.com/chirag1992m/facebookAlbumDownloader/blob/master/js/downloader_min.js Select the whole code, and copy it your clipboard. Now, Open the facebook album you want to download. Scroll…

Read more...

GitHub for beginners (debian/ubuntu/linux)

Just yesterday I was trying to setup my first github repository, but it wasn’t that easy I thought it would be. YES I know, github has a support page, but  it didn’t seemed to work for me.So here, I’ll give you a little introduction on the initial setup of git on your local machine and setting…

Read more...

C++: incomplete type and cannot be defined

A very confusing error just now: error: aggregate ‘std::ofstream out’ has incomplete type and cannot be definedfrom simple code: std::ofstream out;And the similar one: error: variable ‘std::ofstream out’ has initialiser but incomplete typefrom this code: std::ofstream out(fname.c_str(),std::ios_base::app);Using this didn’t help: #include <iostream>Using this also didn’t help: #include <ofstream>That was confusing me most, but now I…

Read more...