6 July, 2006, 01:01
Another open source tool appears on the web.
DownloadSquadLink Console: Tabbed command prompt for Windows.
This one is really useful to me. We are using console when we can’t do everything with mouse clicks. For example, we might want to compile a cs from the visual studio command prompt, we can’t do from the normal command prompt because the assemblies are not referenced(of course you can do, but it is not out of the box)
Console is an application that allows you to use the command prompt. Not only the command or cmd but also anything we would like. Here is the settings windows that we do the configurations.

Using the settings window we can add new consoles. Actually we can directly edit the exml file. Here is my xml file configured for visual studio 2003 and 2005 command prompt, and windowspower shell
<tabs>
<tab title="Console">
<console shell="" init_dir=""/>
<cursor style="0" r="255" g="255" b="255"/>
<background type="0" r="0" g="0" b="0">
<image file="" relative="0" extend="0" position="0">
<tint opacity="0" r="0" g="0" b="0"/>
</image>
</background>
</tab>
<tab title="cmd">
<console shell="cmd.exe" init_dir=""/>
<cursor style="0" r="255" g="255" b="255"/>
<background type="2" r="0" g="0" b="0">
<image file="" relative="0" extend="0" position="0">
<tint opacity="65" r="0" g="0" b="0"/>
</image>
</background>
</tab>
<tab title="Windows Power Shell" icon="C:\Program Files\Windows PowerShell\v1.0\powershell.exe">
<console shell="powershell.exe" init_dir=""/>
<cursor style="8" r="255" g="255" b="255"/>
<background type="0" r="0" g="0" b="0">
<image file="" relative="0" extend="0" position="0">
<tint opacity="0" r="0" g="0" b="0"/>
</image>
</background>
</tab>
<tab title="Visual Studio 2005 Command Prompt">
<console shell="cmd.exe /k ""C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat"" init_dir=""/>
<cursor style="11" r="255" g="255" b="255"/>
<background type="0" r="0" g="0" b="0">
<image file="" relative="0" extend="0" position="0">
<tint opacity="0" r="0" g="0" b="0"/>
</image>
</background>
</tab>
<tab title="Visual Studio .NET 2003 Command Prompt">
<console shell="cmd.exe /k "C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\vsvars32.bat" init_dir=""/>
<cursor style="4" r="255" g="255" b="255"/>
<background type="0" r="0" g="0" b="0">
<image file="" relative="0" extend="0" position="0">
<tint opacity="0" r="0" g="0" b="0"/>
</image>
</background>
</tab>
</tabs>
Here is the result what we get for it.


Very useful and we have got the power of console…
29 June, 2006, 01:09
In a custom control, I wrote a general function to handle the object equality. I have used it several times without error. However today I sent a value type instead of a reference type, and some unexpected results occured.
The base class object have some basic methods which other classes override those methods. One of the methods is Equals. Although equals usually compares references of objects,many .Net framework internal classes implement that method like in System.String class it can compare the contents. When we go back to object and call equals method the object polymorphism occurs . This is not true for value types. When we box the value type as a reference type, it creates a new memory space for that. So for each boxing a separate memory block allocated, and the reference comparison normally returns false. Here is the sample how it behaves.
using System;
public class MyClass
{
public static void Main()
{
string s1 = "can";
string s2 = "can";
Console.WriteLine("s1== s2 {0}",s1==s2 );
object oo1 = new object();
object oo2 = new object();
Console.WriteLine("oo1== oo2 {0}",oo1==oo2 );
decimal d1 = 5;
decimal d2 = 5;
Console.WriteLine("d1== d2 {0}",d1==d2 );
object o1 = d1;
object o2 = d2;
Console.WriteLine("o1== o2 {0}", o1==o2);
Console.ReadLine();
}
}
Below is the output
s1== s2 True
oo1== oo2 False
d1== d2 True
o1== o2 False
_
27 June, 2006, 03:55
I was surfing, and found that brilliant search engine. Hakia

According to its features It has a new algorithm for the searching called MAQ. The results looks relevant served with a simple user interface. It is worth a try. Below is the quotes..
MAQ versus Indexing
hakia’s designers broke from decades-old indexing method and built a much better system (called MAQ) to enable semantic analysis of Web pages, and “meaning-based” search. The information density in the MAQ system is significantly higher than that of a typical index table. The MAQ data resides on a distributed network of fast servers using a mosaic-like structure.
25 June, 2006, 03:45
I was surfing on the developer site of Windows Live . I saw the new (for me) MSN SDK. Lastly there was only activity sdk which is not real SDK.
The new Messenger Add-in SDK is included inside MSN Live messenger, althought the site says it is a seperate download.
Anyway to use it,
- Add the key to windows registry -> HKEY_CURRENT_USER\ Software\ Microsoft\ MSNMessenger\ AddInFeatureEnabled 1

- Create a class library project
- Add MessengerClient.dll which is located on the messenger installation directory
- Use the interface to create the addin, the code will guide you on how to do that
public class AutoReply : IMessengerAddIn
{
MessengerClient m_messenger;
void IMessengerAddIn.Initialize(MessengerClient messenger)
{
m_messenger = messenger;
AddInProperties properties = m_messenger.AddInProperties;
properties.Creator = "Can Erten";
properties.Description = "Test";
m_messenger.IncomingTextMessage += new EventHandler<IncomingTextMessageEventArgs>
(m_messenger_IncomingTextMessage);
}
void m_messenger_IncomingTextMessage(object sender, IncomingTextMessageEventArgs e)
{
m_messenger.SendTextMessage("Unavailable..." + e.UserFrom.FriendlyName, e.UserFrom);
if (m_messenger.LocalUser.Status != UserStatus.Online)
{
string message = m_messenger.LocalUser.PersonalStatusMessage;
m_messenger.SendTextMessage("Unavailable..." + e.UserFrom.FriendlyName, e.UserFrom);
}
}
}
As you can see it is very simple and well developed class library. Thanks to MSN team for being that clear.
- The different part for the delivery is the assembly name. You need to change the assembly name to the namespace and class name.
- Run Msn messenger, in the options windows, addin tab add your dll file. That’s it.
Finally you might want to debug the addin. To do this in visual studio, attach to msn process, make breakpoints and here we go, just debug as normally you do 

24 June, 2006, 01:54
Invoking web services is not much different in windows communication foundation. We have a tool svcutil that generates the interface and the proxy class automatically, I think this will be included later on the IDE. For this sample call I just used google search service. We use the command svcutil with the wsdl adress of the web service, and the program generates a config file and a class file for the service to use.
C:\\Program Files\\Microsoft Visual Studio 8\\VC>svcutil d:\\api\\googleapi\\googlesea
rch.wsdl
Microsoft (R) Service Model Metadata Tool
[Microsoft? .NET Framework, Version 3.0.3906.22]
Copyright (c) Microsoft Corporation. All rights reserved.
Generating files...
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\GoogleSearch.cs
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\output.config
There is also a graphical utility for doing that operation called “Service Configuration Editor”, however as far as I can see this tool only takes the output of the config file. It provides easy to use property controls for modifying the file but the command line versions generated file has some more details on it.
Below is the snippets from the generated file.
The config file specifies the services ABCs ->
<client>
<endpoint address="http://api.google.com/search/beta2" binding="basicHttpBinding"
bindingConfiguration="GoogleSearchBinding" contract="GoogleSearchPort"
name="GoogleSearchPort" />
</client>
ServiceContract setting in the config file specifies the interface implemented the ServiceContractAttribute class. Here is the GoogleSearchPort interface is the serviceContract.
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace = "urn:GoogleSearch")]
public interface GoogleSearchPort
{
[System.ServiceModel.OperationContractAttribute(Action = "urn:GoogleSearchAction", ReplyAction = "*")]
[System.ServiceModel.XmlSerializerFormatAttribute(Style = System.ServiceModel.OperationFormatStyle.Rpc, Use = System.ServiceModel.OperationFormatUse.Encoded)]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(ResultElement))]
[return: System.ServiceModel.MessageParameterAttribute(Name = "return")]
GoogleSearchResult doGoogleSearch(string key, string q, int start, int maxResults, bool filter, string restrict, bool safeSearch, string lr, string ie, string oe);
I just created a new console application project and added these files to the project. Also added the reference “System.ServiceModel” for wcf to work. The rest is the same as previously calling web services, the generated proxy class includes all the information to get the data from the config file. So only thing I have to do is to instanciate and use it.
class Program
{
static void Main(string[] args)
{
using (GoogleSearchPortProxy proxy = new GoogleSearchPortProxy())
{
string key = "secretCode";
string query = "wcf";
GoogleSearchResult res = proxy.doGoogleSearch(key, query, 0, 10, false, "", false, "", "", "");
foreach (ResultElement r in res.resultElements)
{
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine(r.title);
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(r.URL);
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine(r.snippet);
}
Console.ReadLine();
}
}
}
Here is the output of the web service results.
Windows Communication Foundation
http://msdn.microsoft.com/webservices/indigo/default.aspx
Explore "Indigo," a set of .NET technologies for building and managing
service-oriented systems.
Get Connected
http://msdn.microsoft.com/windowsvista/prodinfo/what/connected/default.aspx
The Windows Communication Foundation Web service APIs make it easy to bui
ld and consume secure, reliable, and transacted Web services.
Welcome to WCF
http://www.wcf.co.uk/