Skip to content

Instantly share code, notes, and snippets.

View fxdpntthm's full-sized avatar

Apoorv Ingle fxdpntthm

View GitHub Profile
@fxdpntthm
fxdpntthm / execl-example.c
Created February 15, 2017 03:17
Small sample program explaining how to use execl command
#include<stdio.h>
#include<errno.h>
#include<stdlib.h>
#include<strings.h>
#include<unistd.h>
#define BASH_EXEC "/usr/bin/bash"
#define LS_EXEC "/usr/bin/ls"
#define BSIZE 50
@fxdpntthm
fxdpntthm / execv-example.c
Last active May 18, 2023 15:24
small sample program to demonstrate execv function usage
#include<stdio.h>
#include<errno.h>
#include<stdlib.h>
#include<strings.h>
#include<unistd.h>
#define BASH_EXEC "/usr/bin/bash"
#define LS_EXEC "/usr/bin/ls"
#define BSIZE 50
@fxdpntthm
fxdpntthm / deg-seq.hs
Last active January 31, 2017 23:50
Hakimi-Havel graphical sequence algorithm
module DegreeSequence where
import Data.List
-- | degree sequence is given by a list of non-increasing numbers
degSeq :: [Int] -> [Int]
degSeq = sortBy (flip compare)
-- | a graphical sequence is a degree sequence that has a graphical representation
isGraphicSeq :: [Int] -> Bool