Wednesday, September 24, 2008

defaultdict and R

In answering a question on the python-tutor list, someone used collections.defaultdict. I didn't know about this. I guess it looks a little cleaner to say a = defaultdict(list) rather than use a.setdefault(key,[]).

Well, that isn't much learning for the day, but it's something.

I'm also trying to learn and use R, but fell back to python for my task today when I couldn't quickly figure out how to do what I wanted to in R. R is frustrating right now because it seems so insanely powerful, but at the same time foreign to how my python-oriented brain thinks.

I have "Modern Applied Statistics with S-PLUS" and learned to parrot the examples in order to do some cool stuff, but when I have to deviate much from the examples, I find myself a bit lost. I figure I don't understand the basics of the language well enough and now have "Programming with Data." Hopefully this will get me up to speed, so I can be one of those guys on the R-help list who can answer a question with six different one-liners to accomplish the same thing.

emacs org-mode

I tried org-mode a while ago, loved it, and then inexplicably stopped using it. I think I was trying to figure out how to integrate my entire workflow (calendar, task, notes, etc.) in emacs and it was too much at once. This time I was just using it for notes/outlining and it is quite amazing. The keys are very intuitive also. You use the Meta and Shift keys combined with the arrow keys to move sections up and down, indent, etc.

I also used the table mode to actually make a table I needed and it is, quite simply, incredible. It's amazingly intuitive to fill a table, move rows and columns, insert, and delete. The thing can even be used as a spreadsheet, but I haven't tried that yet.

Tuesday, September 16, 2008

my fingers remember emacs

Long ago, I used to live in emacs. ctrl-x-`, etc. I've been playing with pydev and eclipse recently and got frustrated with trying to figure out how to add modules to the python path that are "egg-link"s. So, I fired up emacs to start editing my text and I can't believe how much my fingers remember. I did a ctrl-5 2 to open a new window without blinking an eye. Where did that come from?