Category Archives: Snippets

C++ || Snippet – How To Display The Size Of A File Using Stat

The following is sample code which demonstrates the use of the “stat” function calls on Unix based systems. The stat function returns

C++ || Snippet – How To Use Message Queues For Interprocess Communication

The following is sample code which demonstrates the use of the msgsnd, msgrcv, and msgget function calls for use with message queues

C++ || Snippet – Multi-Process Synchronization Producer Consumer Problem Using Threads

The following is sample code which demonstrates the use of POSIX threads (pthreads), aswell as pthread mutex and condition variables for use

C++ || Snippet – How To Create And Use Threads For Interprocess Communication

The following is sample code which demonstrates the use of POSIX threads (pthreads), aswell as the pthread_create, and pthread_join function calls on

C++ || Snippet – How To Override The Default Signal Handler (CTRL-C)

The following is sample code which demonstrates the use of the “signal” function call on Unix based systems. Signals are interrupts delivered

C++ || Snippet – How To Use Popen & Save Results Into A Character Array

The following is sample code which demonstrates the use of the “popen” function call on Unix based systems. The “popen” function call

C++ || Snippet – How To Use Fork & Pipe For Interprocess Communication

The following is sample code which demonstrates the use of the fork, read, and write function calls for use with pipes on

C++ || Snippet – How To Use Fork & Execlp For Interprocess Communication

The following is sample code which demonstrates the use of the “fork” and “execlp” function calls on Unix based systems. The “fork”

Python || Custom Random Number Generator Class MyRNG

The following is sample code for a simple random number generator class. This random number generator is based on the Park &

Python || How To Install PyPdf Using Python 3

“pyPdf” is a pure Python library built as a PDF toolkit. It is capable of: • Extracting document information (title, author, ...),

Python || How To Create An Executable Using Cx_Freeze

Python is a simple and powerful programming language for scripting and application development. Various GUI packages available for Python makes it a

C++ || Snippet – Simple Timer Class Using The Clock Function

The following is sample code for a simple timer class using the “clock()” function. The “clock” function returns the processor time that

C++ || Snippet – Custom “Shuffle” Function For Arrays

The following is a custom “Shuffle” function which shuffles the contents of an array. This function rearranges each item within the array

C++ || Snippet – Custom “For Each” Iterator Function For Arrays

A “For Each” algorithm is a function that iterates over all the elements contained in a storage collection, and calls a separate