Protos Project

Components:

We currently have two components. First, an Artificial Intelligent component that was designed in .Net and is used to keep history of updates for records in the database. The component learns from the history and make a decision whether the new update is acceptable/reasonable or not. Second, a mathematical component that calculates the addition, subtraction and multiplication  of two matrices.

(1) The first component is built using .NET webservice and is a component that does self-learning.

Instructions to use the component:

  • Download and install SOAP Toolkit 3.0
  • Start VB6 and add new Standard EXE to the project
  • Click on project from the toolbar and select References
  • Add "Microsoft Soap Type Library v3.0"
  • Add the following to your code:

Dim soapClient3 As MSSOAPLib30.SoapClient30
Set soapClient3 = New MSSOAPLib30.SoapClient30

Call soapClient3.mssoapinit ("http://68.41.98.10/employeeWebApplication/employeeWebService.asmx?wsdl")                                                                                          
If Err <> 0 Then
MsgBox "initialization failed " + Err.Description
End If

'Now call the webmethod
soapClient3.WebMethodName()
 

  • There are two web methods
    • UpdateEmployee: accepts an xml string parameter that contains the new employee information.

      For example:

      dim strUpdate as string

      strUpdate=  "<employee UID= '1'>" & _

      "<SSN>11111111</SSN>" & _

      "<FirstName>Tom</FirstName>" & _

      "<LastName>Khalil</LastName>" & _

      "<StreetAddress>1232 Chase</StreetAddress>" & _

      "<City>Dearborn</City>" & _

      "<State>MI</State>" & _

      "<ZipCode>48126</ZipCode>" & _

      "<DepartmentID>123</DepartmentID>" & _

      "<Title>Information analyst</Title>" & _

      "<StartDate>12/2/1999</StartDate>" & _

      "<EndDate></EndDate>" & _

      "<ManagerFirstName>Paul</ManagerFirstName>" & _

      "<ManagerLastName>Tim</ManagerLastName>" & _

      "<Salary>65000</Salary>" & _

      "</employee>"

      soapClient3.UpdateEmployee(strUpdate)

      The Logic: The component will keep track of the last five updates for each record in an XML. Then, it will calculate the reasonable

                          changes that could be performed on the record. An error will occur if the new changes are not reasonable. If the changes

                          were reasonable, then the update will be performed and the component will recalculate the new reasonable changes.

       

    • ExportDBtoXML: accepts two parameters: mdbfileName and tableName

      For Example: soapClient3.ExportDBtoXML  ("C:\employee.mdb","employee")

      The result: employee.xml will be created and will contain the information in the table

(2) The second component that we created is an ActiveX control that does an import of data from an Excel sheet to an Access table.

To use this component, you should already have the database table created.

We get the input Excel spreadsheet information and the output Access table(Database)information from a Dialog box, where you can browse through your system files and choose the correct file.

We have given a combo box which will show all the tables that are already there in the database that you have selected from which you can pick the table to which the data should be imported.

After the suitable files are selected, the import function could be invoked with the 'Import from Excel to Access' command button.

The zipped file containing the control as an .ocx file can be downloaded from this link: Click here to Download

Once you have the file extracted in your machine, add it to your application from the references(it would have been registered as 'XML2TableControl').

The control has been provided with a property to set and get the Filename. It has also been provided with the basic events like Click, Double Click and Key Press. These events could be used with other controls in your application.

(3) The third control was created as an ActiveX control that reads data from an XML file and displays it in a tabular format which completely describes the data as specified in the XML file.

To use this component, all you need is a file called 'library.xml' in the application path that has the proper XML formatted string. If the XML is not of the correct syntax, the program is going to complain. So, care has to be taken to provide the correct XML. (This is because, we have hard-coded the code to look for this xml file)

As soon as the control is initialized, it is made to read the XML file and load it into a rich text box in the control. The control's function can be invoked by using the 'Get XML Data' command Button.

The result is made to appear on a list box.

The input XML file could be something like:

<?xml version="1.0"?>

<Class>

<Student>

<sname>Deepika </sname>

<course> cse542 </course>

<cname>Rapid Prototyping </cname>

<credits> 4 </credits>

<days> M/W </days>

<time> 3:30PM - 5:17PM </time>

</Student>

<Student>

<sname> Anjani </sname>

<course> cse542 </course>

<cname> Rapid Prototyping </cname>

<credits> 4 </credits>

<days> M/W </days>

<time> 3:30PM - 5:17PM </time>

</Student>

<Student>

<sname> Swapna </sname>

<course> cse542 </course>

<cname> Rapid Prototyping </cname>

<credits> 4 </credits>

<days> M/W </days>

<time> 3:30PM - 5:17PM </time>

</Student>

</Class>

The zipped file containing the control as an .ocx file can be downloaded from this link: Click here to Download

Once you have the file extracted in your machine, add it to your application from the references(it would have been registered as 'Excel_DB').

We didn't find a situation where we can provide some property for this control other than the usual properties that it already has. But we do have provided the basic events like Click, Double Click and Key Press. These events could be used with other controls in your application.

IMPLEMENTATION

The main function that does the XML to Tabular format operation uses the following:

    Dim xmlDoc As New MSXML.DOMDocument (Microsoft XML, Version 2.0 reference is included for this).
    • Dim objNodeList As MSXML.IXMLDOMNodeList
      Dim objDomEleChild As IXMLDOMElement
      Dim objNodeMap As MSXML.IXMLDOMNamedNodeMap
      Dim objNamedItem As MSXML.IXMLDOMNode
  • After XML parsing, the data is printed in the form of a table using the ListBox's AddItem method.

(4) The Fourth component is also an ActiveX control that does cosine similarity calculation.

Cosine Similarity is a technique (or calculation method) that is derived from vector theory.

In Information Retrieval, it is used to indicate (or measure) the degree of similarity between two documents, or between a document and a query.

In Bioinformatics, it is used to indicate (or measure) the degree of similarity between two samples(species).

The cosine of the angle between two vectors is defined as:

sqr[inner product of vectors v,w]

cos(theta) = -----------------------------------------------------

sqr[(length of vector v)^2].sqr[(length of vector w)]

The concept of this metric could be explained by understanding the basics of information retrieval and data mining. Assume we have something like:

D1 D2 D3

Q1 0.3 0.8 0.1

Q2 0.2 0.3 0.6

Q3 0.7 0.1 0.1

Q4 0.2 0.9 0.3

In the matrix above Q1,Q2, Q3 and Q4 are considered to be queries and D1,D2 and D3 are considered to be documents. The numbers between them indicate what is called the 'normalized correlation coefficient' which signifies how relevant (or) how matching is that particular query for that particular document.

So, the input to our control is going to be this correlation coefficient matrix and the output would be the distance matrix that results from the application of cosine similarity measure on it.

IMPLEMENTATION

The input as mentioned before is going to be the correlation matrix that is input to the control via a text area and the output distance matrix is going to be given out in another text area. The control also requires us to provide the number of rows and columns in the matrix being input.

The output by the way is going to be like:

0.00 0.54 0.50

0.54 0.00 0.63

0.50 0.63 0.00

You can see from the output how the diagnols are 0's indicating that the cosine similarity between D1 and D1(between the same documents) is 1 .i.e., cos(0) is 1.i.e., theta is 0.

Properties have been set to let and get the values of the Number of rows and Number of Columns fields and also the main Data Input field.

Bais events such as mouse click, mouse double click and mouse key press are all included for use by other controls.

The zipped file containing the control as an .ocx file can be downloaded from this link: Click here to Download

Once you have the file extracted in your machine, add it to your application from the references(it would have been registered as 'cosineSimilarityControl').

(5) The Fifth control is used to get the data from an Access table and disply it in table format.

This control is hence going to be giving the same kind of output as that of the XMl to Table control except that it is going to differ in its input source.

This does have properties and events associated with it.

The zipped file containing the control as an .ocx file can be downloaded from this link: Click here to Download

Once you have the file extracted in your machine, add it to your application from the references(it would have been registered as 'AccessToTable').

(6) The sixth one is an ActiveX control to do matrix operations like:
    matrix addition,
    matrix subtraction and
    matrix multiplication.

The component basically does all the above said operations on symmetric matrices.

Since, the size of the matrix is something that controls the other controls in it, it has been made as a property for this control. This is hence available for the user at runtime to let or set its property.

The basic events for any control like the Click event, the Double click event and the Key press event are also made available to the user, when they want to integrate it with the other components.

The zipped file containing the control as an .ocx file can be downloaded from this link: Click here to Download

Once you have the file extracted in your machine, add it to your application from the references(it would have been registered as 'MatrixControl').

IMPLEMENTATION

All the matrix operations here are accomplished via a single function called the 'Matrix_Operations'. This function accepts 4 parameters. The parameters are the two matrices and their sizes respectively. In our case, anyways, the sizes are going to be the same.

Design wise, the control is going to have an area to get the sizes of the matrices, according to which, it is going to populate the control with the number of input boxes. The input is required to be entered as rows of the matrices. Once the input is supplied, the control has a 'Calculate' command button to invoke its function, the result of which is displayed on a textarea with appropriate comments.

Hosted by www.Geocities.ws

1