This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Based on http://stackoverflow.com/questions/28309340/managing-emacs-man-buffer-location/28311686 | |
(defun enable-window-reuse-for-modes (&rest modes) | |
"Enables window reuse for given modes - for any of modes specified, | |
in case there already exist window of given mode, new incarnation will reuse them. | |
Examples: | |
(require 'my-window-reuse) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Speed { | |
val N = 10000 | |
val M = 1000 | |
def calc():Double = { | |
val step = 20.0 / N | |
val total = ((0 until N) map { step * _ - 10.0 } | |
map { x => Math.pow(Math.E,-x*x) * step } | |
reduceLeft { _ + _ }) | |
total |