This document is a collection of questions which appear frequently on zephyr. The questions are organized by category, and most have answers.
Send better answers and/or more questions to sprite@cs.cmu.edu.
This page contains questions that concern technical topics other than zephyr itself.
0.94 0.94 scale /showpage {showpage 0.94 0.94 scale} bind def
/usr/local/bin/psmerge foo.ps bar.ps baz.ps | lprnote that psmerge requires the files to have been created using the same application, with the same device setup and resources (fonts, procsets, patterns, files, etc) loaded.
\documentclass{article} \usepackage[pdftex]{graphicx} \begin{document} \includegraphics{foo.pdf} \includegraphics{bar.pdf} \end{document}You can also only include particular pages
\usepackage[pdftex]{graphicx} \includegraphics[page=4]{...}2) The command line
texexec --pdfarrange --result=doc3.pdf doc1.pdf doc2.pdf
%%BoundingBox l b r tyou should put:
l b r l sub t b sub rectclipas the first line of your postscript.
288 756 moveto /Helvetica findfont 12 scalefont setfont (Submitted to foo) showsuggested for every page:
/megabiteme { /Times-Roman findfont 12 scalefont setfont 288 756 moveto (Submitted to Blah) show } def megabiteme /showpage {showpage megabiteme} bind def(Tweak the "288 756" until it's where you want it, e.g., for the bottom of the page, you might want "72 54". 72 = 1 inch.)
pstops "4:0u@.47(4.2in,5.6in)+1u@.47(8.2in,5.6in)+2u@.47(4.2in,10.6in)+3u@.47(8.2in,10.6in)" slides.ps 4.ps
latex
vs latex2e
business?
latex
is
old, to prevent sudden trauma to those who depend on it. Some
people feel traumatized by the default and have aliased latex
to latex2e
. (There are various archived
questions for which the answer is "use latex2e.") See the SCS
LaTeX
and TeX Intro or the local LaTeX and
TeX FAQ (or even the 30 Aug 1996 archive around 1430.)
\tilde{\ } bovik -> ~bovik \char"7E bovik -> ~bovik
Put this at the top of your .tex file: \input epsf then to do a figure, do something like this: \begin{figure} \centerline{\epsfbox{fig1.ps}} \caption{yadda yadda yadda} \label{fig:multi} \end{figure}
\renewcommand{\topfraction}{1} \renewcommand{\bottomfraction}{1} \renewcommand{\textfraction}{0} \setcounter{topnumber}{50} \setcounter{bottomnumber}{50} \setcounter{totalnumber}{100} \renewcommand{\floatpagefraction}{0.8}This tells latex to ignore some rules like "only the top 25% of the page can be occupied by floats". (see pp.176-178)
\usepackage[nomarkers]{endfloat}Also, the
nolists
option will eliminate the list of figures,
if you don't want that.
/afs/cs/usr/sippy/bin/dvi2tty /afs/cs/usr/sippy/lib/tex/txt.sty
% define my compact itemized list \newcounter{ecount} \newenvironment{ecompact}{ \begin{list}% {\arabic{ecount}}{\usecounter{ecount} \parsep 0pt plus 1pt \partopsep 0pt plus 1pt \topsep 2pt plus 2pt minus 1pt \itemsep 0pt plus 1pt}}% {\end{list}} \newenvironment{icompact}{ \begin{list}{$\bullet$}{ \parsep 0pt plus 1pt \partopsep 0pt plus 1pt \topsep 2pt plus 2pt minus 1pt \itemsep 0pt plus 1pt}}% {\end{list}}Sample invocation:
\begin{icompact} \item foo \item bar \item baz \end{icompact}
/usr/local/bin/ps2epsi frame.ps frame_epsf.psand in the tex file use
\documentstyle[psfig]{article} ... \psfig{file=frame_epsf.ps,clip=,width=4in}This will scale the drawing so that it is 4in wide. If you specify both height and width, then the drawing will be stretched appropriately.
\usepackage{endnotes} \let\footnote=\endnoteAnd the following where you want the notes to appear:
\newpage \begingroup \parindent 0pt \parskip 2ex \def\enotesize{\normalsize} \theendnotes \endgroup
\documentclass{report} \usepackage{cmu-titlepage}
\newenvironment{chapquote} {\begin{flushright}\begin{minipage}{3.5in}\begin{flushright}\it} {\end{flushright}\end{minipage}\end{flushright}\bigskip} \def\who#1{\par---\rm #1}Use:
\begin{chapquote} Since it is known that the machine models we were considering can ``efficiently'' simulate a PRAM, we saw no theoretical reason why a good implementation could not be achieved. \who{Dyer, Nash and Dew~\cite{Dyer95}} \end{chapquote}
\newcommand{\D}{\discretionary{}{}{}}Then change URLs like this:
{\tt ftp://ftp.cray.com/product-info/program_env/program_model.html}into this:
{\tt ftp://\D ftp.cray.com/\D product-info/\D program_\D env/\D program_\D model.html}This will allow "hyphenation" at any of the \D spots, by just breaking the line there and not even adding an annoying hyphen. Use the shorter \D rather than \discretionary{}{}{}, otherwise you'll surely get bitten by bibtex's naive line-breaking algorithm.
\bibliographystyle{acm} \bibliography{thesis}(where the "thesis" names the file containing the bib, ala thesis.bib)
\cleardoublepage \addcontentsline{toc}{chapter}{Bibliography} \bibliography{bib}
\rhead{\small Harry Bovik, Page\,\ \thepage{}\,\ of\,\ 6}
\rhead{\scriptsize Page \thepage\ of \pageref{lastpage}} ... \label{lastpage} \end{document}
. . .
\author{ Harry Bovik \\ School of Computer Science\\ Carnegie Mellon University\\ 5000 Forbes Avenue, Pittsburgh PA 15213 \\ \small\tt bovik@cs.cmu.edu % \and % Jack Florey \\ School of Computer Science\\ Some Other University\\ Yadda Yadda \\ MA 02139 \\ \small\tt florey@fnord.edu }You might want two authors from the same institution...
\author{{\protect\rm Harry Bovik\hspace{1.25in} Mary Bovik}\\ \mbox{\small\it \begin{tabular}{c} Computer Science Department\\ Carnegie Mellon University\\ \{hbovik,mbovik\}@cs.cmu.edu \end{tabular}}}"i think the forced \rm and \it there were to conform to somebody's style guidelines." Anyway, you can take these and run with it.
dvips -f pstopnm ppmtogifNote that pstopnm will produce foo001.ppm foo002.ppm etc, one file for each page of the postscript document.
\makeatletter\long\def\unmarkedfootnote#1{{\long\def\@makefntext##1{##1}\footnotetext{#1}}} \unmarkedfootnote{.....}
\usepackage[pdftex]{graphicx} ... \includegraphics{foo.pdf}And, you shouldn't really need the [pdftex] because includegraphics should be smart enough to do that itself.
read-passwd
faster:
(defun prompt-before-exiting () (read-string "Exiting emacs; <RET> to confirm, C-g to abort: ")) (setq kill-emacs-hook 'prompt-before-exiting)
(setq pre-display-buffer-function nil)will cause buffers (e.g. *grep*) to be displayed in the selected frame even if they already appear in other frames.
clear Lock keysym Caps_Lock = Control_R add control = Control_R(you can also do this on the command line, but i forget the details.)"
(require 'jka-compr) (toggle-auto-compression)to force it on:
(toggle-auto-compression 1)
;; fix html mode. this doesn't completely stop all the pain, however. (autoload 'html-helper-mode "html-helper-mode" "Yay HTML" t) (setq auto-mode-alist (cons '("\\.html$" . html-helper-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.htm$" . html-helper-mode) auto-mode-alist)) (setq-default html-helper-build-new-buffer nil) (setq-default html-helper-do-write-file-hooks nil) (setq-default html-helper-indentation-list "") (add-hook 'html-helper-mode-hook '(lambda () (define-key html-helper-mode-map [return] 'newline) (font-lock-mode 1)))
crayon
and slide1
, in the
3rd floor machine room, are both loaded with slides.
They print differently so you should not mix slides from them.
The current incarnation of crayon
is a 600 dpi
deskjet, "excellent for detail work." (Same kind as the "paper"
printer palette.)
slide1
is currently a "1200dpi CMYK color" Tektronix Phaser 560. (Same kind
as the "paper" printers prism and sunbow.) "The Phaser 560 uses a
laser technology allowing it to print five times faster than the old
printers while allowing a maximum 1200x1200 dpi resolution."
chrome
uses wax transfer and has the best
colors, but is "expensive as hell" and would have to be
loaded with slides first. To use chrome, call the operator
to tell them what (paper, transparencies, legal size, etc.)
to load it with, and expect to wait a long time because it
is slow.)
/usr/local/bin/spectrum-transparency(This program is a script, much like /usr/local/bin/double-sided)
"We have normality ... Anything you still can't cope with is therefore your own problem."If you put a "collection.release beta netnews" line in /usr/local/depot/depot.pref.local, you can take it out now if you like. If you have been using r.gp as your news server you should switch back to (spiffy upgraded) dnntp.srv.cs.cmu.edu.
(setq gnus-use-adaptive-scoring t) (setq gnus-default-adaptive-score-alist '((gnus-unread-mark) (gnus-ticked-mark (from 4)) (gnus-dormant-mark (from 5)) (gnus-del-mark (subject -10)) (gnus-read-mark (subject 5)) (gnus-expirable-mark (subject -1)) (gnus-killed-mark (subject -30)) (gnus-kill-file-mark) (gnus-catchup-mark (subject -10)))) (add-hook 'gnus-summary-prepare-hook '(lambda () (gnus-summary-sort-by-score)))into your emacs setup, gnus does the following:
* - pipe R "/usr/local/bin/zrcvalert $(size)"
sender "@evilspammers.com" destroy A - sender "jerk@evilspammers.com" destroy A -(Use the second if there is someone else at evilspammers that you actually want mail from.)
default - pipe R /usr/local/bin/zrcvalert $(size)has the same effect as
* - pipe ? myfunkyzrcvalert $(size)where myfunkyzrcvalert returns an error (the trick is default vs * ... 'default' says only fire this rule if the message hasn't yet matched. so you put the zrcvalert line after the set of lines which match messages for which you don't want to get alerted.)
.mh_profile contains: repl: -filter repl_filter -form repl_form Mail/repl_filter contains: body:component="> " Mail/repl_form contains: %(lit)%(formataddr %<{reply-to}%|%<{from}%|%<{sender}%|%<{return-path}%>%>%>%>)\ %<(nonnull)%(void(width))%(putaddr To: )\n%>\ %(lit)%(formataddr{to})%(formataddr{cc})\ %<(nonnull)%(void(width))%(putaddr cc: )\n%>\ %<{subject}Subject: Re: %{subject}\n%>\ From:Corey Kosak <kosak@cs.cmu.edu> fcc:inbox --------"Or you can use mhl: put the following in mhl.reply"
width=80,overflowtext="> ",overflowoffset=5 date:nocomponent,formatfield="On %{text}" from:nocomponent,formatfield="%{text} wrote:" : body:component="> "
single file | MH directory | single file separation by ^A's | separation by files | separated by From elm/MMDF/VM | MH | elm/sendmail/uucp <--- packf packmbox--->You may also be interested in lclmail (/usr/local/lib/lclmail).
<incl>file1.html</incl> <incl>file2.html</incl>and get the same results as having the two files concatenated? Or am I wishing for too much?
<!--#include virtual="/~magus/includes/footer.html" -->For the server to parse your included files, you need to either name them something.shtml or add the following line to the .htaccess file for the directory:
AddHandler server-parsed .htmlThis stuff will work for anyone who accesses the page through the www.cs server; it (obviously) won't work for people who read it out of AFS. Note also that we're running an old version of apache on www.cs (some people might say "stable") so the 1.2 extensions for that stuff that you find in the apache documentation won't workl.
<Limit GET> order deny,allow deny from all allow from .cmu.edu </Limit>This restricts access to all the files in the www/Zephyr directory (as well as I believe subdirectories.)
<HTML> <HEAD> <TITLE>poof</TITLE> <META HTTP-EQUIV="refresh" CONTENT="10; URL=http://my_new_site"> </HEAD> <BODY> This web page has moved. You will be automatically brought to the new page <A HREF="http://my_new_site"> blah </A> in 10 seconds. </BODY> </HTML>(Yes, the quotes in that META look odd. Just remember it has only two fields, 'http-equiv' and 'content'. see, the 'url' bit in 'content' is actually "optional", such that if you leave it out, it will reload the current page every 10 seconds. I think that is supposed to be a feature.)
use lib /my/dir
$foo = "\L$foo";in perl5:
lc("FOO");
foo | perl -e 'open(BAR,"|bar"); open(BAZ,"|baz"); $|=1; while(<STDIN>) { print BAR; print BAZ; }'
#!/usr/local/bin/perl5 # find files < 1 day old require "find.pl"; # Traverse desired filesystems &find('.'); exit; sub wanted { (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && (int(-C _) < 1) && print("$name\n"); }You can also modify it to make perl collect all the file names and sort them by access time. Try this.
open(FIND,"find . -type file -print|"); while() { chop; $f[$i++] = $_;} @g = sort { (-C $a) <=> (-C $b) } @f; foreach (@g) { $t = (-C $_) ; print $_ . " $t\n";}
someone (several people actually) in the dept multicasts music over the net from his computer and we all listen to itWhy should you care? Some people find it entertaining. Maybe you will too.
/afs/cs/usr/tmwong/bin/micecastd 224.3.1.4 6677 8111 mxaudio http://localhost:8111/- 11 Mar 1999
shout eureka.learning -P <3L33T_SECRET_PASSWORD> -e 8900 -D dj.plafter you discover from some elite zephyrite what the password is (and confirm that eureka is still the right machine.)
ldd <executable>
chatr <executable>
odump -Dl <executable>
dump -H <exectuable>
find . -type f -print | xargs grep string-to-look-forOr if you want to be exceedingly correct it is
find . -type f -print | xargs grep string-to-look-for /dev/nullThat way if
find
returns zero files, the
grep
will search through /dev/null
instead of waiting for input from stdin
, and if
it returns only one file you still get the name of the file.
find . -type f -print0 | xargs -0 grep string-to-look-for
find . -type d -print | xargs fs sa -acl system:anyuser rl -diror
set the toplevel directory the way you want it then: find /afs/cs/foo/bar -type d -exec fs copyacl /afs/cs/foo/bar {} \;
jgraph
will do it too.
x y x y x y(yes, numbers of the form 5.37e-05 are ok.) Then say
gnuplot > plot "file"or
gnuplot <<EOF plot "file" EOF
gnu> set term post gnu> set output "foo" gun> replot
cvs tag bovik-working-copy cvs diff -rbovik-working-copy -rHEAD cvs tag -d bovik-working-copy
/afs/cs/user/dkindred/bin/mweb <word>
-fshort-enums
, you get the following
totally beautiful behavior:
Allocate to an enum type only as many bytes as it needs for the de- clared range of possible values. Specifically, the enum type will be equivalent to the smallest integer type which has enough room.
#define TAGME(x) fprintf (stderr, "About to execute x at line ###\n"), x...I'm in a real-time OS with no decent debugger.
#define TAGME(_str_) fprintf(stderr, "About to execute %s at line %d\n", #_str_, __LINE__)If non-ansi, replace #_str_ with "_str_"
pbmtext | ppmtogif -transparent white pbmtext -builtin fixed $date | pnmcrop | ppmtogif -transparent rgb:FF/FF/FF >! $WDIR/$OUTFILE.gif
giftrans -t #ffffff file.gif > transparentfile.gif
(Start Menu) NT Help --> Index --> Shortcut KeysAlthough, actually it appears to be documented as:
ALT+ESC cycles through the programs in the order they were started.but I use it for just sending the window to the back, which seems to be what the key combination actually does on the first press."
count_bits((x&-x)-1)"looks good. gimme the simplest possible count_bits. speed irrelevant."
i=0; while(x) {x>>=1; i++;} return i;or alternatively
i=0; for(tmp=x; tmp; tmp&=tmp-1,i++) ;"hmm, i wonder if the binding of comma is right in the above"
foo: foo.o same_stuff command foo.o -o foofor each foo in FOO. Is there some obvious way to do this that I am missing?
FOO=target1 target2 target3 $(FOO):%:%.o same_stuff command $< -o $@You may ask "what does $(FOO): mean?" The answer is, apply this pattern rule only to things in $(FOO).
KRBTKFILE=`$HOME/bin/newest_ticket afs` ; export KRBTKFILE /usr/local/bin/aklogThis will get your most recent AFS ticket (token) in the kernel. Another creative use would be say you want to run some command on foo.bar.cs.cmu.edu. Then just do
KRBTKFILE=`$HOME/bin/newest_ticket rcmd foo.bar.cs.cmu.edu` ; export KRBTKFILE rsh foo.bar.cs.cmu.edu some command and args