daily pastebin goal
53%
SHARE
TWEET

Untitled

a guest Feb 20th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. documentclass{beamer}
  2. usepackage{tikz}
  3. usepackage{animate}
  4. begin{document}
  5.   begin{frame}
  6.     frametitle{MD5SUM}
  7.      begin{animateinline}[autoplay,loop]{1}
  8.       cat a
  9.       newframe
  10.       cat b
  11.       newframe
  12.       md5sum a
  13.      end{animateinline}
  14.    end{frame}
  15.  end{document}
  16.      
  17. documentclass{beamer}
  18.   usepackage{beamerthemeWarsaw}
  19.   usepackage{animate}
  20.   usepackage{expl3}
  21.   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  22.   %command for simulating terminal in/output
  23.   %scroll{<width as TeX dim>}{<number of lines>}{terminal text line}
  24.   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  25.   ExplSyntaxOn
  26.   seq_new:Ng_linebuffer_seq
  27.   newcommandscroll[3]{
  28.     ttfamily
  29.     seq_gput_right:Nxg_linebuffer_seq{#3}
  30.     int_compare:nT{seq_length:Ng_linebuffer_seq>#2}{
  31.     seq_gpop_left:NNg_linebuffer_seqdummy
  32.     }
  33.     fbox{begin{minipage}[t][#2baselineskip]{#1}
  34.     seq_map_inline:Nng_linebuffer_seq{mbox{##1}\}
  35.     end{minipage}}
  36.     }
  37.   ExplSyntaxOff
  38.  
  39. begin{document}
  40. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  41. begin{frame}[fragile]
  42.   frametitle{Random records}
  43.   How do you randomly select, say 1000 records from a large file?  Use
  44.   the verb|shuf| command
  45.   begin{animateinline}[autoplay,loop]{1}
  46.     scroll{0.8linewidth}{10}{ cat a}%
  47.     newframe
  48.      scroll{0.8linewidth}{10}{clear}
  49.     end{animateinline}
  50. %
  51. end{frame}
  52. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  53. begin{frame}[fragile]
  54.   frametitle{Checking for Duplicate Files}
  55.   How do you quickly check whether 2 files are the same? Use the
  56.   verb|md5sum| command.
  57.   begin{animateinline}[autoplay,loop]{1}
  58.     scroll{0.8linewidth}{8}{# echo 1 2 3 > a}
  59.     newframe
  60.     scroll{0.8linewidth}{8}{clear}
  61.   end{animateinline}
  62. end{frame}
  63. end{document}
  64.      
  65. documentclass{article}
  66.  
  67. usepackage{courier}
  68. usepackage{animate}  
  69. usepackage{expl3}
  70.  
  71. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
  72. %commands for simulating terminal in/output  
  73. %scroll[<line separator string>]{<width as TeX dim>}
  74. %                             {<number of lines>}{terminal text line}  
  75. %clearbuf  %clears line buffer  
  76. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
  77. ExplSyntaxOn
  78. seq_new:Ng_linebuffer_seq
  79. seq_new:Ng_inputline_seq
  80. newcommandscroll[4][§§]{
  81.   seq_set_split:Nnng_inputline_seq{#1}{#4}
  82.   seq_map_inline:Nng_inputline_seq{
  83.     seq_gput_right:Nxg_linebuffer_seq{##1}
  84.     int_compare:nT{seq_count:Ng_linebuffer_seq>#3}{
  85.       seq_gpop_left:NNg_linebuffer_seqdummy
  86.     }
  87.   }
  88.   fbox{begin{minipage}[t][#3baselineskip]{#2}
  89.     ttfamily
  90.     seq_map_inline:Nng_linebuffer_seq{mbox{##1}\}
  91.   end{minipage}}
  92. }
  93. newcommandclearbuf{seq_gclear:Ng_linebuffer_seq}
  94. ExplSyntaxOff
  95.  
  96. begin{document}  
  97.  
  98.   begin{animateinline}[controls,loop]{1}  
  99.       scroll{0.9linewidth}{8}{cat a}  
  100.     newframe
  101.       scroll{0.9linewidth}{8}{cat b}
  102.     newframe
  103.       scroll{0.9linewidth}{8}{John§§Linda§§Albert§§Francis}  
  104.     newframe
  105.       scroll{0.9linewidth}{8}{ln -s a empty.txt}
  106.     newframe
  107.       scroll{0.9linewidth}{8}{md5sum empty.txt}
  108.     newframe
  109.       scroll{0.9linewidth}{8}{d41d8cd98f00b204e9800998ecf8427e  empty.txt}
  110.     newframe
  111.       scroll{0.9linewidth}{8}{md5sum b}
  112.     newframe
  113.       scroll{0.9linewidth}{8}{88a1d2cf7920275378bebdf438bae941  b}
  114.     newframe
  115.       scroll{0.9linewidth}{8}{clear}clearbuf  
  116.     newframe
  117.       scroll{0.9linewidth}{8}{}clearbuf
  118.     newframe  
  119.     multiframe{10}{i=1+1}{
  120.        scroll{0.9linewidth}{8}{noexpand# Line i}
  121.     }  
  122.   end{animateinline}  
  123.  
  124.   begin{animateinline}[controls,loop]{1}  
  125.       clearbufscroll{0.9linewidth}{8}{cd /usr/bin}
  126.     newframe  
  127.       scroll{0.9linewidth}{8}{echo noexpand$PWD}
  128.     newframe
  129.       scroll{0.9linewidth}{8}{/usr/bin}
  130.     newframe
  131.       scroll{0.9linewidth}{8}{ls -l md5sum}
  132.     newframe
  133.       scroll{0.9linewidth}{8}{%
  134.         -rwxr-xr-x 1 root root 30172 Dec 14 2010
  135.         noexpandbfseriesnoexpandcolor{red}md5sum
  136.       }
  137.     newframe
  138.       scroll{0.9linewidth}{8}{clear}clearbuf
  139.     newframe
  140.       scroll{0.9linewidth}{8}{}clearbuf
  141.   end{animateinline}  
  142.  
  143. end{document}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top