Label Cloud

Wednesday, December 20, 2006

Blogger is out of Beta

Finally, The new and very much improved Blogger is out of beta. I had my blog hosted on blogger since the beginging and used the beta since well....beta. The main issue was API changes and there fore clients had to adjust whenever google made a backend change. Now that its out, hopefully, client support will improve as well.

Now if only Windows Live Writer can support all the blogger functionality and get to the RTM stage.


Share/Save/Bookmark

Wednesday, December 13, 2006

A VERY cool example of compiler optimization

http://blogs.msdn.com/abhinaba/archive/2006/12/13/why-can-we-only-use-constants-in-a-switch-case-statement.aspx

Reading Microsoft Blogs, I saw a great example of compiler optimization. Apparently, C# compiler is able to optimize case statement that is based on string constants. Once the number of cases reaches a specific level (example was with 7 cases including default) , the compiler switched from using if statement, to pre-populating values into a dictionary and doing a value lookup.

It really is amazing how good compilers are these day and proves once again

  • Do not try to outsmart the compiler
  • Do not over-optimize too early
  • Profile early, Profile Often


Share/Save/Bookmark

Monday, December 04, 2006

First experience in Office 2007 at work - Issue resolved

After a few days calls with Microsoft and submitting what seemed to be the first support incident related to Office 2007, I am up an running.

There was a problem with importing a NULL key in the old Outlook ergistry settings

The final solution was to remove (rename) the old Outlook key - HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook.

Update: According to the final report from MS, the problem was with the PONT_STRING key - HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Options\General] "PONT_STRING"=hex:33,32,2c,00 00 was the error value. Removing the key should have solved the problem as well.


Share/Save/Bookmark

Tuesday, November 21, 2006

Using the SQL Server Hosting Toolkit

I've been developing SQL Server based project in the office and on my laptop. Synchronizing the database changes both schema and data is complicated and I was looking for good tool to help with it. Well, now there is one.

Microsoft released a 2nd CTP of SQL Server Hosting Toolkit. Its soul purpose is to create a script to recreate schema and data of a SQL serve database. All it takes is two clicks using the wizard.


Share/Save/Bookmark

Thursday, November 16, 2006

WCF - Processing untyped messages from MSMQ binding

Now that .NET 3.0 is finally released, I am putting in some hours to see how it can be implemented in our infrastructure. Up front the power and flexibility of the framework is a bit overwhelming, however, the tools that are included are great. For example Service Configuration Editor has a great way to specify every setting required and optional for setting up WCF communication.

One of the components that I was looking to replace is a MSMQ Message Processing application. Basically it is a custom written MSMQ Trigger service. Well.. here goes.

WCF includes a binding for interconnecting with non-WCF MSMQ implementations. I've created the final prototype from the basic service sample, and created a ServiceContract interface and implementation class

[ServiceContract()]
public interface IMessageProcessor
{
   [OperationContract(IsOneWay = true)]
   void ProcessMessage(MsmqMessage<Stream> msg);
}

public class MessageProcessor : IMessageProcessor
{
   public void ProcessMessage(MsmqMessage<Stream> msg)
   {
      using (StreamReader sr = new StreamReader(msg.Body))
      {
         MessageBox.Show("Hello: " + sr.ReadToEnd());
         sr.Close();
      }
   }
}

Then added created a main form, and added start/stop events
 
internal static ServiceHost myServiceHost = null;
internal static void StartService()
{
   // Instantiate new ServiceHost
   myServiceHost = new ServiceHost(typeof(MessageProcessor));
   myServiceHost.Open();
}
internal static void StopService()
{
   // Call StopService from your shutdown logic (i.e. dispose method)
   if (myServiceHost.State != CommunicationState.Closed)
   myServiceHost.Close();
}
private void MainForm_Load(object sender, EventArgs e)
{
   StartService();
}
private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
{
   StopService();
}

The next step is to setup the app.config configuration file.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
   <system.serviceModel>
      <behaviors>
         <serviceBehaviors>
            <behavior name="Throttling">
               <serviceThrottling maxConcurrentCalls="2" />
            </behavior>
         </serviceBehaviors>
      </behaviors>
      <bindings>
         <msmqIntegrationBinding>
         <binding name="NewBinding0" exactlyOnce="false" serializationFormat="Stream" />
         </msmqIntegrationBinding>
      </bindings>
      <services>
         <service behaviorConfiguration="Throttling" name="WCFMQListener.MessageProcessor">
            <endpoint address="msmq.formatname:DIRECT=OS:.\private$\testqueue" binding="msmqIntegrationBinding" bindingConfiguration="NewBinding0" contract="WCFMQListener.IMessageProcessor" />
         </service>
      </services>
   </system.serviceModel>
</configuration>

The most time I've spent was to figure out how to read the non-xml formatted message. The key is to declare the method as

void ProcessMessage(MsmqMessage<Stream> msg);

and to adjust binding in the configuration file

serializationFormat="Stream"

The message can be read just as easily as a binary array.


Share/Save/Bookmark

Wednesday, November 15, 2006

First experience in Office 2007 at work

I took a plunge, and installed Office 2007 RTM on my office PC. Here's the picture of my Outlook starting up

And that's about all it does... Since this is my only office PC, if I can not get this resolved today (And MS Premium Support is already involved) - its a clean rebuild!!!
Ohh well, its a good exercise..


Share/Save/Bookmark

Monday, November 06, 2006

Because of a nail...

Yesterday, I heard a great Japanese saying

"Because of a nail, a horseshoe was lost Because of a horseshoe, a horse was lost Because of a horse, a message was not delivered Because a message was not delivered, a war was lost"

Its a great way to reiterate the importance of the weakest link. It is something to apply in development, architecture, work in general and pretty life as a whole.


Share/Save/Bookmark

Friday, October 27, 2006

Google Video Search is on the main google page

I wonder if this is the result of the you-tube buyout, our they were just ready. But either way it is cool. Now nothing stops you from finding that video you were looking for :)


Share/Save/Bookmark

Sunday, October 22, 2006

Disable Security Warning in IE7

One of the new security futures available in IE7 is a warning to correct your security settings if they are not considered "Secure Enough"

Microsoft does not give a good way to disable a warning, and for a good reason. The warning can only be disabled via a registry setting usually set by the group policy.

Here's the setting:

Key: HKCU\Software\Microsoft\Internet Explorer\Security\DisableSecuritySettingsCheck KeyType: DWORD Value: 0x1


Share/Save/Bookmark

MSBuild Community Tasks

I've tried to convert some of the projects from using NANT to MSBuild process, however, the lack of available build tasks was always preventing my from converting any of the advanced scripts.

Now I stumbled upon MSBuild Community Tasks. It covers a lot of the tasks supported by NAnt or NAnt contrib projects. There are still a lot of things to be desired, however, it provides some of the key tasks to make project creation easy. Together with tasks provided by MSBuild, the functionality is very comparable to NANT combined with NANT Contrib. Very, very impressive.

Here's an important yet easy example: Autoincrement version number of the build:

  • Open the .csproj file in notepad or your other favorite text editor
  • Add import directive to the one that already exists in the .csproj file
  • <Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" />
  • Uncomment BeforeBuld and AfterBuild targets located at the end of the project
  • Add Version task to the BeforeBuild:
    <Version VersionFile="version.txt" RevisionType="Increment"> <Output TaskParameter="Major" PropertyName="Major" /> <Output TaskParameter="Minor" PropertyName="Minor" /> <Output TaskParameter="Build" PropertyName="Build" /> <Output TaskParameter="Revision" PropertyName="Revision" /> </Version>
  • Add AssemblyInfo task to the BeforeBuild target
    <AssemblyInfo CodeLanguage="CS" OutputFile="AssemblyVersion.cs" AssemblyVersion="$(Major).$(Minor).$(Build).$(Revision)" AssemblyFileVersion="$(Major).$(Minor).$(Build).$(Revision)" />
  • Remove AssemblyVersion and AssemblyFileVersion from AssemblyInfo.cs file
  • Add AssemblyVersion.cs file to the project

Now compiling the project will adjust version number in version.txt, and use the new version in generating AssemblyVersion.cs

Easy and Extremely Useful

Some Related Links:


Share/Save/Bookmark

Query ExPlus 2.0.1.1 is out

Two main items the release

  1. Drag and Drop from explorer
  2. Automatic packaging of Source and Binary files.

The second item is requires installed MSBuild Community Tasks from http://msbuildtasks.tigris.org/

More on that later


Share/Save/Bookmark

Friday, October 20, 2006

Using IE 7 and liking it, alot

Now that Internet Explorer 7 is finally released, I've tried it again as my main browser. I'm using it, and I'm liking it.

The UI is a bit different, and it takes me a few seconds to find the new STOP button. The menu is also in a different place. The interface is nice and clean. The tabs are finally an integrated part of the UI, instead of an ugly addon from MSN Toolbar.

Really no complains so far.


Share/Save/Bookmark

Tuesday, October 10, 2006

Query ExPlus 2.01 beta is out

  • Serious bug with saving list of connection strings is fixed.
  • Settings are now saved using .NET 2.0 settings API
  • help for command line arguments (-help)

Check it out at http://www.sourceforge.net/projects/queryexplus


Share/Save/Bookmark

Query ExPlus 2.0 beta is now on SourceForge

I've now officially merged code for the Query ExPlus 2.0 into the sourceforge repository. Look for the new release under www.sourceforge.net/projects/queryexplus

Here are some main highlights of the release:

  • Writen in .NET 2.0 - You will need Framework 2.0 installed as it is not backwards compatible
  • Code refactored to make it easier to extend
  • Support for command line parameters to automatically connect to the server
  • Copy data as CSV from the grid output is implemented

All new development is done on the 2.0 branch. I am not planning to backport new functionality unless I feel that it is very critical to the application use.

Please check out the source and the compiled appplication. As always, any comments are welcome.


Share/Save/Bookmark

Thursday, October 05, 2006

Back from Microsoft

The Microsoft trip was a blast. Great campus. Technology is everywhere. Very, very cool. I really liked the idea of providing every guest with a tablet PC loaded with OneNote. As you take notes or jot things down on the screen, everything is saved to a USB key chain. At the end of the trip, you take the key chain with you.

Some points from the trip:

  • It is all about the collaboration. People and applications share data, contacts, files, ideas, and everything in between.
  • Sharepoint is everywhere. It is the presentation server from MS. Every application we saw had a hook into Sharepoint.
  • Sharepoint will have a huge overhaul. It will now support extranet deployment. It will support a knowledgebase, mixed mode authentication, and is the content management solution.
  • Vista will be COOL. Great new technologies around performance, security and virtualization.
  • All server applications from Microsoft are designed from the ground up to be centrally managed and monitored. The idea is that with current technology, applications should manage themselves, or should be managed by other applications. But not by people. This idea is broader then just Microsoft. Microsoft is a part of the consortium behind Service Modeling Language
  • .Net - Well.. For one, there was once again a comment on ".NET 3.0 really should have been called .NET 2.5". It will be interesting to see how Microsoft responds to MONO. So far, it seems that Microsoft is discounting MONO as a viable .NET architecture. As far as Microsoft is concerned,  .NET means Windows. However, if the whole "Collaboration" idea is to work, it has to be beyond Windows.


Share/Save/Bookmark
Directory of Computers/Tech Blogs