How-to verify COM dll is indeed registered, with C#.

I´ve been looking for a way to verify, from within Visual C#, whether a required COM component dynamic link library (DLL) has  indeed been registered in the system and that our dependent class can you use without fear.

In the way to the solution I found approaches using kernel32 LoadLibrary and FreeLibrary calls which actually only verify the existence of the component but nothing about whether it has been registered in the Windows registry.

The most reliable way to do this verification is to use a static method named GetTypeFromProgID,  available in the TYPE class, from the CLR,

This method attempts to load a particular type from the DLL under test.
If successfull it should return the full qualified type. Otherwise, if the DLL is not registered, it will render a NULL result.

This method takes a string parameter which is the ProgID. If progID is a valid entry in the registry and a type is associated with it; otherwise, Nothing

The sample code:


using System;
using System.Runtime.InteropServices;
namespace ComDllVerification
{
    class Program
    {
        static void Main(string[] args)        
        {
            try
            {
                Type T = Type.GetTypeFromProgID("WIA.DeviceManager");
                
                if (T != null)
                {
                    // Safe to go...
                }
            }
            catch (COMException ex)
            {
                // Handle the COM exception here...
            }
        }
    }
}

Git rebase

Source control management has never changed so much its paradigm until GIT.

Git revolutionized they way you deal and manage source code repositories breaking traditional concepts as those found in CVS and SVN.

Working on a branch of one of the mainstream projects I participate, the time came where a merge is needed.
Both master (trunk) and our branch (remote, because it sits on the server) have evolved and merging wouldn´t be easy.

To make things safer I decided to bring the master changes into our branch and for that purpose I choose to use “git rebase” that was expected to “replay” the master changes from the begining and finally apply our changes on top of them, all onto our branch.

The command is pretty easy:

$ git rebase origin/master

If there are many conflicts, they can be resolved manually. Rebase will stop on each conflict, allowing you to fix it and procced or abort.

To proceed:

$ git rebase –continue

To abort:

$ git rebase –abort.

You can also skip a patch by issuing:

$ git rebase –skip

 

And one very important note. Once it´s finished, NO commits or push commands are needed. I made that mistake once and ended up with a merge commit on top of the actual rebase. So don´t doi it! :)
Everything should be rebased on your remote server.
Verify the Git logs or use gitk and you´ll how ended up.

The good point is that commit history, authors, etc..are all preserved.That´s good.

 

Synergy weird behavior on Windows 7

To keep up the pace of running multiple development environments simultaneously, xp, win7, and to avoid dealing with multiple mice/keyboards combinations, I downloaded and installed Synergy, a little tool that allows you to control many computer desktops from just one of them, extending and embracing the combined dektops with a unique experience.

It allows your mouse to roll from one machine´s desktop to the other one, transparently.

My setup has a the Windows 7 box configured as the Synergy server, so others (clients) desktops connect to it to get access to the input devices.

Everything worked smoothly until a recent windows automatic update that took phace las Thursday, September 15th.
Albeit the server service was up and running and client machines connected ok to the server one, the server consistently refused to share its input devices with the clients.

After experimenting with different configurations, I realized the problem was related to the Synergy Windows service accessing the user desktop area.

Fixing this situation, involved:

  1. Disable the Synergy Windows service.
  2. Granting the Synergy app shortcut administrator execution privileges.
  3. Set the app Synergy app to automatically startup with Windows (through msconfig).

Now Synergy is back to normal! ;)

Getting started with semanticweb

From the very first time you attempt a domain name search to begin the setup of your own website to the moment when you “launch” your site on the Internet, a great deal of thought and creativity goes into making your own website. If you have ever attempted this feat, you know just how much goes into it – you want the right domain name, the right format, adequate capabilities, and the ability to adapt and manage your site as easily as possible. Fortunately, professional web hosting companies like Network Solutions simplify the process as much as possible, allowing people the ability to focus almost entirely on the creative side of the experience rather than worry about the technological side, which can be very complicated. However, if you have ever been more curious about how things work on the Internet, it is well worth researching things like what is called the Semantic Web, in order to gain a greater understanding of the Internet’s abilities and inner-workings.

For those who are unfamiliar or merely curious, the Semantic Web is, in simple terms, a sort of data network that exists beneath the surface of the World Wide Web. More specifically, the Semantic Web is defined on its Wikipedia page as “a web of data that facilitates machines to understand the semantics, or meaning, of information on the World Wide Web.” Essentially, the Semantic Web exists to make automated, machine reading of the Internet as fast as possible, so that Internet data can be accessed and understood quickly by machines, allowing the Web to run more smoothly. The idea is to help machines to understand human-related Internet activity, and be able to respond to our requests and needs.

Ultimately, the simplest way to think of the Semantic Web is that it is the “how.” In other words, the Semantic Web represents how the Internet works. Every time you search a phrase, look up a word, purchase something online, etc. you are making a demand of the Internet to respond to whatever it is you have requested. However, it is not up to you to sift through the entire World Wide Web to actually find or accomplish whatever it is you want – this is where the Semantic Web comes in. The idea is that it allows the Internet to automatically take care of the searching, or the completion of whatever task you have laid before it. There is of course more to the Semantic Web than this, as it is a complex and ever-evolving concept, but this has been a basic introduction for anyone curious to find out more about the ways in which the Internet works.

In our Breathing Semantics blog, you will find some examples of semantic web implementations using the FOAF (Friend Of A Friend) ontology concepts.