initial commit

This commit is contained in:
Chris Sexton 2019-12-12 11:33:12 -05:00
commit eecbcc31e0
9 changed files with 621 additions and 0 deletions

206
.gitignore vendored Normal file
View File

@ -0,0 +1,206 @@
# Created by https://www.gitignore.io/api/go,vim,linux,macos,windows,intellij+all
# Edit at https://www.gitignore.io/?templates=go,vim,linux,macos,windows,intellij+all
### Go ###
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, built with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Dependency directories (remove the comment below to include it)
# vendor/
### Go Patch ###
/vendor/
/Godeps/
### Intellij+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
### Intellij+all Patch ###
# Ignores the whole .idea folder and all .iml files
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
.idea/
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
*.iml
modules.xml
.idea/misc.xml
*.ipr
# Sonarlint plugin
.idea/sonarlint
### Linux ###
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Vim ###
# Swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
# Session
Session.vim
Sessionx.vim
# Temporary
.netrwhist
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~
### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
# End of https://www.gitignore.io/api/go,vim,linux,macos,windows,intellij+all
*.toml
*.task
example
*.adoc
tpsemester

5
Makefile Normal file
View File

@ -0,0 +1,5 @@
run: build *.adoc.tpl c311.toml
./semestergen c311.toml
build: gendates.go
go build

15
assignments.adoc.tpl Normal file
View File

@ -0,0 +1,15 @@
{{- range $key, $value := .Assignments}}
{{- range $value.Links}}
:{{.Slug}}: link:{{.URL}}
{{- end}}
{{- end}}
[%header,format=psv,cols="^20h,^20h,<60d"]
|===
| Given | Due Date | Assignment
{{range $key, $value := .Assignments}}
| {{getDate $value.Assigned}} | {{getDate $value.Due}} | {{$value.Title}}: {{range $idx, $el := $value.Links}}{{if $idx}}; {{end}}{{$el.Slug | printf "{%s}"}}[{{$el.Title}}]{{end}}
{{end}}
|===
These events are in a public calendar you may add to your own calendar software: https://p69-caldav.icloud.com/published/2/AAAAAAAAAAAAAAAAAAAAANFRXqg59DGi6z91QTJ-xG1Ope_sr0CiqvA6uMlifzjd3vdL7pulndzvh4lIbs7jcjVkXXeLS7hOJi_yt4J96Y8[Published iCal Link]

13
course.task.tpl Normal file
View File

@ -0,0 +1,13 @@
- {{.Project}} @parallel(true) @autodone(false) @context(Place : IUS) @tags(Place : IUS) @defer(2019-12-20 00:00)
- Assignments @parallel(false) @autodone(false) @context(Place : IUS) @tags(Place : IUS)
{{- range $key, $value := .Assignments}}
- {{$value.Title}} @context(Place : IUS) @tags(Place : IUS) @due({{getDate $value.Assigned}} {{dueTime}})
{{- end}}
- Grading @parallel(false) @autodone(false) @context(Place : IUS) @tags(Place : IUS)
{{- range $key, $value := .Assignments}}
- {{$value.Title}} @context(Place : IUS) @tags(Place : IUS) @defer({{getDate $value.Due}} {{dueTime}})
{{- end}}
- Lectures @parallel(false) @autodone(false) @context(Place : IUS) @tags(Place : IUS)
{{- range $key, $value := .Days}}
- {{$value.Title}} @context(Place : IUS) @tags(Place : IUS) @due({{getDate $value.Num}} {{dueTime}})
{{- end}}

219
gendates.go Normal file
View File

@ -0,0 +1,219 @@
package main
import (
"flag"
"os"
"strings"
"text/template"
"time"
"github.com/BurntSushi/toml"
)
const layout = "2006-01-02"
type DayMap map[int]time.Time
type Eval struct {
Title string
Value string
}
type Link struct {
// Text of Link
Title string
// Link target
URL string
Level int
}
func (l Link) Stars() string {
out := "*"
for i := 0; i < l.Level; i++ {
out += "*"
}
return out
}
func (l Link) Slug() string {
out := strings.ReplaceAll(l.Title, " ", "-")
out = strings.ReplaceAll(out, "#", "")
out = strings.ReplaceAll(out, "&", "")
return out
}
type Assignment struct {
// Assignment name
Title string
// Assignment Link plus supplemental material
Links []Link
// Day of the semester assignment is due (must be a class day)
Due int
// Day of the semester assignment is assigned (must be a class day)
Assigned int
}
type Day struct {
// Assignment name
Title string
// Assignment Link plus supplemental material
Links []Link
Num int
}
type Config struct {
Title string
Instructor string
Office string
Phone string
Email string
Meetings string
Text string
Description string
Legal string
Start time.Time
End time.Time
DaysOff []time.Time
DueTime string
Project string
Days []Day
Assignments []Assignment
Resources []Link
Evaluation []Eval
EvalText string
Dates DayMap
}
func (c Config) GetDate(day int) string {
return c.Dates[day].Format("01-02")
}
func main() {
flag.Parse()
for i := 0; i < flag.NArg(); i++ {
c := mkConfig(flag.Arg(i))
if err := writeSyllabus(c); err != nil {
panic(err)
}
if err := writeSchedule(c); err != nil {
panic(err)
}
if err := writeAssignments(c); err != nil {
panic(err)
}
if err := writeTaskPaper(c); err != nil {
panic(err)
}
}
}
func writeTaskPaper(c Config) error {
f, err := os.Create("course.task")
defer f.Close()
if err != nil {
return err
}
funcs := template.FuncMap{
"getDate": c.GetDate,
"dueTime": func() string { return c.DueTime },
}
//tpl := template.Must(template.ParseFiles("assignments.adoc.tpl"))
tpl, err := template.New("course.task.tpl").Funcs(funcs).ParseFiles("course.task.tpl")
if err != nil {
return err
}
err = tpl.Funcs(funcs).Execute(f, c)
return err
}
func writeAssignments(c Config) error {
f, err := os.Create("assignments.adoc")
defer f.Close()
if err != nil {
return err
}
funcs := template.FuncMap{
"getDate": c.GetDate,
}
//tpl := template.Must(template.ParseFiles("assignments.adoc.tpl"))
tpl, err := template.New("assignments.adoc.tpl").Funcs(funcs).ParseFiles("assignments.adoc.tpl")
if err != nil {
return err
}
err = tpl.Funcs(funcs).Execute(f, c)
return err
}
func writeSchedule(c Config) error {
f, err := os.Create("schedule.adoc")
defer f.Close()
if err != nil {
return err
}
tpl := template.Must(template.ParseFiles("schedule.adoc.tpl"))
err = tpl.Execute(f, c)
return err
}
func writeSyllabus(c Config) error {
f, err := os.Create("syllabus.adoc")
defer f.Close()
if err != nil {
return err
}
tpl := template.Must(template.ParseFiles("syllabus.adoc.tpl"))
err = tpl.Execute(f, c)
return err
}
func mkConfig(path string) Config {
var c Config
if _, err := toml.DecodeFile(path, &c); err != nil {
panic(err)
}
for i := range c.Days {
c.Days[i].Num = i + 1
}
c.Dates = mkDates(c.Start, c.End, c.DaysOff)
return c
}
func mkDates(begin, end time.Time, daysOff []time.Time) DayMap {
if begin.Year() == 1 || end.Year() == 1 {
return DayMap{}
}
out := make(DayMap)
for i, d := 1, begin; d.Before(end.AddDate(0, 0, 1)); d = nextD(d) {
if !in(daysOff, d) {
out[i] = d
i++
}
}
return out
}
func in(days []time.Time, d0 time.Time) bool {
for _, d := range days {
if d0 == d {
return true
}
}
return false
}
func nextD(d0 time.Time) time.Time {
if w := d0.Weekday(); w == time.Monday || w == time.Tuesday {
return d0.AddDate(0, 0, 2)
}
return d0.AddDate(0, 0, 5)
}

5
go.mod Normal file
View File

@ -0,0 +1,5 @@
module code.chrissexton.org/cws/semestergen
go 1.13
require github.com/BurntSushi/toml v0.3.1

2
go.sum Normal file
View File

@ -0,0 +1,2 @@
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=

13
schedule.adoc.tpl Normal file
View File

@ -0,0 +1,13 @@
{{- range $key, $value := .Days}}
{{- range $value.Links}}
:{{.Slug}}: link:{{.URL}}
{{- end}}
{{- end}}
[%header,format=psv,cols="^5h,47d,47a"]
|===
| Day | Topics | Notes
{{range $key, $value := .Days}}
| {{$value.Num}} | {{$value.Title}} | {{range $idx, $l := $value.Links}}{{if $idx}}; {{end}}{{$l.Slug | printf "{%s}"}}[{{$l.Title}}]{{end}}
{{end}}
|===

143
syllabus.adoc.tpl Normal file
View File

@ -0,0 +1,143 @@
= {{.Title}}
:toc: left
ifdef::backend-html5[]
endif::[]
ifdef::backend-pdf[]
:notitle:
:pdf-style: theme.yml
endif::[]
:book: link:https://www.amazon.com/dp/013394302X/
:0001: link:https://falconair.github.io/2015/01/30/composingcontracts.html
ifdef::backend-pdf[= {{.Title}}]
== Information
**Instructor**: {{.Instructor}}
**Office**: {{.Office}}
**Phone**: {{.Phone}}
**Email**: mailto:{{.Email}}[{{.Email}}] (**Email is best!**)
**Meetings**: {{.Meetings}}
*Text*: {{.Text}}
== Course
{{.Description}}
== Schedule
Note: *Many of these links may be dead.* They will be live when we reach the
content represented. Please ask via email if there is a
particular file missing from the course that should be live.
include::schedule.adoc[]
=== Assignments
include::assignments.adoc[]
This schedule is tentative.
== Some F# resources
{{range .Resources -}}
{{- if .URL}}
{{.Stars}} {{.URL}}[{{.Title}}]
{{- else}}
{{.Stars}} {{.Title}}
{{- end}}
{{- end}}
== Grading Scale
|===
| Grade Percentage | Letter Grade
| 90-100 | A
| 80-89 | B
| 70-79 | C
| 60-69 | D
| 0-59 | F
|===
A +/- will be added for the upper/lower two points of each grade respectively.
Note that a C is the minimum grade accepted for Natural Science Degrees.
== Course Evaluation
|===
{{- range .Evaluation}}
| **{{.Title}}** | {{.Value}}
{{- end}}
|===
{{.Legal}}
== Homework
. Homework assignments cover areas you need to know and practice.
. Submit homework at the beginning of class or by time posted in Canvas if online.
. Your submission must be your own work.
== In-Class
. Each class may have an in-class element that counts towards the in-class evaluation.
. These assignments will not be graded, but participation points will be awarded.
. Class participation will also be assigned in this category.
== Code of Student Rights, Responsibilities and Conduct
You are responsible for knowing the IU Code of Student Rights, Responsibilities, and Conduct. http://www.iu.edu/~code/[]
Student responsibilities outlined in the code include Academic Misconduct and Personal Misconduct. Academic Misconduct includes cheating, fabrication, plagiarism, interference, violation of course rules, and facilitating academic dishonesty. Personal Misconduct includes acts of personal misconduct both on and off university property. Ignorance of the rules is not a defense.
=== Plagiarism
Plagiarism is defined as presenting someone else's work, including the work of other students, as one's own. Any ideas or materials taken from another source for either written or oral use must be fully acknowledged, unless the information is common knowledge. What is considered "common knowledge" may differ from course to course.
A student must not adopt or reproduce ideas, opinions, theories, formulas, graphics, or pictures of another person without acknowledgment. A student must give credit to the originality of others and acknowledge indebtedness whenever: Directly quoting another persons actual words, whether oral or written; Using another persons ideas, opinions, or theories; Paraphrasing the words, ideas, opinions, or theories of others, whether oral or written; Borrowing facts, statistics, or illustrative material; or Offering materials assembled or collected by others in the form of projects or collections without acknowledgment. Cheating:
Cheating is considered to be an attempt to use or provide unauthorized assistance, materials, information, or study aids in any form and in any academic exercise or environment.
=== Penalties
* Cheating on homework assignments - loss of all points for that homework and if severe, a failing grade for the course.
* Cheating on quizzes - loss of all points for that quiz and if severe, a failing grade for the course.
* Cheating on exams - loss of all points for that exam and if severe, a failing grade for the course.
== Course Policies
* Please do not hesitate to email me at mailto:cwsexton@ius.edu[cwsexton@ius.edu] if you need to get in touch outside of campus or outside of office hours. I will be happy to resolve issues via email or set up a video call. I will do my best to respond to your emails within 24 hours during business hours Monday through Thursday. It may take me longer to respond on the weekends.
* Feel free to use your laptop during class. Taking notes and following along with exercises is a great way to stay engaged with class. Please avoid allowing any technology use to become a distraction. Participation points may be lowered in this case.
* Please keep your personal computing devices on silent or vibrate.
* If problems occur or if you become ill, please contact me immediately so we can determine your best options.
* If you have problems with equipment, please let me know but you should also contact a person at the computer helpdesk immediately at (812) 941-2447. Technical issues are **not** an excuse for late work. Assignments are given with plenty of lead time to proactively solve technical issues.
* Please proof all assignments and email messages to ensure the use of Standard English, proper grammar, and correct spelling. You will lose points for problems in this area. If you have concerns about your writing, contact the https://www.ius.edu/writing-center/[Writing Center] for a consultation.
* Class Attendance: At IU Southeast, attendance is required. Participation points are non-recoverable for absences.
* Youre probably used to seeing many policy statements on a syllabus.  Faculty include these statements to ensure you understand course expectations so that you can succeed in your courses.  At IU Southeast, we have placed all university policies on a single website easily accessed from every Canvas course site. Simply look at the left navigation bar and click on https://www.ius.edu/get-help/[Succeed at IU Southeast]. You can find links to sites with a great deal of useful information including
** How to avoid plagiarism and cheating
** Disability Services
** FLAGS
** Tutoring centers
** Canvas Guides
** Financial Aid
** Sexual Misconduct
** Counseling
** Writing Center and much more!
 
+
My expectation is that you review university policies carefully to ensure you understand the policy and possible consequences for violating the policy.  Please contact me if you have any questions about any university policy.
* All labs/assignments/forums/quizzes/tests/etc. will be open for a time window, at least a number of hours and in many cases a number of days.
+
Documented illness is the only acceptable excuse for not completing an assignment during its open window. Other reasons for not completing labs/assignments/forums/quizzes/tests/etc. must be explained to the satisfaction of the instructor, who will decide whether missed assignments may be made up. Being sick on the last few days of an assignment's due date is *NOT* an excuse.
== Disclaimer
Although every effort has been made to make the above listing complete and accurate, minor adjustments to the schedule are sometimes necessary due to weather, or other problems that crop up. The quantity of assignments and tests will not increase. In-Class work may change. The grading scale and late policy will remain constant.