Hacking the Good Hack

Name: Tom Treloar
Please allow me to introduce myself. I am a man of little wealth and poor taste.
Annotated Linux Kernel
Art of Common Lisp
Art of Unix Programming
Attrition.org
Basic Instructions
Black Belt Bayesian
Cliki- Common Lisp Wiki
Common Lisp Cookbook
Complexity Zoo
Deriving the Y Combinator
E.T Jaynes
Elements of AI
Enfranchised Mind
Erlang Cookbook
Essentials of Programming Languages
Fixed Point Combinator
Gentoo Security Handbook
Get Arch Linux
Get Sabayon Linux
GNU Privacy Handbook
Hakmem
Haskell Wikibook
Introduction to Haskell
Introduction to Ocaml
JAPH archive
Literate Programs
Monads for the Working Haskell Programmer
My Pastebin
On Stupid Questions
Overcoming Bias
Parrot VM
Programming Interviews
Programming Languages: Application and Interpretation
Qwantz
Real World Haskell
Ruby Essentials
Scheme Cookbook
Scott Aaronson
SL4 Wiki
Stack Overflow
Sysadmin Horror Stories
Tao of Programming
The Fourth Checkraise
The Jargon File
Webster ASM
Why Haskell Matters
Why's Poignant Guide to Ruby
Wikibooks Programming Bookshelf
XKCD
visited *loading* times
For anyone interested, my emacs configuration. Check out Steve Yegge's Effective Emacs for pure wizardry.
;;Tom Treloar's .emacs.
;;A work in progress
;;Licensed under the Motherfucking Software License
;;Tom Treloar
;;pookleblinky AT gmail DOT com
;;http://codekufr.motime.com
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(auto-insert-mode t nil (autoinsert))
'(compilation-scroll-output t)
'(compile-auto-highlight t)
'(compile-command "")
'(face-font-family-alternatives (quote (("courier" "fixed" "lucida") ("helv" "helvetica" "arial" "fixed"))))
'(frame-background-mode (quote dark))
'(perl-brace-imaginary-offset -4)
'(perl-brace-offset 4)
'(tab-always-indent (quote always)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Get Rid of annoyances
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq inhibit-startup-echo-area-message t)
(setq inhibit-startup-message t)
(fset 'yes-or-no-p 'y-or-n-p)
;;Control automatically executes Ct-x Ct-alt
(global-set-key "\C-x\C-m" 'execute-extended-command)
(global-set-key "\C-c\C-m" 'execute-extended-command)
;;make keyboard macros easier
(global-set-key [f5] 'call-last-kbd-macro)
;;Kill the excess newbie crap
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
;disable backup
(setq backup-inhibited t)
;disable auto save
(setq auto-save-default nil)
;Jump mouse out of the way
(mouse-avoidance-mode 'jump)
;;Highlight regions
(transient-mark-mode 1)
;Force files to end with newlines
(setq require-final-newline t)
;;show matching parens
(show-paren-mode 1)
;begin in ~/bin
(cd "~/bin")
;;Start server for emacsclient
(server-start)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Other modules to load
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Load w3m directory
(add-to-list 'load-path "/usr/share/emacs/site-lisp/w3m/")
;;Add w3m ability
(require 'w3m-load)
;;Let there be cookies!
(setq w3m-use-cookies t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Custom Set Faces crap
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:stipple nil :background "dark slate grey" :foreground "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 115 :width normal :family "verdana"))))
'(fringe ((((class color) (background dark)) (:background "grey10" :width ultra-condensed))))
'(header-line ((((class color grayscale) (background dark)) (:inherit mode-line :background "grey20" :foreground "grey90" :box nil))))
'(scroll-bar ((t (:background "dark slate grey" :foreground "#000000")))))
;; always end a file with a newline
(setq require-final-newline t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Code modes
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;LISP
(setq auto-mode-alist
(append '(
("\\.lisp$" . lisp-mode)
("\\.lsp$" . lisp-mode)
("\\.cl$" . lisp-mode)
("\\.asd$" . lisp-mode)
("\\.system$" . lisp-mode)
)auto-mode-alist))
;;Ruby Mode
; loads ruby mode when a .rb file is opened.
(autoload 'ruby-mode "ruby-mode" "Major mode for editing ruby scripts." t)
(setq auto-mode-alist (cons '(".rb$" . ruby-mode) auto-mode-alist))
(setq auto-mode-alist (cons '(".rhtml$" . html-mode) auto-mode-alist))
;;Ocaml Mode
; If you used option 4 above and installed your own version of the
; files and not in the site-lisp/ directory, uncomment this line and
; replace LOC below with the directory you put the files in
;(setq load-path (cons "/usr/share/emacs/22.2/lisp" load-path))
(setq auto-mode-alist
(cons '("\\.ml[iylp]?$" . caml-mode) auto-mode-alist))
(autoload 'caml-mode "caml" "Major mode for editing Caml code." t)
(autoload 'run-caml "inf-caml" "Run an inferior Caml process." t)
; for highlighting
(if window-system (require 'caml-font))
;;Haskell mode
(load "/usr/share/emacs/22.2/lisp/haskell-site-file")
(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
;;(add-hook 'haskell-mode-hook 'turn-on-haskell-simple-indent)
;;Scheme mode
(autoload 'scheme-mode "iuscheme"
"Major mode for Scheme." t)
(autoload 'run-scheme "iuscheme"
"Switch to interactive Scheme buffer." t)
(autoload 'run-alt-scheme "iuscheme"
"Switch to interactive alternative Scheme buffer." t)
(setq auto-mode-alist (cons '("\\.ss$" . scheme-mode) auto-mode-alist))
;;;;;;;;;;;;;;;;;;;;
;; UTF-8
;;;;;;;;;;;;;;;;;;;;
;; set up unicode
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
;; This from a japanese individual. I hope it works.
(setq default-buffer-file-coding-system 'utf-8)
;; From Emacs wiki
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Some helpful stuff now
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq my-name "Tom Treloar\n")
(setq pookmail "pookleblinky AT gmail DOT com\n")
(setq blog "http://codekufr.motime.com")
(defun insert-my-info ()
"Insert my info"
(interactive)
(insert my-name pookmail blog))
(defun dot-emacs ()
"Visit .emacs"
(interactive)
(find-file "~/.emacs"))
(defun insert-date ()
(interactive)
(insert (format-time-string "%d/%m/%Y")))
(defun file-length ()
"Prints the file length"
(interactive)
(message "%s is %d lines long" (buffer-name) (count-lines (point-min) (point-max) )))
;;Lets me easily save the last keyboard macro
(defun save-macro (name)
"save a macro. Take a name as argument
and save the last defined macro under
this name at the end of your .emacs"
(interactive "SName of the macro :") ; ask for the name of the macro
(kmacro-name-last-macro name) ; use this name for the macro
(find-file "~/.emacs") ; open the .emacs file
(goto-char (point-max)) ; go to the end of the .emacs
(newline) ; insert a newline
(insert-kbd-macro name) ; copy the macro
(newline) ; insert a newline
(switch-to-buffer nil)) ; return to the initial buffer
;;Check if it is newer, then compile for speed
(defun byte-compile-user-init-file ()
(let ((byte-compile-warnings '(unresolved)))
;; in case compilation fails, don't leave the old .elc around:
(when (file-exists-p (concat user-init-file ".elc"))
(delete-file (concat user-init-file ".elc")))
(byte-compile-file user-init-file)
;; (message "%s compiled" user-init-file)
))
(defun my-emacs-lisp-mode-hook ()
(when (equal buffer-file-name user-init-file)
(add-hook 'after-save-hook 'byte-compile-user-init-file t t)))
;; (add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
(add-hook 'emacs-lisp-mode-hook 'my-emacs-lisp-mode-hook)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Keyboard Macros Below here
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(fset 'insert-comment-header
(lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([33554453 53 48 59 return 59 59 return 33554453 53 48 59] 0 "%d")) arg)))
I've started learning Parrot. Nothing like compiler design to expand your mind, and attract the ladies.
Actually, I am very interested in whether you could write a VM designed to run on a GPU, taking full advantage of its massively parallel architecture and vectorized mathematics. What could be cooler than writing a Ruby program that runs on a GPU faster than a C program run normally?
I added a $bignum more links, mostly on functional programming as I have been spending the last couple days immersed in Ocaml and Haskell.
I had an idea recently, to create a PLEAC-style cookbook for deriving the Y Combinator in several languages. It ought to be possible to teach even a skiddy the basics of fixed point theory.
A Brit and I are throwing around the idea of starting up a social bookworming site. The idea is to track editions, allow reviews, up/downvoting, and provide users a way of sharing book recommendations.
We're considering using Perl's Catalyst framework for it. The Rails-like MVC convention means it'll be flexible, orthogonal, clean, and rather painless to develop for. The DB, on the other hand, we're still hashing out options for.
After reading about Ocaml, I decided to take it up. As fast as C, as rapid development as a scripting language, and as geekishly appealing as Lisp... it makes me want to dip my balls in it.
I also signed up to contribute to the PLEAC project, whose goal is to provide an analog to the Perl Cookbook in every major language. Lots and lots of work left to do.
A friend in VLSI needs a tool for automating the creation of test benches. Essentially, he wants to be able to parse a .v file for modules, extract their parameters, generate test bench modules instantiating the modules in question, and output a finished .vt file ready to run the simulation. Yes, it has been done, but apparently, no one has made open source tools with which to do this easily (i.e. for people who don't like coding). Take a look at Ruby-VPI, DVS, a current OOP approach to verilog generation, and Wim Vanderbauwhede's Verilog::CodeGen.
I'd like to play with this, and create a whole OOP framework for generating verilog source. Ideally, one ought to be able to abstract entirely away from raw verilog and deal entirely with objects.
Now that I think of it, I'll also join up on the ruby-vpi project. DRY and all that.
def syntaxtest
puts "this works"
end
pre { background: #111122;
padding: 10px;
color: #228822; }
.ruby .normal { color: #fff; }
.ruby .comment { color: #005;
font-style: italic; }
.ruby .keyword { color: #A44;
font-weight: bold; }
.ruby .method { color: #44f; }
.ruby .class { color: #0c4; }
.ruby .module { color: #050; }
.ruby .punct { color: #668;
font-weight: bold; }
.ruby .symbol { color: #ff0; }
.ruby .string { color: #4f4; }
.ruby .char { color: #F07; }
.ruby .ident { color: #fff; }
.ruby .constant { color: #0c4; }
.ruby .regex { color: #B66;
background: #FEF; }
.ruby .number { color: #F99; }
.ruby .attribute { color: #fc4; }
.ruby .global { color: #7FB; }
.ruby .expr { color: #227; }
.ruby .escape { color: #277; }
I'll tweak it for sexiness. I'm working on a script that uses _Why's (PBUH) Hpricot module to impregnate properly syntax-highlighted text into the input form.
I created a Rubyforge account.
Now to start dissecting some foxes!
*rubs hands excitedly*
So many projects to work on. It'll be hard to decide where to jump in first.
I set up pook.googlecode.com to upload whatever code I'm not too embarrassed to make public.
If you are at all a programmer, visit StackOverflow.com. It is the greatest programming resource in the history of the universe. If Donald Knuth and Richard Stallman got together and had a baby, its name would be Jeff Atwood.
After using Subversion for a while, I switched over to Bazaar for my version control needs. It's easy to use, flexible, and stays out of your way.