Guest User

Untitled

a guest
Feb 24th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. * Testing - results
  2. #+name: test
  3. #+begin_src sh :exports results
  4. uptime
  5. #+end_src
  6.  
  7. #+RESULTS:
  8. | 15:49:23 up 2:00 | 2 users | load average: 0.00 | 0.0 | 0.0 |
  9. * Testing - both
  10. #+name: test
  11. #+begin_src sh :exports both
  12. uptime
  13. #+end_src
  14.  
  15. #+RESULTS:
  16. | 15:50:02 up 2:01 | 2 users | load average: 0.00 | 0.0 | 0.0 |
  17.  
  18. 1 Testing - results
  19. --------------------
  20.  
  21.  
  22. 15:49:23 up 2:00 2 users load average: 0.00 0.0 0.0
  23.  
  24. 2 Testing - both
  25. -----------------
  26.  
  27.  
  28. uptime
  29.  
  30. 15:50:02 up 2:01 2 users load average: 0.00 0.0 0.0
  31.  
  32. ** Participants:
  33.  
  34. #+NAME: mytable
  35. | Name | Points |
  36. |-------+--------|
  37. | Alice | 30 |
  38. | Bob | 20 |
  39. | Carol | 25 |
  40. | Dan | 18 |
  41.  
  42. ** Summary data:
  43.  
  44. #+BEGIN_SRC emacs-lisp :cache yes :var data=mytable :exports results
  45. (let* ((scores (mapcar (lambda (row) (cadr row)) data))
  46. (sum (apply '+ scores))
  47. (avg (/ sum (length scores))))
  48. (list '("Total Score" "Average Score")
  49. 'hline
  50. (list sum avg)))
  51. #+END_SRC
  52.  
  53. #+RESULTS[a15af1d9cd34a76f4a6f822c36eccbc8bd493195]:
  54. | Total Score | Average Score |
  55. |-------------+---------------|
  56. | 93 | 23 |
Add Comment
Please, Sign In to add comment