<

LEGO Turing machine

Keywords: , , , , , , , ,

Turing Top
Turing Middle
Turing Bottom
Here’s a great LEGO based Turing machine, Denis writes -

I chose to implement in Lego a slightly different version of the original Turing machine. Instead of having a bi directional tape, it uses a stack. When the symbol beneath the stack is read (and removed), the machine changes “states” and can add zero, one or two symbols on top of the stack.

This variation is maybe very different yet it is possible to show that this simple machine has the same capabilities than a Turing machine. Among other things, it can emulate a Turing machine placed on the stack.

I programmed a small interface (through an Access database so Microsoft Access must be installed on your computer) to enter an test simple Automaton With Append (AWA or AAA in French). Follow this link to download the demo: AAA.zip.

One reason to build the automaton with append instead of the original Turing machine was that I avoided building a bi directional (near) infinite tape.

Read more | Permalink | Comments |

Read more articles in LEGO |

Digg this!

Here's a great LEGO based Turing machine, Denis writes - I chose to implement in Lego a slightly different version of the original Turing machine. Instead of having a bi directional tape, it uses a stack. When the symbol beneath the stack is read (and removed), the machine changes "states" and can add zero, one or two symbols on top of the stack. This variation is maybe very different yet it is possible to show that this simple machine has the same capabilities than ... Read More

Microsoft has Pulled Project Sandcastle for Open Source Violations

Keywords: , , , , ,

In response to community pressure, Microsoft has removed project Sandcastle from their CodePlex website. This is a temporary move while they contemplate Sandcastles future.
Sandcastle is Microsoft’s answer to JavaDoc. Though in active use at Microsoft for several years, it is still a very rough project and appears to be no where near ready for general deployment. Prior to the release of .NET 2.0 and the announcement of Sandcastle the standard tool was the much more mature NDoc. Unfortunately NDoc is no longer being maintained

In response to community pressure, Microsoft has removed project Sandcastle from their CodePlex website. This is a temporary move while they contemplate Sandcastles future. Sandcastle is Microsoft's answer to JavaDoc. Though in active use at Microsoft for several years, it is still a very rough project and appears to be no where near ready for general deployment. Prior to the release of .NET 2.0 and the announcement of Sandcastle the standard tool was the much more mature NDoc. Unfortunately NDoc is ... Read More

Visual Studio (VS200) loosing it’s source control bindings

Keywords: , , , , , ,

VSTS2008 has, on occasion, lost it’s source control settings - specifically, the bindings to TFS server for a given solution and it’s projects.

This seems to be because the solution and project files are not being updated when you use the TFS Source Control Explorer to do a ‘Get Latest’  - a ‘feature’ of VS2008 which allows you to work disconnected/offline - however it seems to have an issue trying to reconnect itself.

To resolve we simply removed the local source directory and did a ‘Get Specific Version - get latest’.

RickSW had a similar experience.

Tim


VSTS2008 has, on occasion, lost it's source control settings - specifically, the bindings to TFS server for a given solution and it's projects. This seems to be because the solution and project files are not being updated when you use the TFS Source Control Explorer to do a 'Get Latest'  - a 'feature' of VS2008 which allows you to work disconnected/offline - however it seems to have an issue trying to reconnect itself. To resolve we simply removed the local source directory and did a ... Read More

NINE Questions with Beth Massi

Keywords: , , , , , , , ,

This time, I’m talking with Beth Massi of the Visual Basic Dev Center (http://msdn.com/vbasic/) and (http://msdn.com/vsto/) at Microsoft.  You can also find Beth’s blog at http://blogs.msdn.com/bethmassi/.  In case you can’t see it, the beer in her hand is a Victoria Bitter (get it?  VB!)

IMAGE_395

1. Where are you from?
I was born in San Pedro, CA (Southern California) but moved up to Northern California for college. I’ve been living primarily in the San Francisco Bay Area ever since.

2. Who do you work for? Give me the 10 second pitch on them. Why would I want to buy their product?
I’ve been working for Microsoft for a little over a year on Visual Studio. If I have to pitch VS to you then we’re in trouble ;-)

3. What brought you to your current employer?
Microsoft approached me to help revamp Visual Basic online content and community especially on our Developer Centers. Previously I was an Architect MVP working for an ISV in the HealthCare industry. I’ve been in and out of the consulting and HealthCare business for a long time and my favorite part of the job was always building app frameworks and mentoring people on programming best practices. I’ve always have had passion for the business application developer and this was a chance to really mentor people at a large scale. I couldn’t pass it up.

4. I’ve known you from your blogs for years, but that’s just one side of you. What’s something the world doesn’t know about you?
I think most people know I have a FoxPro background but they may not know that I was a Program Manager on the VFP 8.0 product and designed two of the IDE features; the Toolbox and the Task Pane Manager, back in 2002. That was the first time I worked for Microsoft but I was a contractor back then. Another (less boring) thing about me is that I love sports, especially baseball. I have Oakland season tickets — Go A’s!!

5. You went to TechEd2008 (Developers) this year. Was it your first time, and what did you think? Worth going back again?
It was my first time and I had a blast. Definitely worth going back again. I blogged about it here: http://blogs.msdn.com/bethmassi/archive/2008/06/09/i-survived-teched.aspx

6. Lots of folks find equal or greater value in the networking, rather than the sessions. Would you agree?  Did you have a favorite session or event?
Working the booth was definitely my favorite. The most fun I always have is talking to people about what they work on, then trying to understand their business challenges and hearing what technology decisions they’ve made. But I also had a great time at the parties too ;-)

7. I followed a lot of folks on Twitter during TechEd, and it seems like the way to go when out of town. What’s your take on Twitter?
I actually am on Facebook so I update status once in a while. I keep saying I should join Twitter but I don’t know if I have time to neglect another social app right now. ;-) I like Facebook because you can pick your “friends” (you define who they are) and you can use it as a very low maintenance way to keep in touch with friends/acquaintances. Twitter’s a much bigger pool and seems more of a way to keep tabs on what and who is going on in the industry.

8. Any non-technical hobbies? What are they and why?
Sports – okay more like watching Sports Center and going to baseball/football games in Oakland
Painting with acrylics – I needed some paintings in the house and thought “I can do that!”
Hiking / mountain biking – too many mountains around here, too little time
Racing /modifying cars – must get this one from my dad, last modification was bigger 300cc injectors and re-tune
Weight lifting – I’d like to be strong one day

9. Last of all, any tattoos?
Of course, I designed them myself. I leave it up to the imagination as to where they are. ;-)


This time, I'm talking with Beth Massi of the Visual Basic Dev Center (http://msdn.com/vbasic/) and (http://msdn.com/vsto/) at Microsoft.  You can also find Beth's blog at http://blogs.msdn.com/bethmassi/.  In case you can't see it, the beer in her hand is a Victoria Bitter (get it?  VB!) 1. Where are you from? I was born in San Pedro, CA (Southern California) but moved up to Northern California for college. I’ve been living primarily in the San Francisco ... 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

Storing BizTalk settings in custom configuration file using Enterprise Library

Keywords: , , , , , , , , ,

Choice of configuration settings storage is an important topic when it comes to enterprise BizTalk application planning. One of the many options is to use regular .Net configuration files. Some prefer this way over the Enterprise SSO database option for reasons of simplicity and familiarity. I wanted to show how it can be done with Microsoft Enterprise Library configuration application block.

In this case Enterprise Library configuration section is placed in the BTNTSvc.exe.config file while application settings are stored in a separate configuration file. The problem here is how do we make EntLib to load required settings file at runtime.  Its done by simple helper class CustomSettings that looks up registry entry for the location and name of the application configuration file and creates FileConfigurationSource with it. The registry entry can be created  by MSI installation package.

The initialization method of this static helper class looks like this (thread synchronization code omited for brevity):

          RegistryKey regKey = null;

          try
          {
             regKey = Registry.LocalMachine.OpenSubKey(@”Software\MyCompany\MyApplication”);
             configurationFile = Path.Combine(
             (string)regKey.GetValue(“ConfigDir”),
             (string)regKey.GetValue(“ConfigFile”));

              ExeConfigurationFileMap fileMap = new ExeConfigurationFileMap();
              fileMap.ExeConfigFilename = configurationFile;
              configuration = ConfigurationManager.OpenMappedExeConfiguration(fileMap, ConfigurationUserLevel.None);
              configurationSource = new FileConfigurationSource(configurationFile);

              //- store configPath in the settings
              configuration.AppSettings.Settings.Add(
              new KeyValueConfigurationElement(“configDir”, (string)regKey.GetValue(“ConfigDir”)));
           }
           catch (Exception ex)
           {
              Debug.WriteLine(“Exception while initializing Settings:” + ex.ToString());
              throw ex;
           }
           finally
           {
              if (regKey != null) regKey.Close();
           }

 Then it has method to access properties by name:

        public static string GetValue(string name)
        {
            KeyValueConfigurationElement entry = Configuration.AppSettings.Settings[name];

            if (entry == null)
                throw new ConfigurationErrorsException(“Key ‘” + name + “‘ is not found in the configuration file.”);

            return Configuration.AppSettings.Settings[name].Value;
        }

 Which is used as in:

string propertyValue = CustomSettings.GetValue(“propertyName”);

 


Choice of configuration settings storage is an important topic when it comes to enterprise BizTalk application planning. One of the many options is to use regular .Net configuration files. Some prefer this way over the Enterprise SSO database option for reasons of simplicity and familiarity. I wanted to show how it can be done with Microsoft Enterprise Library configuration application block. In this case Enterprise Library configuration section is placed in the BTNTSvc.exe.config file while application settings are stored in a separate configuration file. The problem here ... 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

Cache Or Session State - Similar But Different

Keywords: , ,

This week at TechEd Microsoft announce the Velocity project, a distributed in-memory object caching system, which got folks like Dare and ScottW talking about using a distributed caching solution for boosting the performance of web sites. That got me thinking more about the differences between Cache and Session State. Although they seem to be the same, and often caching solutions are used for storing session data, I’m not a big fan of putting session in a cache solution

This week at TechEd Microsoft announce the Velocity project, a distributed in-memory object caching system, which got folks like Dare and ScottW talking about using a distributed caching solution for boosting the performance of web sites. That got me thinking more about the differences between Cache and Session State. Although they seem to be the same, and often caching solutions are used for storing session data, I'm not a big fan of putting session in a cache solution Read More

Microsoft Offline Virtual Machine Servicing Tool

Keywords: , , , , ,

As we use more and more virtual machines, particularly for development, there is a risk because they don’t get updated by pushing critical security or virus updates and then they are fired up six months later we can have a security problem.

Microsoft has a solution for their virtual machine environment adding to the virtual machine management tooling -  the Offline Virtual Machine Servicing Tool. This turns on your VMs, updates them and shuts them down automatically.  You can find information about getting on the Beta at the link below.

Get it here


As we use more and more virtual machines, particularly for development, there is a risk because they don't get updated by pushing critical security or virus updates and then they are fired up six months later we can have a security problem. Microsoft has a solution for their virtual machine environment adding to the virtual machine management tooling -  the Offline Virtual Machine Servicing Tool. This turns on your VMs, updates them and shuts them down automatically.  You can find information ... Read More

WWDC Logistics Suck! Viva la TechEd Organization

Keywords: , , , , , , ,

Okay, I didnt know what to expect this being my first Apple WWDC. I am a vetran of ten Microsoft TechEd’s and a couple MECs. For the most part, Microsoft has cold the logistics of feeding, moving and running over ten thousand people around in an orderly fashion. People would joke about the strictness of the lunch ushers or the “soda and cookie nazis” that guarded the coolers and treats until just the right moment. We laughed at the guards that made us go a certain way and managed the ebb and flow of the geeky crowds. Having been at the Apple WWDC for one day, I laugh no more.

To say that there is no control over anything here would be generous. To wait through the ritualistic Jobsian hazing for this morning’s keynote was a case in painful point. My flight was late last night and I couldnt register on Sunday. Registration opens at 7am, three hours before the keynote. Even though I know the Apple fanboys are famous for lining up hours ahead of time, surely I say, registration would be a simple affair. Ha! How wrong I was. People waiting for the keynote seating and those waiting for registration are put together in one line. This I had to finally just accept as none of the guards or ushers at the front door could confirm this for me. I was told to just get in the big line. Later, some of my line mates confirmed this is indeed where I should be. Then the condensation of the line starts. As you move up you are instructed to make a line four across and the mass starts to condense. Then you are allowed in to the building in groups. At this point, you can continue on to wait in line or register. If you register you lose your place in line and have to then re-join the line wherever it happens to be when you are done registering. You are reminded not to lose your badge – you will not get another.

The way food is distributed is a nightmare. It is just wheeled out to the masses and you would think they just threw one hundred pounds of red meat to five thousand starving tigers. At 3pm, after a morning of nothing but coffee and little dixie cups of water, they put out Odwalla juices, cookies, fruit and chocolate. Chaos insued as people fought and shoved to get to the juices and snacks. People were literally shoving and pushing to grab a juice or a bag of chips. It was a repeat when they rolled out drinks and hot hors d’oeuvres at the reception later that evening. I didnt even stay. I couldnt find anything redeeming about the  mess.

Lining up to get in to sessions isnt any better. Most of them fill up and you have to get in queue as soon as the previous session ends if you want to get in. There are plenty of Apple “staff” around, but not many get involved to make things a good experience.

Apple, send some people up to visit Brian’s team at Microsoft that runs TechEd. Take notes.

And lastly, why the top-secret, CIA type security at all the sessions with regards to giving out information and guarding what is presented? Again, Microsoft beats you hands-down with their transparency, open blogging by staff and information sharing. There arent many (if any) things they wont share and discuss with you, especially at their top technical conference. Community, learning and sharing are key examples they set.


Okay, I didnt know what to expect this being my first Apple WWDC. I am a vetran of ten Microsoft TechEd’s and a couple MECs. For the most part, Microsoft has cold the logistics of feeding, moving and running over ten thousand people around in an orderly fashion. People would joke about the strictness of the lunch ushers or the “soda and cookie nazis” that guarded the coolers and treats until just the right moment. We laughed at the guards that made ... Read More