Skip to content

Instantly share code, notes, and snippets.

View ryanmr's full-sized avatar

Ryan Rampersad ryanmr

View GitHub Profile
<?php
require 'vendor/autoload.php';
/*
Using https://github.com/thephpleague/color-extractor
for library
http://stackoverflow.com/questions/1855884/determine-font-color-based-on-background-color
for brightness text
*/
let_exp:
LET declarations IN sequence_list END (A.LetExp {
decs = declarations,
body = A.SeqExp(sequence_list),
pos = LETleft})
LET declarations IN sequence_list END (A.LetExp {
desc = declarations,
body = A.SeqExp(sequence_list),
pos = LETleft})
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSeriesTable extends Migration {
/**
* Run the migrations.
*
<?php namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
// use Request;
class SeriesController extends Controller {
/**
* Create a new controller instance.
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Course other = (Course) obj;
if (credits != other.credits)
val params' = map (fn ({name, escape, typ, pos}) => (
(case Symbol.look(tenv, typ) of
SOME(t) => t
| NONE => (report pos (E.UndeclaredType (Symbol.name name)) "undeclared type in function params"; E.ERROR)
)
)) params
| tExp (A.IfExp{test, then', else', pos}) =
let
val test' = actual_type(tExp test, pos)
val tty = actual_type(tExp then', pos)
val ety = (case else' of
SOME(e) => actual_type(tExp e, pos)
| _ => tty) (* if there is no else, just pretend it matches with tty - hax *)
(* do the tty and ety match? *)
(* check_duplicates robust enough; could not compare deeply *)
fun check_duplicates([],f) = ()
| check_duplicates(h::l, f) =
if (List.exists (fn (x) => (h = x)) l) then
(f h ; check_duplicates(l,f))
else check_duplicates(l,f)
(* cd2 uses an accessor g to access the record fields or tuples *)
fun check_duplicates2([],f,g) = ()
(*
What I hate about SML; parathensis are optional sometimes and absolutely required other times,
and currying is possible, so you never know what you want.
*)
| tExp(A.RecordExp {fields, typ, pos}) =
let
val typ' = (case Symbol.look(tenv, typ) of
SOME(t) => actual_type(t, pos)
| _ => (report pos (E.UndeclaredType (Symbol.name typ)) "undeclared type for record"; (E.ERROR))
package sabe;
import java.util.ArrayList;
import edu.umn.csci5801.sabe.interfaces.AccountReportIntf;
import sabe.calculations.HealthInsurance;
import sabe.calculations.UndergraduateCSECollegiateFees;
import sabe.calculations.UndergraduateGeneralFees;
import sabe.calculations.UndergraduateInternationalStudentFees;
import sabe.calculations.UndergraduateMedicalCollegiateFees;