Skip to content

Instantly share code, notes, and snippets.

View sacko87's full-sized avatar

John T. Saxon sacko87

View GitHub Profile
@sacko87
sacko87 / regex.01.c
Created September 11, 2012 09:26
Regular Expressions in C
/**
* file : regex.match.1.c
* author : John Saxon (09-Mar-2010)
* revision : $Rev$
*
* this program is to demonstrate how to use the POSIX regular
* expression functions (defined in regex.h).
*
* this particular program shows you how to simply say whether
* a give string (argv[1]) is a match for a given regular
@sacko87
sacko87 / Base.cpp
Last active December 10, 2023 09:14
Factory Pattern in C++ with templates (using the confusingly recurring template and registry patterns)
#include "Base.h"
Base::Base() :
IsRegistered_(false)
{ }
Base::Base(bool isRegistered) :
IsRegistered_(isRegistered)
{ }
@sacko87
sacko87 / Makefile
Created August 11, 2012 21:42
IPC Sender and Receiver Example
# the compiler to use
CC =gcc
# flags to send to the compiler
CFLAGS = -O2 -Wall
# executable names
SENDER_EXEC = Sender
RECEVIER_EXEC = Receiver
# compile the message queue programs