This file contains hidden or 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
(defmacro not-equal (&rest rest) | |
(let ((form '()) | |
(prev (pop rest))) | |
(while rest | |
(dolist (cur rest) | |
(push `(/= ,prev ,cur) form)) | |
(setf prev (pop rest))) | |
`(or ,@form))) |
This file contains hidden or 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
(defun arno/update-eclipse () | |
(interactive) | |
(thread-last (eclim/project-list) | |
; Get names from project list | |
(mapcar (lambda (p) (assoc-default 'name p))) | |
; Remove unused projects to prevent eclipse from reopening them | |
(remove-if (lambda (s) (or (equal s "GantrySync") (equal s "SvgUtil")))) | |
; Refresh the remaining projects | |
(eclim-project-refresh))) |
This file contains hidden or 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
(defun arno/update-eclipse () | |
(interactive) | |
(thread-last (eclim/project-list) | |
;; Get names from project list | |
(mapcar (lambda (p) (assoc-default 'name p))) | |
;; Remove unused projects to prevent eclipse from reopening them | |
(remove-if (lambda (s) (or (equal s "GantrySync") (equal s "SvgUtil")))) | |
;; Refresh the remaining projects | |
(eclim-project-refresh))) |
This file contains hidden or 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
(defun filter (&rest args) ; args = list of all arguments | |
(let ((factors (list -1 -1 -1 | |
-1 8 -1 | |
-1 -1 -1))) | |
(reduce '+ (map '* factors args)))) |
This file contains hidden or 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
(defun filter (&rest args) ; args = list of all arguments | |
(let ((factors (list -1 -1 -1 | |
-1 8 -1 | |
-1 -1 -1))) | |
(reduce '+ (mapcar* '* factors args)))) | |
(filter 10 20 30 40 50 60 70 80 90) | |
;; => 0 |
This file contains hidden or 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
;; -*- mode: emacs-lisp -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Configuration Layers declaration. | |
You should not put any user code in this function besides modifying the variable | |
values." | |
(setq-default | |
;; Base distribution to use. This is a layer contained in the directory |
This file contains hidden or 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
(defun my/move-to-middle () | |
(interactive) | |
(let* ((begin (line-beginning-position)) | |
(end (line-end-position)) | |
(middle (+ begin (/ (- end begin) 2)))) | |
(goto-char middle))) | |
(global-set-key (kbd "C-c m") 'my/move-to-middle) |
This file contains hidden or 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
(defun catalan-next-row (v) | |
(if (or (null v) | |
(= (length v) 0)) | |
[1] | |
(let ((r (make-vector (1+ (length v)) 1))) | |
(dotimes (x (length v)) | |
(unless (= x 0) | |
(setf (aref r x) | |
(+ (aref v x) | |
(aref r (1- x)))))) |
This file contains hidden or 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
(defun ca-vectorize () | |
(let* ((line (thing-at-point 'line t)) | |
(ll (string-to-list line)) | |
(result (make-vector (1- (length ll)) 0))) ; skip newline | |
(loop for c in ll | |
for i below (length ll) | |
do (unless (equal c ?\n) | |
(if (equal c ?\s) | |
(setf (elt result i) 0) | |
(setf (elt result i) 1)))) |
This file contains hidden or 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
(defun ca-vectorize () | |
(let* ((line (thing-at-point 'line t)) | |
(ll (string-to-list line)) | |
(result (make-vector (1- (length ll)) 0))) ; skip newline | |
(loop for c in ll | |
for i below (length ll) | |
do (unless (equal c ?\n) | |
(if (equal c ?\s) | |
(setf (elt result i) 0) | |
(setf (elt result i) 1)))) |