~charles/cdaniels.net

4425bf6576b25d1ae6762dacb893f31749682767 — Charles Daniels a month ago 6ba7392
fix broken newlines
M src/2016-11-24-lab-reports.md => src/2016-11-24-lab-reports.md +5 -5
@@ 252,9 252,9 @@ comment, and is ignored by the compiler.
    backgroundcolor=\color{backcolour},   
    commentstyle=\color{codegreen},
    keywordstyle=\color{magenta},
    numberstyle=\tiny\color{codegray},
    numberstyle=\\tiny\color{codegray},
    stringstyle=\color{codepurple},
    basicstyle=\footnotesize\ttfamily,
    basicstyle=\footnotesize\\ttfamily,
    breakatwhitespace=false,         
    breaklines=true,                 
    captionpos=b,                    


@@ 270,8 270,8 @@ comment, and is ignored by the compiler.
\lstset{style=mystyle}

% make figures work properly in multicols
\newenvironment{Figure}
    {\par\medskip\noindent\minipage{\linewidth}}
\\newenvironment{Figure}
    {\par\medskip\\noindent\minipage{\linewidth}}
    {\endminipage\par\medskip}

```


@@ 971,7 971,7 @@ g = 9.81  # gravity constant
logging.info("output format is: {}".format(','.join(output_format)))

for line in sys.stdin:
  line = line.replace('\n', '')
  line = line.replace('\\n', '')
  logging.debug("processing line: {}".format(line))
  line = [float(x) for x in line.split(',')]
  assert len(line) is 5

M src/2017-07-15-guide-to-make.md => src/2017-07-15-guide-to-make.md +2 -2
@@ 143,7 143,7 @@ Consider the following files comprising a simple C program:

int main() {
	hello();
	printf("Hello from main.c!\n");
	printf("Hello from main.c!\\n");
}
```



@@ 165,7 165,7 @@ int main() {
#include "module.h"

void hello() {
	printf("Hello from module.c!\n");
	printf("Hello from module.c!\\n");
}
```


M src/2017-11-22_make-static-site.md => src/2017-11-22_make-static-site.md +17 -17
@@ 208,7 208,7 @@ index_center.fragment: $(IDXFILES)
	for f in $$(ls *.idx | sort -r) ; do cat "$$f" >> "index_center.fragment" ; done

index.html: header.html.template index_header.template index_center.fragment index_footer.template
	printf '<title>The Blog of Charles Daniels</title>\n' > "$@"
	printf '<title>The Blog of Charles Daniels</title>\\n' > "$@"
	cat $^ >> "$@"
	./mkfooter.sh >> "$@"



@@ 229,7 229,7 @@ extract the post title and date, which is accomplished by the command `grep
'^title.*' < "$META_FILE" | cut -f 2` (in this case, we are extracting the
`title` field). This searches for a line that begins with the string literal
`title`, then extracts the second field therefrom (keep in mind that `cut` uses
`\t` as a delimiter by default).
`\\t` as a delimiter by default).

For illustrative purposes, here is the output of `meta2idx.sh` for this post's
metadata file:


@@ 254,11 254,11 @@ POST_DATE="$(grep '^date.*' < "$META_FILE" | cut -f 2)"
POSTS_ROOT="./"
POST_FILE="$POSTS_ROOT/$(basename "$1" .meta).html"

printf '\t<li class="postlisting">\n'
printf "\t\t<!--POST_TITLE='$POST_TITLE', POST_DATE='$POST_DATE', POST_FILE='$POST_FILE'-->\n"
printf '\t\t<span class="postdate">%s</span>\n' "$POST_DATE"
printf '\t\t<h2><div class="postlink"><a href="%s">%s</a></div></h2>\n' "$POST_FILE" "$POST_TITLE"
printf "\t</li>\n\n"
printf '\\t<li class="postlisting">\\n'
printf "\\t\\t<!--POST_TITLE='$POST_TITLE', POST_DATE='$POST_DATE', POST_FILE='$POST_FILE'-->\\n"
printf '\\t\\t<span class="postdate">%s</span>\\n' "$POST_DATE"
printf '\\t\\t<h2><div class="postlink"><a href="%s">%s</a></div></h2>\\n' "$POST_FILE" "$POST_TITLE"
printf "\\t</li>\\n\\n"
```

## `meta2title.sh`


@@ 291,10 291,10 @@ POST_DATE="$(grep '^date.*' < "$META_FILE" | cut -f 2)"
POSTS_ROOT="./"
POST_FILE="$POSTS_ROOT/$(basename "$1" .meta).html"

printf '<div class="posttitle">\n'
printf '\t<h1 class=posttitletext>%s</h1>\n' "$POST_TITLE"
printf '\t<p class=postdatetext><small>Posted %s</small></p>\n' "$POST_DATE"
printf '</div>\n'
printf '<div class="posttitle">\\n'
printf '\\t<h1 class=posttitletext>%s</h1>\\n' "$POST_TITLE"
printf '\\t<p class=postdatetext><small>Posted %s</small></p>\\n' "$POST_DATE"
printf '</div>\\n'
printf '<title>%s</title>' "$POST_TITLE"
printf '<!--Generated on %s --!>' "$(date)"
```


@@ 324,12 324,12 @@ output every time it is run, which is included below for illustrative purposes.

CURRENT_YEAR=$(date +%Y)

printf "<footer>\n"
printf '\t<div class="footertext">\n'
printf '\t\t<hr>\n'
printf '\t\t<small>Copyright %s Charles Daniels</small>\n' "$CURRENT_YEAR"
printf '\t\t<p><small><a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.</small></p>\n'
printf '\t</div>\n'
printf "<footer>\\n"
printf '\\t<div class="footertext">\\n'
printf '\\t\\t<hr>\\n'
printf '\\t\\t<small>Copyright %s Charles Daniels</small>\\n' "$CURRENT_YEAR"
printf '\\t\\t<p><small><a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.</small></p>\\n'
printf '\\t</div>\\n'
printf '</footer>'
```


M src/sigusr.md => src/sigusr.md +4 -4
@@ 28,7 28,7 @@ handler:
void handler(int signo) {
	printf("Caught signal %i at ", signo);
	print_time();
	printf("\n");
	printf("\\n");
}
```



@@ 84,7 84,7 @@ void print_time(void) {
void handler(int signo) {
	printf("Caught signal %i at ", signo);
	print_time();
	printf("\n");
	printf("\\n");
}

int main(void) {


@@ 96,13 96,13 @@ int main(void) {
	/* wait forever, to give us time to send the signal */
	printf("Beginning wait at ");
	print_time();
	printf("\n");
	printf("\\n");

	while(1) {
		sleep(10);
		printf("Waiting... (");
		print_time();
		printf(")\n");
		printf(")\\n");
	}
}
```