Posts

Newbie on the CCR Road

This post is about the CCR part of MRS, in particular I am going to do some simple examples about ports and a simple arbiter the Receiver. CCR components use ports to communicate with each other. Just like a human being uses speech, verbal speech, or mimicry to communicate, so do CCR components use ports to communicate with each other. Ports are used to Send a message to a particular receiver. Receive a message from a particular sender. In terms of CCR port, we have to define how the message, looks like that our port is going to receive. For this, we have to define the message's underlying data type or more precisely we have to create a port, which receives a message with some particular data type. Port < string > stringPort = new Port < string >(); This creates a new port, which is able to send and receive message of type string. Now, that we have defined our port, how are do we send a message? Nothing simpler than that, the port offers an instance method Post. This m...

A simple GreatestCommonDivisor service in C# - Part2

What if we wanted to consume our previously built GCD Service by a web browser, such as Internet Explorer? ... Nothing easier than that. In fact, with minimal effort we can implement this functionality. Firstly, we have to (1) declare that our service supports the HTTPQuery operation, secondly we have to (2) implement a handler for this HTTPQuery request, and thirdly we may (3) test the service with a browser. 1. Just add the HTTPQuery port to the GCD service's port set, which is defined in GCDTypes.cs (assuming that your service is named GCD). [ServicePort()] public class GCDOperations : PortSet {} So now that we have declared that our service is capable of understanding a HttpQuery action, we need to implement a routine, which handles such HttpQuery requests - a HTTPQueryGCDHandler. 2. Add the following lines to the GCD.cs [ServiceHandler(ServiceHandlerBehavior.Concurrent)] public virtual IEnumerator HTTPQueryGCDHandler(HttpQuery httpQuery) { if (! string .IsNullOrEmpty(htt...

A simple GreatestCommonDivisor service in C# - Part 1

I was finally able to get the GCD service up and running. Essentially it does nothing different than my previously posted GCD service, which is implemented in VPL. So to recall, this service computes the greatest common divisor of two positive integer numbers (inputx, inputy) and outputs the result as greatestcommondivisor. Based on this description of what the service does, the remainder of this post will guide you through the process of how I built such a rather simple DSS service using the MRS object model and C# as implementation language (as mentioned you could also choose VB.NET, C++). This kind of tutorial is divided into distinct steps beginning at creating a new service project to the final result being the service we want. Create new DSS Service The first thing one has to do in order to set up a basic GreatestCommonDivisor service is to create a new DSS service.We will do so by creating a new Visual Studio 2005 Project. More specifically it is a "Simple DSS Service (1.5)...

Online Lectures

Hi folks, I found this link about online learning in video form on another blog and thought I could repost it here http://videolectures.net/ so thanks goes out to http://smart-machines.blogspot.com/ Both links are available in the sidebar. Other online lectures http://www.researchchannel.org/prog/displayinst.aspx?fID=880 Christian

Microsoft Robotics Studio - First Sight

Microsoft Robotics Studio (MRS) I have recently come accross this great piece of new technology, offered for free by big MS [1]. MRS allows to program robots and other external devices via a visual programming language (VPL) or your prefered .NET programming language, such as VB.NET or C#. MRS main abstraction is a service. Assuming you use VPL, a service is graphically represented as a box. Services exist in their own space and can be combined via message passing. In fact, services communicate via a SOAP-like protocol. This communication act is graphically represented by wires between services. Where such a wire connects the output of one service to the input of another. It is up to the developer of a service to decide what a service does, i.e. what kind kind of messages a service understands and what output a service produces. Therefore one can develop rather simple services such as a NoOP service, which does nothing, to a more complex service that for example takes a picture from a...

Working the Snake - Python

I finally found my way to (Iron) Python[1][2] - well I did some Python in the beginning of my studies but lost focus after some time. The experience was quite impressive, since development time is greatly reduced by such a dynamic language. I managed to get some small programs running in less then 1 hour and of course I want to share them with you - precious audience. Since these are my first scripts, I assume that they are not quite correct/stable/... - they are simple and not very error-safe (no checking of arguments ) ... The first is some simple factorial program, which tries to find the greatest common divisor ( gcd )of two numbers by employing the fact that gcd (x, y) = gcd (y, r) where r = x mod y. Since I do not know how a scope for loops can be created (scoping a while/for loop) I did the routine recoursively. The second function builds on the first and is allows to ask whether some number x is a prime number by using the simple strategy of finding a gcd within the range of 1...
Well not much happened today. I was able to implement a triangle filling routine and read a bit on .NET remoting. I thought about how to implement a Z-Buffer for my small system and thought about homogenous clipping as well. The problems I have right now are: I want to implement basic triangle 2D screen-space clipping. Which itself is not a big deal but I do not want to implement a polygon filling scan-line algorithm. A polygon may be the outcome of a triangle clipped against a rectangular clip window. So what is there to do ? Either clip a triangle which produces a polygon and implement a "simple" scanline algorithm to fill that polygon. The other option is of course to split the triangle into a series of triangles. Either way has its intricacies. As mentioned in yesterday's I want to implement homogenous clipping for triangles. Which makes things even more complicated then a simple 2D clipper. The reason is that not only a triangle can be split into a series of triangle...