Archive

Archive for the ‘Tools’ Category

Visual Studio 2010 – Code Metrics calculation

November 2nd, 2009 Sarath Comments

Visual Studio 2010 provides a new feature to calculate various the code metrics. Sadly this options are only available for Managed projects. Sorry native developers!

It allows to calculate the follow matrices of your project

  • Maintainability index
  • Cyclomatic Complexity
  • Depth of Inheritance
  • Class Coupling
  • Lines of code

Most of us mainly interested lines of code (LOC) as various other calculations in the project life cycle calculated based on this.

To calculate Code matrix, Right click on the Solution and choose “Calculate Code Metrics”

image

As you’re seeing above, you can see the information for the entire project and also for the individual items.

It’s possible to filter the results based on given criteria as you’re seeing below.

image

The coolest things is that, you can export these result to an excel sheet without any pain. Just right click on the item and “Open Selection in Microsoft Excel” as you’re seeing below

image

You can get it opened in the excel. See, the filters are automatically applied for header items!

image

To know more check MSDN website.

Tools – Paint .NET is an professional Open source image and photo editor

September 7th, 2009 Sarath Comments

When people thinks about photo and image editing, only one name first comes to mind (at least for me), It’s Adobe Photoshop. But it’s heavy, pricey commercial product. What if you can get major of it’s functionality at free of cost under Windows? Cool eh? Here’s the solution Paint .NET written completely in Microsoft .NET

image

Paint.NET is free image and photo editing software for computers that run Windows. It features an intuitive and innovative user interface with support for layers, unlimited undo, special effects, and a wide variety of useful and powerful tools. An active and growing online community provides friendly help, tutorials, andplugins.

It started development as an undergraduate college senior design project mentored by Microsoft, and is currently being maintained by some of the alumni that originally worked on it. Originally intended as a free replacement for the Microsoft Paint software that comes with Windows, it has grown into a powerful yet simple image and photo editor tool. It has been compared to other digital photo editing software packages such as Adobe® Photoshop®, Corel®Paint Shop Pro®, Microsoft Photo Editor, and The GIMP.

 

It boasts these major features

  • Simple, intuitive, and innovative user interface
  • Layers
  • Active Online Community
  • Frequently Updated (updates every 4-8 weeks)
  • Special Effects
  • Powerful Tools – Splines, Curves, Bezier, magic wand, clone stamp, gradient etc…
  • Unlimited History
  • Free!
    Other variant you can try for free is The GIMP. It’s also an excellent photo editing tool.

Tools: Notepad++ is the powerful text editor you need

September 6th, 2009 Sarath Comments

Fed up with with the normal notepad of Windows? Or are you want some good flexible and powerful text editor? Here it’s Notepad++. The features are truly amazing @ free of cost.

Besides the excellent editing features( just check it’s menu, you will get amazed) Notepad++ features are

Syntax Highlighting and Syntax Folding

WYSIWYG

If you have a colour printer, print your source code (or whatever you want) in colour.
User Defined Syntax Highlighting

It allows user to define his own language : not only the syntax highlighting keywords, but also the syntax folding keywords, comment keywords and the operators.
Auto-completion

For most supported languages, user can make his/her own API list (or download the api files from dowload section). Once the api file is ready, type Ctrl+Space to launch this action (see screenshot).
Multi-Document
Multi-View
Regular Expression Search/Replace supported

Full Drag ‘N’ Drop supported

You can open a document by drag & drop. You can also move your document from a position (or even a view) to another by drag & drop.
Dynamic position of Views

The user can set the position of the views dynamically (only in 2 views mode : the splitter can be set in horizontal or in vertical)

File Status Auto-detection

Zoom in and zoom out

Multi-Language environment supported

Bookmark

Brace and Indent guideline Highlighting

When the caret stay beside of one of those symbol { } [ ] ( ) , the symbol beside of caret and its symmetric opposite symbol will be highlighted, as well as the indent guideline (if any) in order to locate the block more easily.

Macro recording and playback

You can save several macros and edit their keyboard shorcuts for the next use.

image

Another hidden gem in this editor is the build in (Okay, a built in extension) command window. Which is replica of window cmd.exe. This was one of the most helpful one for me when I was working with clearcase server. I was encountering with make files and C++ source code all there was no Visual Studio project file to build. either I’ve to create a dummy project and add these files to Visual Studio and create build commands as the “External tools” option in Visual Studio. But I was truly comfortable with the folder view (I could not see it in the latest version) to manage my files as solution explorer and use the command line to build the project. It was simply awesome and comfortable. Also I don’t need to pay too much memory for Visual Studio as I can do same things here with a lightweight tool. Also it’s integrated with Context menu to easily open the required documents.

It supports plugins and some handy plugins like compare , FTP synchronize etc.

Have a try – Download it here

Some other powerful text editors you can try but I feel this is really comfortable.

Tools: Camstudio is a freeware to capture your screen

September 1st, 2009 Sarath Comments

Here’s the another one in the tools series. Suppose if you’re preparing for a hands-on demo on your product, or want to prepare some cool tutorials like this guy because you just luv2help.  What’s the easiest and cost effective way to capture high resolution vide of your desktop? Camstudio is a free screen recording (capturing) Software. Don’t think about paying some bucks to get the license, it’s absolutely free and Open Source software.

CamStudio is able to record all screen and audio activity on your computer and create industry-standard AVI video files and using its built-in SWF Producer can turn those AVIs into lean, mean, bandwidth-friendly Streaming Flash videos (SWFs)

image 

CamStudio can also add high-quality, anti-aliased (no jagged edges) screen captions to your recordings in seconds and with the unique Video Annotation feature you can even personalise your videos by including a webcam movie of yourself "picture-in-picture" over your desktop.

And if all that wasn’t enough, CamStudio also comes with its own Lossless Codec that produces crystal clear results with a much smaller filesize compared with other more popular codecs, like Microsoft Video 1.

You have total control over the output of your video: you can choose to use custom cursors, to record the whole screen or just a section of it and can reduce or increase the quality of the recording depending on if you want smaller videos (for emailing to people, for instance) or you can have "best quality" ones for burning onto CD/DVD.

Enjoy the cool tools :)

Tools: WinSplit Revolution allows you to organize your windows

September 1st, 2009 Sarath Comments

Windows provides only limited Window arrangement facilities by default. The usual Tile Vertically, horizontally, cascade windows are the usual options available in Windows. But it was never flexible to use, especially with multiple monitors.

In Windows 7, as part of the Desktop Enhancement new Window Organizing features are more flexible than ever.  Like maximizing, horizontal, vertical resizing, side by side view etc.. The best thing is it’s integrated with keyboard shortcuts and also with some cool mouse gestures. e.g by dragging to the top edge, you can maximize the window, to the right or left edge. you can make it 50% size vertically to make a side-by-side comparison. also you can do these with Keyboard shortcuts as well.

But, Windows 7 is yet to be released. Also not everyone opting Windows 7. This kind of simple features are really handy especially when you’re using a high resolution display and multi-monitor setup.

WinSplit Revolution is a free solution for excellent window management for high resolution and multiple monitors. It permits you to "divide" your screen into several parts: halves, thirds, fourths, etc… For instance, a window can be resized and moved to the left half, the right half, the top, a corner… of the screen. Also it helps you to move a Window to another screen when you’re using multiple monitors.

[Image taken from http://www.winsplit-revolution.com/]

 

The utility provides some cool features as (don’t confused with the name, take the help page and try each features you will find it very easy). Also Video Demo will help you for an introduction

  • Automated window handling (resize, move, reorganize, close tasks)
  • Shape – process association
  • Global hotkeys and clickable virtual numpad
  • Automatic startup
  • Automatic update
  • Moving a window with mouse (drag’n'go)
  • Hotkey configure
  • Layout configure
  • Fusion between 2 windows
  • Minimize/Restore by hotkey
  • Mosaic mode

Enjoy this cool utility with your own desktop for painless arrangement of Windows @ free of cost.

In my case, usually use this for dealing windows with multiple monitors and side by side view (for updating review comments :D ). Also resizing my Google reader windows to 50% horizontal for painless reading :) and lot more.

Download it here

Tools: TreeSize tells you where precious disk space has gone to

August 24th, 2009 Sarath Comments

Most of us has faced lot out of disk space situation. It’s truly helpful to to know which folder is utilizing the disk space to do the cleanup. Here’s a freeware, called TreeSize

[This is the same image displayed in http://www.jam-software.com/]

TreeSize Free tells you where precious space has gone to. TreeSize Free can be started from the context menu of a folder or drive and shows you the size of this folder, including its subfolders. You can expand this folder in Explorer-like style and you will see the size of every subfolder. Scanning is done in a thread, so you can already see results while TreeSize Free is working. The space, which is wasted by the file system, can be displayed and the results can be printed in a report. TreeSize Free is freeware for Windows 2000/XP/Vista. Users of Windows 9x/ME can download last compatible version TreeSize Free.

 

Download it here

Categories: Tips, Tools Tags: , , ,

Visual Studio 2010 Tips – Zoom your source code as with Ctrl + Scroll mouse

July 1st, 2009 Sarath Comments

One of the coolest thing in Visual Studio 2010 is the zoom source code functionality( I don’t know if there is any official name for it). As we’re doing with Office Word, any browsers, you can quickly zoom in/out your source code without the pain of going to Tools->Option Menu to change the font size.

Do it with following steps

1. Open your source code

2. Press Control + Scroll Up for Zoom-In the source code

3. Press Control+ Scroll Down for Zoom-Out the source code

 

See the image of a zoomed source code.

Zoom

Squiggles Support in Visual C++ 2010

June 8th, 2009 Sarath Comments

One of the best editor features I’ve enjoyed in Visual Studio Editor with C# environment is the real time highlighting of syntax and semantic errors etc using Squiggles (wavy underline). As native programmer, I wished a lot of we enjoy similar kind of helpful features with Visual C++ editor.

The new version of Visual C++ (coming with Visual Studio 2010) has implemented squiggles display in the source editor. Hovering over the squiggle displays compiler quality syntax/semantic errors. See the sample image below

Image Courteously – Visual C++ Team Blog

This is really a helpful feature as we don’t need to wait for finding the errors until the build and this can save lot of time. This feature is implemented atop (or make use) of intellisense. In my experience most of the large C++ projects are not directly using Visual Studio for building. If you’re directly using Visual Studio, you can benefit the entire features in a centralised manner. But the new features are certainly helps developers even if they’re using external build systems. The error list window will show the errors identified by the intellisense and this helps you to fix the issues before starting external build.

More technical details and information are available at Visual C++ team blog

How to specify multiple exclusion list to xcopy?

April 23rd, 2009 Sarath Comments

xcopy is a powerful tool under Windows to do copying. It’s really helpful for me at the time of project deployment. most of of the time, especially with large projects, the binaries, configuration files has to be copied to the deployment folder by excluding the unwanted/ temporary files in the corresponding folders.

It’s possible tp specify the list of files necessary to exclude during an ‘xcopy’ using /EXCLUDE switch. Here’s a simple tip on how to specify multiple exclusion list to the xcopy operation. For e.g you will have to avoid copying .copying obj, .ilk files, Debug, Release folders (if you’ve copied your binaries to a common bin folder) etc..

xcopy /S /I %BIN_HOME%\*.* C:\Delivery\bin /EXCLUDE:excludelist.txt

In the above statement BIN_HOME is an evironment variable. You can also specify exact path to be copied. You can see that at the end of the statement, it’s specified excludefilelist.txt which contains the full path or partial name of files to be excluded. A sample exclude file list may appear as below. Each file to be excluded should be specified in a new line.  At the end you can see to exclude directories, it’s not necessary to specify prefixing . (dot). See the documentation for more information

Sample exclude list file

.pdb
.ilk
.obj
.pch
.exp
.res
.trg
.idb
.tmp
.log
.ncb
.aps
.bsc
.sbr
.scc
Debug
Release

How to convert a STL container to array

March 12th, 2009 Sarath Comments

Most of the collection classes in C# and Java provides interface to pack the data as an array but C++ STL containers like vector, list etc. are not having direct interface to do this.

To accomplish this, you can write a simple function as follows which is exploiting the power of std::copy function. The function specified below is compatible with any containers which supports iterators. i.e you can use, vector, list etc. with this function. (If you’ve a better idea, please share through comments).

[sourcecode language='cpp']
template
bool ToArray( const container& vec, T*& pArrayOut )
{
int cnt = vec.size();
if( cnt > 0)
{
pArrayOut = new T[cnt];
copy(vec.begin(),vec.end(), pArrayOut );
return true;
}
else
{
pArrayOut = NULL;
return false;
}
}

[/sourcecode]


The pointer should be freed by the caller using delete[] operator. The reason for specifying the output pointer as function argument is to support calling template function without type information. Which means, if the function specified as T* ToArray( const container& ), you can call it as ToArray<int>(vec). You will have to specify the type of the function, but if it’s a parameter, the compiler will automatically deduce the function type.
The following code describes, how to use the function

[sourcecode language='cpp']
int _tmain(int argc, _TCHAR* argv[])
{
list v; // you can also use instead of list
v.push_back( 10 );
v.push_back( 20 );
v.push_back( 40 );
v.push_back( 50 );
v.push_back( 1220 );
v.push_back( 1320 );

int* t = ToArray(v, t );
if( NULL != t )
{
cout << “Failed to convert”;

for( int i =0; i < v.size();i++ )
  {
  cout << t[i] << “\t” ;
  }
delete []t; // free after use
}
return 0;
}
[/sourcecode]

Categories: C++, Code, Tools Tags: ,