Detect & Install .NET 3.5 Framework using Inno Setup.

In this article, we would see how to detect whether the .NET Framework is present or not, and how to install the .NET Framework automatically from the internet (Microsoft Website), if its already not present. The installation won't continue, until the .NET Framework is installed.

Singleton Design Pattern

Singleton Design Pattern is used to restrict instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system. Examples would include objects needed for logging, communication, database access, file manager, scheduler, etc. You could pass such an instance from method to method, or assign it to each object in the system. However, this adds a lot of unnecessary complexity. Simply put, singleton ensures that a class has only one instance, and provides a global point of access to it.

Programming Puzzle: Search Engine

The urban legend goes that if you go to the Google homepage and search for "Google", the universe will implode. We have a secret to share... It is true! Please don't try it, or tell anyone. All right, maybe not. We are just kidding. The same is not true for a universe far far away. In that universe, if you search on any search engine for that search engine's name, the universe does implode! To combat this, people came up with an interesting solution. All queries are pooled together. They are passed to a central system that decides which query goes to which search engine.

Programming Puzzle: Train Timetable

A train line has two stations on it, A and B. Trains can take trips from A to B or from B to A multiple times during a day. When a train arrives at B from A (or arrives at A from B), it needs a certain amount of time before it is ready to take the return journey - this is the turnaround time. For example, if a train arrives at
12:00 and the turnaround time is 0 minutes, it can leave immediately, at 12:00.

How to iterate vector in a loop and delete items from it?

You can't just iterate vector in a for loop and delete the item pointed by the iterator and increment that iterator at the end of the loop, as after deleting the item from the vector, the iterator is invalidated.

The crude way of deleting the items in a vector is:

typedef std::vector<std::string> string_vector;
typedef std::vector<std::string>::iterator string_vector_iterator;

string_vector_iterator iter = m_vPaths.begin();
while (iter != m_vPaths.end())
{
  if(::DeleteFile(iter->c_str()))
  {

Slack: Word of the day

In project management, float or slack is the amount of time that a task in a project network can be delayed without causing a delay to:
  • subsequent tasks (free float)
  • project completion date (total float)
An activity that has a total float equal to zero is said to be a 'critical activity', which means that a delay in the finish time of this activity will cause the entire project to be delayed

Retrospective: Word of the day

The term is also used in software engineering, where a retrospective is a meeting held by a project team at the end of a project or process (often after an iteration) to discuss what was successful about the project or time period covered by that retrospective, what could be improved, and how to incorporate the successes and improvements in future iterations or

Spike solution: Word of the day

"A spike solution is a prototype, working code that explores a possibility or solves key functionality of a specific project requirement, thus reducing the overall risk associated with the project."

Formula: EMI Calculations

How do you calculate your monthly EMI for loans? Well, here is the simple formula for EMI Calculations:
 

How to make subversion ignore obj files?

When you run the subversion status command, it will show lot of files that you don't intend to check-in in the repository, like the temporary object files. You can tell subversion to ignore all such files in a particular directory.

svn propset svn:ignore *.o.d DebugUnicode
svn st

This will tell subversion to ignore all the *.o.d files in the DebugUnicode directory.