Sample program to write basic odbc program to connect/ query/ disconnect with unicode data. //— BEGIN PROGRAM SOURCE #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <sqlext.h> int DBP_SQLSERVER = 1; int DBP_DB2 = 0; int DBP_POSTGRES = 0; #define ENVContinue reading… Introduction to basic ODBC programming
Category: Source Code
Base64 Encoding and Decoding in C
Base64 is a method of encoding arbitrary data as plain ASCII text. It is one of the techniques employed by the MIME standard to send data other than plain text. Base64 encoding takes three bytes, each consisting of eight bits,Continue reading… Base64 Encoding and Decoding in C
SSL Authentication in HTTP : Using cURL – Part 3
Open source curl is one of best & stable http client tool as well as library. In this article, we’ll see how can we use libcurl library as well as curl command line utility for two way client authentication. UsingContinue reading… SSL Authentication in HTTP : Using cURL – Part 3
xerces-c: C++ SAX2 Parser
Basics of validating xmls with a given schema in C++. 1. Create parser instance. SAX2XMLReader* parser = XMLReaderFactory::createXMLReader(); 2. Set required features to parser instance as follow. // Enable the parser’s schema support parser->setFeature(XMLUni::fgXercesSchema, true); // Schema validation requires namespaceContinue reading… xerces-c: C++ SAX2 Parser
xerces-c: C++ SAX2 Parser
Basics of validating xmls with a given schema. 1. Create parser instance. SAX2XMLReader* parser = XMLReaderFactory::createXMLReader(); 2. Set required features to parser instance as follow. // Enable the parser’s schema support parser->setFeature(XMLUni::fgXercesSchema, true); // Schema validation requires namespace processing toContinue reading… xerces-c: C++ SAX2 Parser
Building DOM tree by reading an xml file in Java
import java.io.*; import javax.xml.parsers.*; import org.w3c.dom.*; import org.xml.sax.*; public class BasicDom { public static void main(String[] args) { Document doc = parseXmlFile(“infilename.xml”, false); } // Parses an XML file and returns a DOM document. // If validating is true, theContinue reading… Building DOM tree by reading an xml file in Java
Bubble Sort
The source code for bubble sort. #include #define NUM 6 void swap(int arr[], int i, int j) { int tmp = arr[i]; arr[i] = arr[j]; arr[j] = tmp; } main() { int arr[NUM],i,j; // start reading nums for(i=0;i
Shell Sort
Source code for shell sort is provided below. #include #define NUM 6 main() { int arr[NUM],i,j, incr=2; // start reading nums for(i=0;i
Insertion Sort
Source code for Insertion sort in C language. #include #define NUM 6 main() { int arr[NUM],i,j; // start reading nums for(i=0;i
Selection Sort
The code for the selection sort in C lang is provided below. #include #define NUM 6 void swap(int arr[], int i, int j) { int tmp = arr[i]; arr[i] = arr[j]; arr[j] = tmp; } main() { int arr[NUM],i,j; //Continue reading… Selection Sort