This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Author: Stewart Charles | |
/ Assignment 3 | |
/ CS 4600 | |
/ Version: 2/20/2017 | |
-- Utilizes Matrix Stack and Shape/Objects to draw Quadcopter*/ | |
/* Initialize Variables persistent variables. */ | |
var time; | |
var xSlider, xText, ySlider, yText; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
from functools import reduce | |
""" | |
Vector Class to handle 2D transformations and operations | |
""" | |
class Vec2(object): | |
def __init__(self, x,y): | |
self.x = x | |
self.y = y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* QaUser type that encapsulates information displayed for StudentSummary | |
* which involves enrolled classes, and grades | |
*/ | |
public class SummaryStudent extends QaUser { | |
private List<StudentGrade> studentGrades; | |
private List<StudentClass> studentClasses; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Asserts that there is a row on the Student Grades Page that contains every field of each | |
* Grade in the students list of Grades | |
* @param student the argument student | |
* @return the invoked student grades page | |
*/ | |
public StudentGradesPage assertStudentGrades(final StudentManager.SummaryStudent student) { | |
Assert.assertTrue(student.getStudentGrades().size() > 0); | |
final SelenideElement gradesBody = Util.demand($("div.panel-heading + table tbody")); | |
Assert.assertTrue(student.getStudentGrades().stream().allMatch(grade -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from functools import reduce | |
class Result: | |
passed = 1 | |
failed = 2 | |
skipped = 3 | |
def count_results(results, result): | |
return reduce(lambda accum, current: accum + (current.result_id == result), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defprotocol ToCard | |
"Protocol for coercing a CardItem to a card" | |
(to-card [card] "Produces a bootstrap styled card item")) | |
(defrecord CardItem [title content img-link link] | |
ToCard | |
(to-card [_] | |
[:div.card.bg-dark.text-white | |
[:a.card-top {:href link} | |
[:img.card-img-top {:src img-link}]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func AllMatch(arr interface{}, test func(interface{})bool) bool { | |
switch reflect.TypeOf(arr).Kind() { | |
case reflect.Array,reflect.Slice: | |
a := reflect.ValueOf(arr) | |
for i := 0; i < a.Len(); i++ { | |
if !test(a.Index(i).Interface()) { | |
return false | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import List, TypeVar, Callable | |
from math import sin, pi | |
# TypeVar for a generic number type | |
Num = TypeVar('Num', int, float) | |
""" | |
Function that generates a List of integers that represent a interpolation of font sizes from min to max along | |
a sin wave function that has been transformed to have the desired properties. | |
Returns a List of Integers (List[int]) of size num_pages containing font sizes interpolated between min and max. |