<

The demand for Java and PHP programmers is hotter than ever

Keywords: , , , ,

Most programmers today use Java and PHP in Web 2.0 applications, from social networking sites, to shopping carts, content management systems, and other complex applications. Popular sites, such as LinkedIn and Facebook, are using Java and PHP in some of their most important development work.

Most programmers today use Java and PHP in Web 2.0 applications, from social networking sites, to shopping carts, content management systems, and other complex applications. Popular sites, such as LinkedIn and Facebook, are using Java and PHP in some of their most important development work. Read More

Some Magical bugs in Microsoft Windows

Keywords: , ,

I’ve never seen this bugs before . These bugs are really interesting and magical as well. Let’s hope microsoft’s programmers will solve these bugs very soon.

I've never seen this bugs before . These bugs are really interesting and magical as well. Let's hope microsoft's programmers will solve these bugs very soon. Read More

Venture Capitalists Hot About iPhone Startups

Keywords: , , , , , , , , , ,

If last year saw the venture capital community chasing startups building around the Facebook platform, this year the new new thing are iPhone application makers. In addition to the $100 million iFund floated by Kleiner Perkins Caufield & Byers, other VCs are getting in on the action.
We recently covered Pelagao, which raised $15 Million […]

If last year saw the venture capital community chasing startups building around the Facebook platform, this year the new new thing are iPhone application makers. In addition to the $100 million iFund floated by Kleiner Perkins Caufield & Byers, other VCs are getting in on the action. We recently covered Pelagao, which raised $15 Million from iFund, Reliance Communications and T-Mobile’s Venture Fund. Union Square Ventures and First Round Capital recently invested an undisclosed amount in New York City-based Pinch Media. Add ... Read More

Custom Visual Studio Visualizer

Keywords: , , , , , , ,

Code debugging is one of the most important parts of any development life cycle because it gives you the technique to find the problem and how to resolve it. When we talk about the visual debugging Visual Studio has tremendous potential in the term visual debugging features in the form of DataTips. DataTips tool provide a handy way to view information about your variables in visual studio during debugging only. In old versions of Visual Studio DataTips were limited in the amount of the information they could display. Now in Visual Studio particularly after VS2005 DataTips have been enhanced to give more detail information about the simple and complex variables. By the help of DataTips tool programmer easily visualize different variable data types in their Visualizers.

Visualizer is a new component in Visual Studio debugger user interface that give us a completely new way to view the structure of object or variable in a meaningful way. The first question that comes in your mind is what is actually Visualizer is all about and simple answer of this question is “it’s a dialog box or other interface to display appropriate types in a meaningful way.” Default Visual Studio debugger comes with four standards visulaizers and these are following

Text

HTML

XML visualizer

Dataset visualizer (Dataset, DataTable and DataView objects.)

 

When a debugger variable show a magnifying glass icon on the variable so it’s mean it has an appropriate visualizer.

 

 

In the preceding figure Visual Studio debugger show a DataTable Visualizer when you click the magnifying glass icon debugger show datatable visualizer.

In the following image I want to show image loading in the picture box in debug mode.

 

 

In the above image Visual Studio debugger not able to load image visualizer because there is no visualizer is available.

 

Ok this is an over view of very high level story and now I am going to write custom Image visualizer. Please follow the following steps.

1.       Create a Class Library project in Visual C#.

2.       Name it “VisualDebugger”.

3.       Add following Assemblies References.

a.       Microsoft.VisualStudio.DebuggerVisualizers.dll

b.       System.Drawing.dll

c.       System.Windows.Forms.dll

4.       Rename the class1 to ImageDebugger.cs

5.       Copy the following codes.

 

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Drawing;

using System.Windows.Forms;

using Microsoft.VisualStudio.DebuggerVisualizers;

 

[assembly: System.Diagnostics.DebuggerVisualizer(
typeof(
VisualDebugger.ImageDebugger),
typeof(
VisualizerObjectSource),
Target = typeof(
System.Drawing.Image),
Description =
“Image Visualizer)]

namespace VisualDebugger

{

    public class ImageDebugger : Microsoft.VisualStudio.DebuggerVisualizers.DialogDebuggerVisualizer

    {

        protected override void Show(Microsoft.VisualStudio.DebuggerVisualizers.IDialogVisualizerService windowService, Microsoft.VisualStudio.DebuggerVisualizers.IVisualizerObjectProvider objectProvider)

        {

            System.Drawing.Image image = (Image)objectProvider.GetObject();

 

            Form frm = new Form();

                frm.Text = “Custom Visualizer - “ + image.HorizontalResolution.ToString() + ” “ + image.VerticalResolution.ToString();

                frm.Width = image.Width;

                frm.Height = image.Height;

 

            PictureBox pic = new PictureBox();

                pic.Image = image;

                pic.SizeMode = PictureBoxSizeMode.AutoSize;

              

            frm.Controls.Add(pic);

            frm.ShowDialog();

        }

    }

}

 

Class should be inherited from Microsoft.VisualStudio.DebuggerVisualizers.DialogDebuggerVisualizer and overrider the Show() method of DialogDebuggerVisualizer class to display your custom interface. The next most important and vital part of this visualizer is IVisualizerObjectProvider parameter because you going to caste this interface into apporipate type and in my case it is System.Drawing.Image class(it could be any thing like XML document, your specific class). I used System.Windows.Form class to host my picture box control. One thing that you should keep in mind is apply DebuggerVisualizerAttribute on your class.

 

Note:
First parameter is your custom class, Second parameter is your visualizer source, Third parameter is target object type like XML Document and last is the description of visualizer.

 

Deployment of Visualizer

Copy the DLL to either of the following locations:

Install path\Microsoft Visual Studio 9\Common7\Packages\Debugger\Visualizers\

—or—

My Documents\Visual Studio 2008\Visualizers\

 

Test Visualizer

1.       Create a new application of Windows Forms Application

2.       Give it name

3.       And write the following code.

 

            Image img = Image.FromFile(@”C:\Documents and Settings\sullah\My Documents\My Pictures\ozzie1.jpg”);

            PictureBox pic = new PictureBox();

            pic.Image = img;

 

4.       Set the Breakpoint on pic.Image = img;

 

Following are the outputs.

 


You can clearly see the new Image Visualizer in the preceding image and click on the magnifying glass icon and get output.

 

 


Code debugging is one of the most important parts of any development life cycle because it gives you the technique to find the problem and how to resolve it. When we talk about the visual debugging Visual Studio has tremendous potential in the term visual debugging features in the form of DataTips. DataTips tool provide a handy way to view information about your variables in visual studio during debugging only. In old versions of Visual Studio DataTips were limited in the amount ... Read More

Is the 80 character line limit still relevant?

Keywords: ,

Traditionally, it’s always been standard practice for programmers to wrap long lines of code so they don’t span more than 80 characters across the screen.

Traditionally, it’s always been standard practice for programmers to wrap long lines of code so they don’t span more than 80 characters across the screen. Read More

Lies We Tell New Programmers

Keywords:

Do We tell lies to the new programmers like our kids?

Do We tell lies to the new programmers like our kids? Read More

A tryst with Syncplicity

Keywords: , , , , , , , , , , , , , , , , , , ,

Quickly: What is the most important component of your computer? Is it the monitor? No you can replace it. The graphics card? No you can live without it. Oh What then?
It’s your data!
Think about it. No matter what kind of a user you are, data is always of prime importance. Now the […]

Quickly: What is the most important component of your computer? Is it the monitor? No you can replace it. The graphics card? No you can live without it. Oh What then? It’s your data! Think about it. No matter what kind of a user you are, data is always of prime importance. Now the obvious question, do you back up your data? “oh um.. Actually I.. NO”. That’s the scenario with most users. Let’s take a look at Syncplicity that now not only backs ... Read More

The New iPhone Is Apptastic!

Keywords: , , , , , , , , , , , , , ,

Today’s launch of the 3G iPhone has some welcome changes to the phone itself, but also highlighted the details behind the iPhone development platform. It’s nice to know that when the iPhone comes out on July 11 a horde of programmers have been working around the clock to port and build applications for it. Below […]

Today’s launch of the 3G iPhone has some welcome changes to the phone itself, but also highlighted the details behind the iPhone development platform. It’s nice to know that when the iPhone comes out on July 11 a horde of programmers have been working around the clock to port and build applications for it. Below are some coming and existing attractions to download to your iPhone. Productivity and Information (or things your boss won’t mind you using): iCall: A free Wi-Fi VoIP calling service ... Read More

LessThanDot - Friday the Thirteenths

Keywords:

We’ve decided to do a recurring feature at LessThanDot and have a “Programmer Puzzles” section with interesting puzzles published. This week the challenge has been set to “identify all friday the thirteenths for a given timeframe”. You can use any programming language you like, just please let people know which one you have decided to use!

We've decided to do a recurring feature at LessThanDot and have a "Programmer Puzzles" section with interesting puzzles published. This week the challenge has been set to "identify all friday the thirteenths for a given timeframe". You can use any programming language you like, just please let people know which one you have decided to use! Read More

Python for JavaScript Programmers

Keywords: ,

I couldn’t find anything on the web that attempted to teach Python to readers who already knew JavaScript, so I thought I’d give it a shot, since a number of my friends at Mozilla don’t know much about Python but know JavaScript incredibly well. The languages actually aren’t that dissimilar–in fact, some of JavaScript’s latest features have been borrowed directly from Python.

I couldn't find anything on the web that attempted to teach Python to readers who already knew JavaScript, so I thought I'd give it a shot, since a number of my friends at Mozilla don't know much about Python but know JavaScript incredibly well. The languages actually aren't that dissimilar--in fact, some of JavaScript's latest features have been borrowed directly from Python. Read More