Subscribe for email updates

Get all updates to your inbox to stay tune.

Curve tracing programs - Draw sin(x) curve using Graphics programming in C

Learn how to draw curve tracing graphics programs in c language

Graphics programming in C

Learn how to write basic and advanced graphics programming in c language

Curve tracing programs - Draw Cos(x) curve using Graphics programming in C

Learn how to draw curve tracing graphics programs in c language

Make file tutorial

A step by step guide to learn how to write make file in Linux with examples

Wednesday, June 20, 2012

CLOC - Count Lines of source code

Hello readers, Recently i came to know about a tool which is very powerful and provides lots of details about your source code. It supports many languages including c,c++,scripting,xml,sql  etc.

The tool is "CLOC" which stands for 'Count Lines Of Code'.

Lets see how to download, how to use it with an example.

1. CLOC overview:

The following overview is taken from official website.

'cloc counts blank lines, comment lines, and physical lines of source code in many programming languages. Given two versions of a code base, cloc can compute differences in blank, comment, and source lines. It is written entirely in Perl with no dependencies outside the standard distribution of Perl v5.6 and higher (code from some external modules is embedded within cloc) and so is quite portable. cloc is known to run on many flavors of Linux, Mac OS X, AIX, Solaris, IRIX, z/OS, and Windows. (To run the Perl source version of cloc on Windows one needs ActiveState Perl 5.6.1 or higher, Cygwin, or MobaXTerm with the Perl plug-in installed. Alternatively one can use the Windows binary of cloc generated with perl2exe to run on Windows computers that have neither Perl nor Cygwin.)'


Wednesday, June 13, 2012

calculate MD5 Digest using EVP API


Previous articles discussed about calculating MD5 Digest and Calculating SHA Digest using openssl API and C program. The above two programs uses MD5 specific apis defined in openssl/md5.h and SHA specific apis defined in openssl/sha.h.

To Make all cryptographic  operations generic, openssl provided envelope APIs referred as "Digital envelopes". The EVP library provides a high-level interface to cryptographic functions. There are many EVP_ functions.

One of them is EVP_Digest. Here we are going to discuss how to use EVP_Digest API to calculate MD5 digest of a file.

Tuesday, June 12, 2012

List of thread Ids of a process in Linux using Proc


we have seen how to identify number of threads associated with a process in Linux. Read article Thread count in a linux process. Lets see the another tip to achieve the same task.

Using proc pseudo file system, one can get lot of useful information about a process and its thread. Each file in the proc file system has specific information about a process. Read about proc file system.

Wednesday, June 6, 2012

Thread count in a linux process

Have you ever tried to see how many threads a process has ?
You might have used GDB to figure this out. Is it possible to get number of threads a process has without using GDB ?

Yes, It is possible. Lets see two ways of figuring this out without using GDB.


Tuesday, June 5, 2012

Calculate MD5 Digest - Using BIO APIs



Previous articles discussed about calculating MD5 Digest and Calculating SHA Digest using openssl API and C program. The above two programs are written using stdio file input output APIs. These APIs are platform dependent.

To avoid this problem, openSSL provides an I/O abstraction , it hides many of the underlying I/O details from an application. That is BIO API library. This post explains calculate MD5 digest using openssl,BIO APIs.