Monday, March 03, 2008

Microsoft Robotics Studio Links


 

MSDN Robotics Forums

http://forums.microsoft.com/MSDN/default.aspx?ForumGroupID=383&SiteID=1


 

Microsoft Robotics Downloads

http://msdn2.microsoft.com/en-us/robotics/aa731520.aspx

Introductory Courseware for Microsoft Robotics Studio

http://www.microsoft.com/downloads/details.aspx?FamilyId=F294C8E7-6617-4DD8-8354-7E97F3167E1A&displaylang=en


 

Channel 9 Videos

Robots and BizTalk Services

http://channel9.msdn.com/ShowPost.aspx?PostID=386824

Microsoft Robotics Studio and Lego Mindstorms NXT

http://channel9.msdn.com/ShowPost.aspx?PostID=325661

Microsoft Robotics Tour:

Part 1:CCR, VPL, Simulation - http://channel9.msdn.com/Showpost.aspx?postid=303072

Part 2:CCR, VPL, Simulation - http://channel9.msdn.com/Showpost.aspx?postid=303135

Singapore Sumo-Robot How-To

#1: Getting the Robotics Bits

http://channel9.msdn.com/Showpost.aspx?postid=309026

#2: Understanding Your Robot's Inputs and Outputs

http://channel9.msdn.com/Showpost.aspx?postid=309686

#3: Building Your First Robot

http://channel9.msdn.com/Showpost.aspx?postid=309685

#4: Understanding Your Robot's Code Methods

http://channel9.msdn.com/Showpost.aspx?postid=309688


 


 


 

CCR Programming - Jeffrey Richter and George Chrysanthakopoulos

http://channel9.msdn.com/showpost.aspx?postid=219308

Microsoft Robotics Studio

http://channel9.msdn.com/ShowPost.aspx?PostID=206574


 

    

Walter Stiers - Academic Relations Team (BeLux)

http://blogs.msdn.com/walterst/archive/tags/Robotics/default.aspx


 


 

Windows Embedded Academic Program (WEMAP)
The Windows Embedded Academic Program (WEMAP) helps provide a better understanding of the Windows CE and Windows XP Embedded operating systems to academia. As a participant in this program, you can learn how to educate the next generation of embedded developers on Windows Embedded technologies. You can participate in a variety of programs, including student competitions like the Windows Embedded Student ChallengE and discounted hardware programs, such as the Hardware Empowerment Program.


 

HowTo Videos: Robotics and .Net fundamentals

http://blogs.msdn.com/dawate/archive/2007/12/14/robotics-and-net-fundamentals-series.aspx

http://channel8.msdn.com/Posts/HowTo-Videos-Robotics-and-Net-fundamentals/

Monday, February 11, 2008

Return an exit code from a C# Windows Application

To exit an Windows Forms Application, we have the option to use Application.Exit() or the System.Environment.Exit().

The difference is discussed here (http://geekswithblogs.net/mtreadwell/archive/2004/06/06/6123.aspx) and the suggestion was made to use System.Environment.Exit() for console applications since it can accept an exit code which will be returned to the Operating System.

But for Windows applications, what should we do ?

I have tried to modify the Main function definition so it will have a return value, a lesson learned from C/C++ old days, then add a property to my main form to indicate if my application would report a success or failure report

And so, my Main function will look like this :

 

        [STAThread]
       
static int Main(string[] arguments)
        {

            Application.EnableVisualStyles()
;
           
Application.SetCompatibleTextRenderingDefault(false);

           
MainForm mainForm = new MainForm();
            Application.Run(mainForm)
;

           
//return exit code
            // 0  : no problem
            // -1 : error occured

           
int exitCode = mainForm.Succeeded == true ? 0 : -1;
            return
exitCode;
           

       
}

 

This approach can be extended to report different exit codes for different scenarios (think about MSBuild or NAnt exit codes).

Saturday, February 09, 2008

Guidelines for Test-Driven Development

 

Jeffrey Palermo has an interesting article on MSDN about TDD in .net development, discussing the process of Red-Green-Refactor, benefits of TDD and what characterizes a good unit test

Microsoft Sync Framework

According to Microsoft definition; the Sync Framework is "a comprehensive synchronization platform enabling collaboration and offline for applications, services and devices with support for any data type, any data store, any transfer protocol, and network topology."

What does it mean for us developers?

Hmmm, I am trying to think about an example here. Take Microsoft Outlook and Microsoft Groove as an example; both are collaboration platforms, can work offline and online, and support many protocols.

Look at the technical options that we have now if we need to build something like this:

  • Database Replication
  • Offline Application Block
  • WCF with Queued Messages

I don't know of any other option, but each of the above options has different approach and has issues and limitations as well.

The Sync framework is coming to put a uniform way of building applications like Outlook without pain, the framework is now addressing Data, files and feeds synchronization in addition to having the ability to role your own providers; think about synchronizing an Oracle database with an Outlook folder or a SharePoint list.

The concept is discussed in Introduction to the Microsoft Sync Framework Runtime , while the motivations, goals and approach is briefly discussed by Moe Khosravy the Lead Program Manager on his article Next Generation Synchronization Framework or watch him talk about it on Channel8 http://channel8.msdn.com/Posts/Sync-your-Facebook-with-your-phone-Whats-the-Sync-Framework/

There is also a number of Screen casts http://blogs.msdn.com/sync/archive/2008/01/14/microsoft-sync-framework-sync-services-for-ado-net-video-webcasts.aspx

So, what are you waiting for, go ahead and download the SDK (http://www.microsoft.com/downloads/details.aspx?FamilyId=C88BA2D1-CEF3-4149-B301-9B056E7FB1E6&displaylang=en) and start playing.

Interested on the subject, or have played with it … let me know by commenting on this post

Friday, February 08, 2008

[Architecting Desktop Applications with 2.0] MSDN Webcast series

MSDN Webcast: Architecting Desktop Applications with 2.0 (Part 01 of 15): Smart Clients and N-tier Design (Level 300)

MSDN Webcast: Architecting Desktop Applications with 2.0 (Part 02 of 15): Design Patterns for GUI Applications (Level 300)

MSDN Webcast: Architecting Desktop Applications with 2.0 (Part 03 of 15): Creating Dynamic and Configurable Applications (Level 300)

MSDN Webcast: Architecting Desktop Applications with 2.0 (Part 04 of 15): Architecting a Secure Desktop Application (Level 300)

MSDN Webcast: Architecting Desktop Applications with 2.0 (Part 05 of 15): Designing the Business Tier (Level 300)

MSDN Webcast: Architecting Desktop Applications with 2.0 (Part 06 of 15): Designing the Data Access Tier (Level 300)

MSDN Webcast: Architecting Desktop Applications with 2.0 (Part 07 of 15): Best Practices for Developing N-Tier Applications (Level 300)

MSDN Webcast: Architecting Desktop Applications with 2.0 (Part 08 of 15): Turning Tiers into Components (Level 300)

MSDN Webcast: Architecting Desktop Applications with 2.0 (Part 09 of 15): Build, Build, Build, Test, Test, Test (Level 300)

MSDN Webcast: Architecting Desktop Applications with 2.0 (Part 10 of 15): Multithreading for Performance and Responsiveness (Level 300) (Level 300)

MSDN Webcast: Architecting Desktop Applications with 2.0 (Part 11 of 15): Designing Distributed Applications Around Remote Access (Level 300) (Level 300)

MSDN Webcast: Architecting Desktop Applications with 2.0 (Part 12 of 15): Designing Distributed Applications Around Web Services (Level 300) (Level 300)

MSDN Webcast: Architecting Desktop Applications with 2.0 (Part 13 of 15): Securing a Distributed Application (Level 300) (Level 300)

MSDN Webcast: Architecting Desktop Applications with 2.0 (Part 14 of 15): ClickOnce Deployment (Level 300) (Level 300)

MSDN Webcast: Architecting Desktop Applications with 2.0 (Part 15 of 15): Learning from Agile Development (Level 300) (Level 300)

Tuesday, January 15, 2008

How to get the month name according to the current windows local

I used the DateTimeFormatInfo class to get the month name as a string by calling this method GetMonthName(int) , then I found that it retrun the English representation of the month even in non english regional settings (Windows locale).

The culture aware class is the CultureInfo, which can be accessed from the Current thread, so simply call:

System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.GetMonthName(monthNumber);

to get a culture specific month name.

Thursday, January 10, 2008

Blogs/Casts I read and recommend

ARCast.TV - Exotic Locations, Global Perspective and Architectural Insight… It’s ARCast.TV with Ron Jacobs

RSS Feed :http://channel9.msdn.com/rss.aspx?ShowID=26

 

Scott Hanselman - Scott Hanselman's Thoughts on .NET, WebServices, and Life , also listen to his PodCast (www.hanselminutes.com)

RSS Feed : http://feeds.feedburner.com/ScottHanselman

 

MSDN Nuggets - not the stuff we eat ... its MSDN Nuggets

RSS Feed :  http://www.microsoft.com/uk/msdn/nuggets/rss.aspx?t=all

 

 Daniel Moth a Microsoft geek and a former MVP (lots of Screen Casts)

RSS Feed : http://feeds.feedburner.com/DanielMoth

VS2005 Gotcha : DataTable with Seed = 0 will kill you

Sunday, December 09, 2007

MSBuild Exec Task fail if we have any space in the command

To execute an external application using MSBuild, I use the built in Exec task. A problem we all face is spaces in command line we execute. and this makes MSBuild unhappy , the task will fail.

To correct that, we should surround the command path and any paramters with quotation, a trick from old DOS days, but this also will not work as MSBuild is an XML file and " is reserved for attributes.

The trick here is to use the " in MSBuild scripts whenever you need a " , this makes your script really ugly, here I found another guy who rasie the issue to an upper level.

 

My prefered way to do that is to have the external application and each parameter in a separate property; just to make the command line itself more readable.

 

<Project>
 <PropertyGroup>
    <ToolPath>&quot;my-external-application.exe&quot;</ToolPath>
    <Param1>&quot;my-param-value&quot;</Param1>
    <Param2>&quot;my-param-value&quot;</Param2>
 </PropertyGroup>

<Target Name="Run-External-App">
 <Exec Command="$(ToolPath) $(Param1) $(Param1)"/>
</Target>

</Project>

Wednesday, November 21, 2007

Give Your Applications Mapping Capabilities

A couple of articles have been published on devx (thanks to Bruno Zambetti) discussing the development of mapping applications using .NET and Google Earth.

Part 1:http://www.devx.com/webdev/Article/35662

Part 2 : http://www.devx.com/webdev/Article/35744

Wednesday, November 07, 2007

Capture a Screen Shot using C#

Capture an image of the Screen using this C# code http://www.developerfusion.co.uk/show/4630/

Thanks to James Crowley (http://www.jamescrowley.co.uk/ )

Tuesday, October 30, 2007

Thursday, October 25, 2007

Congratulations for all of my colleagues and myself for the promotions
Go Worx Go …




Microsoft UI Automation Library

As part of Windows Vista, Microsoft has released the new GUI automation library available through the .NET Framework 3.0, so it works on Windows Vista, Windows XP and Windows Server® 2003. Moreover, it works seamlessly with both Windows Presentation Foundation UIs and HWND-based applications.

For more information:

http://msdn2.microsoft.com/en-us/library/ms747327.aspx

http://msdn.microsoft.com/msdnmag/issues/07/03/Bugslayer/default.aspx

http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=352&SiteID=1




Monday, October 22, 2007

Spy ++, # and other Windows Debugging tools

Remember the Spy++ tool shipped with Visual Studio long ago?

I was a fan of this tool, as it tells me the internals of any windows application and the controls that compose its GUI.

Trying to use this tool with .net application will tell you no useful information, because it examines the Win32 structures inside the application which is not the same thing from a .net developer point of view.

A bunch of tools will provide the same features but for .net world, here are some links:


 

.NET Object Spy and InvokeRemote

Runtime Object Editor

http://www.codeproject.com/csharp/RuntimeObjectEditor.asp

http://www.acorns.com.au/Projects/Hawkeye/


 

A simple Windows forms properties spy

Managed Spy

Dynamic Event Hooks for Object Debugging

Automate applications using VBScript

I have just discovered a nice feature in Windows Script Host; which is the SendKeys method in the WScript.Shell class.

Using this method to send a stream of key strokes to another application would allow for remote automation or (for example) creating application tutorials.

Cut the following code, paste in a text file and give it .vbs extension, double click the file to run it and watch J


 

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run "notepad"

WScript.Sleep 100

WshShell.AppActivate "Untitled - Notepad"

WScript.Sleep 100

WshShell.SendKeys "Hello"

How to set the value of a DataGridView cell programmatically

The new DataGridView control doesn't have a Cells collection, but it has Rows,Columns and a default indexer.

To set the value of a certain cell in the DataGridView, it is easy to use the indexer like this:

dataGridView1[1,1].Value = "New Value";

Or, we can do that using the Rows collection:

Rows[1].Cells[1].Value = "New Value";

For more information about the DataGridView see those links:

A New Grid Control in Windows Forms

http://www.windowsclient.net/Samples/Go%20To%20Market/DataGridView/DataGridView%20FAQ.doc

Monday, August 20, 2007

Nunit + MSBuild

 
 

I wanted to run the test cases for my libraries as a part of building them, so I will make sure every time I have to build the libraries that they are functioning correctly.

 
 

Unfortunatly, the built-in tasks will not do that be default; the option here is to call the nunit-console using the

 
 

Then doing a simple google search, I found MSBuildCommunityTasks.

 
 

MSBuild Community Tasks Project is an open source project for some missing and useful tasks, one of them is the Nunit task.

 
 

After I got the installer,I tried to find the documentation and see how to use the Nunit task, but I haven't seen any example on how to use it.

 
 

Try and Error; this is the last resort, but I also got some information by looking into the source code of the Nunit task itself to know how to allow the task to find the nunit-console.exe.

 
 

I followed the following steps to actually get my Nunit test cases to run during my build.

 
 

1 - import the MSBuild.Community.Tasks.Targets files:
 

<Import
Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>

 
 

2 - Copy the Nunit\bin directory to my source code folder tree under a top level folder; example:

 
 

\My-Source-Code

+--\Tools

+--\Nunit

+--\MyLibrary

 
 

3 - Created a property in the Msbuild script to hold the relative path to nunit binaries

 
 

<PropertyGroup>

<NUnit-ToolPath>.\Tools\NUnit</NUnit-ToolPath>

</PropertyGroup>

 
 

 
 

4 - My library and its tests are part of the same solution, so the MSBuild task <<MSBuild> will build the library and the tests at the sametime.

<MSBuild

Projects="MyLibraryWithTests.sln"

Targets="Build"

/>

 
 

5 - Then come the play with Nunit task to actually run the test cases:

 
 

<NUnit

Assemblies=".\bin\Debug\MyLibrary.Tests.exe"

ToolPath="$(NUnit-ToolPath)"

DisableShadowCopy="true"

/>

 
 

Notice that:

I had to set the DisableShadowCopy="true" to run the tests in their original location and instruct nunit-console not to make a copy in a temp folder

 
 

6 - I liked to organize a little bit, so I have created 2 targets; one for the build and one for the test, then a single target to call them both; which makes my build script looks like this:

 
 

 
 

 
 

 
 

 
 

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="BuildAll" >

 
 

<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>

 
 

<!--ToolsSettings-->

<PropertyGroup>

<NUnit-ToolPath>..\Tools\NUnit</NUnit-ToolPath>

</PropertyGroup>

 
 


 

<Target Name="BuildAll" DependsOnTargets="MyLibrary;MyLibrary-Test">

</Target>


 

<Target Name="MyLibrary">

<MSBuild Projects="MyLibrary.sln" Targets="Build" />

</Target>

 
 


 

<Target Name="MyLibrary-Test">

<NUnit

Assemblies=".\bin\Debug\MyLibrary-Test.exe"

ToolPath="$(NUnit-ToolPath)"

DisableShadowCopy="true"

/>


 


 

</Target>

 
 

 
 

</Project>

Monday, August 13, 2007

ITWorx wins Microsoft's 2007 Partner of the Year Award

ITWorx , one of the largest software professional services firms in the region, and Microsoft Gold Certified Partner, has received yet another award to add to its portfolio, winning '2007 Microsoft Custom Development Solutions Partner of the Year, Web Development', at the Microsoft Worldwide Partner Conference on July 11th in Denver, Colorado.

More info:
http://www.microsoft.com/presspass/press/2007/jun07/06-11FinalistPOTYPR.mspx
http://www.itworx.com/News/Press+Releases/ITWorx+Counted+Among+Top+Finalists+for+the+2007+Microsoft+Partner+of+the+Year+Award+in+Custom+Develo.htm
http://www.ameinfo.com/128502.html

Go Worx Go

Thursday, June 07, 2007

Microsoft Plans Visual Studio Shell

Visual Studio Shell, a scaled-down version of Visual Studio, it is intended to allow developers to build Visual Studio functionality atop their own vertical tools, as well as integrating various languages such as Fortran, Cobol, Ruby and PHP.

Developers will be able to use Visual Studio Shell in two modes: integrated and isolated. The integrated mode is built upon Microsoft's existing Visual Studio Premier Partner Edition 2005, primarily used by language integrators.

The isolated option allows partners and developers to build products on top of Visual Studio, with the ability to customize the experience so that it doesn't necessarily look like Visual Studio
for more information visit Visual Studio Extensibility , and Craig Skibo's WebLog