Stuff.^H'

I wrote an Android client for a work project which speaks to a server via oauth. Then I wrote an Emacs client which does the same thing; guess which one was more fun to write?

Mike Patton singing Italian songs from the 60's? Why thank you. I don't mind if I do. I like "Deep Down" especially because it happens to be the theme song from the very last movie riffed by MST3K.

Stocks for the Long Run by Jeremy J. Siegel is a fascinating book practically overflowing with charts, graphs and tables of stock data. Of course everyone who has ever prepared a chart knows that the visual display of data is a tricky job.

I don't feel like livejournal is the right place for me to keep blogging. The only right choice seems to be self-hosting but I really can't be bothered with blogging software and the keeping thereof. I don't want anyone's "social" anything. I just can't wait for this fad to die.

My ideal blogging software would have a command line interface and would generate RSS from my posts.

This actually works well



Some things I have to write down in order to understand. I start with a pile of paper and draw the code-flow over and over again until it makes sense. I've never met a piece of software which can do this for me as well. As a result I end up with a few dozen pages with a lot of useful scribbles and notes. When I'm done scribbling and people like my ideas then it's time to code. I scan in all of the scribbles since they are useful references. I invert the colors of the images so that moving from the design-scribble to the code won't hurt my eyes and load all of the scribbles into Emacs buffers.

The result works surprisingly well with the exception that I can't annotate the scribbles from within Emacs.

From my handwriting you can see that I should probably have become a doctor.

Does Emacs Lisp Already Have This?

(as always I'm sure that Emacs Lisp already has something like this and I haven't found it yet)

Here is a sketch of an idea for a replacement format in Emacs Lisp. It is inspired by Common Lisp, and is therefore ugly.

(defun yformat (out string &rest objects)
  (cond ((not out)
	 (apply 'format string objects))
	((integerp out)
	 (goto-char out)
	 (insert (apply 'format string objects)))
	((bufferp out)
	 (with-current-buffer out
	   (insert (apply 'format string objects))))
	(out
	 (insert (apply 'format string objects)))))


I'll try to write a real version of this and then I'll try to use it and see how much code something like this would save.

Unfortunately something like this would never fly with emacs-devel even if it turned out to be useful. Overloading is ugly, Emacs Lisp isn't Common Lisp and doesn't want to be either, and finally there is no way to make this backward compatible with old code.

Pump Up The Jam

I listened to the entire 23 servings of The Psychology, Biology and Politics of Food with Professor Kelly D. Brownell. I thought I knew something about food before I started but I was wrong. The erudite and soft-spoken Kelly D. Brownell is a great lecturer. Even though the lectures have a strong U.S.-centric liberal slant Dr Brownell is well aware of this fact and takes pains to present a balanced picture(*).

I am now listening to Financial Markets with Professor Robert Shiller(**). I'm liking the lectures already because the professor has serious reservations about free market theories. The problem here is that the recorded volume is so low that I can't hear anything in a noisy place(***). The solution is to chuck these sound files into the venerable Audacity and hit Amplify with an enormous 10db (turn on allow clipping). I haven't heard any noticeable distortion and the results are clearly audible.

(*) Ultimately, and despite trying very hard, I think he fails to balance the political arguments. But any level headed listener can complete the picture.

(**) I hope that isn't a nominative determinism.

(***) Like a gym.

rt-liberation.el update

Thanks to John Alberts an obscure but debilitating bug, which has to do with custom RT fields, has been fixed in the latest rt-liberation.el.

android development with emacs; a code snipplet

I develop for Android using GNU/Emacs. Whenever I add some Emacs Lisp to help me along I try to remember and post it here. Typically I'll launch screen, then launch the Android emulator and $ adb logcat > logcat from within. Then I disconnect from the screen session and am left with the emulator and GNU/Emacs. The following code snipplet adds some font-locking and auto-revert-tail-mode to the Emacs buffer visiting the logcat file:


(add-to-list 'auto-mode-alist '("logcat" . android-logcat-mode))
...
(defvar android-logcat-font-lock-keywords
  (list '("^V/.*$"
	  . font-lock-comment-face)
	'("^W/.*$"
	  . font-lock-constant-face)
	'("^E/.*$"
	  . font-lock-warning-face)))

(define-derived-mode android-logcat-mode text-mode "Android-Logcat"
  "Major mode for looking at Android logcat output."
  (interactive)
  (auto-revert-tail-mode)
  (goto-char (point-max))
  (set (make-local-variable 'font-lock-defaults)
       '(android-logcat-font-lock-keywords))
  (font-lock-mode 1))