Thursday, February 3, 2011

Management

Management in all business and organizational activities is the act of getting people together to accomplish desired goals and objectives using available resources efficiently and effectively. Management comprises planning, organizing, staffing, leading or directing, and controlling an organization (a group of one or more people or entities) or effort for the purpose of accomplishing a goal. Resourcing encompasses the deployment and manipulation of human resources, financial resources, technological resources, and natural resources.

continue reading

Wednesday, February 2, 2011

Newton's Laws of Motion

Newton's laws of motion consist of three physical laws that form the basis for classical mechanics. They describe the relationship between the forces acting on a body and its motiondue to those forces. They have been expressed in several different ways over nearly three centuries, and can be summarized as follows:
  1. First law: Every body remains in a state of rest or uniform motion (constant velocity) unless it is acted upon by an external unbalanced force. This means that in the absence of a non-zero net force, the center of mass of a body either remains at rest, or moves at a constant speed in a straight line.

continue reading

Capacitor

A capacitor (formerly known as condenser) is a passive electronic component consisting of a pair of conductors separated by a dielectric (insulator). When there is a potential difference (voltage) across the conductors, a static electric field develops in the dielectric that stores energy and produces a mechanical force between the conductors. An ideal capacitor is characterized by a single constant value, capacitance, measured in farads. This is the ratio of the electric charge on each conductor to the potential difference between them.

continue reading

Resistor

A resistor is a two-terminal electronic component which implements electrical resistance as a circuit element. When a voltage V is applied across the terminals of a resistor, a current I will flow through the resistor in direct proportion to that voltage. The reciprocal of the constant of proportionality is known as the resistance R, since, with a given voltage V, a larger value of R.

continue reading

Tuesday, February 1, 2011

Share printer from Windows XP from Windows 7

One common problem I have run into with clients is trying to share a printer connected to a Windows XP machine with Windows 7. There are lots of people out there that have USB connected printers attached to one computer, usually a Windows XP machine.

If you get a new laptop running Windows 7, it makes sense to share that printer so that any computer can print to it. Unfortunately, trying to print to an shared printer on XP from Windows 7 is not as simple as it should be !

continue reading

How to Host MultiSpeak Web Services on Your Windows PC?

You can load the MultiSpeak web service definitions on a local PC for convenience. In order to do so you must have Microsoft's Internet Information Server (IIS) loaded on the PC.

How to install IIS and load the MultiSpeak web services on Windows XP Professional:


  1. Insert the Windows XP Professional CD-ROM into your CD-ROM drive.
  2. From the Start Button, go to Settings, and then Control Panel.
  3. In the Control Panel window, select Add/Remove Programs.
  4. In the Add/Remove window, select Add/Remove Windows Components.
  5. In the Wizard window, check Internet Information Services, leaving all of the default installation settings intact. Click NEXT. Wait for Windows to finish loading IIS, then click FINISH.
  6. An Inetpub folder will be created on your hard drive.
  7. Open the Inetpub folder and find the folder named wwwroot.
  8. Unzip the file named MultiSpeakBusArchitecture Vxxx MMDDYY.zip into the wwwroot folder (where Vxxx is the version name, e.g. V30qb for Version 3.0, bus build q, and MMDDYY is the date of the release).
  9. Next we would like to make sure that the web server is running. Open the Control Panel, then Administrative Tools, and double-click on the "Internet Information Services" icon. While in the Internet Information Services window, click the plus sign next to the name of your computer to expand the tree view, then click the plus sign on the "Web Sites" entry to expand that entry, and finally expand the "Default Web Site" entry by clicking its plus sign. Right click on "Default Web Site" and make sure that the word "Start" is greyed out; if not, click on "Start" to start the localhost web server.
  10. Next we want to create a virtual directory for the MultiSpeak web services. Right click on the "Default Web Site" entry, choose "New" and then "Virtual Directory" from the menu. A Virtual Directory Creation Wizard window will open. Follow the instructions to create a new virtual directory. Begin by choosing an alias name for the directory. For this example I will use the alias to be "MultiSpeakWebServices", but you could use any folder name you like. Click NEXT. The Virtual Direction Creation wizard will open. Next browse to the directory that was created when you unzipped the web services in the C:/Inetpub/wwwroot folder in step 8. It should have the same name as the zip file you unzipped in step 8. Click the NEXT button to accept the directory. Next the wizard will ask you to choose "Access Permissions". Accept the default access permissions by clicking the "Next" button, and then the "Finish" button to complete the wizard. The Internet Information Services window should now show a new entry under the "Default Web Sites" tree entry that is named "MultiSpeakWebServices" (or whatever name you chose when you created the new virtual directory in this step).
  11. In the Internet Information Services Manager window, right click on the new virtual directory that you just created, choose properties, and the ASP.NET tab in the Properties window. Make sure that the ASP.NET version is 2.0 or higher. If the ASP.NET tab does not exist, or if ASP.NET version 2.0 or higher is not an option from the pull down menu in the ASP.NET version box, then you will have to download the .NET Framework Version 2.0 or higher from the Microsoft web site. You can get the .NET Framework Version 2.0 download from: http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en . This will download a file named dotnetfx.exe. Follow the setup wizard to install dotnetfx.exe and repeat this step to ensure that the virtual directory defaults to ASP.NET version 2.0 or higher.
  12. Open your browser and type in http://localhost/MultiSpeakWebServices/IndexPage.aspx . If you chose a different name than "MultiSpeakWebServices" for your new virtual directory in step 11, substitute that name in the URL shown above (for instance if you used "MyNewVirtualDirectory" instead of MultiSpeakWebServices" the URL would be http://localhost/MyNewVirtualDirectory/IndexPage.aspx .
  13. The opening index page for the Web services should come up.


 

Sorting the methods alphabetically

If the web service methods are not displayed alphabetically, you can force ASP.NET to sort the methods by modifying the DefaultWsdlHelpGenerator.aspx page which is used to create that test page (%windir%\Microsoft.NET\Framework\v1.1.4322\CONFIG\DefaultWsdlHelpGenerator.aspx).  ASP.NET gathers up the description information for the requested web service/asmx and passes that data to the help generator page.  You can modify this page however you see fit (or you can tell ASP.NET to look in a different location for the generation page by modifying the machine.config's system.web/webServices/wsdlHelpGenerator node).

If you look in this file, you'll see around line 1285:

        Hashtable methodsTable = new Hashtable();
        operationExists = false;
        foreach (ServiceDescription description in serviceDescriptions) {
                foreach (PortType portType in description.PortTypes) {
                        foreach (Operation operation in portType.Operations) {
                                string messageName = operation.Messages.Input.Name;
                                if (messageName == null || messageName.Length == 0) messageName = operation.Name;
                                if (messageName == operationName)  operationExists = true;
                                if (messageName == null) messageName = String.Empty;
                                methodsTable[messageName] = operation;
                        }
                }
        }
        MethodList.DataSource = methodsTable;

The code is creating a hashtable of all of the methods available in the Web service and is then binding the repeater you see on the test page that lists all of the methods to this hashtable.  This sheds light one why the methods appear to be in no particular order on the test page: the code is enumerating a Hashtable rather than an ordered list, so the ordering is at the mercy of the hash values generated for messageName and thus the buckets into which the operations are placed.

To get the methods listed in alphabetical order, all we need to do is make a one line change, from:
        Hashtable methodsTable = new Hashtable();
to
        SortedList methodsTable = new SortedList();

Instead of being placed into a Hashtable, the operations will all be placed into the SortedList, indexed by messageName.  When MethodList is bound to methodsTable (which we would probably also want to rename just for clarity's sake), methodsTable will be enumerated in alphabetical order (thanks to SortedListEnumerator), and thus the methods listed on the test page will be in alphabetical order.

continue reading