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: C/C++
Poodle fix for all the users of libcurl
As you know, SSLv3, most popular TLS protocol, is announced as victim of this Poodle vulnerability. After this announcement, all the enterprise community rushed to disable SSLv3 & SSLv2 protocols as part of their security enforcements. This page explains theContinue reading… Poodle fix for all the users of libcurl
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
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
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
Fast Bit Counting Routines
A common problem asked in job interviews is to count the number of bits that are on in an unsigned integer. Here are seven solutions to this problem. Source code in C is available. Iterated Count int bitcount (unsigned intContinue reading… Fast Bit Counting Routines