<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Racket FacDev  by bsmall2</title>
    <link>https://snap.as/bsmall2/racket-facdev</link>
    <description>Recent photos by bsmall2</description>
    <managingEditor> (bsmall2)</managingEditor>
    <pubDate>Fri, 17 Apr 2026 05:34:04 +0000</pubDate>
    <image>
      <url>https://snap.as/favicon.ico</url>
      <title>bsmall2 on Snap.as</title>
      <link>https://snap.as/bsmall2/racket-facdev</link>
    </image>
    <item>
      <title>Another Album</title>
      <link>https://snap.as/bsmall2/racket-facdev/ZjDLkj0</link>
      <description>&lt;![CDATA[ Another Album&#xA; &#xA; https://snap.as/bsmall2/fd-racket&#xA;&#xA;https://snap.as/bsmall2/fd-racket&#xA;&#xA; https://ruhrspora.de/posts/3357215&#xA; https://write.as/bs2facdev/questionnaire-visualization ]]&gt;</description>
      <content:encoded><![CDATA[<div><img src="https://i.snap.as/ZjDLkj0.image" /></div><p>Another Album</p>
<ul><li><a href="https://snap.as/bsmall2/fd-racket" rel="nofollow">https://snap.as/bsmall2/fd-racket</a></li></ul>

<p><a href="https://snap.as/bsmall2/fd-racket" rel="nofollow">https://snap.as/bsmall2/fd-racket</a></p>
<ul><li><a href="https://ruhrspora.de/posts/3357215" rel="nofollow">https://ruhrspora.de/posts/3357215</a></li>
<li><a href="https://write.as/bs2facdev/questionnaire-visualization" rel="nofollow">https://write.as/bs2facdev/questionnaire-visualization</a></li></ul>
]]></content:encoded>
      <author>bsmall2</author>
      <guid>https://snap.as/bsmall2/racket-facdev/ZjDLkj0</guid>
      <pubDate>Wed, 19 Feb 2020 06:51:42 +0000</pubDate>
    </item>
    <item>
      <title>201801アンケートデータ視覚化</title>
      <link>https://snap.as/bsmall2/racket-facdev/ZGuUO4c</link>
      <description>&lt;![CDATA[ 201801アンケートデータ視覚化&#xA;&#xA;code&#xA;lang racket&#xA;&#xA;(define my-home (find-system-path &#39;home-dir))&#xA;(define learning-directory &#34;Learning-Racket&#34;)&#xA;(define facdev-directory &#34;FD&#34;)&#xA;;; ~/home-directory/Learning-Racket/FD&#34;&#xA;(define data-file &#34;DG-2018-1-Frequencies.csv&#34;)&#xA;&#xA;(define Q-ja-file &#34;SetsuMon.csv&#34;)&#xA;;; 出席,学生取組,私はこの授業によく出席した                                              &#xA;;; 発言,学生取組,私は授業内容について質問や発言した                                      &#xA;;; 取組,学生取組,私はこの科目に積極的に取り組んだ予習と復習した)                         &#xA;;; 聞取,教員実施,教員の声は聞き取りやすかった。                                          &#xA;;; 資料,教員実施,教員の板書（またはPPT・配布資料など）は読みやすかった（見やすかった）   &#xA;;; 時刻,教員実施,教員は授業の開始・終了の時刻を守ろうとしていた                          &#xA;;; 反応,教員実施,教員は学生の反応を確かめながら授業を進めていた                          &#xA;;; 熱意,教員実施,教員は熱意を持って授業をしていた                                        &#xA;;; 理解,総合評価,私はこの授業内容を理解できた                                            &#xA;;; 役立,総合評価,私はこの授業で学んだ内容はなんらかの形で将来的に役立つと感じた          &#xA;;; 満足,総合評価,私は総合的に判断してこの授業で満足が得られた&#xA;&#xA;;; KaiTou.csv&#xA;;; 5, 特に,特にそう思う&#xA;;; 4, 多少,多少そう思う&#xA;;; 3, どちも,どちらともいえない&#xA;;; 2, あまり,あまりそう思わない&#xA;;; 1, 全く,全くそう思わない&#xA;&#xA;(define working-directory (build-path my-home learning-directory facdev-directory))&#xA;(current-directory-for-user working-directory)&#xA;(define data-path (build-path working-directory data-file))&#xA;(define get-data&#xA;  (lambda (pth)&#xA;    (let ((inp (open-input-file pth))&#xA;&#x9;   (lines (port-  lines inp)))&#xA;      (close-input-port inp)&#xA;      (map (lambda (s) (string-split&#xA;&#x9;&#x9;&#x9;(regexp-replace &#34;\&#34;&#34; s &#34;&#34;)&#xA;&#x9;&#x9;&#x9;&#x9;     &#34;,&#34;))&#xA;&#x9;   lines))))&#xA;&#xA;(define fd-data (get-data data-path))&#xA;(define info-data (list (first fd-data) (second fd-data)))&#xA;(define data-labels (cddr fd-data))&#xA;(define questions-ja (get-data (build-path working-directory Q-ja-file)))&#xA;&#xA;(define (transpose-table tbl)&#xA;  (define (helper tbl dict) ; dictionary&#xA;    (cond&#xA;     ((empty? (first tbl)) (reverse dict))&#xA;     (#t (helper (map cdr tbl) (cons (cons (first (first tbl))&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;   (map first (cdr tbl)))&#xA;&#x9;&#x9;&#x9;&#x9;     dict)))))&#xA;  (helper tbl &#39;()))&#xA;&#xA;;; from info-lines generate plot-title and file-name&#xA;(define info-dict (transpose-table info-data))&#xA;(define (plot-title-join dict)&#xA;  (define (title-part entry)&#xA;    (string-join entry &#34;:&#34;))&#xA;  (map title-part dict))&#xA;(define plot-title-string&#xA;  (string-join (plot-title-join info-dict)&#xA;              &#34;,&#34;))&#xA;(define (filename-join dict)&#xA;  (string-join&#xA;   (map car (dict-values dict))&#xA;   &#34;-&#34;))&#xA;(define plot-file-name&#xA;  (filename-join info-dict))&#xA;;;;;;;;;&#xA;&#xA;(define (reorder-responses-ascending dat-labs) ;; data-labels&#xA;  (map (lambda (row) (cons (car row) (reverse (cdr row)))) dat-labs))&#xA;&#xA;(define ascending-data-labels&#xA;  (reorder-responses-ascending data-labels))&#xA;&#xA;(define (get-response-number row n)&#xA;  (string-  number (list-ref row n)))&#xA;&#xA;(define (sum-responses row n m)&#xA;  (+ (get-response-number  row n)(get-response-number row m)))&#xA;&#xA;(define (positives-sum row)&#xA;  (sum-responses row 4 5))&#xA;(define (negatives-sum row)&#xA;  (sum-responses row 1 2))&#xA;&#xA;(require plot)&#xA;(require plot/utils)&#xA;&#xA;;; (define neutral-response 3)&#xA;(define (neutral-line row y)&#xA;  (let ((neutral-label (list-ref row 3))&#xA;         (neutral-number (string-  number neutral-label))&#xA;&#x9; (half (/ neutral-number 2)))&#xA;    (list &#xA;     (hrule y (- half) half #:color &#34;black&#34;)&#xA;     (point-label (vector 0 y) (string-append &#34;3:&#34; neutral-label)&#xA;                 #:anchor &#39;bottom #:point-size 5 #:size 9))))&#xA;&#xA;(define (positive-line row y)&#xA;  (let ((4-label (list-ref row 4))&#xA;         (4-number (string-  number 4-label))&#xA;         (5-label (list-ref row 5))&#xA;         (5-number (string-  number 5-label))&#xA;         (4n5 (+ 4-number 5-number)))&#xA;    (list&#xA;&#xA;     (lines (list(vector 0 y) (vector 4-number y)) #:color &#34;green&#34;)&#xA;     (lines (list (vector 4-number y) (vector 4n5 y)) #:color &#34;green&#34; #:width 3)&#xA;     (points (list (vector 4-number y)) #:color &#34;black&#34; #:sym &#39;fullcircle #:size 5)&#xA;     (point-label (vector 4n5 y) (string-append &#34;4:&#34; 4-label &#34;,&#34; &#34;5:&#34; 5-label)&#xA;                 #:anchor &#39;bottom #:point-size 5))))&#xA;&#xA;(define (negative-line row y)&#xA;  (let ((1-label (list-ref row 1))&#xA;         (1-number (string-  number 1-label))&#xA;         (2-label (list-ref row 2))&#xA;         (2-number (string-  number 2-label))&#xA;         (1n2 (+ 1-number 2-number)))&#xA;    (list&#xA;     (point-label (vector (- 1n2) y) (string-append &#34;1:&#34; 1-label &#34;,&#34; &#34;2:&#34; 2-label)&#xA;                 #:anchor &#39;bottom #:point-size 2)&#xA;     (lines (list (vector (- 1n2) y) (vector (- 2-number) y)) #:color &#34;blue&#34; #:width 3)&#xA;     (lines (list (vector (- 2-number) y) (vector 0 y)) #:color &#34;blue&#34;)&#xA;     (points (list (vector 0 y)) #:color &#34;black&#34; #:sym &#39;fullcircle #:size 5)&#xA;     )))&#xA;&#xA;(define (place-question key dict y)&#xA;  (let ((d-ref (dict-ref dict key))&#xA;         (type (first d-ref))&#xA;         (question (second d-ref))&#xA;         (label (string-append type &#34;:&#34; question))&#xA;         (y-offset .3)&#xA;         (q-y (+ y y-offset)))positives-sum&#xA;    (point-label (vector 0 q-y) label #:size 16 #:point-size 0)))&#xA;&#xA;(define (plot-a-question row dict y)&#xA;  (list&#xA;   (neutral-line row (- y .25))&#xA;   (positive-line row (- y .05))&#xA;   (negative-line row (- y .05))&#xA;   (place-question (first row) dict y)&#xA;   ))&#xA;&#xA;(define (plot-questions data dict)&#xA;  (define (helper rows y plots)&#xA;    (cond&#xA;      ((empty? rows) plots)&#xA;      (#t (helper (cdr rows) (add1 y)&#xA;                 (cons (plot-a-question (car rows) dict y) plots)))))&#xA;  (helper data 1 &#39;()))&#xA;&#xA;(parameterize&#xA;    ((plot-title plot-title-string)&#xA;     (plot-x-axis? #f)&#xA;     (plot-x-label #f)&#xA;     (plot-x-far-axis? #f)&#xA;     (plot-y-axis? #f)&#xA;     (plot-y-label #f)&#xA;     (plot-y-far-axis? #f)&#xA;     (plot-width 1200)&#xA;     (plot-height 1000))&#xA;     (plot&#xA;      (plot-questions&#xA;       (sort (cdr ascending-data-labels) #:key positives-sum   )&#xA;       questions-ja)&#xA;      #;(plot-a-question (fourth ascending-data-labels) questions-ja 4)&#xA;    &#xA;      &#xA;&#x9;   #:x-min -800 #:x-max 2500&#xA;&#x9;   #:y-min 0 #:y-max 11.5&#xA;           #:out-file (string-append plot-file-name &#34;-made-2019-07-01-b.png&#34;)&#xA;           #:out-kind &#39;png))&#xA;&#xA; 他のデータ視覚化とコード:&#xA;    https://write.as/bs2lr/&#xA;  #Racket #DrRacket #FD #FacultyDevelopment #DataVisualization #データ視覚化 ]]&gt;</description>
      <content:encoded><![CDATA[<div><img src="https://i.snap.as/ZGuUO4c.image" /></div><p>201801アンケートデータ視覚化</p>

<h3>code</h3>

<pre><code>#lang racket

(define my-home (find-system-path &#39;home-dir))
(define learning-directory &#34;Learning-Racket&#34;)
(define facdev-directory &#34;FD&#34;)
;; ~/home-directory/Learning-Racket/FD&#34;
(define data-file &#34;DG-2018-1-Frequencies.csv&#34;)

(define Q-ja-file &#34;SetsuMon.csv&#34;)
;; 出席,学生取組,私はこの授業によく出席した                                              
;; 発言,学生取組,私は授業内容について質問や発言した                                      
;; 取組,学生取組,私はこの科目に積極的に取り組んだ予習と復習した)                         
;; 聞取,教員実施,教員の声は聞き取りやすかった。                                          
;; 資料,教員実施,教員の板書（またはPPT・配布資料など）は読みやすかった（見やすかった）   
;; 時刻,教員実施,教員は授業の開始・終了の時刻を守ろうとしていた                          
;; 反応,教員実施,教員は学生の反応を確かめながら授業を進めていた                          
;; 熱意,教員実施,教員は熱意を持って授業をしていた                                        
;; 理解,総合評価,私はこの授業内容を理解できた                                            
;; 役立,総合評価,私はこの授業で学んだ内容はなんらかの形で将来的に役立つと感じた          
;; 満足,総合評価,私は総合的に判断してこの授業で満足が得られた

;; KaiTou.csv
;; 5, 特に,特にそう思う
;; 4, 多少,多少そう思う
;; 3, どちも,どちらともいえない
;; 2, あまり,あまりそう思わない
;; 1, 全く,全くそう思わない

(define working-directory (build-path my-home learning-directory facdev-directory))
(current-directory-for-user working-directory)
(define data-path (build-path working-directory data-file))
(define get-data
  (lambda (pth)
    (let* ((inp (open-input-file pth))
	   (lines (port-&gt;lines inp)))
      (close-input-port inp)
      (map (lambda (s) (string-split
			(regexp-replace* &#34;\&#34;&#34; s &#34;&#34;)
				     &#34;,&#34;))
	   lines))))

(define fd-data (get-data data-path))
(define info-data (list (first fd-data) (second fd-data)))
(define data-labels (cddr fd-data))
(define questions-ja (get-data (build-path working-directory Q-ja-file)))

(define (transpose-table tbl)
  (define (helper tbl dict) ; dictionary
    (cond
     ((empty? (first tbl)) (reverse dict))
     (#t (helper (map cdr tbl) (cons (cons (first (first tbl))
					   (map first (cdr tbl)))
				     dict)))))
  (helper tbl &#39;()))

;; from info-lines generate plot-title and file-name
(define info-dict (transpose-table info-data))
(define (plot-title-join dict)
  (define (title-part entry)
    (string-join entry &#34;:&#34;))
  (map title-part dict))
(define plot-title-string
  (string-join (plot-title-join info-dict)
              &#34;,&#34;))
(define (filename-join dict)
  (string-join
   (map car (dict-values dict))
   &#34;-&#34;))
(define plot-file-name
  (filename-join info-dict))
;;;;;;;;


(define (reorder-responses-ascending dat-labs) ;; data-labels
  (map (lambda (row) (cons (car row) (reverse (cdr row)))) dat-labs))

(define ascending-data-labels
  (reorder-responses-ascending data-labels))

(define (get-response-number row n)
  (string-&gt;number (list-ref row n)))

(define (sum-responses row n m)
  (+ (get-response-number  row n)(get-response-number row m)))

(define (positives-sum row)
  (sum-responses row 4 5))
(define (negatives-sum row)
  (sum-responses row 1 2))

(require plot)
(require plot/utils)

;; (define neutral-response 3)
(define (neutral-line row y)
  (let* ((neutral-label (list-ref row 3))
         (neutral-number (string-&gt;number neutral-label))
	 (half (/ neutral-number 2)))
    (list 
     (hrule y (- half) half #:color &#34;black&#34;)
     (point-label (vector 0 y) (string-append &#34;3:&#34; neutral-label)
                 #:anchor &#39;bottom #:point-size 5 #:size 9))))

(define (positive-line row y)
  (let* ((4-label (list-ref row 4))
         (4-number (string-&gt;number 4-label))
         (5-label (list-ref row 5))
         (5-number (string-&gt;number 5-label))
         (4n5 (+ 4-number 5-number)))
    (list

     (lines (list(vector 0 y) (vector 4-number y)) #:color &#34;green&#34;)
     (lines (list (vector 4-number y) (vector 4n5 y)) #:color &#34;green&#34; #:width 3)
     (points (list (vector 4-number y)) #:color &#34;black&#34; #:sym &#39;fullcircle #:size 5)
     (point-label (vector 4n5 y) (string-append &#34;4:&#34; 4-label &#34;,&#34; &#34;5:&#34; 5-label)
                 #:anchor &#39;bottom #:point-size 5))))

(define (negative-line row y)
  (let* ((1-label (list-ref row 1))
         (1-number (string-&gt;number 1-label))
         (2-label (list-ref row 2))
         (2-number (string-&gt;number 2-label))
         (1n2 (+ 1-number 2-number)))
    (list
     (point-label (vector (- 1n2) y) (string-append &#34;1:&#34; 1-label &#34;,&#34; &#34;2:&#34; 2-label)
                 #:anchor &#39;bottom #:point-size 2)
     (lines (list (vector (- 1n2) y) (vector (- 2-number) y)) #:color &#34;blue&#34; #:width 3)
     (lines (list (vector (- 2-number) y) (vector 0 y)) #:color &#34;blue&#34;)
     (points (list (vector 0 y)) #:color &#34;black&#34; #:sym &#39;fullcircle #:size 5)
     )))

(define (place-question key dict y)
  (let* ((d-ref (dict-ref dict key))
         (type (first d-ref))
         (question (second d-ref))
         (label (string-append type &#34;:&#34; question))
         (y-offset .3)
         (q-y (+ y y-offset)))positives-sum
    (point-label (vector 0 q-y) label #:size 16 #:point-size 0)))

(define (plot-a-question row dict y)
  (list
   (neutral-line row (- y .25))
   (positive-line row (- y .05))
   (negative-line row (- y .05))
   (place-question (first row) dict y)
   ))

(define (plot-questions data dict)
  (define (helper rows y plots)
    (cond
      ((empty? rows) plots)
      (#t (helper (cdr rows) (add1 y)
                 (cons (plot-a-question (car rows) dict y) plots)))))
  (helper data 1 &#39;()))

(parameterize
    ((plot-title plot-title-string)
     (plot-x-axis? #f)
     (plot-x-label #f)
     (plot-x-far-axis? #f)
     (plot-y-axis? #f)
     (plot-y-label #f)
     (plot-y-far-axis? #f)
     (plot-width 1200)
     (plot-height 1000))
     (plot
      (plot-questions
       (sort (cdr ascending-data-labels) #:key positives-sum &gt;)
       questions-ja)
      #;(plot-a-question (fourth ascending-data-labels) questions-ja 4)
    
      
	   #:x-min -800 #:x-max 2500
	   #:y-min 0 #:y-max 11.5
           #:out-file (string-append plot-file-name &#34;-made-2019-07-01-b.png&#34;)
           #:out-kind &#39;png))
</code></pre>
<ul><li>他のデータ視覚化とコード:
<ul><li><a href="https://write.as/bs2lr/" rel="nofollow">https://write.as/bs2lr/</a>
#Racket #DrRacket #FD #FacultyDevelopment #DataVisualization #データ視覚化</li></ul></li></ul>
]]></content:encoded>
      <author>bsmall2</author>
      <guid>https://snap.as/bsmall2/racket-facdev/ZGuUO4c</guid>
      <pubDate>Mon, 01 Jul 2019 12:10:29 +0000</pubDate>
    </item>
    <item>
      <title>Racket Plot for Faculty Development</title>
      <link>https://snap.as/bsmall2/racket-facdev/b55YvlT</link>
      <description>&lt;![CDATA[ Racket Plot for Faculty Development&#xA;Questionnaire Result Visualization:&#xA;&#xA;;; test: list&#xA;     ;; test: (negative-line (third data-strings) 3)&#xA;     ;; test: (negative-line (third data-strings) 3)&#xA;     ;; test: (negative-line (third data-strings) 3)&#xA;  #racket-lang #racket-plot #visualization  ]]&gt;</description>
      <content:encoded><![CDATA[<div><img src="https://i.snap.as/b55YvlT.image" /></div><p>Racket Plot for Faculty Development
Questionnaire Result Visualization:</p>

<pre><code>;; test: list
     ;; test: (negative-line (third data-strings) 3)
     ;; test: (negative-line (third data-strings) 3)
     ;; test: (negative-line (third data-strings) 3)
</code></pre>

<p>  #racket-lang #racket-plot #visualization</p>
]]></content:encoded>
      <author>bsmall2</author>
      <guid>https://snap.as/bsmall2/racket-facdev/b55YvlT</guid>
      <pubDate>Wed, 19 Feb 2020 06:51:42 +0000</pubDate>
    </item>
    <item>
      <title></title>
      <link>https://snap.as/bsmall2/racket-facdev/VOAZaP5</link>
      <description>&lt;![CDATA[  ]]&gt;</description>
      <content:encoded><![CDATA[<div><img src="https://i.snap.as/VOAZaP5.png" /></div>]]></content:encoded>
      <author>bsmall2</author>
      <guid>https://snap.as/bsmall2/racket-facdev/VOAZaP5</guid>
      <pubDate>Thu, 04 Apr 2019 13:45:23 +0000</pubDate>
    </item>
    <item>
      <title></title>
      <link>https://snap.as/bsmall2/racket-facdev/SNzGnvo</link>
      <description>&lt;![CDATA[  ]]&gt;</description>
      <content:encoded><![CDATA[<div><img src="https://i.snap.as/SNzGnvo.png" /></div>]]></content:encoded>
      <author>bsmall2</author>
      <guid>https://snap.as/bsmall2/racket-facdev/SNzGnvo</guid>
      <pubDate>Wed, 03 Apr 2019 06:48:36 +0000</pubDate>
    </item>
    <item>
      <title>Pages Generated by DrRacket with Code:</title>
      <link>https://snap.as/bsmall2/racket-facdev/Binke65</link>
      <description>&lt;![CDATA[ Pages Generated by DrRacket with Code:&#xA;&#xA;lang racket&#xA;&#xA;(define base-dir &#34;NanKyuRoll&#34;)&#xA;&#xA;(define working-directory (build-path (find-system-path &#39;home-dir)&#xA;                                     base-dir))&#xA;;; csv-data-file&#xA;(define data-file-name (build-path working-directory &#34;data/2018/1/EK1-a.csv&#34;))&#xA;&#xA;;; go through list of file names from the directory&#xA;;; given from command-line.&#xA;&#xA;;; get from command-line, default to 6&#xA;(define seat-row-num &#34;6&#34;)&#xA;&#xA;(define end-ext-dta &#34;-roll-data.rkt&#34;)&#xA;(define end-ext-htm &#34;-roll-sheet.html&#34;)&#xA;(define end-ext-seats (string-append &#34;-seat-chart&#34;  &#34;-&#34; seat-row-num &#34;.html&#34;))&#xA;&#xA;;; use at the end of the semester to output bureacratic report&#xA;(define end-ext-attnd &#34;-attendance.html&#34;)&#xA;&#xA;;; get and clean data from sjis-encoded .csv file&#xA;(define characters-to-replace&#xA;  &#39;((&#34;\&#34;&#34; &#34;&#34;)&#xA;    (&#34; &#34; &#34; &#34;)&#xA;    (&#34;\u3000&#34; &#34; &#34;) &#xA;    (&#34;�K&#34; &#34;II&#34;)&#xA;    (&#34;&#34; &#34;今&#34;)&#xA;    (&#34;&#34; &#34;別&#34;)&#xA;    (&#34;&#34; &#34;匡&#34;)))&#xA;&#xA;(define clean-sjis-string&#xA;  (lambda (sjis-str char-rplc-list)&#xA;    (let ((new-str sjis-str))&#xA;      (for-each (lambda (pair)&#xA;&#x9;     (set! new-str (regexp-replace (regexp (car pair))&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;    new-str&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;    (cadr pair))))&#xA;      char-rplc-list)&#xA;    new-str)))&#xA;&#xA;(define get-sjis-file-contents-as-list-of-strings&#xA;  (lambda (fstr char-pairs)&#xA;    (let ((inf (open-input-file fstr))&#xA;&#x9;   (iu8 (reencode-input-port inf &#34;SJIS&#34;))&#xA;&#x9;   (str (port-  string iu8))&#xA;&#x9;   (cln-str (clean-sjis-string str char-pairs))) ;; closes port too&#xA;      (string-split cln-str &#34;\n&#34;))))&#xA;&#xA;(define got-strs (get-sjis-file-contents-as-list-of-strings data-file-name characters-to-replace))&#xA;&#xA;(define got-lsts (map (lambda (s) (string-split s &#34;,&#34;)) got-strs))&#xA;&#xA;;; class data lists from first two lines of .csv file&#xA;(define cls-dta-lst (list (car got-lsts)&#xA;&#x9;&#x9;&#x9;  (cadr got-lsts)))&#xA;;; student data lists from third line on of .csv file&#xA;(define stt-dta-lst (cdddr got-lsts))&#xA;&#xA;;; from data table-style  rows from .csv file&#xA;;;    make associative lists&#xA;(define transpose-rows-columns&#xA;  (lambda (lol) ;; list of lists&#xA;    (define helper&#xA;      (lambda (lol keep)&#xA;&#x9;(cond ((null? (car lol)) (reverse keep))&#xA;&#x9;      (#t (helper (map cdr lol) (cons (map car lol) keep))))))&#xA;    (helper lol &#39;())))&#xA;&#xA;;; associative list reference&#xA;(define als-ref&#xA;  (lambda (key als)&#xA;    (let ((tmp (assoc key als)))&#xA;      (if tmp (cadr tmp) #f))))&#xA;&#xA;(define cls-als&#xA;  (transpose-rows-columns cls-dta-lst))&#xA;&#xA;(define stt-rll-dta&#xA;  (map (lambda (row)&#xA;&#x9; (list (first row) (second row)))&#xA;       stt-dta-lst))&#xA;&#xA;;; (require racket/pretty) not-needed?&#xA;(define defntn-symbol-to-string&#xA;  (lambda (symbl deftn)&#xA;    (let ((dfn &#34;&#34;)&#xA;&#x9;  (os (open-output-string)))&#xA;      (pretty-print (append&#xA;&#x9;&#x9;     (cons &#39;define (list symbl))&#xA;&#x9;&#x9;     (list deftn))&#xA;&#x9;&#x9;    os)&#xA;      (set! dfn (get-output-string os))&#xA;      (set! dfn (regexp-replace #rx&#34;\\(\\(&#34; dfn &#34;&#39;((&#34;))&#xA;      (set! dfn (regexp-replace #rx&#34;&#39;\\(define &#34; dfn &#34;(define &#34;))&#xA;      dfn)))&#xA;&#xA;(define from-als-name-directory&#xA;  (lambda (als)&#xA;    (build-path&#xA;     (find-system-path &#39;home-dir)&#xA;     base-dir&#xA;     (als-ref &#34;年度&#34; als)&#xA;     (als-ref &#34;学期&#34; als))))&#xA;(define from-als-make-directory&#xA;  (lambda (als)&#xA;    (make-directory*&#xA;     (from-als-name-directory als))))&#xA;(define from-als-name-file&#xA;  (lambda (als end-ext)&#xA;    (let ((time (als-ref &#34;開講曜日&#34; als))&#xA;&#x9;  (clss (als-ref &#34;科目名&#34; als)))&#xA;      (build-path (path-  string (from-als-name-directory als))&#xA;&#x9;&#x9;  (string-append time clss&#xA;&#x9;&#x9;&#x9;&#x9; end-ext)))))&#xA;(define roll-file (from-als-name-file cls-als end-ext-dta))&#xA;(define roll-sheet (from-als-name-file cls-als end-ext-htm))&#xA;&#xA;;; only need first two columns from sjis-csv-data above&#xA;(require (only-in srfi/1 iota))&#xA;;; set the number of class-meetings used for roll-sheet&#xA;(define classes 15)&#xA;; (define roll-heads&#xA;;  &#39;(&#34;学籍番号&#34; &#34;学生氏名&#34;   1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 tst grd))&#xA;(define roll-heads&#xA;  (cons &#34;学籍番号&#34; (cons &#34;学生氏名&#34;&#xA;&#x9;&#x9;&#x9; (append (iota classes 1)&#xA;&#x9;&#x9;&#x9;&#x9; (cons &#39;tst &#39;(grd))))))&#xA;;; one underline per cell under each class number in roll table&#xA;(define class-lines (map (lambda (n) &#34;&#34;) (iota classes)))&#xA;&#xA;(define roll-data&#xA;  (lambda (stdt-list)&#xA;    (map (lambda (lst) (list (car lst) (cadr lst)))&#xA;&#x9; stdt-list)))&#xA;;; later get the keys and the roll-heads from cls-als data position?&#xA;(define stdt-keys (list (first roll-heads)(second roll-heads)))&#xA;;; &#34;学籍番号&#34; &#34;学生氏名&#34; &#xA;(define clss-keys &#39;(&#34;年度&#34; &#34;学期&#34; &#34;科目名&#34; &#34;開講曜日&#34; &#34;開講教室&#34; &#34;教員氏名&#34;))&#xA;(define comment-string-sample-roll-date-lists&#xA;&#34;&#xA;;; ;; (define rll-dta&#xA;;; ;;   &#39;((\&#34;1531116007\&#34; \&#34;石牟礼 道子\&#34; 1 0 1 1 1 0 1 1 0 1 1 0 1 1 1)&#xA;;; cls-dts need to be entered during/after the semester&#xA;;; (define cls-dts&#xA;;;  &#39;((10 01)(10 15)(10 22)(10 29)(11 5)(11 12)(11 19)(11 26)&#xA;;; (12 3)(12 10)(12 17)(1 7)(1 21)(1 28)(2 4)))  &#xA;&#34;&#xA;)&#xA;&#xA;(define start-roll-data-file&#xA;  (lambda (als end-ext)&#xA;    (let ((out-fle (open-output-file&#xA;&#x9;&#x9;  ;;  (build-path&#xA;&#x9;&#x9;    ;; (from-als-name-directory als)&#xA;&#x9;&#x9;     (from-als-name-file als end-ext)&#xA;&#x9;&#x9;    #:exists &#39;replace)))&#xA;      (display comment-string-sample-roll-date-lists out-fle)&#xA;      (close-output-port out-fle))))&#xA;&#xA;;; (start-roll-data-rkt roll-file explan-string)&#xA;(start-roll-data-file cls-als end-ext-dta)&#xA;&#xA;;; This procedure puts symbols and their definitions into roll-data file&#xA;(define add-to-roll-data-file&#xA;  (lambda (sym f-als s-als) ;; file als, and symbol als, not alwasy the same&#xA;    (let ((apnd-file (open-output-file&#xA;&#x9;&#x9;      (from-als-name-file f-als end-ext-dta)&#xA;&#x9;&#x9;      #:exists &#39;append)))&#xA;      ;; earlier version worked with emacs geiser, but got #%top errors in DrRacket&#xA;      (display (defntn-symbol-to-string sym s-als) apnd-file)&#xA;      (close-output-port apnd-file))))&#xA;&#xA;;; only need two definitions so far&#xA;;; avoiding #%top issues with eval&#xA;(add-to-roll-data-file &#39;cls-als cls-als cls-als)   &#xA;(add-to-roll-data-file &#39;stt-rll-dta cls-als stt-rll-dta)    &#xA;&#xA;(require scribble/html) ;; for output-xml&#xA;(require scribble/html/html) ;; for table etc&#xA;;; clss-keys stdt-keys&#xA;(define class-table&#xA;  (lambda (als kys)&#xA;    (table class: &#34;classinfo&#34;&#xA;&#x9;   (tr&#xA;&#x9;    (map (lambda (ky)&#xA;&#x9;&#x9;   (th (car (assoc ky als))))&#xA;&#x9;&#x9; kys))&#xA;&#x9;   (tr&#xA;&#x9;    (map (lambda (ky)&#xA;&#x9;&#x9;   (td (cadr (assoc ky als))))&#xA;&#x9;&#x9;       kys)))))&#xA;&#xA;;; use class-lines as global variable, or argument?&#xA;(define roll-table&#xA;  (lambda (als kys)&#xA;    (table class: &#34;roll&#34;&#xA;&#x9;   (tr&#xA;&#x9;    (map (lambda (hd)  ;; any need to separate keys from nums, tst, grd? as in Guile script?&#xA;&#x9;&#x9;   (th class: &#34;hdr&#34; hd))&#xA;&#x9;&#x9; roll-heads))&#xA;&#x9;   (map (lambda (ls)&#xA;&#x9;&#x9;  (tr (td class: &#34;num&#34; (car ls))&#xA;&#x9;&#x9;      (td class: &#34;stu&#34; (cadr ls))&#xA;&#x9;&#x9;      (map (lambda (s)&#xA;&#x9;&#x9;&#x9;     (td class: &#34;line&#34; s))&#xA;&#x9;&#x9;&#x9;   class-lines)))&#xA;&#x9;&#x9;als))))&#xA;&#x9;    &#xA;;; -rll-sht-.html&#xA;(define class-sheet-html&#xA;  (lambda (class-alst cls-kys stdn-alst stn-kys)&#xA;    (let ((page-ttle (path-  string (file-name-from-path (from-als-name-file class-alst &#34;&#34;))))&#xA;&#x9;  (out-file (open-output-file roll-sheet #:exists &#39;replace)))&#xA;      (output-xml (xhtml&#xA;&#x9;&#x9;  (head (title page-ttle )&#xA;&#x9;&#x9;&#x9;(meta http-equiv: &#34;Content-Type&#34; content: &#34;text/html;charset=utf-8&#34;)&#xA;&#x9;&#x9;&#x9;(map style (list ;;saves spase to map style over a list of strings&#xA;&#x9;&#x9;&#x9;&#x9;    &#34;h2 { font-weight: normal; }&#34;&#xA;&#x9;&#x9;&#x9;&#x9;    &#34;table.classinfo { margin: 1em 0 3em 0; } &#34;&#xA;&#x9;&#x9;&#x9;&#x9;    &#34;table.classinfo td, th { font-weight: normal; padding-right: 1em; text-align: left; }&#34;&#xA;&#x9;&#x9;&#x9;&#x9;    &#34;table.roll th { font-weight: 50; font-size: 9pt; }&#34;&#xA;&#x9;&#x9;&#x9;&#x9;    &#34;table.roll td {padding-right: .5em; text-align: left; }&#34;&#xA;&#x9;&#x9;&#x9;&#x9;    &#34;table.rollsymbols td.date {font-size: 9pt; text-align: right; }&#34;&#xA;&#x9;&#x9;&#x9;&#x9;    &#34;td.num { font-size: 8pt; }&#34;&#xA;&#x9;&#x9;&#x9;&#x9;    &#34;td.stu { font-size: 10pt; width: 6em; }&#34;&#xA;&#x9;&#x9;&#x9;&#x9;    &#34;td.blank { padding: 10px 0px 2px 0px;  text-align: center; }&#34;&#xA;&#x9;&#x9;&#x9;&#x9;    &#34;table.seating td {padding: 4px 6px 6px 6px; font-size: 11pt; }&#34;)))&#xA;&#x9;&#x9;  (body (h2 page-ttle)&#xA;&#x9;&#x9;&#x9;(class-table class-alst cls-kys)&#xA;&#x9;&#x9;&#x9;(roll-table stdn-alst stn-kys)&#xA;&#x9;&#x9;&#x9;))&#xA;&#x9;&#x9;  out-file)&#xA;      (close-output-port out-file))))&#xA;&#xA;(class-sheet-html cls-als clss-keys stt-rll-dta stdt-keys)&#xA;&#xA;;; end roll-sheet generation&#xA;;; start seating chart generation&#xA;(define seat-chart (from-als-name-file cls-als end-ext-seats))&#xA;&#xA;(define fill-row&#xA;  (lambda (lst num)&#xA;    (cond&#xA;     ((= 0 num) (reverse lst))&#xA;     (#t (fill-row (cons &#39;(&#34;&#34; &#34;_&#34;) lst) (sub1 num))))))&#xA;&#xA;(define split-rows&#xA;  (lambda (list limt)&#xA;    (let ((lim (if (number? limt) limt (string-  number limt)))&#xA;&#x9;  (rows &#39;()))&#xA;      (define helper ;; re-write with split-at and drop later&#xA;&#x9;(lambda (lst now prt prts)&#xA;&#x9;  (cond&#xA;&#x9;   ((null? lst)(reverse (cons (fill-row prt (- lim now)) prts)))&#xA;&#x9;   ((= lim now)(helper lst 0 &#39;() (cons (reverse prt) prts)))&#xA;&#x9;   (#t (helper (cdr lst) (add1 now) (cons (car lst) prt) prts)))))&#xA;      (helper list 0 &#39;() &#39;()))))&#xA;&#xA;(define lng-nme-  lst-nme&#xA;  (lambda (name)&#xA;    (if (  7 (string-length name))&#xA;&#x9;name&#xA;&#x9;(last (string-split name)))))&#xA;&#xA;(define stdt-cell&#xA;  (lambda (pair)&#xA;    (td (lng-nme-  lst-nme (cadr pair)) (br) (car pair))))&#xA;&#xA;;; stt-rll-dta in current flow,&#xA;;; or import roll-file from -roll-data.rkt if hand-change order in .rkt file&#xA;(define seat-table&#xA;  ;; for now outupt a default 6 seater row .html page&#xA;  (lambda (rll-dta lmt)&#xA;    (table class: &#34;seating chart&#34;&#xA;&#x9;   (map (lambda (row)&#xA;&#x9;&#x9;  (tr&#xA;&#x9;&#x9;   (map (lambda (pair)&#xA;&#x9;&#x9;&#x9;  (stdt-cell pair))&#xA;&#x9;&#x9;&#x9;row)))&#xA;&#x9;&#x9;(split-rows rll-dta lmt)))))&#xA;;; (output-xml (seat-table stt-rll-dta seat-row-num))&#xA;&#xA;(define class-seating-html&#xA;  (lambda (rll-dta row-len)&#xA;    (let ((out-file (open-output-file seat-chart #:exists &#39;replace))&#xA;&#x9;  (page-ttle (path-  string (file-name-from-path seat-chart))))&#xA;      (output-xml (xhtml&#xA;&#x9;&#x9;   (head (title page-ttle )&#xA;&#x9;&#x9;&#x9; (meta http-equiv: &#34;Content-Type&#34; content: &#34;text/html;charset=utf-8&#34;)&#xA;&#x9;&#x9;&#x9; (map style (list ;;saves space to map style over a list of strings&#xA;                                     &#34;@page { size: 210mm 297mm; margin: 4mm 4mm 6mm 4mm; }&#34;&#xA;&#x9;&#x9;&#x9;&#x9;     &#34;h2 { font-weight: normal; }&#34;&#xA;                                     &#34;table.teacher {border: thin solid; margin: -2em 2em 2em 20em; padding: .5em 1em .5em 1em;}&#34;&#xA;                                     &#34;table.seating td {padding: 3px 6px 4px 6px; font-size: 11pt; }  &#34;)))&#xA;                   (body (p page-ttle)&#xA;                        (table class: &#34;teacher box&#34; (tr (td  &#34;teacher&#34;)))                      &#xA;                        (seat-table rll-dta row-len)))&#xA;                 out-file)&#xA;      (close-output-port out-file))))&#xA;&#xA;(class-seating-html stt-rll-dta seat-row-num)&#xA;&#xA; #Racket #DrRacket #LearningRacket #Programming #LearningProgramming#Scheme #RacketThroughExamples ]]&gt;</description>
      <content:encoded><![CDATA[<div><img src="https://i.snap.as/Binke65.png" /></div><p>Pages Generated by DrRacket with Code:</p>

<pre><code>#lang racket


(define base-dir &#34;NanKyuRoll&#34;)

(define working-directory (build-path (find-system-path &#39;home-dir)
                                     base-dir))
;; csv-data-file
(define data-file-name (build-path working-directory &#34;data/2018/1/EK1-a.csv&#34;))

;; go through list of file names from the directory
;; given from command-line.

;; get from command-line, default to 6
(define seat-row-num &#34;6&#34;)

(define end-ext-dta &#34;-roll-data.rkt&#34;)
(define end-ext-htm &#34;-roll-sheet.html&#34;)
(define end-ext-seats (string-append &#34;-seat-chart&#34;  &#34;-&#34; seat-row-num &#34;.html&#34;))

;; use at the end of the semester to output bureacratic report
(define end-ext-attnd &#34;-attendance.html&#34;)


;; get and clean data from sjis-encoded .csv file
(define characters-to-replace
  &#39;((&#34;\&#34;&#34; &#34;&#34;)
    (&#34; &#34; &#34; &#34;)
    (&#34;\u3000&#34; &#34; &#34;) 
    (&#34;�K&#34; &#34;II&#34;)
    (&#34;&#34; &#34;今&#34;)
    (&#34;&#34; &#34;別&#34;)
    (&#34;&#34; &#34;匡&#34;)))

(define clean-sjis-string
  (lambda (sjis-str char-rplc-list)
    (let ((new-str sjis-str))
      (for-each (lambda (pair)
	     (set! new-str (regexp-replace* (regexp (car pair))
					    new-str
					    (cadr pair))))
      char-rplc-list)
    new-str)))

(define get-sjis-file-contents-as-list-of-strings
  (lambda (fstr char-pairs)
    (let* ((inf (open-input-file fstr))
	   (iu8 (reencode-input-port inf &#34;SJIS&#34;))
	   (str (port-&gt;string iu8))
	   (cln-str (clean-sjis-string str char-pairs))) ;; closes port too
      (string-split cln-str &#34;\n&#34;))))

(define got-strs (get-sjis-file-contents-as-list-of-strings data-file-name characters-to-replace))

(define got-lsts (map (lambda (s) (string-split s &#34;,&#34;)) got-strs))

;; class data lists from first two lines of .csv file
(define cls-dta-lst (list (car got-lsts)
			  (cadr got-lsts)))
;; student data lists from third line on of .csv file
(define stt-dta-lst (cdddr got-lsts))

;; from data table-style  rows from .csv file
;;    make associative lists
(define transpose-rows-columns
  (lambda (lol) ;; list of lists
    (define helper
      (lambda (lol keep)
	(cond ((null? (car lol)) (reverse keep))
	      (#t (helper (map cdr lol) (cons (map car lol) keep))))))
    (helper lol &#39;())))

;; associative list reference
(define als-ref
  (lambda (key als)
    (let ((tmp (assoc key als)))
      (if tmp (cadr tmp) #f))))

(define cls-als
  (transpose-rows-columns cls-dta-lst))

(define stt-rll-dta
  (map (lambda (row)
	 (list (first row) (second row)))
       stt-dta-lst))

;; (require racket/pretty) not-needed?
(define defntn-symbol-to-string
  (lambda (symbl deftn)
    (let ((dfn &#34;&#34;)
	  (os (open-output-string)))
      (pretty-print (append
		     (cons &#39;define (list symbl))
		     (list deftn))
		    os)
      (set! dfn (get-output-string os))
      (set! dfn (regexp-replace #rx&#34;\\(\\(&#34; dfn &#34;&#39;((&#34;))
      (set! dfn (regexp-replace #rx&#34;&#39;\\(define &#34; dfn &#34;(define &#34;))
      dfn)))

(define from-als-name-directory
  (lambda (als)
    (build-path
     (find-system-path &#39;home-dir)
     base-dir
     (als-ref &#34;年度&#34; als)
     (als-ref &#34;学期&#34; als))))
(define from-als-make-directory
  (lambda (als)
    (make-directory*
     (from-als-name-directory als))))
(define from-als-name-file
  (lambda (als end-ext)
    (let ((time (als-ref &#34;開講曜日&#34; als))
	  (clss (als-ref &#34;科目名&#34; als)))
      (build-path (path-&gt;string (from-als-name-directory als))
		  (string-append time clss
				 end-ext)))))
(define roll-file (from-als-name-file cls-als end-ext-dta))
(define roll-sheet (from-als-name-file cls-als end-ext-htm))

;; only need first two columns from sjis-csv-data above
(require (only-in srfi/1 iota))
;; set the number of class-meetings used for roll-sheet
(define classes 15)
; (define roll-heads
;  &#39;(&#34;学籍番号&#34; &#34;学生氏名&#34;   1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 tst grd))
(define roll-heads
  (cons &#34;学籍番号&#34; (cons &#34;学生氏名&#34;
			 (append (iota classes 1)
				 (cons &#39;tst &#39;(grd))))))
;; one underline per cell under each class number in roll table
(define class-lines (map (lambda (n) &#34;_&#34;) (iota classes)))

(define roll-data
  (lambda (stdt-list)
    (map (lambda (lst) (list (car lst) (cadr lst)))
	 stdt-list)))
;; later get the keys and the roll-heads from cls-als data position?
(define stdt-keys (list (first roll-heads)(second roll-heads)))
;; &#34;学籍番号&#34; &#34;学生氏名&#34; 
(define clss-keys &#39;(&#34;年度&#34; &#34;学期&#34; &#34;科目名&#34; &#34;開講曜日&#34; &#34;開講教室&#34; &#34;教員氏名&#34;))
(define comment-string-sample-roll-date-lists
&#34;
;; ;; (define rll-dta
;; ;;   &#39;((\&#34;1531116007\&#34; \&#34;石牟礼 道子\&#34; 1 0 1 1 1 0 1 1 0 1 1 0 1 1 1)
;; cls-dts need to be entered during/after the semester
;; (define cls-dts
;;  &#39;((10 01)(10 15)(10 22)(10 29)(11 5)(11 12)(11 19)(11 26)
;; (12 3)(12 10)(12 17)(1 7)(1 21)(1 28)(2 4)))  
&#34;
)

(define start-roll-data-file
  (lambda (als end-ext)
    (let ((out-fle (open-output-file
		  ;;  (build-path
		    ;; (from-als-name-directory als)
		     (from-als-name-file als end-ext)
		    #:exists &#39;replace)))
      (display comment-string-sample-roll-date-lists out-fle)
      (close-output-port out-fle))))

;; (start-roll-data-rkt roll-file explan-string)
(start-roll-data-file cls-als end-ext-dta)

;; This procedure puts symbols and their definitions into roll-data file
(define add-to-roll-data-file
  (lambda (sym f-als s-als) ;; file als, and symbol als, not alwasy the same
    (let ((apnd-file (open-output-file
		      (from-als-name-file f-als end-ext-dta)
		      #:exists &#39;append)))
      ;; earlier version worked with emacs geiser, but got #%top errors in DrRacket
      (display (defntn-symbol-to-string sym s-als) apnd-file)
      (close-output-port apnd-file))))

;; only need two definitions so far
;; avoiding #%top issues with eval
(add-to-roll-data-file &#39;cls-als cls-als cls-als)   
(add-to-roll-data-file &#39;stt-rll-dta cls-als stt-rll-dta)    

(require scribble/html) ;; for output-xml
(require scribble/html/html) ;; for table etc
;; clss-keys stdt-keys
(define class-table
  (lambda (als kys)
    (table class: &#34;classinfo&#34;
	   (tr
	    (map (lambda (ky)
		   (th (car (assoc ky als))))
		 kys))
	   (tr
	    (map (lambda (ky)
		   (td (cadr (assoc ky als))))
		       kys)))))

;; use class-lines as global variable, or argument?
(define roll-table
  (lambda (als kys)
    (table class: &#34;roll&#34;
	   (tr
	    (map (lambda (hd)  ;; any need to separate keys from nums, tst, grd? as in Guile script?
		   (th class: &#34;hdr&#34; hd))
		 roll-heads))
	   (map (lambda (ls)
		  (tr (td class: &#34;num&#34; (car ls))
		      (td class: &#34;stu&#34; (cadr ls))
		      (map (lambda (s)
			     (td class: &#34;line&#34; s))
			   class-lines)))
		als))))
	    
;; -rll-sht-.html
(define class-sheet-html
  (lambda (class-alst cls-kys stdn-alst stn-kys)
    (let ((page-ttle (path-&gt;string (file-name-from-path (from-als-name-file class-alst &#34;&#34;))))
	  (out-file (open-output-file roll-sheet #:exists &#39;replace)))
      (output-xml (xhtml
		  (head (title page-ttle )
			(meta http-equiv: &#34;Content-Type&#34; content: &#34;text/html;charset=utf-8&#34;)
			(map style (list ;;saves spase to map style over a list of strings
				    &#34;h2 { font-weight: normal; }&#34;
				    &#34;table.classinfo { margin: 1em 0 3em 0; } &#34;
				    &#34;table.classinfo td, th { font-weight: normal; padding-right: 1em; text-align: left; }&#34;
				    &#34;table.roll th { font-weight: 50; font-size: 9pt; }&#34;
				    &#34;table.roll td {padding-right: .5em; text-align: left; }&#34;
				    &#34;table.rollsymbols td.date {font-size: 9pt; text-align: right; }&#34;
				    &#34;td.num { font-size: 8pt; }&#34;
				    &#34;td.stu { font-size: 10pt; width: 6em; }&#34;
				    &#34;td.blank { padding: 10px 0px 2px 0px;  text-align: center; }&#34;
				    &#34;table.seating td {padding: 4px 6px 6px 6px; font-size: 11pt; }&#34;)))
		  (body (h2 page-ttle)
			(class-table class-alst cls-kys)
			(roll-table stdn-alst stn-kys)
			))
		  out-file)
      (close-output-port out-file))))

(class-sheet-html cls-als clss-keys stt-rll-dta stdt-keys)

;; end roll-sheet generation
;; start seating chart generation
(define seat-chart (from-als-name-file cls-als end-ext-seats))

(define fill-row
  (lambda (lst num)
    (cond
     ((= 0 num) (reverse lst))
     (#t (fill-row (cons &#39;(&#34;_&#34; &#34;_&#34;) lst) (sub1 num))))))

(define split-rows
  (lambda (list limt)
    (let ((lim (if (number? limt) limt (string-&gt;number limt)))
	  (rows &#39;()))
      (define helper ;; re-write with split-at and drop later
	(lambda (lst now prt prts)
	  (cond
	   ((null? lst)(reverse (cons (fill-row prt (- lim now)) prts)))
	   ((= lim now)(helper lst 0 &#39;() (cons (reverse prt) prts)))
	   (#t (helper (cdr lst) (add1 now) (cons (car lst) prt) prts)))))
      (helper list 0 &#39;() &#39;()))))

(define lng-nme-&gt;lst-nme
  (lambda (name)
    (if (&gt; 7 (string-length name))
	name
	(last (string-split name)))))

(define stdt-cell
  (lambda (pair)
    (td (lng-nme-&gt;lst-nme (cadr pair)) (br) (car pair))))

;; stt-rll-dta in current flow,
;; or import roll-file from -roll-data.rkt if hand-change order in .rkt file
(define seat-table
  ;; for now outupt a default 6 seater row .html page
  (lambda (rll-dta lmt)
    (table class: &#34;seating chart&#34;
	   (map (lambda (row)
		  (tr
		   (map (lambda (pair)
			  (stdt-cell pair))
			row)))
		(split-rows rll-dta lmt)))))
;; (output-xml (seat-table stt-rll-dta seat-row-num))

(define class-seating-html
  (lambda (rll-dta row-len)
    (let ((out-file (open-output-file seat-chart #:exists &#39;replace))
	  (page-ttle (path-&gt;string (file-name-from-path seat-chart))))
      (output-xml (xhtml
		   (head (title page-ttle )
			 (meta http-equiv: &#34;Content-Type&#34; content: &#34;text/html;charset=utf-8&#34;)
			 (map style (list ;;saves space to map style over a list of strings
                                     &#34;@page { size: 210mm 297mm; margin: 4mm 4mm 6mm 4mm; }&#34;
				     &#34;h2 { font-weight: normal; }&#34;
                                     &#34;table.teacher {border: thin solid; margin: -2em 2em 2em 20em; padding: .5em 1em .5em 1em;}&#34;
                                     &#34;table.seating td {padding: 3px 6px 4px 6px; font-size: 11pt; }  &#34;)))
                   (body (p page-ttle)
                        (table class: &#34;teacher box&#34; (tr (td  &#34;teacher&#34;)))                      
                        (seat-table rll-dta row-len)))
                 out-file)
      (close-output-port out-file))))

(class-seating-html stt-rll-dta seat-row-num)

</code></pre>

<p> #Racket #DrRacket #LearningRacket #Programming #LearningProgramming#Scheme #RacketThroughExamples</p>
]]></content:encoded>
      <author>bsmall2</author>
      <guid>https://snap.as/bsmall2/racket-facdev/Binke65</guid>
      <pubDate>Wed, 03 Apr 2019 06:48:25 +0000</pubDate>
    </item>
    <item>
      <title></title>
      <link>https://snap.as/bsmall2/racket-facdev/ZGf5eN2</link>
      <description>&lt;![CDATA[  ]]&gt;</description>
      <content:encoded><![CDATA[<div><img src="https://i.snap.as/ZGf5eN2.png" /></div>]]></content:encoded>
      <author>bsmall2</author>
      <guid>https://snap.as/bsmall2/racket-facdev/ZGf5eN2</guid>
      <pubDate>Mon, 01 Jul 2019 12:16:22 +0000</pubDate>
    </item>
    <item>
      <title></title>
      <link>https://snap.as/bsmall2/racket-facdev/2Ke0tYf</link>
      <description>&lt;![CDATA[  ]]&gt;</description>
      <content:encoded><![CDATA[<div><img src="https://i.snap.as/2Ke0tYf.png" /></div>]]></content:encoded>
      <author>bsmall2</author>
      <guid>https://snap.as/bsmall2/racket-facdev/2Ke0tYf</guid>
      <pubDate>Mon, 01 Jul 2019 12:16:23 +0000</pubDate>
    </item>
    <item>
      <title></title>
      <link>https://snap.as/bsmall2/racket-facdev/VfK72aA</link>
      <description>&lt;![CDATA[  ]]&gt;</description>
      <content:encoded><![CDATA[<div><img src="https://i.snap.as/VfK72aA.png" /></div>]]></content:encoded>
      <author>bsmall2</author>
      <guid>https://snap.as/bsmall2/racket-facdev/VfK72aA</guid>
      <pubDate>Mon, 01 Jul 2019 12:16:22 +0000</pubDate>
    </item>
  </channel>
</rss>