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
;;; Original URL: http://fpn.mit.edu/Downloads/SuffixTree | |
;;; Copyright [email protected] 2004. | |
(defpackage :suffix-tree | |
(:export :build-suffix-tree :stree-root :*stree-print-string* | |
:random-string :subtree-size :count-leaves) | |
(:use :common-lisp)) | |
;; An O(n) implementation of McCreight's suffix-tree algorithm. | |
;; Usage example: |
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
;;;; -*- Mode: Lisp -*- | |
;;;; http://pastebin.com/S1FzEZpn | |
;; | |
;; vim: filetype=lisp | |
(in-package :stumpwm) | |
;; Load swank. | |
;; ! what's this? | |
(load "/opt/quicklisp/dists/quicklisp/software/slime-20120307-cvs/swank-loader.lisp") |
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
(require 'thingatpt) | |
(require 'imenu) | |
(defun mine-goto-symbol-at-point () | |
"Will navigate to the symbol at the current point of the cursor" | |
(interactive) | |
(ido-goto-symbol (thing-at-point 'symbol))) | |
(defun ido-goto-symbol (&optional a-symbol) | |
"Will update the imenu index and then use ido to select a symbol to navigate to" |
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
;; Push mark when using ido-imenu | |
(defvar push-mark-before-goto-char nil) | |
(defadvice goto-char (before push-mark-first activate) | |
(when push-mark-before-goto-char | |
(push-mark))) | |
(defun ido-imenu-push-mark () | |
(interactive) |
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
(defun toggle-earmuffs () | |
"Add or remove earmuffs (asterisks at front and end) of | |
variables." | |
(interactive) | |
(let* ((saved-point (point)) | |
(variable (thing-at-point 'symbol)) | |
(bounds (bounds-of-thing-at-point 'symbol)) | |
(len (- (cdr bounds) (car bounds))) | |
(start-char (elt variable 0)) |
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
;;; constants.el --- enter definition of constants into source code | |
;; Copyright (c) 2003, 2004, 2005 Carsten Dominik | |
;; Author: Carsten Dominik <[email protected]> | |
;; Version: 2.2 | |
;; Keywords: programming, languages | |
;; This file is not part of GNU Emacs. | |
;; This file is free software; you can redistribute it and/or modify |
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
;; On Lisp P.400 | |
(princ (let ((syms nil)) | |
(do-symbols (s) | |
(push s syms)) | |
(sort syms #'(lambda (x y) | |
(> (length (symbol-name x)) | |
(length (symbol-name y))))))) | |
;; (LEAST-NEGATIVE-NORMALIZED-SINGLE-FLOAT |
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
;; Minimum Number Of Coin Tosses Such That Probability Of Getting 3 | |
;; Consecutive Heads Is Greater Than 1/2 | |
;; http://blog.eduflix.tv/2012/05/contest-answer-minimum-number-of-coin-tosses-such-that-probability-of-getting-3-consecutive-heads-is-greater-than-12/ | |
(require 'cl) | |
(defun flip () | |
"Flip a coin." | |
(if (< 0 (random)) 'H 'T)) |
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
;; Minimum Number Of Coin Tosses Such That Probability Of Getting 3 | |
;; Consecutive Heads Is Greater Than 1/2 | |
;; http://blog.eduflix.tv/2012/05/contest-answer-minimum-number-of-coin-tosses-such-that-probability-of-getting-3-consecutive-heads-is-greater-than-12/ | |
(require 'cl) | |
(defun flip () | |
"Flip a coin." | |
(if (< 0 (random)) 'H 'T)) |
OlderNewer