Sunday, October 10, 2010

VC++ Tip: Show Includes

The following is a useful Visual C++ tip that solves a frequent problem any VC++ developer might face.
There are time in which you get errors from files you have never created, or included into your codes.
This can be very frustrating and hard to debug especially if that file is burried deep into #include tree.

Consider the following example where you get an error such as
c:\program files\microsoft visual studio 8\vc\include\math.h(486): error C2084: function 'long abs(long)' already has a body

You might be scratching your head to figure out what does this mean knowing that you have never included "math.h" in your code.
One way of proceeding is to go open each nested #include file to determine where this file is include. However you will soon discover
that you have entered a complex labyrinth in which the way out is so difficult to find.

Another easier approach is tell the compiler to show the list of all included files used in the comilation:
1.Open the project's Property Pages dialog box.
2.Click the C/C++ folder.
3.Click the Advanced property page.
4.Modify the Show Includes property to 'yes'






On compilation you get a list like the following:
:c:\globalProjects\localProjects\srcCtrl\srv\src\myproj\util\net\ServerBase.h
: c:\globalProjects\localProjects\srcCtrl\srv\src\myprojTools\myprojUtils.h
: c:\globalProjects\localProjects\srcCtrl\srv\src\myproj\util\net\NetworkConnection.h
: :c:\globalProjects\localProjects\srcCtrl\srv\src\myproj\util\Obj.h
: : C:\Dev\Dependencies\thrdParty\extension\thrdParty\stlport\stl\_threads.h
: : :C:\Dev\Dependencies\thrdParty\extension\thrdParty\stlport\stl\_cstddef.h
: : : C:\Program Files\Microsoft Visual Studio 8\VC\include\stddef.h
: : : :C:\Program Files\Microsoft Visual Studio 8\VC\include\crtdefs.h
: : : : C:\Program Files\Microsoft Visual Studio 8\VC\include\sal.h
: : : : C:\Program Files\Microsoft Visual Studio 8\VC\include\crtassem.h
: : : : C:\Program Files\Microsoft Visual Studio 8\VC\include\vadefs.h
: : :C:\globalProjects\thrdParty\extension\stlport\stl/_cstdlib.h
: : : C:\Program Files\Microsoft Visual Studio 8\VC\include\stdlib.h
: : : :C:\Program Files\Microsoft Visual Studio 8\VC\include\crtdefs.h
: : : :C:\Program Files\Microsoft Visual Studio 8\VC\include\limits.h
: : : : C:\Program Files\Microsoft Visual Studio 8\VC\include\crtdefs.h
: : : C:\globalProjects\thrdParty\extension\stlport\stl\_cmath.h
: : : :C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h
: : : : C:\Program Files\Microsoft Visual Studio 8\VC\include\crtdefs.h
>c:\program files\microsoft visual studio 8\vc\include\math.h(486) : error C2084: function 'long abs(long)' already has a body


In here you will find the whole tree of #include before the error. Notice how deep math.h is include far below ServerBase.h.


It is extremely difficult to detect its presence without the use of this option.

Sunday, October 3, 2010

Quality Content Comparative Analysis

There are plenty of ways to create content on the internet. Blogs, articles, videos, forums, and Q&A etc...
There is also on unexploited potential way that can be used to create quality content which is chatting.
Certainly there are pros and cons for each way. Below is a comparative analysis for each method:

Articles and blogs are maybe the most well known methods their advantage is that they are or might be complete and detailed with complete exposure of the domain or point of view. On the other side they are the less interactive. Despite that most of them have commenting features; it is rare to see true interaction between authors and readers.

Video content are now notorious with Youtube especially that there are plenty of people who are trying to provide quality videos. Consuming this type of content is by far easier than reading especially when presented in an appropriate manner. The problem of video content is mostly in availability of the topics. It is still far behind written text. Interactivity is not better than blogs, it consists only of viewers comments.

Forums and Q&A on other hand have better interactivity but less complete content. They are usually centered on a post or a question that people discuss and exchange opinion. The content is not really a detailed info rather than an exposure of a problem that the community is asked to contribute to the solution. Although the interactivity is higher however it is not in real-time. So the interest party must have enough patience before succeeding getting the community to be engaged in the solution.

Chatting has always been the fun thing and to meet other people generally from the opposite sex. However this does not have to be this way. People are usually interested in topics, this clearly seen in the comments on blogs or videos as described earlier. So chatting can be part of the quality content creation if it is presented accordingly. Any event, news or article can trigger a discussion between supporters and opponents. Services like www.SimpleConnexion.com give people the option to find others who are interested in a particular subject and exchange with them opinion in real time fashion and at the end publish the content of this discussion so that other people benefit from this opinion exchange.
The advantage of this method is that it is real-time; people get replies in a matter of seconds. It is challenging because a person can easily ask his peer to clarify his answer or opinion which means it creates a better understanding. The content of the discussion can be published as just explained.
The difficulty is to really find someone to chat on a specified topic at a particular time. This difficulty will be overcome as more and more people adopt this type of chatting.

In conclusion diversity of methods leads to richness and creativity as well as provides suitable ways for different people according to their preferences and needs.