21 October 2009

Magic indeed

I just noticed Apple came out with the "Magic Mouse" yesterday.

The same Multi-Touch technology first introduced on the revolutionary iPhone comes to the mouse. It’s called Magic Mouse, and it’s the world’s first Multi-Touch mouse. Click anywhere, scroll in any direction, and swipe through images on its smooth, seamless top shell.

The new Magic Mouse redefines what a mouse should do. In addition to its smooth, seamless top-shell design that acts as one button or two, Magic Mouse features a Multi-Touch surface with gesture support. Scroll vertically, horizontally, and diagonally — a full 360 degrees — simply by touching anywhere on the top surface. With a greater surface area for scrolling, you can get around a long timeline in iMovie, through a lengthy web page in Safari, or around a set of images in iPhoto more efficiently. You can also swipe through pages in Safari or photos in iPhoto with two fingers. It’s the most advanced Apple mouse ever made.

...NO. I really wish Apple would knock this off, it drives me insane. Multitouch was not introduced on the revolutionary iPhone, and this isn't the world's first Multitouch mouse. They should know, since they destroyed the company that made them. They've owned Fingerworks' technology for almost five years now. They own it. They don't need to copy it or reproduce it, they've literally got the guys that invented it working for them right now, and after five years they created a legendary magical mouse that lets you:

  • Click anywhere

  • Scroll in any direction

  • Swipe through photos


I realize Apple users are new to the concept of a functional mouse and might be a little behind on all the advances, but last time I checked mice already let you click anywhere. They also let you scroll in any direction, scroll wheels were added to mice 15 years ago, and rocker wheels weren't long after that. Finally, side function buttons for swiping through photos or whatever else you want are maybe a decade old. Calling scrolling in any direction "gesture support" is absurd, this was gesture support

Apple bought out the best multitouch company there was and took five years to incorporate their technology into a mouse that's only ten years behind the rest of the world. Not that I can really argue with their selling point, it is "the most advanced Apple mouse ever made."

08 October 2009

Emacs -> Sprunge

Woo code! I got bored and wrote a function for Emacs that posts the current buffer to sprunge. Since I'm usually pasting IRC snippets, I also threw together a major mode with 4 regexps to syntax highlight IRC. Behold:



Here's the elisp source. The hash table maps major mode names to the corresponding pygments lexer name, which sprunge uses for syntax highlighting; if the mode of the buffer you post is in the map, the sprunge link will include the correct argument to syntax highlight it the same way

(setq sprunge-suffixes (make-hash-table :test 'equal))
(puthash "Python" "py" sprunge-suffixes)
(puthash "Shell-script" "sh" sprunge-suffixes)
(puthash "IRC" "irc" sprunge-suffixes)

(defun sprunge ()
"Posts the current buffer to sprunge, and shows the resulting URL in a new buffer"
(interactive)
(if (buffer-file-name) (save-buffer) (write-file "/tmp/sprunge-post"))
(delete-other-windows)
(let ((sprunge-buffer (get-buffer-create "*sprunge*"))
(sprunge-window (split-window-vertically (- (window-height) 5)))
(filename buffer-file-name)
(suffix (if (gethash mode-name sprunge-suffixes) (concat "?" (gethash mode-name sprunge-suffixes)) "")))
(select-window sprunge-window)
(set-window-buffer sprunge-window sprunge-buffer)
(erase-buffer)
(insert (shell-command-to-string (concat "curl -F 'sprunge=<" filename "' http://sprunge.us")))
(delete-char -1) ; Newline after URL
(insert suffix "\n")))

(define-derived-mode irc-mode
text-mode "IRC" "Major mode for IRC logs"
(setq font-lock-defaults
'((("\\[[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\\]" . font-lock-constant-face)
("<.*>" . font-lock-keyword-face)
("[a-zA-Z0-9`^_-]+:" . font-lock-type-face)
(">>> .*" . font-lock-builtin-face)
))))