Skip to content

Instantly share code, notes, and snippets.

View matthew-ball's full-sized avatar

Matthew Ball matthew-ball

  • Canberra, ACT, Australia
View GitHub Profile
(defgroup user-variables nil "User variables.")
(defcustom user-notes-file "~/Documents/notes.org" "File for user's notes." :group 'user-variables)
(defcustom user-journal-file "~/Documents/journal.org" "File for user's journal." :group 'user-variables)
(defcustom user-journal-directory "~/Documents/.journal/" "Directory for user's journal files." :group 'user-variables)
(defcustom user-archive-file "~/Documents/.archive.org" "Directory for archiving user's completed tasks." :group 'user-variables)
(defcustom user-home-directory "~/" "User home directory." :group 'user-variables)
(defcustom user-documents-directory "~/Documents/" "User documents directory." :group 'user-variables)
(defmacro add-to-list (object list)
`(setf ,list (push ,object ,list)))
(defun print-card (card stream ignore)
(declare (ignore ignore))
(format stream "~a of ~a" (card-value card) (card-suit card)))
(defstruct (card (:print-function print-card))
suit
(defmacro add-to-list (object list)
`(setf ,list (push ,object ,list)))
(defun print-card (card stream ignore)
(declare (ignore ignore))
(format stream "~a of ~a" (card-value card) (card-suit card)))
(defstruct (card (:print-function print-card))
;; TODO: image
;; IMPORTANT: knowledge representation system (krs)
(defstruct (knowledge-base (:conc-name kb-))
(facts nil)
(beliefs nil))
(defun new-knowledge-base ()
(let ((base (make-knowledge-base :facts (make-hash-table) :beliefs (make-hash-table))))
base))
# deb cdrom:[Debian GNU/Linux 7.1.0 _Wheezy_ - Official i386 xfce-CD Binary-1 20130615-21:54]/ wheezy main
# deb cdrom:[Debian GNU/Linux 7.1.0 _Wheezy_ - Official i386 xfce-CD Binary-1 20130615-21:54]/ wheezy main
# debian security updates
deb http://security.debian.org/ wheezy/updates main
#deb-src http://security.debian.org/ wheezy/updates main
deb http://mirror.aarnet.edu.au/debian/ wheezy main non-free contrib
deb http://mirror.aarnet.edu.au/debian/ wheezy-backports main non-free contrib
deb http://mirror.aarnet.edu.au/debian/ wheezy-updates main non-free contrib
;;; IMPORTANT: slime and swank
;; SOURCE: `https://github.com/slime/slime'
(load (format nil "~A/swank-loader.lisp" *user-slime-directory*))
(swank-loader:init)
(defvar *swank-p* nil "Predicate representing whether or not a common lisp swank server is active.")
(defcommand run-swank () ()
"Start a (persistent) swank server on port 4005."
(defun surrounded-by-p (char)
"Returns t if word is surrounded by given char."
(save-excursion
(and (forward-word -1)
(equal char (char-before))
(forward-word 1)
(equal char (char-after)))))
(defun surround-word (char &optional force)
"Surrounds word with given character. If force is nil and word is already surrounded by given character removes them."
;;; init.lisp --- Configuration for StumpWM environment
;; Copyright (C) 2008-2014 Matthew Ball
;; Author: Matthew Ball <[email protected]>
;; Keywords: window manager
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
; ---------------------------------------------------------------------
;
; Name: Matthew Ball
; Student Number: 4537508
; Course: COMP2300
; Assignment Number: 2
; Name of this file: cachesim.ass
; Lab Group: Thursday, 8:00am - 10:00am
;
;
(ql:quickload 'cl-irc)
;; TODO: module system
;;(load "./reference-module.lisp")
;;(load "./knowledge-module.lisp")
;;(load "./procedure-module.lisp")
(defvar *connection* nil "IRC connection")
(defvar *nickname* "bot" "Default name of the bot.")