{C++ etc.}

Latest Posts
 
Home | C++ Posts | Linux Posts | Programming Posts | Issue Tracking Posts

Monday, March 22, 2010

This application has failed to start because the application configuration is incorrect.. Solution

I came across this error when trying to run an application built with Visual C++ 2010 express on another machine which did not have the .net runtime, Visual C++ redistributable packages installed.

Solution:
Copy all the DLLs in "[installation directory]\VC\redist\x86\Microsoft.VC.CRT\" to the application directory. These DLLs are needed if the application runs in "Release" mode

Copy all the DLLs in "[installation directory]\VC\redist\Debug_NonRedist/x86/Microsoft.VC.DebugCRT\" to the applciation directory. These DLLs are needed if the application runs in "Debug" mode

Now the application should run without an issue. Install the appropriate (i.e. 2005/2008/2010 etc.)  Visual C++ redistributable package on the target computer for a more permenet solution.

Basic Performance Profiling and Tuning of C++ Programs in Linux

I've just highlighted the basic things you need to get started on profiling. Hopefully it would serve to help developers to refine their methods and go for more complex profiling strategies.


The required tools:
1. Run the tool called callgrind (which is part of the valgrind suite):
valgrind --tool=callgrind [parameters]
2. This would create a file of the format:callgrind.out. You could go through this file using an editor but it's hard to do a proper analysis using only your wits. This is where KCacheGrind comes in.

3. Run KCacheGrind and load the callgrind output file in to it.


Now you would have a visual representation of the calls made by each method displayed as a percentage of the total call count via a rectangular area diagram.

4.

  • If you have a method which you would like to optimize, change the grouping to "Class" and search for the method in order find it quickly.
  • Otherwise, look for the methods which are called the most and optimize them.

5.Also try to lower the call count to these methods by modifying the callers to re-use values

Also Refer:

Sunday, March 21, 2010

Gas Masks and Filters in Metro 2033

If you're playing Metro 2033, there's an important concept that you must come to terms with..
Have plenty of filters and don't let your Gas Mask take damage.
The sooner you get familiar with these things, the easier it would be to play the game.

There's another small problem... You don't get a lot of ammo. What you have is not going to be enough to blast your way out of attacks by blindly spamming bullets. Remember, it's a shooter... but it's not Modern Warfare 2 ;)

Saturday, March 20, 2010

fstream.clear()... How MS takes a working model and breaks it.

I've used fstreams in Linux/Solaris a lot of times and it's always been the same simple model.
  • Open
  • Process
  • Close

Recently, I was working on porting some Linux code to Windows and a strange thing happened (well a lot of strange things happened but this really had me dumbfounded :-|). I found that once an fstream is used to open a file, I can't re-use it even after calling close(). If I created a new fstream instance for each file, everything worked fine.
I found the solution here.
It reads:
It might be surprising to learn that this is in fact by design. The C++ Standard specifies that neither open or close clears the status flags of a stream. As such, the behavior you are seeing is in fact exactly what should happen.

The good news is that this is easy to work around, just add a call to the clear() method of the stream prior to opening it like so:
void open(const char* sFilename) {
m_stream.clear();//clear status of stream, as we're about to reuse it on a fresh file.
int nMode = std::ios::in | std::ios::_Nocreate;
m_stream.open(sFilename, nMode);
if (!m_stream) {
throw "Cannot open file";
}
m_isOpen = true;
}



What's bizarre about this is that you should not have to call clear(). "clear()" is a method specified in ios to be used to clear error flags. It's relevance for normal file handling operations is just beyond me.
This is another instance where MS has taken a working system and added unnecessary and irrelevant complexity in to it.

Thursday, March 11, 2010

The Best Free Open Source Web Based Issue Tracker



I've been working on standardizing the development work flow at my company (LHI) and a key feature of this was implementing an Issue tracking service. It would have to run on Linux and not use MS technologies like asp. Additional features like project management and SVN integration were also taken in to account.
First came the evaluation phase where I went through countless blog posts looking for the perfect match. There were many candidates.

were the main ones. Bugzilla went out the window as soon as I visited there site. My PM has had some bad experiences with Trac so it was out as well. Mantis had the "simple" written all over it and I had doubts whether it would hold up in the long run. But when it came to Redmine, we hit the jackpot.

Aesthetics are important. Some "gurus" might argue that as long as it's functioning looks don't matter. But we're talking about a system which would be used by various people from diverse backgrounds and they should not go "aaaaaaaaarrrrrggggghhhhhhhh" when they log in to the system.

Also it should be easy to use. Redmine had the aesthetics part going for it. It wasn't overflowing with artistic touches but had enough stylistics elements to please the eye. The setup on SuSe 11.1 was reletively painless. I had it up and running in 3 hours and I'm just a developer ;-) So far, my experience with Redmine (which has been limited to setting up a single project, adding users and integrating svn) has been excellent.

I haven't played around with customizations and plugins and am still in the process of migrating the site to Apache2 but I think these things would not be difficult. All in all, Redmine is a gem amongst the free and open source issue tracking software arena.