Skip to content

Instantly share code, notes, and snippets.

View TorNATO-PRO's full-sized avatar
👨‍🔬
Busyworking

Nathan Waltz TorNATO-PRO

👨‍🔬
Busyworking
View GitHub Profile
-- | Given a representation of an arithmetic expression, convert
-- | it into a format (involving assignments) such that every
-- | operand to an operator is either a variable or integer
-- | literal.
-- |
-- | For example:
-- | ```
-- | x * 3 + y + a * b
-- | ```
-- | ->
import Prelude
import Control.Alternative ((<|>))
import Data.Array (filter)
import Data.Array.NonEmpty (head, last)
import Data.Either (Either(..))
import Data.Int as Int
import Data.String (Pattern(..), split)
import Data.String.CodeUnits as String
import Data.Traversable (sum, traverse)
module Main where
import Prelude
import Control.Monad.ST (ST)
import Control.Monad.ST as ST
import Control.Monad.ST.Internal (STRef)
import Control.Monad.ST.Internal as STRef
import Data.Exists (Exists, mkExists, runExists)
import Effect (Effect)
-- In memory REST API for getting Animal information.
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ImportQualifiedPost #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE TypeOperators #-}
module SimpleAnimalAPI
@TorNATO-PRO
TorNATO-PRO / main.c
Created April 5, 2022 23:20
A snake program I threw together for a cyber security thing.
/**
* @file main.c
*
* @author Nathan Waltz (nathan.waltz@wsu.edu)
* @brief A snake game to demonstrate a covert channel.
* @version 0.1
* @date 2022-04-05
*
* @copyright Copyright (c) 2022
*
#
# A simple makefile for compiling three java classes
#
# define a makefile variable for the java compiler
#
JCC = javac
# define a makefile variable for compilation flags
# the -g flag compiles with debugging information
# 'make depend' uses makedepend to automatically generate dependencies
# (dependencies are added to end of Makefile)
# 'make' build executable file 'mycc'
# 'make clean' removes all .o and executable files
#
# define the C compiler to use
CC = gcc
# define any compile-time flags
#
# This is an example Makefile for a countwords program. This
# program uses both the scanner module and a counter module.
# Typing 'make' or 'make count' will create the executable file.
#
# define some Makefile variables for the compiler and compiler flags
# to use Makefile variables later in the Makefile: $()
#
# -g adds debugging information to the executable file
# the compiler: gcc for C program, define as g++ for C++
CC = gcc
# compiler flags:
# -g adds debugging information to the executable file
# -Wall turns on most, but not all, compiler warnings
CFLAGS = -g -Wall
# the build target executable:
TARGET = myprog
# build an executable named myprog from myprog.c
all: myprog.c
gcc -g -Wall -o myprog myprog.c
clean:
$(RM) myprog