Monday, January 07, 2019

Excel to TestLink export macro

The attached macro exports test suites, test cases from Microsoft Excel to TestLink v1.9.7



https://drive.google.com/open?id=1ATP9tqOzRT5feMS-slxOk1mAtH-FsmTGkNl8TKYc0P4

Labels: , ,

Tuesday, August 23, 2011

5 rules of written communication

Always follow the rules of written communication:

Courtesy
Correctness
Conciseness
Completeness
Clarity

Tuesday, October 30, 2007

Assigned value starts with zero in C / C++

Any assignment that starts with zero is taken as Octal.
That is
Int x = 011;
Cout << x;
// will print 9
// will show 80 X 1 + 81 X 1 = 9

Thursday, December 08, 2005

Starting and Stopping a service using a Windows Application

Steps

0. Create a windows Form in a Windows Application

1. First add the ServiceProcess.dll (as a .Net reference to the project)
// Add this
2. using System.ServiceProcess;


// Class level object
3. private ServiceController objServiceController;

// Constructor
4. public Form1() { // // Required for Windows Form Designer support // InitializeComponent();
objServiceController = new ServiceController ("ServiceTest", "MPHWIME009");

}
5.
private void btnStartService_Click(object sender, System.EventArgs e) { if(objServiceController.Status == ServiceControllerStatus.Stopped) { objServiceController.Start(); objServiceController.Refresh (); } }
6.
private void btnStopService_Click(object sender, System.EventArgs e) { if(objServiceController.Status == ServiceControllerStatus.Running) { objServiceController.Stop(); objServiceController.Refresh (); } }

Wednesday, November 30, 2005

Validating XML with XSD


public bool VerifySchema(string xmlFilePath, string strXSDPath)
{
bool IsSucessful = true;
try
{
XmlTextReader r = new XmlTextReader("D:\\usr\\PRASANTH\\VCPP\\COMPlus\\06-10-2005T103217726-EMRGDIARY.xml");
XmlValidatingReader v = new XmlValidatingReader(r);
XmlSchemaCollection xsc = null;
XmlTextReader tr ;
tr = new XmlTextReader(strXSDPath);
xsc = new XmlSchemaCollection();
xsc.Add(null, tr);
v.Schemas.Add (xsc);
v.ValidationType = ValidationType.Schema;
v.ValidationEventHandler +=
new ValidationEventHandler(MyValidationEventHandler);
while (v.Read())
{
}
v.Close();
// Check whether the document is valid or invalid.
if (isValid)
Console.WriteLine("Document is valid");
else
Console.WriteLine("Document is invalid");
}
catch (Exception ex)
{
IsSucessful = false;
throw new Exception (ex.Message);
}
return IsSucessful;
}
///
/// Validation handler for the validation errors in the XML file
///

///
///
public static void MyValidationEventHandler(object sender, ValidationEventArgs args)
{
isValid = false;
Console.WriteLine("Validation event\n" + args.Message);
}

Tuesday, November 29, 2005

Stored Procedures for the xml insertion

CREATE TABLE RDCXMLFILES ( FILENAME VARCHAR2 (50), FILECONTENT XMLTYPE ) ;

CREATE OR REPLACE PROCEDURE spT1 (tmpBlob in out CLOB)ASdpBlob CLOB; BEGINDBMS_LOB.CREATETEMPORARY(dpBlob, False, 0);tmpBlob := dpBlob; END;/

create or replace procedure spInsertRDCXML(File_Name in varchar, File_Content in CLOB)ASv_FileName varchar(26);v_doc CLOB;v_xml XMLTYPE;BEGINv_FileName := File_Name;v_doc := File_Content ;v_xml := sys.xmltype.createXML(v_doc);INSERT INTO RDCXMLFILES VALUES (v_FileName, v_xml );END;/

XML Insertions for Oracle XMLType Large Files

private void MethodXX()
{
try
{
string fileName = "File.DAT";
StreamReader objSR = new StreamReader (@"..\\..\\File.DAT");
string completeFile = objSR.ReadToEnd ();
OracleConnection oraCon = new OracleConnection ();
oraCon.ConnectionString = "Data Source=RDCFEED;User Id=SYSMAN;Password=password;Integrated Security=no;";
oraCon.Open ();
OracleCommand oraCmd = new OracleCommand ("spT1", oraCon);
oraCmd.Transaction = oraCmd.Connection.BeginTransaction ();
oraCmd.CommandType = CommandType.StoredProcedure;
oraCmd.Parameters.Add(new OracleParameter("tmpBlob", OracleType.Clob)).Direction = ParameterDirection.Output;
oraCmd.ExecuteNonQuery();
OracleLob tempLob = OracleLob.Null ;
tempLob = (OracleLob )oraCmd.Parameters[0].Value;
byte [] fileInBytes;
Encoding temp = Encoding.Unicode ;
fileInBytes = temp.GetBytes (completeFile);
tempLob.BeginBatch(OracleLobOpenMode.ReadWrite);
tempLob.Write(fileInBytes, 0, fileInBytes.Length);
tempLob.EndBatch();
oraCmd.Parameters.Clear();
oraCmd.CommandText = "spInsertRDCXML";
oraCmd.CommandType = CommandType.StoredProcedure;
OracleParameter paramFileName = new OracleParameter ("File_Name", OracleType.VarChar);
paramFileName.Direction = ParameterDirection.Input ;
paramFileName.Value = fileName;
OracleParameter paramFileContent = new OracleParameter ("File_Content", OracleType.Clob);
paramFileContent.Direction = ParameterDirection.Input ;
paramFileContent.Value = tempLob;
oraCmd.Parameters.Add (paramFileName);
oraCmd.Parameters.Add (paramFileContent);
oraCmd.ExecuteNonQuery ();
oraCmd.Transaction.Commit ();
}
catch(Exception ex)
{
MessageBox.Show (ex.Message );
}
}

Wednesday, October 12, 2005

English Learning

Good English Dictionary at Merriam Webster
Interesting stuff Britannica