Update qqzreorder.pl
cover Update qqzreorder.pl
From a2d0cd80fb99a15bd5265f12863ac8f0183f9a9b Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 18 Nov 2017 23:43:37 +0900
Subject: [PATCH 0/3] Update qqzreorder.pl
Hi Paul,
In commit 90197e37d310 ("Fix layout hiccups in answers to quick quizzes"), I missed that code snippets at the end of QQAs were taken care of by qqzreorder.pl. The hiccup I saw in rcuapi.tex was the regression of conversion of code snippets to "listing" environment. I should have updated qqzreorder.pl at the time so that it could take care of "listing"s at the end of QQAs.
Patch #1 updates qqzreorder.pl and tweaks a code snippet in memorder's QQA, which has such a listing at the end of a QQA.
Patch #2 reverts the unnecessary changes in the above mentioned commit. It has no effect in the resulting PDF, but the spacial case handling should be done in a consistent manner.
Patch #3 fixes unrelated trivial typos.
Thanks, Akira
--
Akira Yokosawa (3):
Update qqzreorder.pl to take care of listing at the end of QQA Partial revert of 'Fix layout hiccups in answers to quick quizzes'
memorder: Fix trivial typo
defer/rcuapi.tex | 7 +++---- memorder/memorder.tex | 5 +++-- utilities/qqzreorder.pl | 24 ++++++++++++------------ 3 files changed, 18 insertions(+), 18 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/3 Update qqzreorder.pl to take care of listing at the end of QQA
From 75056ec5dd25a1e6daa45cf4592e51fbb26685a8 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 18 Nov 2017 21:03:23 +0900
Subject: [PATCH 1/3] Update qqzreorder.pl to take care of listing at the end of QQA
Also add a blank line above \begin{listing} so that the reordered \QuickE{} is output at the right place.
--- memorder/memorder.tex | 1 + utilities/qqzreorder.pl | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 12 deletions(-)
memorder/memorder.tex +1 -0
@@ -2634,6 +2634,7 @@ suffice to prevent the \co{exists} clause from triggering. shows a somewhat nonsensical but very real example. Creating a more useful (but still real) litmus test is left as an exercise for the reader. + \begin{listing}[tbp] { \scriptsize \begin{verbbox}[\LstLineNo]
utilities/qqzreorder.pl +12 -12
@@ -2,8 +2,8 @@ # # Move line of \QuickE{} below \end{enumerate} to just above # the \end{enumerate}. -# Move line of \QuickE{} below \end{figure} to above -# \begin{figure} corresponding to it. +# Move line of \QuickE{} below \end{listing} to above +# \begin{listing} corresponding to it. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by
@@ -25,8 +25,8 @@ my $line; my $after_end_enum = 0; -my $in_figure = 0; -my $after_figure = 0; +my $in_listing = 0; +my $after_listing = 0; my $line_idx = 1; my @line_buf;
@@ -42,15 +42,15 @@ while($line = <>) { $after_end_enum = 0; next; } - if ($in_figure) { - if ($line =~ /\\end\{figure\}/) { - $after_figure = 1; - $in_figure = 0; + if ($in_listing) { + if ($line =~ /\\end\{listing\}/) { + $after_listing = 1; + $in_listing = 0; } $line_buf[++$line_idx] = $line; next; } - if ($after_figure) { + if ($after_listing) { if ($line =~ /%/) { $line_buf[++$line_idx] = $line; next;
@@ -68,7 +68,7 @@ while($line = <>) { $line_buf[1] = $line; } $line_idx = 1; - $after_figure = 0; + $after_listing = 0; next; } if ($line =~ /\\end\{enumerate\}/) {
@@ -77,8 +77,8 @@ while($line = <>) { $after_end_enum = 1; next; } - if ($line =~ /\\begin\{figure\}/) { - $in_figure = 1; + if ($line =~ /\\begin\{listing\}/) { + $in_listing = 1; $line_buf[++$line_idx] = $line; next; }
Signature · 1 line
2.7.4
PATCH 2/3 Partial revert of 'Fix layout hiccups in answers to quick quizzes'
In reply to Akira YokosawaFrom 3f6060fdcfe12b94ac56380e4211c06316b141c5 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 18 Nov 2017 23:30:40 +0900
Subject: [PATCH 2/3] Partial revert of 'Fix layout hiccups in answers to quick quizzes'
As qqzreorder.pl can take care of "listing" at the end of QQA now, some of the changes made in commit 90197e37d310 ("Fix layout hiccups in answers to quick quizzes") can be reverted.
--- defer/rcuapi.tex | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
defer/rcuapi.tex +3 -4
@@ -367,8 +367,8 @@ returns a value that must be passed into the corresponding In practice, however, doing this is almost certainly a bad idea. In particular, the code shown in Listing~\ref{lst:defer:Multistage SRCU Deadlocks} - could still result in deadlock.% -% + could still result in deadlock. + \begin{listing}[htbp] \scriptsize {
@@ -388,8 +388,7 @@ returns a value that must be passed into the corresponding \theverbbox \caption{Multistage SRCU Deadlocks} \label{lst:defer:Multistage SRCU Deadlocks} -\end{listing}% -% +\end{listing} } \QuickQuizEnd The Linux kernel currently has a surprising number of RCU APIs and
Signature · 1 line
2.7.4
PATCH 3/3 memorder: Fix trivial typo
In reply to Akira YokosawaFrom a2d0cd80fb99a15bd5265f12863ac8f0183f9a9b Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 18 Nov 2017 23:39:26 +0900
Subject: [PATCH 3/3] memorder: Fix trivial typo
--- memorder/memorder.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
memorder/memorder.tex +2 -2
@@ -10,7 +10,7 @@ Causality and sequencing are deeply intuitive, and hackers often tend to have a much stronger grasp of these concepts than does the general population. These intuitions can be extremely powerful tools when writing, analyzing, -and debugging both sequential code and parallel code that makes +and debugging both sequential code and parallel code that make use of standard mutual-exclusion mechanisms, such as locking and RCU. Unfortunately, these intuitions break down completely in face of
@@ -38,7 +38,7 @@ follows up with more detail on what representative hardware platforms actually do to unwary parallel programmers. Finally, Section~\ref{sec:memorder:Where is Memory Ordering Needed?} provides some rules of thumb for what situations require parallel -programmers to take special action to preserver memory ordering. +programmers to take special action to preserve memory ordering. \section{Ordering: Why and How?} \label{sec:memorder:Ordering: Why and How?}
Signature · 1 line
2.7.4
Re: [PATCH 3/3] memorder: Fix trivial typo
Quoted 6 lines · Akira Yokosawa
Quoted 1 line
From
a2d0cd80fb99a15bd5265f12863ac8f0183f9a9bMon Sep 17 00:00:00 2001From: Akira Yokosawa <[email protected]>
Date: Sat, 18 Nov 2017 23:39:26 +0900
Subject: [PATCH 3/3] memorder: Fix trivial typoSigned-off-by Akira Yokosawa <[email protected]>
I applied all three, and especially like the script taking up some of the manual handling of quick quizzes with figures!
One thing I left out, please see below.
Thanx, Paul
Quoted 9 lines
--- memorder/memorder.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)memorder/memorder.tex +0
-0
memorder/memorder.tex Causality and sequencing are deeply intuitive, and hackers often · line 16
Quoted 8 lines
memorder/memorder.tex +1
-1@@ -10,7 +10,7 @@ Causality and sequencing are deeply intuitive, and hackers often tend to have a much stronger grasp of these concepts than does the general population. These intuitions can be extremely powerful tools when writing, analyzing, -and debugging both sequential code and parallel code that makes +and debugging both sequential code and parallel code that make use of standard mutual-exclusion mechanisms, such as locking and RCU. Unfortunately, these intuitions break down completely in face of
If it was "intuitions" that made use of "standard mutual-exclusion mechanisms", this fix would be correct. Plural "intuitions" would require plural "make". (And no, I have no idea why English adds "s" to nouns to denote plural, but removes "s" from verbs to denote plural. Probably because it is English...)
But it is "code" that made use of "standard mutual-exclusion mechanisms". I am treating "code" like "water", that is, "lines of code" would be plural (like "molecules of water"), but "code" is singular (like "water").
I also treat "data" as singular, that is, as a collective noun. This is controversial, and people who like "data" to be plural probably also like "code" to be plural when referring to lines of code.
https://en.wikipedia.org/wiki/Data_(word)
And it appears that most people are now willing to put up with "data" as a collective noun when applied to computers. Others are probably still protesting that "data" is the plural form of "datum" in Latin.
But, yes, English! :-/
Thanx, Paul
Quoted 13 lines
memorder/memorder.tex +1
-1@@ -38,7 +38,7 @@ follows up with more detail on what representative hardware platforms actually do to unwary parallel programmers. Finally, Section~\ref{sec:memorder:Where is Memory Ordering Needed?} provides some rules of thumb for what situations require parallel -programmers to take special action to preserver memory ordering. +programmers to take special action to preserve memory ordering. \section{Ordering: Why and How?} \label{sec:memorder:Ordering: Why and How?}Signature · 1 line
2.7.4
Re: [PATCH 3/3] memorder: Fix trivial typo
Quoted 39 lines · Paul E. McKenney
Quoted 6 lines · Akira Yokosawa
Quoted 1 line
From
a2d0cd80fb99a15bd5265f12863ac8f0183f9a9bMon Sep 17 00:00:00 2001From: Akira Yokosawa <[email protected]>
Date: Sat, 18 Nov 2017 23:39:26 +0900
Subject: [PATCH 3/3] memorder: Fix trivial typoSigned-off-by Akira Yokosawa <[email protected]>I applied all three, and especially like the script taking up some of the manual handling of quick quizzes with figures!
One thing I left out, please see below.
Thanx, Paul
Quoted 9 lines
--- memorder/memorder.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)memorder/memorder.tex +0
-0memorder/memorder.tex Causality and sequencing are deeply intuitive, and hackers often · line 16
Quoted 8 lines
memorder/memorder.tex +1
-1@@ -10,7 +10,7 @@ Causality and sequencing are deeply intuitive, and hackers often tend to have a much stronger grasp of these concepts than does the general population. These intuitions can be extremely powerful tools when writing, analyzing, -and debugging both sequential code and parallel code that makes +and debugging both sequential code and parallel code that make use of standard mutual-exclusion mechanisms, such as locking and RCU. Unfortunately, these intuitions break down completely in face ofIf it was "intuitions" that made use of "standard mutual-exclusion mechanisms", this fix would be correct. Plural "intuitions" would require plural "make". (And no, I have no idea why English adds "s" to nouns to denote plural, but removes "s" from verbs to denote plural. Probably because it is English...)
Quoted 3 lines
But it is "code" that made use of "standard mutual-exclusion mechanisms". I am treating "code" like "water", that is, "lines of code" would be plural (like "molecules of water"), but "code" is singular (like "water").
I see. What happened in my mind was a dumb pattern match with:
"Both X and Y that makes use of ..."
Quoted 5 lines
I also treat "data" as singular, that is, as a collective noun. This is controversial, and people who like "data" to be plural probably also like "code" to be plural when referring to lines of code.
Quoted 7 lines
https://en.wikipedia.org/wiki/Data_(word)
And it appears that most people are now willing to put up with "data" as a collective noun when applied to computers. Others are probably still protesting that "data" is the plural form of "datum" in Latin.
But, yes, English! :-/
Yes. "data" always bother/bothers me... :-(
Thanks, Akira
Quoted 18 lines
Thanx, Paul
Quoted 13 lines
memorder/memorder.tex +1
-1@@ -38,7 +38,7 @@ follows up with more detail on what representative hardware platforms actually do to unwary parallel programmers. Finally, Section~\ref{sec:memorder:Where is Memory Ordering Needed?} provides some rules of thumb for what situations require parallel -programmers to take special action to preserver memory ordering. +programmers to take special action to preserve memory ordering. \section{Ordering: Why and How?} \label{sec:memorder:Ordering: Why and How?}Signature · 1 line
2.7.4