Browse Source

Fix some more things related to control key weirdness

master
Taylor Bockman 9 years ago
parent
commit
f7f814b4a1
  1. 4
      dotfiles/Xresources
  2. 9
      dotfiles/emacs.d/init.el
  3. 4
      dotfiles/tmux.conf
  4. 41
      sicp-2.5-notes

4
dotfiles/Xresources

@ -127,6 +127,10 @@ URxvt.tabbed.title: no
! URxvt.keysym.Control-Left: \033[1;5D ! URxvt.keysym.Control-Left: \033[1;5D
! URxvt.keysym.Control-Right: \033[1;5C ! URxvt.keysym.Control-Right: \033[1;5C
! URxvt doesn't nicely send C-S- to the underlying app so they have to be
! added here as they become necessary.
! URxvt.keysym.C-S-0:
Xft.dpi: 96 Xft.dpi: 96
Xft.antialias: 1 Xft.antialias: 1
Xft.hinting: 1 Xft.hinting: 1

9
dotfiles/emacs.d/init.el

@ -216,7 +216,6 @@
(require 'fill-column-indicator) (require 'fill-column-indicator)
(setq fci-rule-width 1)
(setq fci-rule-color "black") (setq fci-rule-color "black")
(setq fci-rule-column 120) (setq fci-rule-column 120)
(add-hook 'after-change-major-mode-hook 'fci-mode) (add-hook 'after-change-major-mode-hook 'fci-mode)
@ -306,14 +305,6 @@
(projectile-global-mode) (projectile-global-mode)
;;------------------------------------------------------------------------------------- ;;-------------------------------------------------------------------------------------
;; Rainbow Delimiters (on most programming modes)
;;-------------------------------------------------------------------------------------
(require 'rainbow-delimiters)
(add-hook 'prog-mode-hook 'rainbow-delimiters-mode)
;;-------------------------------------------------------------------------------------
;; Neotree Configuration ;; Neotree Configuration
;;------------------------------------------------------------------------------------- ;;-------------------------------------------------------------------------------------

4
dotfiles/tmux.conf

@ -87,5 +87,5 @@ bind p paste-buffer
# Enable vi-like keybindings # Enable vi-like keybindings
set-window-option -g mode-keys vi set-window-option -g mode-keys vi
# Pass-through C- # Pass-through C-<arrow>
#set-window-option -g xterm-keys on set-window-option -g xterm-keys on

41
sicp-2.5-notes

@ -0,0 +1,41 @@
(car (cons x y))
(car (lambda (m) (m x y)))
((lambda (m) (m x y)) (lambda (p q) p)))
(lambda (x y) x)))
x
(define (cdr z) (z (lambda (x y) y)))
2.5 - Given that we know the bases - 2, and 3, we only need to find the exponents.
For example, 6 can only be represented one way - 2^1 3^1, meaning our pair of numbers a and b are 1
So, cons is simple:
(define (cons x y) (* (expt 2 x) (expt 3 y)))
Now we're left solving for a and b
log(2^a * 3^b) = alog(2) + blog(3)
call our "cons" value x
Because integer factorizations are unique we only need to find the biggest power of two and three that
go into the number.
(define (power-of-x value base)
(define (iter current-power)
(if (< ((expt base current-power) value)
(iter (+ current-power 1))
(current-power))))
Then with this we can write car and cdr as
(define (car int) (power-of-x int 2))
(define (cdr int) (power-of-x int 3))
Loading…
Cancel
Save