Random Bits of Open Code

Check-in [90b623893c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add topmgrid from local.makefile and add Makefile for wiki-to-dot
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:90b623893c45ad21404855ca74893013ffd7b3bd
User & Date: mrwellan 2019-04-22 17:59:19
Context
2019-04-23
00:38
Group Updater should be integrated. Still problems with runstats datafiles check-in: 455b1ac6ad user: jmoon18 tags: trunk
2019-04-22
17:59
Add topmgrid from local.makefile and add Makefile for wiki-to-dot check-in: 90b623893c user: mrwellan tags: trunk
2019-04-19
23:42
Fixed open-db to match other queries check-in: b5f39c8f5c user: jmoon18 tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ringchart/Makefile.

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Put the path for source data in local.make as INPUTPATH
include local.make

FULLSRCFILES=$(wildcard $(INPUT_DIR)/*.gz)
SRCFILES=$(notdir $(FULLSRCFILES))
TARGETFILES=$(addsuffix .log, $(patsubst %.gz,%,$(SRCFILES)))


all : runstats process $(TARGETFILES)

# 	@echo FULLSRCFILES: $(FULLSRCFILES)
# 	@echo SRCFILES: $(SRCFILES)
# 	@echo TARGETFILES: $(TARGETFILES)

% : %.scm
	csc $<

genhtml : runstats
	runstats sumup
	runstats rollup
	runstats datafiles
	mkdir -p html
	mv *.html html

jobs.db : output.db
	echo Please copy output.db to jobs.db








<











|







2
3
4
5
6
7
8

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Put the path for source data in local.make as INPUTPATH
include local.make

FULLSRCFILES=$(wildcard $(INPUT_DIR)/*.gz)
SRCFILES=$(notdir $(FULLSRCFILES))
TARGETFILES=$(addsuffix .log, $(patsubst %.gz,%,$(SRCFILES)))


all : runstats process $(TARGETFILES)

# 	@echo FULLSRCFILES: $(FULLSRCFILES)
# 	@echo SRCFILES: $(SRCFILES)
# 	@echo TARGETFILES: $(TARGETFILES)

% : %.scm
	csc $<

genhtml : runstats
	runstats sumup
	runstats rollup $(TOPMGRID)
	runstats datafiles
	mkdir -p html
	mv *.html html

jobs.db : output.db
	echo Please copy output.db to jobs.db

Changes to utils/Makefile.




1
2
3
4
5



trial.dot :
	csi -bq wiki-to-dot.scm  > trial.dot

trial.pdf : trial.dot
	dot -T pdf trial.dot > tr
>
>
>





1
2
3
4
5
6
7
8
~/bin/wiki-to-dot : wiki-to-dot.scm
	csc wiki-to-dot.scm -o ~/bin/wiki-to-dot

trial.dot :
	csi -bq wiki-to-dot.scm  > trial.dot

trial.pdf : trial.dot
	dot -T pdf trial.dot > tr

Changes to utils/wiki-to-dot.scm.

9
10
11
12
13
14
15


16
17
18
19
20
21
22
..
58
59
60
61
62
63
64

65
66
67

68

69
70
71
72
73
74
75
76
77
78
79
80

(define pages (let ((all (fsl "wiki list")))
		(if (null? show-pages)
		    all
		    (filter (lambda (x)
			      (member x show-pages))
			    all))))



(print "// pages \"" (string-intersperse pages "\", \"") "\"")

(print "digraph G {")
(print "  rankdir=LR;")
(define cnum 0)
;;(define seprx "\\][^\\[]" )
................................................................................
		(loop (read-line) #t))
	       ((string-search "</verbatim>" inl)
		(loop (read-line) #f))
	       (ver (loop (read-line) ver))
	       (else
		(if (and (string-search "\\[" inl)
			 (> (length ldat) 0))

		    (for-each
		     (lambda (seg)
		       (if (not (string-null? seg))

			   (let* ((parts (string-split seg "|")))

			     (if (> (length parts) 1)
				 (print "   \"" page "\" -> \"" (escape-quotes (car parts))
					"\" [label=\"" (escape-quotes (cadr parts)) "\"];")
				 (print "   \"" page "\" -> \"" (escape-quotes seg) "\";")))))
		     ldat))
		;; (print "ldat: \"" (string-intersperse ldat "\",\"") "\"")
		(loop (read-line) ver))))))))
   (print " }\n")
   )
 pages)

(print "}")







>
>







 







>
|
|
|
>
|
>
|
|
|
|
|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
..
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

(define pages (let ((all (fsl "wiki list")))
		(if (null? show-pages)
		    all
		    (filter (lambda (x)
			      (member x show-pages))
			    all))))

(define max-links-per-page 10)

(print "// pages \"" (string-intersperse pages "\", \"") "\"")

(print "digraph G {")
(print "  rankdir=LR;")
(define cnum 0)
;;(define seprx "\\][^\\[]" )
................................................................................
		(loop (read-line) #t))
	       ((string-search "</verbatim>" inl)
		(loop (read-line) #f))
	       (ver (loop (read-line) ver))
	       (else
		(if (and (string-search "\\[" inl)
			 (> (length ldat) 0))
		    (let ((link-count 0))
		      (for-each
		       (lambda (seg)
			 (if (not (string-null? seg))
			     (if (< link-count max-links-per-page)
				 (let* ((parts (string-split seg "|")))
				   (set! link-count (+ link-count 1))
				   (if (> (length parts) 1)
				       (print "   \"" page "\" -> \"" (escape-quotes (car parts))
					      "\" [label=\"" (escape-quotes (cadr parts)) "\"];")
				       (print "   \"" page "\" -> \"" (escape-quotes seg) "\";"))))))
			 ldat)))
		;; (print "ldat: \"" (string-intersperse ldat "\",\"") "\"")
		(loop (read-line) ver))))))))
   (print " }\n")
   )
 pages)

(print "}")